1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.24.3 */
6 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
11 #include "ldk_rust_types.h"
14 * An error when accessing the chain via [`Access`].
16 typedef enum LDKAccessError {
18 * The requested chain is unknown.
20 LDKAccessError_UnknownChain,
22 * The requested transaction doesn't exist or hasn't confirmed.
24 LDKAccessError_UnknownTx,
26 * Must be last for serialization purposes
28 LDKAccessError_Sentinel,
32 * An enum which can either contain a or not
34 typedef enum LDKCOption_NoneZ {
36 * When we're in this state, this COption_NoneZ contains a
38 LDKCOption_NoneZ_Some,
40 * When we're in this state, this COption_NoneZ contains nothing
42 LDKCOption_NoneZ_None,
44 * Must be last for serialization purposes
46 LDKCOption_NoneZ_Sentinel,
50 * An error enum representing a failure to persist a channel monitor update.
52 typedef enum LDKChannelMonitorUpdateErr {
54 * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
55 * our state failed, but is expected to succeed at some point in the future).
57 * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
58 * submitting new commitment transactions to the counterparty. Once the update(s) that failed
59 * have been successfully applied, a [`MonitorEvent::UpdateCompleted`] event should be returned
60 * via [`Watch::release_pending_monitor_events`] which will then restore the channel to an
63 * Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If
64 * you return a TemporaryFailure you must ensure that it is written to disk safely before
65 * writing out the latest ChannelManager state.
67 * Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur
68 * (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting
69 * to claim it on this channel) and those updates must be applied wherever they can be. At
70 * least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should
71 * be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to
72 * the channel which would invalidate previous ChannelMonitors are not made when a channel has
75 * Note that even if updates made after TemporaryFailure succeed you must still provide a
76 * [`MonitorEvent::UpdateCompleted`] to ensure you have the latest monitor and re-enable
77 * normal channel operation. Note that this is normally generated through a call to
78 * [`ChainMonitor::channel_monitor_updated`].
80 * Note that the update being processed here will not be replayed for you when you return a
81 * [`MonitorEvent::UpdateCompleted`] event via [`Watch::release_pending_monitor_events`], so
82 * you must store the update itself on your own local disk prior to returning a
83 * TemporaryFailure. You may, of course, employ a journaling approach, storing only the
84 * ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at
87 * For deployments where a copy of ChannelMonitors and other local state are backed up in a
88 * remote location (with local copies persisted immediately), it is anticipated that all
89 * updates will return TemporaryFailure until the remote copies could be updated.
91 * [`ChainMonitor::channel_monitor_updated`]: chainmonitor::ChainMonitor::channel_monitor_updated
93 LDKChannelMonitorUpdateErr_TemporaryFailure,
95 * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a
96 * different watchtower and cannot update with all watchtowers that were previously informed
99 * At reception of this error, ChannelManager will force-close the channel and return at
100 * least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at
101 * least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel
102 * update must be rejected.
104 * This failure may also signal a failure to update the local persisted copy of one of
105 * the channel monitor instance.
107 * Note that even when you fail a holder commitment transaction update, you must store the
108 * update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor
109 * broadcasts it (e.g distributed channel-monitor deployment)
111 * In case of distributed watchtowers deployment, the new version must be written to disk, as
112 * state may have been stored but rejected due to a block forcing a commitment broadcast. This
113 * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
114 * lagging behind on block processing.
116 LDKChannelMonitorUpdateErr_PermanentFailure,
118 * Must be last for serialization purposes
120 LDKChannelMonitorUpdateErr_Sentinel,
121 } LDKChannelMonitorUpdateErr;
124 * An enum that represents the speed at which we want a transaction to confirm used for feerate
127 typedef enum LDKConfirmationTarget {
129 * We are happy with this transaction confirming slowly when feerate drops some.
131 LDKConfirmationTarget_Background,
133 * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
135 LDKConfirmationTarget_Normal,
137 * We'd like this transaction to confirm in the next few blocks.
139 LDKConfirmationTarget_HighPriority,
141 * Must be last for serialization purposes
143 LDKConfirmationTarget_Sentinel,
144 } LDKConfirmationTarget;
147 * Errors that may occur when constructing a new `RawInvoice` or `Invoice`
149 typedef enum LDKCreationError {
151 * The supplied description string was longer than 639 __bytes__ (see [`Description::new(…)`](./struct.Description.html#method.new))
153 LDKCreationError_DescriptionTooLong,
155 * The specified route has too many hops and can't be encoded
157 LDKCreationError_RouteTooLong,
159 * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
161 LDKCreationError_TimestampOutOfBounds,
163 * The supplied millisatoshi amount was greater than the total bitcoin supply.
165 LDKCreationError_InvalidAmount,
167 * Route hints were required for this invoice and were missing. Applies to
168 * [phantom invoices].
170 * [phantom invoices]: crate::utils::create_phantom_invoice
172 LDKCreationError_MissingRouteHints,
174 * Must be last for serialization purposes
176 LDKCreationError_Sentinel,
180 * Enum representing the crypto currencies (or networks) supported by this library
182 typedef enum LDKCurrency {
190 LDKCurrency_BitcoinTestnet,
204 * Must be last for serialization purposes
206 LDKCurrency_Sentinel,
210 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
212 typedef enum LDKIOError {
214 LDKIOError_PermissionDenied,
215 LDKIOError_ConnectionRefused,
216 LDKIOError_ConnectionReset,
217 LDKIOError_ConnectionAborted,
218 LDKIOError_NotConnected,
219 LDKIOError_AddrInUse,
220 LDKIOError_AddrNotAvailable,
221 LDKIOError_BrokenPipe,
222 LDKIOError_AlreadyExists,
223 LDKIOError_WouldBlock,
224 LDKIOError_InvalidInput,
225 LDKIOError_InvalidData,
227 LDKIOError_WriteZero,
228 LDKIOError_Interrupted,
230 LDKIOError_UnexpectedEof,
232 * Must be last for serialization purposes
238 * An enum representing the available verbosity levels of the logger.
240 typedef enum LDKLevel {
242 * Designates extremely verbose information, including gossip-induced messages
246 * Designates very low priority, often extremely verbose, information
250 * Designates lower priority information
254 * Designates useful information
258 * Designates hazardous situations
262 * Designates very serious errors
266 * Must be last for serialization purposes
272 * An enum representing the possible Bitcoin or test networks which we can run on
274 typedef enum LDKNetwork {
276 * The main Bitcoin blockchain.
280 * The testnet3 blockchain.
284 * A local test blockchain.
288 * A blockchain on which blocks are signed instead of mined.
292 * Must be last for serialization purposes
298 * Specifies the recipient of an invoice, to indicate to [`KeysInterface::sign_invoice`] what node
299 * secret key should be used to sign the invoice.
301 typedef enum LDKRecipient {
303 * The invoice should be signed with the local node secret key.
307 * The invoice should be signed with the phantom node secret key. This secret key must be the
308 * same for all nodes participating in the [phantom node payment].
310 * [phantom node payment]: PhantomKeysManager
312 LDKRecipient_PhantomNode,
314 * Must be last for serialization purposes
316 LDKRecipient_Sentinel,
320 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
322 typedef enum LDKSecp256k1Error {
324 * Signature failed verification
326 LDKSecp256k1Error_IncorrectSignature,
328 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
330 LDKSecp256k1Error_InvalidMessage,
334 LDKSecp256k1Error_InvalidPublicKey,
338 LDKSecp256k1Error_InvalidSignature,
342 LDKSecp256k1Error_InvalidSecretKey,
346 LDKSecp256k1Error_InvalidSharedSecret,
350 LDKSecp256k1Error_InvalidRecoveryId,
352 * Invalid tweak for add_assign or mul_assign
354 LDKSecp256k1Error_InvalidTweak,
356 * Didn't pass enough memory to context creation with preallocated memory
358 LDKSecp256k1Error_NotEnoughMemory,
360 * Bad set of public keys.
362 LDKSecp256k1Error_InvalidPublicKeySum,
364 * The only valid parity values are 0 or 1.
366 LDKSecp256k1Error_InvalidParityValue,
368 * Must be last for serialization purposes
370 LDKSecp256k1Error_Sentinel,
374 * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
375 * requirements sections in BOLT #11
377 typedef enum LDKSemanticError {
379 * The invoice is missing the mandatory payment hash
381 LDKSemanticError_NoPaymentHash,
383 * The invoice has multiple payment hashes which isn't allowed
385 LDKSemanticError_MultiplePaymentHashes,
387 * No description or description hash are part of the invoice
389 LDKSemanticError_NoDescription,
391 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
393 LDKSemanticError_MultipleDescriptions,
395 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
398 LDKSemanticError_NoPaymentSecret,
400 * The invoice contains multiple payment secrets
402 LDKSemanticError_MultiplePaymentSecrets,
404 * The invoice's features are invalid
406 LDKSemanticError_InvalidFeatures,
408 * The recovery id doesn't fit the signature/pub key
410 LDKSemanticError_InvalidRecoveryId,
412 * The invoice's signature is invalid
414 LDKSemanticError_InvalidSignature,
416 * The invoice's amount was not a whole number of millisatoshis
418 LDKSemanticError_ImpreciseAmount,
420 * Must be last for serialization purposes
422 LDKSemanticError_Sentinel,
426 * SI prefixes for the human readable part
428 typedef enum LDKSiPrefix {
446 * Must be last for serialization purposes
448 LDKSiPrefix_Sentinel,
452 * A Rust str object, ie a reference to a UTF8-valid string.
453 * This is *not* null-terminated so cannot be used directly as a C string!
455 typedef struct LDKStr {
457 * A pointer to the string's bytes, in UTF8 encoding
459 const uint8_t *chars;
461 * The number of bytes (not characters!) pointed to by `chars`
465 * Whether the data pointed to by `chars` should be freed or not.
471 * Represents an error returned from the bech32 library during validation of some bech32 data
473 typedef enum LDKBech32Error_Tag {
475 * String does not contain the separator character
477 LDKBech32Error_MissingSeparator,
479 * The checksum does not match the rest of the data
481 LDKBech32Error_InvalidChecksum,
483 * The data or human-readable part is too long or too short
485 LDKBech32Error_InvalidLength,
487 * Some part of the string contains an invalid character
489 LDKBech32Error_InvalidChar,
491 * Some part of the data has an invalid value
493 LDKBech32Error_InvalidData,
495 * The bit conversion failed due to a padding issue
497 LDKBech32Error_InvalidPadding,
499 * The whole string must be of one case
501 LDKBech32Error_MixedCase,
503 * Must be last for serialization purposes
505 LDKBech32Error_Sentinel,
506 } LDKBech32Error_Tag;
508 typedef struct LDKBech32Error {
509 LDKBech32Error_Tag tag;
512 uint32_t invalid_char;
515 uint8_t invalid_data;
521 * A serialized transaction, in (pointer, length) form.
523 * This type optionally owns its own memory, and thus the semantics around access change based on
524 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
525 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
526 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
527 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
528 * you would be invalid.
530 * Note that, while it may change in the future, because transactions on the Rust side are stored
531 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
532 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
533 * `data_is_owned` either set or unset at your discretion.
535 typedef struct LDKTransaction {
537 * The serialized transaction data.
539 * This is non-const for your convenience, an object passed to Rust is never written to.
543 * The length of the serialized transaction
547 * Whether the data pointed to by `data` should be freed or not.
553 * A dynamically-allocated array of u8s of arbitrary size.
554 * This corresponds to std::vector in C++
556 typedef struct LDKCVec_u8Z {
558 * The elements in the array.
559 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
563 * The number of elements pointed to by `data`.
569 * A transaction output including a scriptPubKey and value.
570 * This type *does* own its own memory, so must be free'd appropriately.
572 typedef struct LDKTxOut {
574 * The script_pubkey in this output
576 struct LDKCVec_u8Z script_pubkey;
578 * The value, in satoshis, of this output
584 * The contents of CResult_NoneNoneZ
586 typedef union LDKCResult_NoneNoneZPtr {
588 * Note that this value is always NULL, as there are no contents in the OK variant
592 * Note that this value is always NULL, as there are no contents in the Err variant
595 } LDKCResult_NoneNoneZPtr;
598 * A CResult_NoneNoneZ represents the result of a fallible operation,
599 * containing a () on success and a () on failure.
600 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
602 typedef struct LDKCResult_NoneNoneZ {
604 * The contents of this CResult_NoneNoneZ, accessible via either
605 * `err` or `result` depending on the state of `result_ok`.
607 union LDKCResult_NoneNoneZPtr contents;
609 * Whether this CResult_NoneNoneZ represents a success state.
612 } LDKCResult_NoneNoneZ;
617 * Implements the per-commitment secret storage scheme from
618 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
620 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
623 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
625 * A pointer to the opaque Rust object.
626 * Nearly everywhere, inner must be non-null, however in places where
627 * the Rust equivalent takes an Option, it may be set to null to indicate None.
629 LDKnativeCounterpartyCommitmentSecrets *inner;
631 * Indicates that this is the only struct which contains the same pointer.
632 * Rust functions which take ownership of an object provided via an argument require
633 * this to be true and invalidate the object pointed to by inner.
636 } LDKCounterpartyCommitmentSecrets;
641 * An error in decoding a message or struct.
643 typedef struct MUST_USE_STRUCT LDKDecodeError {
645 * A pointer to the opaque Rust object.
646 * Nearly everywhere, inner must be non-null, however in places where
647 * the Rust equivalent takes an Option, it may be set to null to indicate None.
649 LDKnativeDecodeError *inner;
651 * Indicates that this is the only struct which contains the same pointer.
652 * Rust functions which take ownership of an object provided via an argument require
653 * this to be true and invalidate the object pointed to by inner.
659 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
661 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
663 * A pointer to the contents in the success state.
664 * Reading from this pointer when `result_ok` is not set is undefined.
666 struct LDKCounterpartyCommitmentSecrets *result;
668 * A pointer to the contents in the error state.
669 * Reading from this pointer when `result_ok` is set is undefined.
671 struct LDKDecodeError *err;
672 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
675 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
676 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
677 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
679 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
681 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
682 * `err` or `result` depending on the state of `result_ok`.
684 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
686 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
689 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
692 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
694 typedef struct LDKSecretKey {
696 * The bytes of the secret key
702 * The contents of CResult_SecretKeyErrorZ
704 typedef union LDKCResult_SecretKeyErrorZPtr {
706 * A pointer to the contents in the success state.
707 * Reading from this pointer when `result_ok` is not set is undefined.
709 struct LDKSecretKey *result;
711 * A pointer to the contents in the error state.
712 * Reading from this pointer when `result_ok` is set is undefined.
714 enum LDKSecp256k1Error *err;
715 } LDKCResult_SecretKeyErrorZPtr;
718 * A CResult_SecretKeyErrorZ represents the result of a fallible operation,
719 * containing a crate::c_types::SecretKey on success and a crate::c_types::Secp256k1Error on failure.
720 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
722 typedef struct LDKCResult_SecretKeyErrorZ {
724 * The contents of this CResult_SecretKeyErrorZ, accessible via either
725 * `err` or `result` depending on the state of `result_ok`.
727 union LDKCResult_SecretKeyErrorZPtr contents;
729 * Whether this CResult_SecretKeyErrorZ represents a success state.
732 } LDKCResult_SecretKeyErrorZ;
735 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
737 typedef struct LDKPublicKey {
739 * The bytes of the public key
741 uint8_t compressed_form[33];
745 * The contents of CResult_PublicKeyErrorZ
747 typedef union LDKCResult_PublicKeyErrorZPtr {
749 * A pointer to the contents in the success state.
750 * Reading from this pointer when `result_ok` is not set is undefined.
752 struct LDKPublicKey *result;
754 * A pointer to the contents in the error state.
755 * Reading from this pointer when `result_ok` is set is undefined.
757 enum LDKSecp256k1Error *err;
758 } LDKCResult_PublicKeyErrorZPtr;
761 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
762 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
763 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
765 typedef struct LDKCResult_PublicKeyErrorZ {
767 * The contents of this CResult_PublicKeyErrorZ, accessible via either
768 * `err` or `result` depending on the state of `result_ok`.
770 union LDKCResult_PublicKeyErrorZPtr contents;
772 * Whether this CResult_PublicKeyErrorZ represents a success state.
775 } LDKCResult_PublicKeyErrorZ;
780 * The set of public keys which are used in the creation of one commitment transaction.
781 * These are derived from the channel base keys and per-commitment data.
783 * A broadcaster key is provided from potential broadcaster of the computed transaction.
784 * A countersignatory key is coming from a protocol participant unable to broadcast the
787 * These keys are assumed to be good, either because the code derived them from
788 * channel basepoints via the new function, or they were obtained via
789 * CommitmentTransaction.trust().keys() because we trusted the source of the
790 * pre-calculated keys.
792 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
794 * A pointer to the opaque Rust object.
795 * Nearly everywhere, inner must be non-null, however in places where
796 * the Rust equivalent takes an Option, it may be set to null to indicate None.
798 LDKnativeTxCreationKeys *inner;
800 * Indicates that this is the only struct which contains the same pointer.
801 * Rust functions which take ownership of an object provided via an argument require
802 * this to be true and invalidate the object pointed to by inner.
808 * The contents of CResult_TxCreationKeysDecodeErrorZ
810 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
812 * A pointer to the contents in the success state.
813 * Reading from this pointer when `result_ok` is not set is undefined.
815 struct LDKTxCreationKeys *result;
817 * A pointer to the contents in the error state.
818 * Reading from this pointer when `result_ok` is set is undefined.
820 struct LDKDecodeError *err;
821 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
824 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
825 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
826 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
828 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
830 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
831 * `err` or `result` depending on the state of `result_ok`.
833 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
835 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
838 } LDKCResult_TxCreationKeysDecodeErrorZ;
843 * One counterparty's public keys which do not change over the life of a channel.
845 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
847 * A pointer to the opaque Rust object.
848 * Nearly everywhere, inner must be non-null, however in places where
849 * the Rust equivalent takes an Option, it may be set to null to indicate None.
851 LDKnativeChannelPublicKeys *inner;
853 * Indicates that this is the only struct which contains the same pointer.
854 * Rust functions which take ownership of an object provided via an argument require
855 * this to be true and invalidate the object pointed to by inner.
858 } LDKChannelPublicKeys;
861 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
863 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
865 * A pointer to the contents in the success state.
866 * Reading from this pointer when `result_ok` is not set is undefined.
868 struct LDKChannelPublicKeys *result;
870 * A pointer to the contents in the error state.
871 * Reading from this pointer when `result_ok` is set is undefined.
873 struct LDKDecodeError *err;
874 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
877 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
878 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
879 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
881 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
883 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
884 * `err` or `result` depending on the state of `result_ok`.
886 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
888 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
891 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
894 * The contents of CResult_TxCreationKeysErrorZ
896 typedef union LDKCResult_TxCreationKeysErrorZPtr {
898 * A pointer to the contents in the success state.
899 * Reading from this pointer when `result_ok` is not set is undefined.
901 struct LDKTxCreationKeys *result;
903 * A pointer to the contents in the error state.
904 * Reading from this pointer when `result_ok` is set is undefined.
906 enum LDKSecp256k1Error *err;
907 } LDKCResult_TxCreationKeysErrorZPtr;
910 * A CResult_TxCreationKeysErrorZ represents the result of a fallible operation,
911 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::c_types::Secp256k1Error on failure.
912 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
914 typedef struct LDKCResult_TxCreationKeysErrorZ {
916 * The contents of this CResult_TxCreationKeysErrorZ, accessible via either
917 * `err` or `result` depending on the state of `result_ok`.
919 union LDKCResult_TxCreationKeysErrorZPtr contents;
921 * Whether this CResult_TxCreationKeysErrorZ represents a success state.
924 } LDKCResult_TxCreationKeysErrorZ;
927 * An enum which can either contain a u32 or not
929 typedef enum LDKCOption_u32Z_Tag {
931 * When we're in this state, this COption_u32Z contains a u32
933 LDKCOption_u32Z_Some,
935 * When we're in this state, this COption_u32Z contains nothing
937 LDKCOption_u32Z_None,
939 * Must be last for serialization purposes
941 LDKCOption_u32Z_Sentinel,
942 } LDKCOption_u32Z_Tag;
944 typedef struct LDKCOption_u32Z {
945 LDKCOption_u32Z_Tag tag;
956 * Information about an HTLC as it appears in a commitment transaction
958 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
960 * A pointer to the opaque Rust object.
961 * Nearly everywhere, inner must be non-null, however in places where
962 * the Rust equivalent takes an Option, it may be set to null to indicate None.
964 LDKnativeHTLCOutputInCommitment *inner;
966 * Indicates that this is the only struct which contains the same pointer.
967 * Rust functions which take ownership of an object provided via an argument require
968 * this to be true and invalidate the object pointed to by inner.
971 } LDKHTLCOutputInCommitment;
974 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
976 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
978 * A pointer to the contents in the success state.
979 * Reading from this pointer when `result_ok` is not set is undefined.
981 struct LDKHTLCOutputInCommitment *result;
983 * A pointer to the contents in the error state.
984 * Reading from this pointer when `result_ok` is set is undefined.
986 struct LDKDecodeError *err;
987 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
990 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
991 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
992 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
994 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
996 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
997 * `err` or `result` depending on the state of `result_ok`.
999 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
1001 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
1004 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
1009 * Late-bound per-channel counterparty data used to build transactions.
1011 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
1013 * A pointer to the opaque Rust object.
1014 * Nearly everywhere, inner must be non-null, however in places where
1015 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1017 LDKnativeCounterpartyChannelTransactionParameters *inner;
1019 * Indicates that this is the only struct which contains the same pointer.
1020 * Rust functions which take ownership of an object provided via an argument require
1021 * this to be true and invalidate the object pointed to by inner.
1024 } LDKCounterpartyChannelTransactionParameters;
1027 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
1029 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
1031 * A pointer to the contents in the success state.
1032 * Reading from this pointer when `result_ok` is not set is undefined.
1034 struct LDKCounterpartyChannelTransactionParameters *result;
1036 * A pointer to the contents in the error state.
1037 * Reading from this pointer when `result_ok` is set is undefined.
1039 struct LDKDecodeError *err;
1040 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
1043 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1044 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1045 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1047 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
1049 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
1050 * `err` or `result` depending on the state of `result_ok`.
1052 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
1054 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
1057 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
1062 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
1063 * The fields are organized by holder/counterparty.
1065 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
1066 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
1068 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
1070 * A pointer to the opaque Rust object.
1071 * Nearly everywhere, inner must be non-null, however in places where
1072 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1074 LDKnativeChannelTransactionParameters *inner;
1076 * Indicates that this is the only struct which contains the same pointer.
1077 * Rust functions which take ownership of an object provided via an argument require
1078 * this to be true and invalidate the object pointed to by inner.
1081 } LDKChannelTransactionParameters;
1084 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
1086 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
1088 * A pointer to the contents in the success state.
1089 * Reading from this pointer when `result_ok` is not set is undefined.
1091 struct LDKChannelTransactionParameters *result;
1093 * A pointer to the contents in the error state.
1094 * Reading from this pointer when `result_ok` is set is undefined.
1096 struct LDKDecodeError *err;
1097 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
1100 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1101 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1102 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1104 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
1106 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
1107 * `err` or `result` depending on the state of `result_ok`.
1109 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
1111 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
1114 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
1117 * Represents a secp256k1 signature serialized as two 32-byte numbers
1119 typedef struct LDKSignature {
1121 * The bytes of the signature in "compact" form
1123 uint8_t compact_form[64];
1127 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
1128 * This corresponds to std::vector in C++
1130 typedef struct LDKCVec_SignatureZ {
1132 * The elements in the array.
1133 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1135 struct LDKSignature *data;
1137 * The number of elements pointed to by `data`.
1140 } LDKCVec_SignatureZ;
1145 * Information needed to build and sign a holder's commitment transaction.
1147 * The transaction is only signed once we are ready to broadcast.
1149 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
1151 * A pointer to the opaque Rust object.
1152 * Nearly everywhere, inner must be non-null, however in places where
1153 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1155 LDKnativeHolderCommitmentTransaction *inner;
1157 * Indicates that this is the only struct which contains the same pointer.
1158 * Rust functions which take ownership of an object provided via an argument require
1159 * this to be true and invalidate the object pointed to by inner.
1162 } LDKHolderCommitmentTransaction;
1165 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
1167 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
1169 * A pointer to the contents in the success state.
1170 * Reading from this pointer when `result_ok` is not set is undefined.
1172 struct LDKHolderCommitmentTransaction *result;
1174 * A pointer to the contents in the error state.
1175 * Reading from this pointer when `result_ok` is set is undefined.
1177 struct LDKDecodeError *err;
1178 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
1181 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1182 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1183 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1185 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
1187 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
1188 * `err` or `result` depending on the state of `result_ok`.
1190 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
1192 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
1195 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
1200 * A pre-built Bitcoin commitment transaction and its txid.
1202 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
1204 * A pointer to the opaque Rust object.
1205 * Nearly everywhere, inner must be non-null, however in places where
1206 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1208 LDKnativeBuiltCommitmentTransaction *inner;
1210 * Indicates that this is the only struct which contains the same pointer.
1211 * Rust functions which take ownership of an object provided via an argument require
1212 * this to be true and invalidate the object pointed to by inner.
1215 } LDKBuiltCommitmentTransaction;
1218 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1220 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1222 * A pointer to the contents in the success state.
1223 * Reading from this pointer when `result_ok` is not set is undefined.
1225 struct LDKBuiltCommitmentTransaction *result;
1227 * A pointer to the contents in the error state.
1228 * Reading from this pointer when `result_ok` is set is undefined.
1230 struct LDKDecodeError *err;
1231 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1234 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1235 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1236 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1238 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1240 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1241 * `err` or `result` depending on the state of `result_ok`.
1243 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1245 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1248 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1253 * A wrapper on ClosingTransaction indicating that the built bitcoin
1254 * transaction is trusted.
1256 * See trust() and verify() functions on CommitmentTransaction.
1258 * This structure implements Deref.
1260 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
1262 * A pointer to the opaque Rust object.
1263 * Nearly everywhere, inner must be non-null, however in places where
1264 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1266 LDKnativeTrustedClosingTransaction *inner;
1268 * Indicates that this is the only struct which contains the same pointer.
1269 * Rust functions which take ownership of an object provided via an argument require
1270 * this to be true and invalidate the object pointed to by inner.
1273 } LDKTrustedClosingTransaction;
1276 * The contents of CResult_TrustedClosingTransactionNoneZ
1278 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
1280 * A pointer to the contents in the success state.
1281 * Reading from this pointer when `result_ok` is not set is undefined.
1283 struct LDKTrustedClosingTransaction *result;
1285 * Note that this value is always NULL, as there are no contents in the Err variant
1288 } LDKCResult_TrustedClosingTransactionNoneZPtr;
1291 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
1292 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
1293 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1295 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
1297 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
1298 * `err` or `result` depending on the state of `result_ok`.
1300 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
1302 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
1305 } LDKCResult_TrustedClosingTransactionNoneZ;
1310 * This class tracks the per-transaction information needed to build a commitment transaction and will
1311 * actually build it and sign. It is used for holder transactions that we sign only when needed
1312 * and for transactions we sign for the counterparty.
1314 * This class can be used inside a signer implementation to generate a signature given the relevant
1317 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1319 * A pointer to the opaque Rust object.
1320 * Nearly everywhere, inner must be non-null, however in places where
1321 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1323 LDKnativeCommitmentTransaction *inner;
1325 * Indicates that this is the only struct which contains the same pointer.
1326 * Rust functions which take ownership of an object provided via an argument require
1327 * this to be true and invalidate the object pointed to by inner.
1330 } LDKCommitmentTransaction;
1333 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1335 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1337 * A pointer to the contents in the success state.
1338 * Reading from this pointer when `result_ok` is not set is undefined.
1340 struct LDKCommitmentTransaction *result;
1342 * A pointer to the contents in the error state.
1343 * Reading from this pointer when `result_ok` is set is undefined.
1345 struct LDKDecodeError *err;
1346 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1349 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1350 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1351 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1353 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1355 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1356 * `err` or `result` depending on the state of `result_ok`.
1358 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1360 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1363 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1368 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1369 * transaction and the transaction creation keys) are trusted.
1371 * See trust() and verify() functions on CommitmentTransaction.
1373 * This structure implements Deref.
1375 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1377 * A pointer to the opaque Rust object.
1378 * Nearly everywhere, inner must be non-null, however in places where
1379 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1381 LDKnativeTrustedCommitmentTransaction *inner;
1383 * Indicates that this is the only struct which contains the same pointer.
1384 * Rust functions which take ownership of an object provided via an argument require
1385 * this to be true and invalidate the object pointed to by inner.
1388 } LDKTrustedCommitmentTransaction;
1391 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1393 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1395 * A pointer to the contents in the success state.
1396 * Reading from this pointer when `result_ok` is not set is undefined.
1398 struct LDKTrustedCommitmentTransaction *result;
1400 * Note that this value is always NULL, as there are no contents in the Err variant
1403 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1406 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1407 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1408 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1410 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1412 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1413 * `err` or `result` depending on the state of `result_ok`.
1415 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1417 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1420 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1423 * The contents of CResult_CVec_SignatureZNoneZ
1425 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1427 * A pointer to the contents in the success state.
1428 * Reading from this pointer when `result_ok` is not set is undefined.
1430 struct LDKCVec_SignatureZ *result;
1432 * Note that this value is always NULL, as there are no contents in the Err variant
1435 } LDKCResult_CVec_SignatureZNoneZPtr;
1438 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1439 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1440 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1442 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1444 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1445 * `err` or `result` depending on the state of `result_ok`.
1447 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1449 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1452 } LDKCResult_CVec_SignatureZNoneZ;
1457 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1459 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1461 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1463 * A pointer to the opaque Rust object.
1464 * Nearly everywhere, inner must be non-null, however in places where
1465 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1467 LDKnativeShutdownScript *inner;
1469 * Indicates that this is the only struct which contains the same pointer.
1470 * Rust functions which take ownership of an object provided via an argument require
1471 * this to be true and invalidate the object pointed to by inner.
1474 } LDKShutdownScript;
1477 * The contents of CResult_ShutdownScriptDecodeErrorZ
1479 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
1481 * A pointer to the contents in the success state.
1482 * Reading from this pointer when `result_ok` is not set is undefined.
1484 struct LDKShutdownScript *result;
1486 * A pointer to the contents in the error state.
1487 * Reading from this pointer when `result_ok` is set is undefined.
1489 struct LDKDecodeError *err;
1490 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
1493 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
1494 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
1495 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1497 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
1499 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
1500 * `err` or `result` depending on the state of `result_ok`.
1502 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
1504 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
1507 } LDKCResult_ShutdownScriptDecodeErrorZ;
1512 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
1514 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
1516 * A pointer to the opaque Rust object.
1517 * Nearly everywhere, inner must be non-null, however in places where
1518 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1520 LDKnativeInvalidShutdownScript *inner;
1522 * Indicates that this is the only struct which contains the same pointer.
1523 * Rust functions which take ownership of an object provided via an argument require
1524 * this to be true and invalidate the object pointed to by inner.
1527 } LDKInvalidShutdownScript;
1530 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
1532 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
1534 * A pointer to the contents in the success state.
1535 * Reading from this pointer when `result_ok` is not set is undefined.
1537 struct LDKShutdownScript *result;
1539 * A pointer to the contents in the error state.
1540 * Reading from this pointer when `result_ok` is set is undefined.
1542 struct LDKInvalidShutdownScript *err;
1543 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
1546 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
1547 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
1548 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1550 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
1552 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
1553 * `err` or `result` depending on the state of `result_ok`.
1555 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
1557 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
1560 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
1563 * The contents of CResult_NoneErrorZ
1565 typedef union LDKCResult_NoneErrorZPtr {
1567 * Note that this value is always NULL, as there are no contents in the OK variant
1571 * A pointer to the contents in the error state.
1572 * Reading from this pointer when `result_ok` is set is undefined.
1574 enum LDKIOError *err;
1575 } LDKCResult_NoneErrorZPtr;
1578 * A CResult_NoneErrorZ represents the result of a fallible operation,
1579 * containing a () on success and a crate::c_types::IOError on failure.
1580 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1582 typedef struct LDKCResult_NoneErrorZ {
1584 * The contents of this CResult_NoneErrorZ, accessible via either
1585 * `err` or `result` depending on the state of `result_ok`.
1587 union LDKCResult_NoneErrorZPtr contents;
1589 * Whether this CResult_NoneErrorZ represents a success state.
1592 } LDKCResult_NoneErrorZ;
1599 typedef struct MUST_USE_STRUCT LDKRouteHop {
1601 * A pointer to the opaque Rust object.
1602 * Nearly everywhere, inner must be non-null, however in places where
1603 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1605 LDKnativeRouteHop *inner;
1607 * Indicates that this is the only struct which contains the same pointer.
1608 * Rust functions which take ownership of an object provided via an argument require
1609 * this to be true and invalidate the object pointed to by inner.
1615 * The contents of CResult_RouteHopDecodeErrorZ
1617 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
1619 * A pointer to the contents in the success state.
1620 * Reading from this pointer when `result_ok` is not set is undefined.
1622 struct LDKRouteHop *result;
1624 * A pointer to the contents in the error state.
1625 * Reading from this pointer when `result_ok` is set is undefined.
1627 struct LDKDecodeError *err;
1628 } LDKCResult_RouteHopDecodeErrorZPtr;
1631 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
1632 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
1633 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1635 typedef struct LDKCResult_RouteHopDecodeErrorZ {
1637 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
1638 * `err` or `result` depending on the state of `result_ok`.
1640 union LDKCResult_RouteHopDecodeErrorZPtr contents;
1642 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
1645 } LDKCResult_RouteHopDecodeErrorZ;
1648 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
1649 * This corresponds to std::vector in C++
1651 typedef struct LDKCVec_RouteHopZ {
1653 * The elements in the array.
1654 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1656 struct LDKRouteHop *data;
1658 * The number of elements pointed to by `data`.
1661 } LDKCVec_RouteHopZ;
1664 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
1665 * This corresponds to std::vector in C++
1667 typedef struct LDKCVec_CVec_RouteHopZZ {
1669 * The elements in the array.
1670 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1672 struct LDKCVec_RouteHopZ *data;
1674 * The number of elements pointed to by `data`.
1677 } LDKCVec_CVec_RouteHopZZ;
1682 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
1683 * it can take multiple paths. Each path is composed of one or more hops through the network.
1685 typedef struct MUST_USE_STRUCT LDKRoute {
1687 * A pointer to the opaque Rust object.
1688 * Nearly everywhere, inner must be non-null, however in places where
1689 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1691 LDKnativeRoute *inner;
1693 * Indicates that this is the only struct which contains the same pointer.
1694 * Rust functions which take ownership of an object provided via an argument require
1695 * this to be true and invalidate the object pointed to by inner.
1701 * The contents of CResult_RouteDecodeErrorZ
1703 typedef union LDKCResult_RouteDecodeErrorZPtr {
1705 * A pointer to the contents in the success state.
1706 * Reading from this pointer when `result_ok` is not set is undefined.
1708 struct LDKRoute *result;
1710 * A pointer to the contents in the error state.
1711 * Reading from this pointer when `result_ok` is set is undefined.
1713 struct LDKDecodeError *err;
1714 } LDKCResult_RouteDecodeErrorZPtr;
1717 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
1718 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
1719 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1721 typedef struct LDKCResult_RouteDecodeErrorZ {
1723 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
1724 * `err` or `result` depending on the state of `result_ok`.
1726 union LDKCResult_RouteDecodeErrorZPtr contents;
1728 * Whether this CResult_RouteDecodeErrorZ represents a success state.
1731 } LDKCResult_RouteDecodeErrorZ;
1736 * Parameters needed to find a [`Route`].
1738 * Passed to [`find_route`] and [`build_route_from_hops`], but also provided in
1739 * [`Event::PaymentPathFailed`] for retrying a failed payment path.
1741 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
1743 typedef struct MUST_USE_STRUCT LDKRouteParameters {
1745 * A pointer to the opaque Rust object.
1746 * Nearly everywhere, inner must be non-null, however in places where
1747 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1749 LDKnativeRouteParameters *inner;
1751 * Indicates that this is the only struct which contains the same pointer.
1752 * Rust functions which take ownership of an object provided via an argument require
1753 * this to be true and invalidate the object pointed to by inner.
1756 } LDKRouteParameters;
1759 * The contents of CResult_RouteParametersDecodeErrorZ
1761 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
1763 * A pointer to the contents in the success state.
1764 * Reading from this pointer when `result_ok` is not set is undefined.
1766 struct LDKRouteParameters *result;
1768 * A pointer to the contents in the error state.
1769 * Reading from this pointer when `result_ok` is set is undefined.
1771 struct LDKDecodeError *err;
1772 } LDKCResult_RouteParametersDecodeErrorZPtr;
1775 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
1776 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1777 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1779 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
1781 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
1782 * `err` or `result` depending on the state of `result_ok`.
1784 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
1786 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
1789 } LDKCResult_RouteParametersDecodeErrorZ;
1794 * A list of hops along a payment path terminating with a channel to the recipient.
1796 typedef struct MUST_USE_STRUCT LDKRouteHint {
1798 * A pointer to the opaque Rust object.
1799 * Nearly everywhere, inner must be non-null, however in places where
1800 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1802 LDKnativeRouteHint *inner;
1804 * Indicates that this is the only struct which contains the same pointer.
1805 * Rust functions which take ownership of an object provided via an argument require
1806 * this to be true and invalidate the object pointed to by inner.
1812 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
1813 * This corresponds to std::vector in C++
1815 typedef struct LDKCVec_RouteHintZ {
1817 * The elements in the array.
1818 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1820 struct LDKRouteHint *data;
1822 * The number of elements pointed to by `data`.
1825 } LDKCVec_RouteHintZ;
1828 * An enum which can either contain a u64 or not
1830 typedef enum LDKCOption_u64Z_Tag {
1832 * When we're in this state, this COption_u64Z contains a u64
1834 LDKCOption_u64Z_Some,
1836 * When we're in this state, this COption_u64Z contains nothing
1838 LDKCOption_u64Z_None,
1840 * Must be last for serialization purposes
1842 LDKCOption_u64Z_Sentinel,
1843 } LDKCOption_u64Z_Tag;
1845 typedef struct LDKCOption_u64Z {
1846 LDKCOption_u64Z_Tag tag;
1855 * A dynamically-allocated array of u64s of arbitrary size.
1856 * This corresponds to std::vector in C++
1858 typedef struct LDKCVec_u64Z {
1860 * The elements in the array.
1861 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1865 * The number of elements pointed to by `data`.
1873 * The recipient of a payment.
1875 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
1877 * A pointer to the opaque Rust object.
1878 * Nearly everywhere, inner must be non-null, however in places where
1879 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1881 LDKnativePaymentParameters *inner;
1883 * Indicates that this is the only struct which contains the same pointer.
1884 * Rust functions which take ownership of an object provided via an argument require
1885 * this to be true and invalidate the object pointed to by inner.
1888 } LDKPaymentParameters;
1891 * The contents of CResult_PaymentParametersDecodeErrorZ
1893 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
1895 * A pointer to the contents in the success state.
1896 * Reading from this pointer when `result_ok` is not set is undefined.
1898 struct LDKPaymentParameters *result;
1900 * A pointer to the contents in the error state.
1901 * Reading from this pointer when `result_ok` is set is undefined.
1903 struct LDKDecodeError *err;
1904 } LDKCResult_PaymentParametersDecodeErrorZPtr;
1907 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
1908 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1909 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1911 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
1913 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
1914 * `err` or `result` depending on the state of `result_ok`.
1916 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
1918 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
1921 } LDKCResult_PaymentParametersDecodeErrorZ;
1926 * A channel descriptor for a hop along a payment path.
1928 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
1930 * A pointer to the opaque Rust object.
1931 * Nearly everywhere, inner must be non-null, however in places where
1932 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1934 LDKnativeRouteHintHop *inner;
1936 * Indicates that this is the only struct which contains the same pointer.
1937 * Rust functions which take ownership of an object provided via an argument require
1938 * this to be true and invalidate the object pointed to by inner.
1944 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
1945 * This corresponds to std::vector in C++
1947 typedef struct LDKCVec_RouteHintHopZ {
1949 * The elements in the array.
1950 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1952 struct LDKRouteHintHop *data;
1954 * The number of elements pointed to by `data`.
1957 } LDKCVec_RouteHintHopZ;
1960 * The contents of CResult_RouteHintDecodeErrorZ
1962 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
1964 * A pointer to the contents in the success state.
1965 * Reading from this pointer when `result_ok` is not set is undefined.
1967 struct LDKRouteHint *result;
1969 * A pointer to the contents in the error state.
1970 * Reading from this pointer when `result_ok` is set is undefined.
1972 struct LDKDecodeError *err;
1973 } LDKCResult_RouteHintDecodeErrorZPtr;
1976 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
1977 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
1978 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1980 typedef struct LDKCResult_RouteHintDecodeErrorZ {
1982 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
1983 * `err` or `result` depending on the state of `result_ok`.
1985 union LDKCResult_RouteHintDecodeErrorZPtr contents;
1987 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
1990 } LDKCResult_RouteHintDecodeErrorZ;
1993 * The contents of CResult_RouteHintHopDecodeErrorZ
1995 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
1997 * A pointer to the contents in the success state.
1998 * Reading from this pointer when `result_ok` is not set is undefined.
2000 struct LDKRouteHintHop *result;
2002 * A pointer to the contents in the error state.
2003 * Reading from this pointer when `result_ok` is set is undefined.
2005 struct LDKDecodeError *err;
2006 } LDKCResult_RouteHintHopDecodeErrorZPtr;
2009 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
2010 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
2011 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2013 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
2015 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
2016 * `err` or `result` depending on the state of `result_ok`.
2018 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
2020 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
2023 } LDKCResult_RouteHintHopDecodeErrorZ;
2028 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2030 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2032 * A pointer to the opaque Rust object.
2033 * Nearly everywhere, inner must be non-null, however in places where
2034 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2036 LDKnativeChannelDetails *inner;
2038 * Indicates that this is the only struct which contains the same pointer.
2039 * Rust functions which take ownership of an object provided via an argument require
2040 * this to be true and invalidate the object pointed to by inner.
2043 } LDKChannelDetails;
2046 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
2047 * This corresponds to std::vector in C++
2049 typedef struct LDKCVec_ChannelDetailsZ {
2051 * The elements in the array.
2052 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2054 struct LDKChannelDetails *data;
2056 * The number of elements pointed to by `data`.
2059 } LDKCVec_ChannelDetailsZ;
2064 * An Err type for failure to process messages.
2066 typedef struct MUST_USE_STRUCT LDKLightningError {
2068 * A pointer to the opaque Rust object.
2069 * Nearly everywhere, inner must be non-null, however in places where
2070 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2072 LDKnativeLightningError *inner;
2074 * Indicates that this is the only struct which contains the same pointer.
2075 * Rust functions which take ownership of an object provided via an argument require
2076 * this to be true and invalidate the object pointed to by inner.
2079 } LDKLightningError;
2082 * The contents of CResult_RouteLightningErrorZ
2084 typedef union LDKCResult_RouteLightningErrorZPtr {
2086 * A pointer to the contents in the success state.
2087 * Reading from this pointer when `result_ok` is not set is undefined.
2089 struct LDKRoute *result;
2091 * A pointer to the contents in the error state.
2092 * Reading from this pointer when `result_ok` is set is undefined.
2094 struct LDKLightningError *err;
2095 } LDKCResult_RouteLightningErrorZPtr;
2098 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2099 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2100 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2102 typedef struct LDKCResult_RouteLightningErrorZ {
2104 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2105 * `err` or `result` depending on the state of `result_ok`.
2107 union LDKCResult_RouteLightningErrorZPtr contents;
2109 * Whether this CResult_RouteLightningErrorZ represents a success state.
2112 } LDKCResult_RouteLightningErrorZ;
2115 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
2116 * This corresponds to std::vector in C++
2118 typedef struct LDKCVec_PublicKeyZ {
2120 * The elements in the array.
2121 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2123 struct LDKPublicKey *data;
2125 * The number of elements pointed to by `data`.
2128 } LDKCVec_PublicKeyZ;
2131 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
2132 * look up the corresponding function in rust-lightning's docs.
2134 typedef struct LDKThirtyTwoBytes {
2136 * The thirty-two bytes
2139 } LDKThirtyTwoBytes;
2142 * Some information provided on receipt of payment depends on whether the payment received is a
2143 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
2145 typedef enum LDKPaymentPurpose_Tag {
2147 * Information for receiving a payment that we generated an invoice for.
2149 LDKPaymentPurpose_InvoicePayment,
2151 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
2152 * (the payee) providing a preimage.
2154 LDKPaymentPurpose_SpontaneousPayment,
2156 * Must be last for serialization purposes
2158 LDKPaymentPurpose_Sentinel,
2159 } LDKPaymentPurpose_Tag;
2161 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
2163 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
2164 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
2165 * [`ChannelManager::claim_funds`].
2167 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2168 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2170 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2172 struct LDKThirtyTwoBytes payment_preimage;
2174 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2175 * number of deanonymization attacks during the routing process.
2176 * It is provided here for your reference, however its accuracy is enforced directly by
2177 * [`ChannelManager`] using the values you previously provided to
2178 * [`ChannelManager::create_inbound_payment`] or
2179 * [`ChannelManager::create_inbound_payment_for_hash`].
2181 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2182 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2183 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2185 struct LDKThirtyTwoBytes payment_secret;
2186 } LDKPaymentPurpose_LDKInvoicePayment_Body;
2188 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
2189 LDKPaymentPurpose_Tag tag;
2191 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
2193 struct LDKThirtyTwoBytes spontaneous_payment;
2196 } LDKPaymentPurpose;
2199 * The contents of CResult_PaymentPurposeDecodeErrorZ
2201 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
2203 * A pointer to the contents in the success state.
2204 * Reading from this pointer when `result_ok` is not set is undefined.
2206 struct LDKPaymentPurpose *result;
2208 * A pointer to the contents in the error state.
2209 * Reading from this pointer when `result_ok` is set is undefined.
2211 struct LDKDecodeError *err;
2212 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
2215 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
2216 * containing a crate::lightning::util::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
2217 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2219 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
2221 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
2222 * `err` or `result` depending on the state of `result_ok`.
2224 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
2226 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
2229 } LDKCResult_PaymentPurposeDecodeErrorZ;
2232 * The reason the channel was closed. See individual variants more details.
2234 typedef enum LDKClosureReason_Tag {
2236 * Closure generated from receiving a peer error message.
2238 * Our counterparty may have broadcasted their latest commitment state, and we have
2241 LDKClosureReason_CounterpartyForceClosed,
2243 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
2245 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
2247 LDKClosureReason_HolderForceClosed,
2249 * The channel was closed after negotiating a cooperative close and we've now broadcasted
2250 * the cooperative close transaction. Note the shutdown may have been initiated by us.
2252 LDKClosureReason_CooperativeClosure,
2254 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
2255 * commitment transaction came from our counterparty, but it may also have come from
2256 * a copy of our own `ChannelMonitor`.
2258 LDKClosureReason_CommitmentTxConfirmed,
2260 * The funding transaction failed to confirm in a timely manner on an inbound channel.
2262 LDKClosureReason_FundingTimedOut,
2264 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
2266 LDKClosureReason_ProcessingError,
2268 * The peer disconnected prior to funding completing. In this case the spec mandates that we
2269 * forget the channel entirely - we can attempt again if the peer reconnects.
2271 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
2272 * peer because of mutual incompatibility between us and our channel counterparty.
2274 LDKClosureReason_DisconnectedPeer,
2276 * Closure generated from `ChannelManager::read` if the ChannelMonitor is newer than
2277 * the ChannelManager deserialized.
2279 LDKClosureReason_OutdatedChannelManager,
2281 * Must be last for serialization purposes
2283 LDKClosureReason_Sentinel,
2284 } LDKClosureReason_Tag;
2286 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
2288 * The error which the peer sent us.
2290 * The string should be sanitized before it is used (e.g emitted to logs
2291 * or printed to stdout). Otherwise, a well crafted error message may exploit
2292 * a security vulnerability in the terminal emulator or the logging subsystem.
2294 struct LDKStr peer_msg;
2295 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
2297 typedef struct LDKClosureReason_LDKProcessingError_Body {
2299 * A developer-readable error message which we generated.
2302 } LDKClosureReason_LDKProcessingError_Body;
2304 typedef struct MUST_USE_STRUCT LDKClosureReason {
2305 LDKClosureReason_Tag tag;
2307 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
2308 LDKClosureReason_LDKProcessingError_Body processing_error;
2313 * An enum which can either contain a crate::lightning::util::events::ClosureReason or not
2315 typedef enum LDKCOption_ClosureReasonZ_Tag {
2317 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::util::events::ClosureReason
2319 LDKCOption_ClosureReasonZ_Some,
2321 * When we're in this state, this COption_ClosureReasonZ contains nothing
2323 LDKCOption_ClosureReasonZ_None,
2325 * Must be last for serialization purposes
2327 LDKCOption_ClosureReasonZ_Sentinel,
2328 } LDKCOption_ClosureReasonZ_Tag;
2330 typedef struct LDKCOption_ClosureReasonZ {
2331 LDKCOption_ClosureReasonZ_Tag tag;
2334 struct LDKClosureReason some;
2337 } LDKCOption_ClosureReasonZ;
2340 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
2342 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
2344 * A pointer to the contents in the success state.
2345 * Reading from this pointer when `result_ok` is not set is undefined.
2347 struct LDKCOption_ClosureReasonZ *result;
2349 * A pointer to the contents in the error state.
2350 * Reading from this pointer when `result_ok` is set is undefined.
2352 struct LDKDecodeError *err;
2353 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
2356 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
2357 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2358 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2360 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
2362 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
2363 * `err` or `result` depending on the state of `result_ok`.
2365 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
2367 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
2370 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
2373 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
2375 typedef enum LDKHTLCDestination_Tag {
2377 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
2378 * there is insufficient capacity in our outbound channel.
2380 LDKHTLCDestination_NextHopChannel,
2382 * Scenario where we are unsure of the next node to forward the HTLC to.
2384 LDKHTLCDestination_UnknownNextHop,
2386 * Failure scenario where an HTLC may have been forwarded to be intended for us,
2387 * but is invalid for some reason, so we reject it.
2389 * Some of the reasons may include:
2391 * * Expected MPP amount to claim does not equal HTLC total
2392 * * Claimable amount does not match expected amount
2394 LDKHTLCDestination_FailedPayment,
2396 * Must be last for serialization purposes
2398 LDKHTLCDestination_Sentinel,
2399 } LDKHTLCDestination_Tag;
2401 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
2403 * The `node_id` of the next node. For backwards compatibility, this field is
2404 * marked as optional, versions prior to 0.0.110 may not always be able to provide
2405 * counterparty node information.
2407 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2409 struct LDKPublicKey node_id;
2411 * The outgoing `channel_id` between us and the next node.
2413 struct LDKThirtyTwoBytes channel_id;
2414 } LDKHTLCDestination_LDKNextHopChannel_Body;
2416 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
2418 * Short channel id we are requesting to forward an HTLC to.
2420 uint64_t requested_forward_scid;
2421 } LDKHTLCDestination_LDKUnknownNextHop_Body;
2423 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
2425 * The payment hash of the payment we attempted to process.
2427 struct LDKThirtyTwoBytes payment_hash;
2428 } LDKHTLCDestination_LDKFailedPayment_Body;
2430 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
2431 LDKHTLCDestination_Tag tag;
2433 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
2434 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
2435 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
2437 } LDKHTLCDestination;
2440 * An enum which can either contain a crate::lightning::util::events::HTLCDestination or not
2442 typedef enum LDKCOption_HTLCDestinationZ_Tag {
2444 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::util::events::HTLCDestination
2446 LDKCOption_HTLCDestinationZ_Some,
2448 * When we're in this state, this COption_HTLCDestinationZ contains nothing
2450 LDKCOption_HTLCDestinationZ_None,
2452 * Must be last for serialization purposes
2454 LDKCOption_HTLCDestinationZ_Sentinel,
2455 } LDKCOption_HTLCDestinationZ_Tag;
2457 typedef struct LDKCOption_HTLCDestinationZ {
2458 LDKCOption_HTLCDestinationZ_Tag tag;
2461 struct LDKHTLCDestination some;
2464 } LDKCOption_HTLCDestinationZ;
2467 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
2469 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
2471 * A pointer to the contents in the success state.
2472 * Reading from this pointer when `result_ok` is not set is undefined.
2474 struct LDKCOption_HTLCDestinationZ *result;
2476 * A pointer to the contents in the error state.
2477 * Reading from this pointer when `result_ok` is set is undefined.
2479 struct LDKDecodeError *err;
2480 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
2483 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
2484 * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
2485 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2487 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
2489 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
2490 * `err` or `result` depending on the state of `result_ok`.
2492 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
2494 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
2497 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
2502 * A channel_update message to be sent or received from a peer
2504 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2506 * A pointer to the opaque Rust object.
2507 * Nearly everywhere, inner must be non-null, however in places where
2508 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2510 LDKnativeChannelUpdate *inner;
2512 * Indicates that this is the only struct which contains the same pointer.
2513 * Rust functions which take ownership of an object provided via an argument require
2514 * this to be true and invalidate the object pointed to by inner.
2520 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
2521 * return packet by a node along the route. See [BOLT #4] for details.
2523 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
2525 typedef enum LDKNetworkUpdate_Tag {
2527 * An error indicating a `channel_update` messages should be applied via
2528 * [`NetworkGraph::update_channel`].
2530 LDKNetworkUpdate_ChannelUpdateMessage,
2532 * An error indicating that a channel failed to route a payment, which should be applied via
2533 * [`NetworkGraph::channel_failed`].
2535 LDKNetworkUpdate_ChannelFailure,
2537 * An error indicating that a node failed to route a payment, which should be applied via
2538 * [`NetworkGraph::node_failed`].
2540 LDKNetworkUpdate_NodeFailure,
2542 * Must be last for serialization purposes
2544 LDKNetworkUpdate_Sentinel,
2545 } LDKNetworkUpdate_Tag;
2547 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
2549 * The update to apply via [`NetworkGraph::update_channel`].
2551 struct LDKChannelUpdate msg;
2552 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
2554 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
2556 * The short channel id of the closed channel.
2558 uint64_t short_channel_id;
2560 * Whether the channel should be permanently removed or temporarily disabled until a new
2561 * `channel_update` message is received.
2564 } LDKNetworkUpdate_LDKChannelFailure_Body;
2566 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
2568 * The node id of the failed node.
2570 struct LDKPublicKey node_id;
2572 * Whether the node should be permanently removed from consideration or can be restored
2573 * when a new `channel_update` message is received.
2576 } LDKNetworkUpdate_LDKNodeFailure_Body;
2578 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
2579 LDKNetworkUpdate_Tag tag;
2581 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2582 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
2583 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
2588 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
2590 typedef enum LDKCOption_NetworkUpdateZ_Tag {
2592 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
2594 LDKCOption_NetworkUpdateZ_Some,
2596 * When we're in this state, this COption_NetworkUpdateZ contains nothing
2598 LDKCOption_NetworkUpdateZ_None,
2600 * Must be last for serialization purposes
2602 LDKCOption_NetworkUpdateZ_Sentinel,
2603 } LDKCOption_NetworkUpdateZ_Tag;
2605 typedef struct LDKCOption_NetworkUpdateZ {
2606 LDKCOption_NetworkUpdateZ_Tag tag;
2609 struct LDKNetworkUpdate some;
2612 } LDKCOption_NetworkUpdateZ;
2617 * A reference to a transaction output.
2619 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
2620 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
2622 typedef struct MUST_USE_STRUCT LDKOutPoint {
2624 * A pointer to the opaque Rust object.
2625 * Nearly everywhere, inner must be non-null, however in places where
2626 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2628 LDKnativeOutPoint *inner;
2630 * Indicates that this is the only struct which contains the same pointer.
2631 * Rust functions which take ownership of an object provided via an argument require
2632 * this to be true and invalidate the object pointed to by inner.
2640 * Information about a spendable output to a P2WSH script. See
2641 * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
2643 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
2645 * A pointer to the opaque Rust object.
2646 * Nearly everywhere, inner must be non-null, however in places where
2647 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2649 LDKnativeDelayedPaymentOutputDescriptor *inner;
2651 * Indicates that this is the only struct which contains the same pointer.
2652 * Rust functions which take ownership of an object provided via an argument require
2653 * this to be true and invalidate the object pointed to by inner.
2656 } LDKDelayedPaymentOutputDescriptor;
2661 * Information about a spendable output to our \"payment key\". See
2662 * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this.
2664 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
2666 * A pointer to the opaque Rust object.
2667 * Nearly everywhere, inner must be non-null, however in places where
2668 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2670 LDKnativeStaticPaymentOutputDescriptor *inner;
2672 * Indicates that this is the only struct which contains the same pointer.
2673 * Rust functions which take ownership of an object provided via an argument require
2674 * this to be true and invalidate the object pointed to by inner.
2677 } LDKStaticPaymentOutputDescriptor;
2680 * When on-chain outputs are created by rust-lightning (which our counterparty is not able to
2681 * claim at any point in the future) an event is generated which you must track and be able to
2682 * spend on-chain. The information needed to do this is provided in this enum, including the
2683 * outpoint describing which txid and output index is available, the full output which exists at
2684 * that txid/index, and any keys or other information required to sign.
2686 typedef enum LDKSpendableOutputDescriptor_Tag {
2688 * An output to a script which was provided via KeysInterface directly, either from
2689 * `get_destination_script()` or `get_shutdown_scriptpubkey()`, thus you should already know
2690 * how to spend it. No secret keys are provided as rust-lightning was never given any key.
2691 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2692 * on-chain using the payment preimage or after it has timed out.
2694 LDKSpendableOutputDescriptor_StaticOutput,
2696 * An output to a P2WSH script which can be spent with a single signature after a CSV delay.
2698 * The witness in the spending input should be:
2699 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2701 * Note that the nSequence field in the spending input must be set to to_self_delay
2702 * (which means the transaction is not broadcastable until at least to_self_delay
2703 * blocks after the outpoint confirms).
2705 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2706 * it is an output from an old state which we broadcast (which should never happen).
2708 * To derive the delayed_payment key which is used to sign for this input, you must pass the
2709 * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in
2710 * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to
2711 * chan_utils::derive_private_key. The public key can be generated without the secret key
2712 * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in
2715 * To derive the revocation_pubkey provided here (which is used in the witness
2716 * script generation), you must pass the counterparty revocation_basepoint (which appears in the
2717 * call to Sign::ready_channel) and the provided per_commitment point
2718 * to chan_utils::derive_public_revocation_key.
2720 * The witness script which is hashed and included in the output script_pubkey may be
2721 * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey
2722 * (derived as above), and the to_self_delay contained here to
2723 * chan_utils::get_revokeable_redeemscript.
2725 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2727 * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which
2728 * corresponds to the public key in Sign::pubkeys().payment_point).
2729 * The witness in the spending input, is, thus, simply:
2730 * <BIP 143 signature> <payment key>
2732 * These are generally the result of our counterparty having broadcast the current state,
2733 * allowing us to claim the non-HTLC-encumbered outputs immediately.
2735 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2737 * Must be last for serialization purposes
2739 LDKSpendableOutputDescriptor_Sentinel,
2740 } LDKSpendableOutputDescriptor_Tag;
2742 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2744 * The outpoint which is spendable
2746 struct LDKOutPoint outpoint;
2748 * The output which is referenced by the given outpoint.
2750 struct LDKTxOut output;
2751 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2753 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2754 LDKSpendableOutputDescriptor_Tag tag;
2756 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2758 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2761 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2764 } LDKSpendableOutputDescriptor;
2767 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
2768 * This corresponds to std::vector in C++
2770 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2772 * The elements in the array.
2773 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2775 struct LDKSpendableOutputDescriptor *data;
2777 * The number of elements pointed to by `data`.
2780 } LDKCVec_SpendableOutputDescriptorZ;
2785 * Features used within the channel_type field in an OpenChannel message.
2787 * A channel is always of some known \"type\", describing the transaction formats used and the exact
2788 * semantics of our interaction with our peer.
2790 * Note that because a channel is a specific type which is proposed by the opener and accepted by
2791 * the counterparty, only required features are allowed here.
2793 * This is serialized differently from other feature types - it is not prefixed by a length, and
2794 * thus must only appear inside a TLV where its length is known in advance.
2796 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
2798 * A pointer to the opaque Rust object.
2799 * Nearly everywhere, inner must be non-null, however in places where
2800 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2802 LDKnativeChannelTypeFeatures *inner;
2804 * Indicates that this is the only struct which contains the same pointer.
2805 * Rust functions which take ownership of an object provided via an argument require
2806 * this to be true and invalidate the object pointed to by inner.
2809 } LDKChannelTypeFeatures;
2812 * An Event which you should probably take some action in response to.
2814 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
2815 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
2816 * written as it makes no sense to respond to it after reconnecting to peers).
2818 typedef enum LDKEvent_Tag {
2820 * Used to indicate that the client should generate a funding transaction with the given
2821 * parameters and then call [`ChannelManager::funding_transaction_generated`].
2822 * Generated in [`ChannelManager`] message handling.
2823 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
2824 * counterparty can steal your funds!
2826 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2827 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2829 LDKEvent_FundingGenerationReady,
2831 * Indicates we've received (an offer of) money! Just gotta dig out that payment preimage and
2832 * feed it to [`ChannelManager::claim_funds`] to get it....
2834 * Note that if the preimage is not known, you should call
2835 * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
2836 * network congestion.
2837 * If you fail to call either [`ChannelManager::claim_funds`] or
2838 * [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
2839 * automatically failed.
2842 * LDK will not stop an inbound payment from being paid multiple times, so multiple
2843 * `PaymentReceived` events may be generated for the same payment.
2845 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2846 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
2848 LDKEvent_PaymentReceived,
2850 * Indicates a payment has been claimed and we've received money!
2852 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
2853 * to an [`Event::PaymentReceived`]. However, if we previously crashed during a
2854 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
2855 * [`Event::PaymentReceived`] event.
2858 * LDK will not stop an inbound payment from being paid multiple times, so multiple
2859 * `PaymentReceived` events may be generated for the same payment. If you then call
2860 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentReceived`] you may get
2861 * multiple `PaymentClaimed` events.
2863 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2865 LDKEvent_PaymentClaimed,
2867 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
2868 * and we got back the payment preimage for it).
2870 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
2871 * event. In this situation, you SHOULD treat this payment as having succeeded.
2873 LDKEvent_PaymentSent,
2875 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
2876 * provide failure information for each MPP part in the payment.
2878 * This event is provided once there are no further pending HTLCs for the payment and the
2879 * payment is no longer retryable, either due to a several-block timeout or because
2880 * [`ChannelManager::abandon_payment`] was previously called for the corresponding payment.
2882 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
2884 LDKEvent_PaymentFailed,
2886 * Indicates that a path for an outbound payment was successful.
2888 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
2889 * [`Event::PaymentSent`] for obtaining the payment preimage.
2891 LDKEvent_PaymentPathSuccessful,
2893 * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped
2894 * something. You may wish to retry with a different route.
2896 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
2897 * [`Event::PaymentFailed`] and [`all_paths_failed`].
2899 * [`all_paths_failed`]: Self::PaymentPathFailed::all_paths_failed
2901 LDKEvent_PaymentPathFailed,
2903 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
2905 LDKEvent_ProbeSuccessful,
2907 * Indicates that a probe payment we sent failed at an intermediary node on the path.
2909 LDKEvent_ProbeFailed,
2911 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
2912 * a time in the future.
2914 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
2916 LDKEvent_PendingHTLCsForwardable,
2918 * Used to indicate that an output which you should know how to spend was confirmed on chain
2919 * and is now spendable.
2920 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
2921 * counterparty spending them due to some kind of timeout. Thus, you need to store them
2922 * somewhere and spend them when you create on-chain transactions.
2924 LDKEvent_SpendableOutputs,
2926 * This event is generated when a payment has been successfully forwarded through us and a
2927 * forwarding fee earned.
2929 LDKEvent_PaymentForwarded,
2931 * Used to indicate that a previously opened channel with the given `channel_id` is in the
2932 * process of closure.
2934 LDKEvent_ChannelClosed,
2936 * Used to indicate to the user that they can abandon the funding transaction and recycle the
2937 * inputs for another purpose.
2939 LDKEvent_DiscardFunding,
2941 * Indicates a request to open a new channel by a peer.
2943 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the
2944 * request, call [`ChannelManager::force_close_without_broadcasting_txn`].
2946 * The event is only triggered when a new open channel request is received and the
2947 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
2949 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
2950 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
2951 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
2953 LDKEvent_OpenChannelRequest,
2955 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
2958 * Some scenarios where this event may be sent include:
2959 * * Insufficient capacity in the outbound channel
2960 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
2961 * * When an unknown SCID is requested for forwarding a payment.
2962 * * Claiming an amount for an MPP payment that exceeds the HTLC total
2963 * * The HTLC has timed out
2965 * This event, however, does not get generated if an HTLC fails to meet the forwarding
2966 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
2968 LDKEvent_HTLCHandlingFailed,
2970 * Must be last for serialization purposes
2975 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
2977 * The random channel_id we picked which you'll need to pass into
2978 * [`ChannelManager::funding_transaction_generated`].
2980 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2982 struct LDKThirtyTwoBytes temporary_channel_id;
2984 * The counterparty's node_id, which you'll need to pass back into
2985 * [`ChannelManager::funding_transaction_generated`].
2987 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
2989 struct LDKPublicKey counterparty_node_id;
2991 * The value, in satoshis, that the output should have.
2993 uint64_t channel_value_satoshis;
2995 * The script which should be used in the transaction output.
2997 struct LDKCVec_u8Z output_script;
2999 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for
3000 * an inbound channel.
3002 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3004 uint64_t user_channel_id;
3005 } LDKEvent_LDKFundingGenerationReady_Body;
3007 typedef struct LDKEvent_LDKPaymentReceived_Body {
3009 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
3010 * not stop you from registering duplicate payment hashes for inbound payments.
3012 struct LDKThirtyTwoBytes payment_hash;
3014 * The value, in thousandths of a satoshi, that this payment is for.
3016 uint64_t amount_msat;
3018 * Information for claiming this received payment, based on whether the purpose of the
3019 * payment is to pay an invoice or to send a spontaneous payment.
3021 struct LDKPaymentPurpose purpose;
3022 } LDKEvent_LDKPaymentReceived_Body;
3024 typedef struct LDKEvent_LDKPaymentClaimed_Body {
3026 * The payment hash of the claimed payment. Note that LDK will not stop you from
3027 * registering duplicate payment hashes for inbound payments.
3029 struct LDKThirtyTwoBytes payment_hash;
3031 * The value, in thousandths of a satoshi, that this payment is for.
3033 uint64_t amount_msat;
3035 * The purpose of this claimed payment, i.e. whether the payment was for an invoice or a
3036 * spontaneous payment.
3038 struct LDKPaymentPurpose purpose;
3039 } LDKEvent_LDKPaymentClaimed_Body;
3041 typedef struct LDKEvent_LDKPaymentSent_Body {
3043 * The id returned by [`ChannelManager::send_payment`] and used with
3044 * [`ChannelManager::retry_payment`].
3046 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3047 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3049 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3051 struct LDKThirtyTwoBytes payment_id;
3053 * The preimage to the hash given to ChannelManager::send_payment.
3054 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
3057 struct LDKThirtyTwoBytes payment_preimage;
3059 * The hash that was given to [`ChannelManager::send_payment`].
3061 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3063 struct LDKThirtyTwoBytes payment_hash;
3065 * The total fee which was spent at intermediate hops in this payment, across all paths.
3067 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
3068 * overpayment to the recipient node.
3070 * If the recipient or an intermediate node misbehaves and gives us free money, this may
3071 * overstate the amount paid, though this is unlikely.
3073 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
3075 struct LDKCOption_u64Z fee_paid_msat;
3076 } LDKEvent_LDKPaymentSent_Body;
3078 typedef struct LDKEvent_LDKPaymentFailed_Body {
3080 * The id returned by [`ChannelManager::send_payment`] and used with
3081 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3083 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3084 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3085 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3087 struct LDKThirtyTwoBytes payment_id;
3089 * The hash that was given to [`ChannelManager::send_payment`].
3091 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3093 struct LDKThirtyTwoBytes payment_hash;
3094 } LDKEvent_LDKPaymentFailed_Body;
3096 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
3098 * The id returned by [`ChannelManager::send_payment`] and used with
3099 * [`ChannelManager::retry_payment`].
3101 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3102 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3104 struct LDKThirtyTwoBytes payment_id;
3106 * The hash that was given to [`ChannelManager::send_payment`].
3108 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3110 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3112 struct LDKThirtyTwoBytes payment_hash;
3114 * The payment path that was successful.
3116 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
3118 struct LDKCVec_RouteHopZ path;
3119 } LDKEvent_LDKPaymentPathSuccessful_Body;
3121 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
3123 * The id returned by [`ChannelManager::send_payment`] and used with
3124 * [`ChannelManager::retry_payment`] and [`ChannelManager::abandon_payment`].
3126 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3127 * [`ChannelManager::retry_payment`]: crate::ln::channelmanager::ChannelManager::retry_payment
3128 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3130 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3132 struct LDKThirtyTwoBytes payment_id;
3134 * The hash that was given to [`ChannelManager::send_payment`].
3136 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3138 struct LDKThirtyTwoBytes payment_hash;
3140 * Indicates the payment was rejected for some reason by the recipient. This implies that
3141 * the payment has failed, not just the route in question. If this is not set, you may
3142 * retry the payment via a different route.
3144 bool rejected_by_dest;
3146 * Any failure information conveyed via the Onion return packet by a node along the failed
3149 * Should be applied to the [`NetworkGraph`] so that routing decisions can take into
3150 * account the update.
3152 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
3154 struct LDKCOption_NetworkUpdateZ network_update;
3156 * For both single-path and multi-path payments, this is set if all paths of the payment have
3157 * failed. This will be set to false if (1) this is an MPP payment and (2) other parts of the
3158 * larger MPP payment were still in flight when this event was generated.
3160 * Note that if you are retrying individual MPP parts, using this value to determine if a
3161 * payment has fully failed is race-y. Because multiple failures can happen prior to events
3162 * being processed, you may retry in response to a first failure, with a second failure
3163 * (with `all_paths_failed` set) still pending. Then, when the second failure is processed
3164 * you will see `all_paths_failed` set even though the retry of the first failure still
3165 * has an associated in-flight HTLC. See (1) for an example of such a failure.
3167 * If you wish to retry individual MPP parts and learn when a payment has failed, you must
3168 * call [`ChannelManager::abandon_payment`] and wait for a [`Event::PaymentFailed`] event.
3170 * (1) <https://github.com/lightningdevkit/rust-lightning/issues/1164>
3172 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3174 bool all_paths_failed;
3176 * The payment path that failed.
3178 struct LDKCVec_RouteHopZ path;
3180 * The channel responsible for the failed payment path.
3182 * Note that for route hints or for the first hop in a path this may be an SCID alias and
3183 * may not refer to a channel in the public network graph. These aliases may also collide
3184 * with channels in the public network graph.
3186 * If this is `Some`, then the corresponding channel should be avoided when the payment is
3187 * retried. May be `None` for older [`Event`] serializations.
3189 struct LDKCOption_u64Z short_channel_id;
3191 * Parameters needed to compute a new [`Route`] when retrying the failed payment path.
3193 * See [`find_route`] for details.
3195 * [`Route`]: crate::routing::router::Route
3196 * [`find_route`]: crate::routing::router::find_route
3198 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3200 struct LDKRouteParameters retry;
3201 } LDKEvent_LDKPaymentPathFailed_Body;
3203 typedef struct LDKEvent_LDKProbeSuccessful_Body {
3205 * The id returned by [`ChannelManager::send_probe`].
3207 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3209 struct LDKThirtyTwoBytes payment_id;
3211 * The hash generated by [`ChannelManager::send_probe`].
3213 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3215 struct LDKThirtyTwoBytes payment_hash;
3217 * The payment path that was successful.
3219 struct LDKCVec_RouteHopZ path;
3220 } LDKEvent_LDKProbeSuccessful_Body;
3222 typedef struct LDKEvent_LDKProbeFailed_Body {
3224 * The id returned by [`ChannelManager::send_probe`].
3226 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3228 struct LDKThirtyTwoBytes payment_id;
3230 * The hash generated by [`ChannelManager::send_probe`].
3232 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
3234 struct LDKThirtyTwoBytes payment_hash;
3236 * The payment path that failed.
3238 struct LDKCVec_RouteHopZ path;
3240 * The channel responsible for the failed probe.
3242 * Note that for route hints or for the first hop in a path this may be an SCID alias and
3243 * may not refer to a channel in the public network graph. These aliases may also collide
3244 * with channels in the public network graph.
3246 struct LDKCOption_u64Z short_channel_id;
3247 } LDKEvent_LDKProbeFailed_Body;
3249 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
3251 * The minimum amount of time that should be waited prior to calling
3252 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
3253 * you should wait a random amount of time in roughly the range (now + time_forwardable,
3254 * now + 5*time_forwardable).
3256 uint64_t time_forwardable;
3257 } LDKEvent_LDKPendingHTLCsForwardable_Body;
3259 typedef struct LDKEvent_LDKSpendableOutputs_Body {
3261 * The outputs which you should store as spendable by you.
3263 struct LDKCVec_SpendableOutputDescriptorZ outputs;
3264 } LDKEvent_LDKSpendableOutputs_Body;
3266 typedef struct LDKEvent_LDKPaymentForwarded_Body {
3268 * The incoming channel between the previous node and us. This is only `None` for events
3269 * generated or serialized by versions prior to 0.0.107.
3271 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3273 struct LDKThirtyTwoBytes prev_channel_id;
3275 * The outgoing channel between the next node and us. This is only `None` for events
3276 * generated or serialized by versions prior to 0.0.107.
3278 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3280 struct LDKThirtyTwoBytes next_channel_id;
3282 * The fee, in milli-satoshis, which was earned as a result of the payment.
3284 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
3285 * was pending, the amount the next hop claimed will have been rounded down to the nearest
3286 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
3287 * claimed the full value in millisatoshis from the source. In this case,
3288 * `claim_from_onchain_tx` will be set.
3290 * If the channel which sent us the payment has been force-closed, we will claim the funds
3291 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
3292 * fees which we will spend and will instead set this to `None`. It is possible duplicate
3293 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
3296 struct LDKCOption_u64Z fee_earned_msat;
3298 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
3301 bool claim_from_onchain_tx;
3302 } LDKEvent_LDKPaymentForwarded_Body;
3304 typedef struct LDKEvent_LDKChannelClosed_Body {
3306 * The channel_id of the channel which has been closed. Note that on-chain transactions
3307 * resolving the channel are likely still awaiting confirmation.
3309 struct LDKThirtyTwoBytes channel_id;
3311 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
3312 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
3313 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
3314 * `user_channel_id` will be 0 for an inbound channel.
3315 * This will always be zero for objects serialized with LDK versions prior to 0.0.102.
3317 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3318 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3319 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
3321 uint64_t user_channel_id;
3323 * The reason the channel was closed.
3325 struct LDKClosureReason reason;
3326 } LDKEvent_LDKChannelClosed_Body;
3328 typedef struct LDKEvent_LDKDiscardFunding_Body {
3330 * The channel_id of the channel which has been closed.
3332 struct LDKThirtyTwoBytes channel_id;
3334 * The full transaction received from the user
3336 struct LDKTransaction transaction;
3337 } LDKEvent_LDKDiscardFunding_Body;
3339 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
3341 * The temporary channel ID of the channel requested to be opened.
3343 * When responding to the request, the `temporary_channel_id` should be passed
3344 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
3345 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
3347 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3348 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3350 struct LDKThirtyTwoBytes temporary_channel_id;
3352 * The node_id of the counterparty requesting to open the channel.
3354 * When responding to the request, the `counterparty_node_id` should be passed
3355 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
3356 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
3359 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3360 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3362 struct LDKPublicKey counterparty_node_id;
3364 * The channel value of the requested channel.
3366 uint64_t funding_satoshis;
3368 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
3372 * The features that this channel will operate with. If you reject the channel, a
3373 * well-behaved counterparty may automatically re-attempt the channel with a new set of
3376 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
3377 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3380 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
3381 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
3382 * 0.0.107. Channels setting this type also need to get manually accepted via
3383 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
3384 * or will be rejected otherwise.
3386 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3388 struct LDKChannelTypeFeatures channel_type;
3389 } LDKEvent_LDKOpenChannelRequest_Body;
3391 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
3393 * The channel over which the HTLC was received.
3395 struct LDKThirtyTwoBytes prev_channel_id;
3397 * Destination of the HTLC that failed to be processed.
3399 struct LDKHTLCDestination failed_next_destination;
3400 } LDKEvent_LDKHTLCHandlingFailed_Body;
3402 typedef struct MUST_USE_STRUCT LDKEvent {
3405 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
3406 LDKEvent_LDKPaymentReceived_Body payment_received;
3407 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
3408 LDKEvent_LDKPaymentSent_Body payment_sent;
3409 LDKEvent_LDKPaymentFailed_Body payment_failed;
3410 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
3411 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
3412 LDKEvent_LDKProbeSuccessful_Body probe_successful;
3413 LDKEvent_LDKProbeFailed_Body probe_failed;
3414 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
3415 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
3416 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
3417 LDKEvent_LDKChannelClosed_Body channel_closed;
3418 LDKEvent_LDKDiscardFunding_Body discard_funding;
3419 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
3420 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
3425 * An enum which can either contain a crate::lightning::util::events::Event or not
3427 typedef enum LDKCOption_EventZ_Tag {
3429 * When we're in this state, this COption_EventZ contains a crate::lightning::util::events::Event
3431 LDKCOption_EventZ_Some,
3433 * When we're in this state, this COption_EventZ contains nothing
3435 LDKCOption_EventZ_None,
3437 * Must be last for serialization purposes
3439 LDKCOption_EventZ_Sentinel,
3440 } LDKCOption_EventZ_Tag;
3442 typedef struct LDKCOption_EventZ {
3443 LDKCOption_EventZ_Tag tag;
3446 struct LDKEvent some;
3449 } LDKCOption_EventZ;
3452 * The contents of CResult_COption_EventZDecodeErrorZ
3454 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
3456 * A pointer to the contents in the success state.
3457 * Reading from this pointer when `result_ok` is not set is undefined.
3459 struct LDKCOption_EventZ *result;
3461 * A pointer to the contents in the error state.
3462 * Reading from this pointer when `result_ok` is set is undefined.
3464 struct LDKDecodeError *err;
3465 } LDKCResult_COption_EventZDecodeErrorZPtr;
3468 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
3469 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3470 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3472 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
3474 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
3475 * `err` or `result` depending on the state of `result_ok`.
3477 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
3479 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
3482 } LDKCResult_COption_EventZDecodeErrorZ;
3487 * An accept_channel message to be sent or received from a peer
3489 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
3491 * A pointer to the opaque Rust object.
3492 * Nearly everywhere, inner must be non-null, however in places where
3493 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3495 LDKnativeAcceptChannel *inner;
3497 * Indicates that this is the only struct which contains the same pointer.
3498 * Rust functions which take ownership of an object provided via an argument require
3499 * this to be true and invalidate the object pointed to by inner.
3507 * An open_channel message to be sent or received from a peer
3509 typedef struct MUST_USE_STRUCT LDKOpenChannel {
3511 * A pointer to the opaque Rust object.
3512 * Nearly everywhere, inner must be non-null, however in places where
3513 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3515 LDKnativeOpenChannel *inner;
3517 * Indicates that this is the only struct which contains the same pointer.
3518 * Rust functions which take ownership of an object provided via an argument require
3519 * this to be true and invalidate the object pointed to by inner.
3527 * A funding_created message to be sent or received from a peer
3529 typedef struct MUST_USE_STRUCT LDKFundingCreated {
3531 * A pointer to the opaque Rust object.
3532 * Nearly everywhere, inner must be non-null, however in places where
3533 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3535 LDKnativeFundingCreated *inner;
3537 * Indicates that this is the only struct which contains the same pointer.
3538 * Rust functions which take ownership of an object provided via an argument require
3539 * this to be true and invalidate the object pointed to by inner.
3542 } LDKFundingCreated;
3547 * A funding_signed message to be sent or received from a peer
3549 typedef struct MUST_USE_STRUCT LDKFundingSigned {
3551 * A pointer to the opaque Rust object.
3552 * Nearly everywhere, inner must be non-null, however in places where
3553 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3555 LDKnativeFundingSigned *inner;
3557 * Indicates that this is the only struct which contains the same pointer.
3558 * Rust functions which take ownership of an object provided via an argument require
3559 * this to be true and invalidate the object pointed to by inner.
3567 * A channel_ready message to be sent or received from a peer
3569 typedef struct MUST_USE_STRUCT LDKChannelReady {
3571 * A pointer to the opaque Rust object.
3572 * Nearly everywhere, inner must be non-null, however in places where
3573 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3575 LDKnativeChannelReady *inner;
3577 * Indicates that this is the only struct which contains the same pointer.
3578 * Rust functions which take ownership of an object provided via an argument require
3579 * this to be true and invalidate the object pointed to by inner.
3587 * An announcement_signatures message to be sent or received from a peer
3589 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
3591 * A pointer to the opaque Rust object.
3592 * Nearly everywhere, inner must be non-null, however in places where
3593 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3595 LDKnativeAnnouncementSignatures *inner;
3597 * Indicates that this is the only struct which contains the same pointer.
3598 * Rust functions which take ownership of an object provided via an argument require
3599 * this to be true and invalidate the object pointed to by inner.
3602 } LDKAnnouncementSignatures;
3607 * Struct used to return values from revoke_and_ack messages, containing a bunch of commitment
3608 * transaction updates if they were pending.
3610 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
3612 * A pointer to the opaque Rust object.
3613 * Nearly everywhere, inner must be non-null, however in places where
3614 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3616 LDKnativeCommitmentUpdate *inner;
3618 * Indicates that this is the only struct which contains the same pointer.
3619 * Rust functions which take ownership of an object provided via an argument require
3620 * this to be true and invalidate the object pointed to by inner.
3623 } LDKCommitmentUpdate;
3628 * A revoke_and_ack message to be sent or received from a peer
3630 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
3632 * A pointer to the opaque Rust object.
3633 * Nearly everywhere, inner must be non-null, however in places where
3634 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3636 LDKnativeRevokeAndACK *inner;
3638 * Indicates that this is the only struct which contains the same pointer.
3639 * Rust functions which take ownership of an object provided via an argument require
3640 * this to be true and invalidate the object pointed to by inner.
3648 * A closing_signed message to be sent or received from a peer
3650 typedef struct MUST_USE_STRUCT LDKClosingSigned {
3652 * A pointer to the opaque Rust object.
3653 * Nearly everywhere, inner must be non-null, however in places where
3654 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3656 LDKnativeClosingSigned *inner;
3658 * Indicates that this is the only struct which contains the same pointer.
3659 * Rust functions which take ownership of an object provided via an argument require
3660 * this to be true and invalidate the object pointed to by inner.
3668 * A shutdown message to be sent or received from a peer
3670 typedef struct MUST_USE_STRUCT LDKShutdown {
3672 * A pointer to the opaque Rust object.
3673 * Nearly everywhere, inner must be non-null, however in places where
3674 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3676 LDKnativeShutdown *inner;
3678 * Indicates that this is the only struct which contains the same pointer.
3679 * Rust functions which take ownership of an object provided via an argument require
3680 * this to be true and invalidate the object pointed to by inner.
3688 * A channel_reestablish message to be sent or received from a peer
3690 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
3692 * A pointer to the opaque Rust object.
3693 * Nearly everywhere, inner must be non-null, however in places where
3694 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3696 LDKnativeChannelReestablish *inner;
3698 * Indicates that this is the only struct which contains the same pointer.
3699 * Rust functions which take ownership of an object provided via an argument require
3700 * this to be true and invalidate the object pointed to by inner.
3703 } LDKChannelReestablish;
3708 * A channel_announcement message to be sent or received from a peer
3710 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
3712 * A pointer to the opaque Rust object.
3713 * Nearly everywhere, inner must be non-null, however in places where
3714 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3716 LDKnativeChannelAnnouncement *inner;
3718 * Indicates that this is the only struct which contains the same pointer.
3719 * Rust functions which take ownership of an object provided via an argument require
3720 * this to be true and invalidate the object pointed to by inner.
3723 } LDKChannelAnnouncement;
3728 * A node_announcement message to be sent or received from a peer
3730 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
3732 * A pointer to the opaque Rust object.
3733 * Nearly everywhere, inner must be non-null, however in places where
3734 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3736 LDKnativeNodeAnnouncement *inner;
3738 * Indicates that this is the only struct which contains the same pointer.
3739 * Rust functions which take ownership of an object provided via an argument require
3740 * this to be true and invalidate the object pointed to by inner.
3743 } LDKNodeAnnouncement;
3748 * An error message to be sent or received from a peer
3750 typedef struct MUST_USE_STRUCT LDKErrorMessage {
3752 * A pointer to the opaque Rust object.
3753 * Nearly everywhere, inner must be non-null, however in places where
3754 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3756 LDKnativeErrorMessage *inner;
3758 * Indicates that this is the only struct which contains the same pointer.
3759 * Rust functions which take ownership of an object provided via an argument require
3760 * this to be true and invalidate the object pointed to by inner.
3768 * A warning message to be sent or received from a peer
3770 typedef struct MUST_USE_STRUCT LDKWarningMessage {
3772 * A pointer to the opaque Rust object.
3773 * Nearly everywhere, inner must be non-null, however in places where
3774 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3776 LDKnativeWarningMessage *inner;
3778 * Indicates that this is the only struct which contains the same pointer.
3779 * Rust functions which take ownership of an object provided via an argument require
3780 * this to be true and invalidate the object pointed to by inner.
3783 } LDKWarningMessage;
3786 * Used to put an error message in a LightningError
3788 typedef enum LDKErrorAction_Tag {
3790 * The peer took some action which made us think they were useless. Disconnect them.
3792 LDKErrorAction_DisconnectPeer,
3794 * The peer did something harmless that we weren't able to process, just log and ignore
3796 LDKErrorAction_IgnoreError,
3798 * The peer did something harmless that we weren't able to meaningfully process.
3799 * If the error is logged, log it at the given level.
3801 LDKErrorAction_IgnoreAndLog,
3803 * The peer provided us with a gossip message which we'd already seen. In most cases this
3804 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
3805 * our own channel announcements.
3807 LDKErrorAction_IgnoreDuplicateGossip,
3809 * The peer did something incorrect. Tell them.
3811 LDKErrorAction_SendErrorMessage,
3813 * The peer did something incorrect. Tell them without closing any channels.
3815 LDKErrorAction_SendWarningMessage,
3817 * Must be last for serialization purposes
3819 LDKErrorAction_Sentinel,
3820 } LDKErrorAction_Tag;
3822 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
3824 * An error message which we should make an effort to send before we disconnect.
3826 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3828 struct LDKErrorMessage msg;
3829 } LDKErrorAction_LDKDisconnectPeer_Body;
3831 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
3833 * The message to send.
3835 struct LDKErrorMessage msg;
3836 } LDKErrorAction_LDKSendErrorMessage_Body;
3838 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
3840 * The message to send.
3842 struct LDKWarningMessage msg;
3844 * The peer may have done something harmless that we weren't able to meaningfully process,
3845 * though we should still tell them about it.
3846 * If this event is logged, log it at the given level.
3848 enum LDKLevel log_level;
3849 } LDKErrorAction_LDKSendWarningMessage_Body;
3851 typedef struct MUST_USE_STRUCT LDKErrorAction {
3852 LDKErrorAction_Tag tag;
3854 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
3856 enum LDKLevel ignore_and_log;
3858 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
3859 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
3866 * A query_channel_range message is used to query a peer for channel
3867 * UTXOs in a range of blocks. The recipient of a query makes a best
3868 * effort to reply to the query using one or more reply_channel_range
3871 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
3873 * A pointer to the opaque Rust object.
3874 * Nearly everywhere, inner must be non-null, however in places where
3875 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3877 LDKnativeQueryChannelRange *inner;
3879 * Indicates that this is the only struct which contains the same pointer.
3880 * Rust functions which take ownership of an object provided via an argument require
3881 * this to be true and invalidate the object pointed to by inner.
3884 } LDKQueryChannelRange;
3889 * A query_short_channel_ids message is used to query a peer for
3890 * routing gossip messages related to one or more short_channel_ids.
3891 * The query recipient will reply with the latest, if available,
3892 * channel_announcement, channel_update and node_announcement messages
3893 * it maintains for the requested short_channel_ids followed by a
3894 * reply_short_channel_ids_end message. The short_channel_ids sent in
3895 * this query are encoded. We only support encoding_type=0 uncompressed
3896 * serialization and do not support encoding_type=1 zlib serialization.
3898 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
3900 * A pointer to the opaque Rust object.
3901 * Nearly everywhere, inner must be non-null, however in places where
3902 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3904 LDKnativeQueryShortChannelIds *inner;
3906 * Indicates that this is the only struct which contains the same pointer.
3907 * Rust functions which take ownership of an object provided via an argument require
3908 * this to be true and invalidate the object pointed to by inner.
3911 } LDKQueryShortChannelIds;
3916 * A reply_channel_range message is a reply to a query_channel_range
3917 * message. Multiple reply_channel_range messages can be sent in reply
3918 * to a single query_channel_range message. The query recipient makes a
3919 * best effort to respond based on their local network view which may
3920 * not be a perfect view of the network. The short_channel_ids in the
3921 * reply are encoded. We only support encoding_type=0 uncompressed
3922 * serialization and do not support encoding_type=1 zlib serialization.
3924 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
3926 * A pointer to the opaque Rust object.
3927 * Nearly everywhere, inner must be non-null, however in places where
3928 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3930 LDKnativeReplyChannelRange *inner;
3932 * Indicates that this is the only struct which contains the same pointer.
3933 * Rust functions which take ownership of an object provided via an argument require
3934 * this to be true and invalidate the object pointed to by inner.
3937 } LDKReplyChannelRange;
3942 * A gossip_timestamp_filter message is used by a node to request
3943 * gossip relay for messages in the requested time range when the
3944 * gossip_queries feature has been negotiated.
3946 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
3948 * A pointer to the opaque Rust object.
3949 * Nearly everywhere, inner must be non-null, however in places where
3950 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3952 LDKnativeGossipTimestampFilter *inner;
3954 * Indicates that this is the only struct which contains the same pointer.
3955 * Rust functions which take ownership of an object provided via an argument require
3956 * this to be true and invalidate the object pointed to by inner.
3959 } LDKGossipTimestampFilter;
3962 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
3963 * broadcast to most peers).
3964 * These events are handled by PeerManager::process_events if you are using a PeerManager.
3966 typedef enum LDKMessageSendEvent_Tag {
3968 * Used to indicate that we've accepted a channel open and should send the accept_channel
3969 * message provided to the given peer.
3971 LDKMessageSendEvent_SendAcceptChannel,
3973 * Used to indicate that we've initiated a channel open and should send the open_channel
3974 * message provided to the given peer.
3976 LDKMessageSendEvent_SendOpenChannel,
3978 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
3980 LDKMessageSendEvent_SendFundingCreated,
3982 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
3984 LDKMessageSendEvent_SendFundingSigned,
3986 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
3988 LDKMessageSendEvent_SendChannelReady,
3990 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
3992 LDKMessageSendEvent_SendAnnouncementSignatures,
3994 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
3995 * message should be sent to the peer with the given node_id.
3997 LDKMessageSendEvent_UpdateHTLCs,
3999 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
4001 LDKMessageSendEvent_SendRevokeAndACK,
4003 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
4005 LDKMessageSendEvent_SendClosingSigned,
4007 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
4009 LDKMessageSendEvent_SendShutdown,
4011 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
4013 LDKMessageSendEvent_SendChannelReestablish,
4015 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
4016 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
4018 * Note that after doing so, you very likely (unless you did so very recently) want to call
4019 * ChannelManager::broadcast_node_announcement to trigger a BroadcastNodeAnnouncement event.
4020 * This ensures that any nodes which see our channel_announcement also have a relevant
4021 * node_announcement, including relevant feature flags which may be important for routing
4024 LDKMessageSendEvent_BroadcastChannelAnnouncement,
4026 * Used to indicate that a node_announcement should be broadcast to all peers.
4028 LDKMessageSendEvent_BroadcastNodeAnnouncement,
4030 * Used to indicate that a channel_update should be broadcast to all peers.
4032 LDKMessageSendEvent_BroadcastChannelUpdate,
4034 * Used to indicate that a channel_update should be sent to a single peer.
4035 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
4036 * private channel and we shouldn't be informing all of our peers of channel parameters.
4038 LDKMessageSendEvent_SendChannelUpdate,
4040 * Broadcast an error downstream to be handled
4042 LDKMessageSendEvent_HandleError,
4044 * Query a peer for channels with funding transaction UTXOs in a block range.
4046 LDKMessageSendEvent_SendChannelRangeQuery,
4048 * Request routing gossip messages from a peer for a list of channels identified by
4049 * their short_channel_ids.
4051 LDKMessageSendEvent_SendShortIdsQuery,
4053 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
4054 * emitted during processing of the query.
4056 LDKMessageSendEvent_SendReplyChannelRange,
4058 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
4059 * enable receiving gossip messages from the peer.
4061 LDKMessageSendEvent_SendGossipTimestampFilter,
4063 * Must be last for serialization purposes
4065 LDKMessageSendEvent_Sentinel,
4066 } LDKMessageSendEvent_Tag;
4068 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
4070 * The node_id of the node which should receive this message
4072 struct LDKPublicKey node_id;
4074 * The message which should be sent.
4076 struct LDKAcceptChannel msg;
4077 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
4079 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
4081 * The node_id of the node which should receive this message
4083 struct LDKPublicKey node_id;
4085 * The message which should be sent.
4087 struct LDKOpenChannel msg;
4088 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
4090 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
4092 * The node_id of the node which should receive this message
4094 struct LDKPublicKey node_id;
4096 * The message which should be sent.
4098 struct LDKFundingCreated msg;
4099 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
4101 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
4103 * The node_id of the node which should receive this message
4105 struct LDKPublicKey node_id;
4107 * The message which should be sent.
4109 struct LDKFundingSigned msg;
4110 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
4112 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
4114 * The node_id of the node which should receive these message(s)
4116 struct LDKPublicKey node_id;
4118 * The channel_ready message which should be sent.
4120 struct LDKChannelReady msg;
4121 } LDKMessageSendEvent_LDKSendChannelReady_Body;
4123 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
4125 * The node_id of the node which should receive these message(s)
4127 struct LDKPublicKey node_id;
4129 * The announcement_signatures message which should be sent.
4131 struct LDKAnnouncementSignatures msg;
4132 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
4134 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
4136 * The node_id of the node which should receive these message(s)
4138 struct LDKPublicKey node_id;
4140 * The update messages which should be sent. ALL messages in the struct should be sent!
4142 struct LDKCommitmentUpdate updates;
4143 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
4145 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
4147 * The node_id of the node which should receive this message
4149 struct LDKPublicKey node_id;
4151 * The message which should be sent.
4153 struct LDKRevokeAndACK msg;
4154 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
4156 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
4158 * The node_id of the node which should receive this message
4160 struct LDKPublicKey node_id;
4162 * The message which should be sent.
4164 struct LDKClosingSigned msg;
4165 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
4167 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
4169 * The node_id of the node which should receive this message
4171 struct LDKPublicKey node_id;
4173 * The message which should be sent.
4175 struct LDKShutdown msg;
4176 } LDKMessageSendEvent_LDKSendShutdown_Body;
4178 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
4180 * The node_id of the node which should receive this message
4182 struct LDKPublicKey node_id;
4184 * The message which should be sent.
4186 struct LDKChannelReestablish msg;
4187 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
4189 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
4191 * The channel_announcement which should be sent.
4193 struct LDKChannelAnnouncement msg;
4195 * The followup channel_update which should be sent.
4197 struct LDKChannelUpdate update_msg;
4198 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
4200 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
4202 * The node_announcement which should be sent.
4204 struct LDKNodeAnnouncement msg;
4205 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
4207 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
4209 * The channel_update which should be sent.
4211 struct LDKChannelUpdate msg;
4212 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
4214 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
4216 * The node_id of the node which should receive this message
4218 struct LDKPublicKey node_id;
4220 * The channel_update which should be sent.
4222 struct LDKChannelUpdate msg;
4223 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
4225 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
4227 * The node_id of the node which should receive this message
4229 struct LDKPublicKey node_id;
4231 * The action which should be taken.
4233 struct LDKErrorAction action;
4234 } LDKMessageSendEvent_LDKHandleError_Body;
4236 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
4238 * The node_id of this message recipient
4240 struct LDKPublicKey node_id;
4242 * The query_channel_range which should be sent.
4244 struct LDKQueryChannelRange msg;
4245 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
4247 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
4249 * The node_id of this message recipient
4251 struct LDKPublicKey node_id;
4253 * The query_short_channel_ids which should be sent.
4255 struct LDKQueryShortChannelIds msg;
4256 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
4258 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
4260 * The node_id of this message recipient
4262 struct LDKPublicKey node_id;
4264 * The reply_channel_range which should be sent.
4266 struct LDKReplyChannelRange msg;
4267 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
4269 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
4271 * The node_id of this message recipient
4273 struct LDKPublicKey node_id;
4275 * The gossip_timestamp_filter which should be sent.
4277 struct LDKGossipTimestampFilter msg;
4278 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
4280 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
4281 LDKMessageSendEvent_Tag tag;
4283 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
4284 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
4285 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
4286 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
4287 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
4288 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
4289 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
4290 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
4291 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
4292 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
4293 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
4294 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
4295 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
4296 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
4297 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
4298 LDKMessageSendEvent_LDKHandleError_Body handle_error;
4299 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
4300 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
4301 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
4302 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
4304 } LDKMessageSendEvent;
4307 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
4308 * This corresponds to std::vector in C++
4310 typedef struct LDKCVec_MessageSendEventZ {
4312 * The elements in the array.
4313 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4315 struct LDKMessageSendEvent *data;
4317 * The number of elements pointed to by `data`.
4320 } LDKCVec_MessageSendEventZ;
4323 * The contents of CResult_TxOutAccessErrorZ
4325 typedef union LDKCResult_TxOutAccessErrorZPtr {
4327 * A pointer to the contents in the success state.
4328 * Reading from this pointer when `result_ok` is not set is undefined.
4330 struct LDKTxOut *result;
4332 * A pointer to the contents in the error state.
4333 * Reading from this pointer when `result_ok` is set is undefined.
4335 enum LDKAccessError *err;
4336 } LDKCResult_TxOutAccessErrorZPtr;
4339 * A CResult_TxOutAccessErrorZ represents the result of a fallible operation,
4340 * containing a crate::c_types::TxOut on success and a crate::lightning::chain::AccessError on failure.
4341 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4343 typedef struct LDKCResult_TxOutAccessErrorZ {
4345 * The contents of this CResult_TxOutAccessErrorZ, accessible via either
4346 * `err` or `result` depending on the state of `result_ok`.
4348 union LDKCResult_TxOutAccessErrorZPtr contents;
4350 * Whether this CResult_TxOutAccessErrorZ represents a success state.
4353 } LDKCResult_TxOutAccessErrorZ;
4356 * A tuple of 2 elements. See the individual fields for the types contained.
4358 typedef struct LDKC2Tuple_usizeTransactionZ {
4360 * The element at position 0
4364 * The element at position 1
4366 struct LDKTransaction b;
4367 } LDKC2Tuple_usizeTransactionZ;
4370 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4371 * This corresponds to std::vector in C++
4373 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
4375 * The elements in the array.
4376 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4378 struct LDKC2Tuple_usizeTransactionZ *data;
4380 * The number of elements pointed to by `data`.
4383 } LDKCVec_C2Tuple_usizeTransactionZZ;
4386 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
4387 * This corresponds to std::vector in C++
4389 typedef struct LDKCVec_TxidZ {
4391 * The elements in the array.
4392 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4394 struct LDKThirtyTwoBytes *data;
4396 * The number of elements pointed to by `data`.
4402 * The contents of CResult_NoneChannelMonitorUpdateErrZ
4404 typedef union LDKCResult_NoneChannelMonitorUpdateErrZPtr {
4406 * Note that this value is always NULL, as there are no contents in the OK variant
4410 * A pointer to the contents in the error state.
4411 * Reading from this pointer when `result_ok` is set is undefined.
4413 enum LDKChannelMonitorUpdateErr *err;
4414 } LDKCResult_NoneChannelMonitorUpdateErrZPtr;
4417 * A CResult_NoneChannelMonitorUpdateErrZ represents the result of a fallible operation,
4418 * containing a () on success and a crate::lightning::chain::ChannelMonitorUpdateErr on failure.
4419 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4421 typedef struct LDKCResult_NoneChannelMonitorUpdateErrZ {
4423 * The contents of this CResult_NoneChannelMonitorUpdateErrZ, accessible via either
4424 * `err` or `result` depending on the state of `result_ok`.
4426 union LDKCResult_NoneChannelMonitorUpdateErrZPtr contents;
4428 * Whether this CResult_NoneChannelMonitorUpdateErrZ represents a success state.
4431 } LDKCResult_NoneChannelMonitorUpdateErrZ;
4436 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
4437 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
4438 * preimage claim backward will lead to loss of funds.
4440 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
4442 * A pointer to the opaque Rust object.
4443 * Nearly everywhere, inner must be non-null, however in places where
4444 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4446 LDKnativeHTLCUpdate *inner;
4448 * Indicates that this is the only struct which contains the same pointer.
4449 * Rust functions which take ownership of an object provided via an argument require
4450 * this to be true and invalidate the object pointed to by inner.
4456 * An event to be processed by the ChannelManager.
4458 typedef enum LDKMonitorEvent_Tag {
4460 * A monitor event containing an HTLCUpdate.
4462 LDKMonitorEvent_HTLCEvent,
4464 * A monitor event that the Channel's commitment transaction was confirmed.
4466 LDKMonitorEvent_CommitmentTxConfirmed,
4468 * Indicates a [`ChannelMonitor`] update has completed. See
4469 * [`ChannelMonitorUpdateErr::TemporaryFailure`] for more information on how this is used.
4471 * [`ChannelMonitorUpdateErr::TemporaryFailure`]: super::ChannelMonitorUpdateErr::TemporaryFailure
4473 LDKMonitorEvent_UpdateCompleted,
4475 * Indicates a [`ChannelMonitor`] update has failed. See
4476 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used.
4478 * [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure
4480 LDKMonitorEvent_UpdateFailed,
4482 * Must be last for serialization purposes
4484 LDKMonitorEvent_Sentinel,
4485 } LDKMonitorEvent_Tag;
4487 typedef struct LDKMonitorEvent_LDKUpdateCompleted_Body {
4489 * The funding outpoint of the [`ChannelMonitor`] that was updated
4491 struct LDKOutPoint funding_txo;
4493 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
4494 * [`ChannelMonitor::get_latest_update_id`].
4496 * Note that this should only be set to a given update's ID if all previous updates for the
4497 * same [`ChannelMonitor`] have been applied and persisted.
4499 uint64_t monitor_update_id;
4500 } LDKMonitorEvent_LDKUpdateCompleted_Body;
4502 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
4503 LDKMonitorEvent_Tag tag;
4506 struct LDKHTLCUpdate htlc_event;
4509 struct LDKOutPoint commitment_tx_confirmed;
4511 LDKMonitorEvent_LDKUpdateCompleted_Body update_completed;
4513 struct LDKOutPoint update_failed;
4519 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
4520 * This corresponds to std::vector in C++
4522 typedef struct LDKCVec_MonitorEventZ {
4524 * The elements in the array.
4525 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4527 struct LDKMonitorEvent *data;
4529 * The number of elements pointed to by `data`.
4532 } LDKCVec_MonitorEventZ;
4535 * A tuple of 3 elements. See the individual fields for the types contained.
4537 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
4539 * The element at position 0
4541 struct LDKOutPoint a;
4543 * The element at position 1
4545 struct LDKCVec_MonitorEventZ b;
4547 * The element at position 2
4549 struct LDKPublicKey c;
4550 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
4553 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
4554 * This corresponds to std::vector in C++
4556 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
4558 * The elements in the array.
4559 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4561 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
4563 * The number of elements pointed to by `data`.
4566 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
4569 * An enum which can either contain a crate::c_types::derived::C2Tuple_usizeTransactionZ or not
4571 typedef enum LDKCOption_C2Tuple_usizeTransactionZZ_Tag {
4573 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains a crate::c_types::derived::C2Tuple_usizeTransactionZ
4575 LDKCOption_C2Tuple_usizeTransactionZZ_Some,
4577 * When we're in this state, this COption_C2Tuple_usizeTransactionZZ contains nothing
4579 LDKCOption_C2Tuple_usizeTransactionZZ_None,
4581 * Must be last for serialization purposes
4583 LDKCOption_C2Tuple_usizeTransactionZZ_Sentinel,
4584 } LDKCOption_C2Tuple_usizeTransactionZZ_Tag;
4586 typedef struct LDKCOption_C2Tuple_usizeTransactionZZ {
4587 LDKCOption_C2Tuple_usizeTransactionZZ_Tag tag;
4590 struct LDKC2Tuple_usizeTransactionZ some;
4593 } LDKCOption_C2Tuple_usizeTransactionZZ;
4598 * [`Score`] implementation that uses a fixed penalty.
4600 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4602 * A pointer to the opaque Rust object.
4603 * Nearly everywhere, inner must be non-null, however in places where
4604 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4606 LDKnativeFixedPenaltyScorer *inner;
4608 * Indicates that this is the only struct which contains the same pointer.
4609 * Rust functions which take ownership of an object provided via an argument require
4610 * this to be true and invalidate the object pointed to by inner.
4613 } LDKFixedPenaltyScorer;
4616 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4618 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4620 * A pointer to the contents in the success state.
4621 * Reading from this pointer when `result_ok` is not set is undefined.
4623 struct LDKFixedPenaltyScorer *result;
4625 * A pointer to the contents in the error state.
4626 * Reading from this pointer when `result_ok` is set is undefined.
4628 struct LDKDecodeError *err;
4629 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4632 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4633 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4634 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4636 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4638 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4639 * `err` or `result` depending on the state of `result_ok`.
4641 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4643 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4646 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4649 * A tuple of 2 elements. See the individual fields for the types contained.
4651 typedef struct LDKC2Tuple_u64u64Z {
4653 * The element at position 0
4657 * The element at position 1
4660 } LDKC2Tuple_u64u64Z;
4663 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
4665 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
4667 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
4669 LDKCOption_C2Tuple_u64u64ZZ_Some,
4671 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
4673 LDKCOption_C2Tuple_u64u64ZZ_None,
4675 * Must be last for serialization purposes
4677 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
4678 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
4680 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
4681 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
4684 struct LDKC2Tuple_u64u64Z some;
4687 } LDKCOption_C2Tuple_u64u64ZZ;
4692 * Represents the compressed public key of a node
4694 typedef struct MUST_USE_STRUCT LDKNodeId {
4696 * A pointer to the opaque Rust object.
4697 * Nearly everywhere, inner must be non-null, however in places where
4698 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4700 LDKnativeNodeId *inner;
4702 * Indicates that this is the only struct which contains the same pointer.
4703 * Rust functions which take ownership of an object provided via an argument require
4704 * this to be true and invalidate the object pointed to by inner.
4710 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
4711 * This corresponds to std::vector in C++
4713 typedef struct LDKCVec_NodeIdZ {
4715 * The elements in the array.
4716 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4718 struct LDKNodeId *data;
4720 * The number of elements pointed to by `data`.
4728 * A Record, unit of logging output with Metadata to enable filtering
4729 * Module_path, file, line to inform on log's source
4731 typedef struct MUST_USE_STRUCT LDKRecord {
4733 * A pointer to the opaque Rust object.
4734 * Nearly everywhere, inner must be non-null, however in places where
4735 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4737 LDKnativeRecord *inner;
4739 * Indicates that this is the only struct which contains the same pointer.
4740 * Rust functions which take ownership of an object provided via an argument require
4741 * this to be true and invalidate the object pointed to by inner.
4747 * A trait encapsulating the operations required of a logger
4749 typedef struct LDKLogger {
4751 * An opaque pointer which is passed to your function implementations as an argument.
4752 * This has no meaning in the LDK, and can be NULL or any other value.
4758 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
4760 * Frees any resources associated with this object given its this_arg pointer.
4761 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4763 void (*free)(void *this_arg);
4769 * Represents the network as nodes and channels between them
4771 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4773 * A pointer to the opaque Rust object.
4774 * Nearly everywhere, inner must be non-null, however in places where
4775 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4777 LDKnativeNetworkGraph *inner;
4779 * Indicates that this is the only struct which contains the same pointer.
4780 * Rust functions which take ownership of an object provided via an argument require
4781 * this to be true and invalidate the object pointed to by inner.
4789 * [`Score`] implementation using channel success probability distributions.
4791 * Based on *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4792 * and Stefan Richter [[1]]. Given the uncertainty of channel liquidity balances, probability
4793 * distributions are defined based on knowledge learned from successful and unsuccessful attempts.
4794 * Then the negative `log10` of the success probability is used to determine the cost of routing a
4795 * specific HTLC amount through a channel.
4797 * Knowledge about channel liquidity balances takes the form of upper and lower bounds on the
4798 * possible liquidity. Certainty of the bounds is decreased over time using a decay function. See
4799 * [`ProbabilisticScoringParameters`] for details.
4801 * Since the scorer aims to learn the current channel liquidity balances, it works best for nodes
4802 * with high payment volume or that actively probe the [`NetworkGraph`]. Nodes with low payment
4803 * volume are more likely to experience failed payment paths, which would need to be retried.
4807 * Mixing the `no-std` feature between serialization and deserialization results in undefined
4810 * [1]: https://arxiv.org/abs/2107.05322
4812 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4814 * A pointer to the opaque Rust object.
4815 * Nearly everywhere, inner must be non-null, however in places where
4816 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4818 LDKnativeProbabilisticScorer *inner;
4820 * Indicates that this is the only struct which contains the same pointer.
4821 * Rust functions which take ownership of an object provided via an argument require
4822 * this to be true and invalidate the object pointed to by inner.
4825 } LDKProbabilisticScorer;
4828 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4830 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4832 * A pointer to the contents in the success state.
4833 * Reading from this pointer when `result_ok` is not set is undefined.
4835 struct LDKProbabilisticScorer *result;
4837 * A pointer to the contents in the error state.
4838 * Reading from this pointer when `result_ok` is set is undefined.
4840 struct LDKDecodeError *err;
4841 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4844 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4845 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4846 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4848 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4850 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4851 * `err` or `result` depending on the state of `result_ok`.
4853 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4855 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4858 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4863 * Features used within an `init` message.
4865 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4867 * A pointer to the opaque Rust object.
4868 * Nearly everywhere, inner must be non-null, however in places where
4869 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4871 LDKnativeInitFeatures *inner;
4873 * Indicates that this is the only struct which contains the same pointer.
4874 * Rust functions which take ownership of an object provided via an argument require
4875 * this to be true and invalidate the object pointed to by inner.
4881 * The contents of CResult_InitFeaturesDecodeErrorZ
4883 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4885 * A pointer to the contents in the success state.
4886 * Reading from this pointer when `result_ok` is not set is undefined.
4888 struct LDKInitFeatures *result;
4890 * A pointer to the contents in the error state.
4891 * Reading from this pointer when `result_ok` is set is undefined.
4893 struct LDKDecodeError *err;
4894 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4897 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4898 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4899 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4901 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4903 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4904 * `err` or `result` depending on the state of `result_ok`.
4906 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4908 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4911 } LDKCResult_InitFeaturesDecodeErrorZ;
4916 * Features used within a `channel_announcement` message.
4918 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4920 * A pointer to the opaque Rust object.
4921 * Nearly everywhere, inner must be non-null, however in places where
4922 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4924 LDKnativeChannelFeatures *inner;
4926 * Indicates that this is the only struct which contains the same pointer.
4927 * Rust functions which take ownership of an object provided via an argument require
4928 * this to be true and invalidate the object pointed to by inner.
4931 } LDKChannelFeatures;
4934 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4936 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4938 * A pointer to the contents in the success state.
4939 * Reading from this pointer when `result_ok` is not set is undefined.
4941 struct LDKChannelFeatures *result;
4943 * A pointer to the contents in the error state.
4944 * Reading from this pointer when `result_ok` is set is undefined.
4946 struct LDKDecodeError *err;
4947 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4950 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4951 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4952 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4954 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4956 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4957 * `err` or `result` depending on the state of `result_ok`.
4959 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4961 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4964 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4969 * Features used within a `node_announcement` message.
4971 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4973 * A pointer to the opaque Rust object.
4974 * Nearly everywhere, inner must be non-null, however in places where
4975 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4977 LDKnativeNodeFeatures *inner;
4979 * Indicates that this is the only struct which contains the same pointer.
4980 * Rust functions which take ownership of an object provided via an argument require
4981 * this to be true and invalidate the object pointed to by inner.
4987 * The contents of CResult_NodeFeaturesDecodeErrorZ
4989 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4991 * A pointer to the contents in the success state.
4992 * Reading from this pointer when `result_ok` is not set is undefined.
4994 struct LDKNodeFeatures *result;
4996 * A pointer to the contents in the error state.
4997 * Reading from this pointer when `result_ok` is set is undefined.
4999 struct LDKDecodeError *err;
5000 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5003 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5004 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5005 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5007 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5009 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5010 * `err` or `result` depending on the state of `result_ok`.
5012 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5014 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5017 } LDKCResult_NodeFeaturesDecodeErrorZ;
5022 * Features used within an invoice.
5024 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
5026 * A pointer to the opaque Rust object.
5027 * Nearly everywhere, inner must be non-null, however in places where
5028 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5030 LDKnativeInvoiceFeatures *inner;
5032 * Indicates that this is the only struct which contains the same pointer.
5033 * Rust functions which take ownership of an object provided via an argument require
5034 * this to be true and invalidate the object pointed to by inner.
5037 } LDKInvoiceFeatures;
5040 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
5042 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
5044 * A pointer to the contents in the success state.
5045 * Reading from this pointer when `result_ok` is not set is undefined.
5047 struct LDKInvoiceFeatures *result;
5049 * A pointer to the contents in the error state.
5050 * Reading from this pointer when `result_ok` is set is undefined.
5052 struct LDKDecodeError *err;
5053 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
5056 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5057 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5058 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5060 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
5062 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
5063 * `err` or `result` depending on the state of `result_ok`.
5065 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
5067 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
5070 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
5073 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
5075 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
5077 * A pointer to the contents in the success state.
5078 * Reading from this pointer when `result_ok` is not set is undefined.
5080 struct LDKChannelTypeFeatures *result;
5082 * A pointer to the contents in the error state.
5083 * Reading from this pointer when `result_ok` is set is undefined.
5085 struct LDKDecodeError *err;
5086 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
5089 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
5090 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5091 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5093 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
5095 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
5096 * `err` or `result` depending on the state of `result_ok`.
5098 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
5100 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
5103 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
5106 * The contents of CResult_NodeIdDecodeErrorZ
5108 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
5110 * A pointer to the contents in the success state.
5111 * Reading from this pointer when `result_ok` is not set is undefined.
5113 struct LDKNodeId *result;
5115 * A pointer to the contents in the error state.
5116 * Reading from this pointer when `result_ok` is set is undefined.
5118 struct LDKDecodeError *err;
5119 } LDKCResult_NodeIdDecodeErrorZPtr;
5122 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
5123 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
5124 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5126 typedef struct LDKCResult_NodeIdDecodeErrorZ {
5128 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
5129 * `err` or `result` depending on the state of `result_ok`.
5131 union LDKCResult_NodeIdDecodeErrorZPtr contents;
5133 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
5136 } LDKCResult_NodeIdDecodeErrorZ;
5139 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
5141 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
5143 * A pointer to the contents in the success state.
5144 * Reading from this pointer when `result_ok` is not set is undefined.
5146 struct LDKCOption_NetworkUpdateZ *result;
5148 * A pointer to the contents in the error state.
5149 * Reading from this pointer when `result_ok` is set is undefined.
5151 struct LDKDecodeError *err;
5152 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
5155 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
5156 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5157 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5159 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
5161 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
5162 * `err` or `result` depending on the state of `result_ok`.
5164 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
5166 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
5169 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
5172 * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
5175 typedef struct LDKAccess {
5177 * An opaque pointer which is passed to your function implementations as an argument.
5178 * This has no meaning in the LDK, and can be NULL or any other value.
5182 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
5183 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
5186 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
5188 struct LDKCResult_TxOutAccessErrorZ (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
5190 * Frees any resources associated with this object given its this_arg pointer.
5191 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5193 void (*free)(void *this_arg);
5197 * An enum which can either contain a crate::lightning::chain::Access or not
5199 typedef enum LDKCOption_AccessZ_Tag {
5201 * When we're in this state, this COption_AccessZ contains a crate::lightning::chain::Access
5203 LDKCOption_AccessZ_Some,
5205 * When we're in this state, this COption_AccessZ contains nothing
5207 LDKCOption_AccessZ_None,
5209 * Must be last for serialization purposes
5211 LDKCOption_AccessZ_Sentinel,
5212 } LDKCOption_AccessZ_Tag;
5214 typedef struct LDKCOption_AccessZ {
5215 LDKCOption_AccessZ_Tag tag;
5218 struct LDKAccess some;
5221 } LDKCOption_AccessZ;
5224 * The contents of CResult_boolLightningErrorZ
5226 typedef union LDKCResult_boolLightningErrorZPtr {
5228 * A pointer to the contents in the success state.
5229 * Reading from this pointer when `result_ok` is not set is undefined.
5233 * A pointer to the contents in the error state.
5234 * Reading from this pointer when `result_ok` is set is undefined.
5236 struct LDKLightningError *err;
5237 } LDKCResult_boolLightningErrorZPtr;
5240 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5241 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5242 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5244 typedef struct LDKCResult_boolLightningErrorZ {
5246 * The contents of this CResult_boolLightningErrorZ, accessible via either
5247 * `err` or `result` depending on the state of `result_ok`.
5249 union LDKCResult_boolLightningErrorZPtr contents;
5251 * Whether this CResult_boolLightningErrorZ represents a success state.
5254 } LDKCResult_boolLightningErrorZ;
5257 * A tuple of 3 elements. See the individual fields for the types contained.
5259 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5261 * The element at position 0
5263 struct LDKChannelAnnouncement a;
5265 * The element at position 1
5267 struct LDKChannelUpdate b;
5269 * The element at position 2
5271 struct LDKChannelUpdate c;
5272 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5275 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZs of arbitrary size.
5276 * This corresponds to std::vector in C++
5278 typedef struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5280 * The elements in the array.
5281 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5283 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *data;
5285 * The number of elements pointed to by `data`.
5288 } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5291 * A dynamically-allocated array of crate::lightning::ln::msgs::NodeAnnouncements of arbitrary size.
5292 * This corresponds to std::vector in C++
5294 typedef struct LDKCVec_NodeAnnouncementZ {
5296 * The elements in the array.
5297 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5299 struct LDKNodeAnnouncement *data;
5301 * The number of elements pointed to by `data`.
5304 } LDKCVec_NodeAnnouncementZ;
5307 * The contents of CResult_NoneLightningErrorZ
5309 typedef union LDKCResult_NoneLightningErrorZPtr {
5311 * Note that this value is always NULL, as there are no contents in the OK variant
5315 * A pointer to the contents in the error state.
5316 * Reading from this pointer when `result_ok` is set is undefined.
5318 struct LDKLightningError *err;
5319 } LDKCResult_NoneLightningErrorZPtr;
5322 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5323 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5324 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5326 typedef struct LDKCResult_NoneLightningErrorZ {
5328 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5329 * `err` or `result` depending on the state of `result_ok`.
5331 union LDKCResult_NoneLightningErrorZPtr contents;
5333 * Whether this CResult_NoneLightningErrorZ represents a success state.
5336 } LDKCResult_NoneLightningErrorZ;
5341 * Details about one direction of a channel as received within a [`ChannelUpdate`].
5343 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
5345 * A pointer to the opaque Rust object.
5346 * Nearly everywhere, inner must be non-null, however in places where
5347 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5349 LDKnativeChannelUpdateInfo *inner;
5351 * Indicates that this is the only struct which contains the same pointer.
5352 * Rust functions which take ownership of an object provided via an argument require
5353 * this to be true and invalidate the object pointed to by inner.
5356 } LDKChannelUpdateInfo;
5359 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
5361 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
5363 * A pointer to the contents in the success state.
5364 * Reading from this pointer when `result_ok` is not set is undefined.
5366 struct LDKChannelUpdateInfo *result;
5368 * A pointer to the contents in the error state.
5369 * Reading from this pointer when `result_ok` is set is undefined.
5371 struct LDKDecodeError *err;
5372 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
5375 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
5376 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5377 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5379 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
5381 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
5382 * `err` or `result` depending on the state of `result_ok`.
5384 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
5386 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
5389 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
5394 * Details about a channel (both directions).
5395 * Received within a channel announcement.
5397 typedef struct MUST_USE_STRUCT LDKChannelInfo {
5399 * A pointer to the opaque Rust object.
5400 * Nearly everywhere, inner must be non-null, however in places where
5401 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5403 LDKnativeChannelInfo *inner;
5405 * Indicates that this is the only struct which contains the same pointer.
5406 * Rust functions which take ownership of an object provided via an argument require
5407 * this to be true and invalidate the object pointed to by inner.
5413 * The contents of CResult_ChannelInfoDecodeErrorZ
5415 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
5417 * A pointer to the contents in the success state.
5418 * Reading from this pointer when `result_ok` is not set is undefined.
5420 struct LDKChannelInfo *result;
5422 * A pointer to the contents in the error state.
5423 * Reading from this pointer when `result_ok` is set is undefined.
5425 struct LDKDecodeError *err;
5426 } LDKCResult_ChannelInfoDecodeErrorZPtr;
5429 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
5430 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5431 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5433 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
5435 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
5436 * `err` or `result` depending on the state of `result_ok`.
5438 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
5440 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
5443 } LDKCResult_ChannelInfoDecodeErrorZ;
5448 * Fees for routing via a given channel or a node
5450 typedef struct MUST_USE_STRUCT LDKRoutingFees {
5452 * A pointer to the opaque Rust object.
5453 * Nearly everywhere, inner must be non-null, however in places where
5454 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5456 LDKnativeRoutingFees *inner;
5458 * Indicates that this is the only struct which contains the same pointer.
5459 * Rust functions which take ownership of an object provided via an argument require
5460 * this to be true and invalidate the object pointed to by inner.
5466 * The contents of CResult_RoutingFeesDecodeErrorZ
5468 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
5470 * A pointer to the contents in the success state.
5471 * Reading from this pointer when `result_ok` is not set is undefined.
5473 struct LDKRoutingFees *result;
5475 * A pointer to the contents in the error state.
5476 * Reading from this pointer when `result_ok` is set is undefined.
5478 struct LDKDecodeError *err;
5479 } LDKCResult_RoutingFeesDecodeErrorZPtr;
5482 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
5483 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
5484 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5486 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
5488 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
5489 * `err` or `result` depending on the state of `result_ok`.
5491 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
5493 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
5496 } LDKCResult_RoutingFeesDecodeErrorZ;
5499 * A 4-byte byte array.
5501 typedef struct LDKFourBytes {
5509 * A 16-byte byte array.
5511 typedef struct LDKSixteenBytes {
5519 * A 12-byte byte array.
5521 typedef struct LDKTwelveBytes {
5531 * Represents a hostname for serialization purposes.
5532 * Only the character set and length will be validated.
5533 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
5534 * Its length is guaranteed to be representable by a single byte.
5535 * This serialization is used by BOLT 7 hostnames.
5537 typedef struct MUST_USE_STRUCT LDKHostname {
5539 * A pointer to the opaque Rust object.
5540 * Nearly everywhere, inner must be non-null, however in places where
5541 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5543 LDKnativeHostname *inner;
5545 * Indicates that this is the only struct which contains the same pointer.
5546 * Rust functions which take ownership of an object provided via an argument require
5547 * this to be true and invalidate the object pointed to by inner.
5553 * An address which can be used to connect to a remote peer
5555 typedef enum LDKNetAddress_Tag {
5557 * An IPv4 address/port on which the peer is listening.
5561 * An IPv6 address/port on which the peer is listening.
5565 * An old-style Tor onion address/port on which the peer is listening.
5567 * This field is deprecated and the Tor network generally no longer supports V2 Onion
5568 * addresses. Thus, the details are not parsed here.
5570 LDKNetAddress_OnionV2,
5572 * A new-style Tor onion address/port on which the peer is listening.
5573 * To create the human-readable \"hostname\", concatenate ed25519_pubkey, checksum, and version,
5574 * wrap as base32 and append \".onion\".
5576 LDKNetAddress_OnionV3,
5578 * A hostname/port on which the peer is listening.
5580 LDKNetAddress_Hostname,
5582 * Must be last for serialization purposes
5584 LDKNetAddress_Sentinel,
5585 } LDKNetAddress_Tag;
5587 typedef struct LDKNetAddress_LDKIPv4_Body {
5589 * The 4-byte IPv4 address
5591 struct LDKFourBytes addr;
5593 * The port on which the node is listening
5596 } LDKNetAddress_LDKIPv4_Body;
5598 typedef struct LDKNetAddress_LDKIPv6_Body {
5600 * The 16-byte IPv6 address
5602 struct LDKSixteenBytes addr;
5604 * The port on which the node is listening
5607 } LDKNetAddress_LDKIPv6_Body;
5609 typedef struct LDKNetAddress_LDKOnionV3_Body {
5611 * The ed25519 long-term public key of the peer
5613 struct LDKThirtyTwoBytes ed25519_pubkey;
5615 * The checksum of the pubkey and version, as included in the onion address
5619 * The version byte, as defined by the Tor Onion v3 spec.
5623 * The port on which the node is listening
5626 } LDKNetAddress_LDKOnionV3_Body;
5628 typedef struct LDKNetAddress_LDKHostname_Body {
5630 * The hostname on which the node is listening.
5632 struct LDKHostname hostname;
5634 * The port on which the node is listening.
5637 } LDKNetAddress_LDKHostname_Body;
5639 typedef struct MUST_USE_STRUCT LDKNetAddress {
5640 LDKNetAddress_Tag tag;
5642 LDKNetAddress_LDKIPv4_Body i_pv4;
5643 LDKNetAddress_LDKIPv6_Body i_pv6;
5645 struct LDKTwelveBytes onion_v2;
5647 LDKNetAddress_LDKOnionV3_Body onion_v3;
5648 LDKNetAddress_LDKHostname_Body hostname;
5653 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
5654 * This corresponds to std::vector in C++
5656 typedef struct LDKCVec_NetAddressZ {
5658 * The elements in the array.
5659 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5661 struct LDKNetAddress *data;
5663 * The number of elements pointed to by `data`.
5666 } LDKCVec_NetAddressZ;
5671 * Information received in the latest node_announcement from this node.
5673 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
5675 * A pointer to the opaque Rust object.
5676 * Nearly everywhere, inner must be non-null, however in places where
5677 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5679 LDKnativeNodeAnnouncementInfo *inner;
5681 * Indicates that this is the only struct which contains the same pointer.
5682 * Rust functions which take ownership of an object provided via an argument require
5683 * this to be true and invalidate the object pointed to by inner.
5686 } LDKNodeAnnouncementInfo;
5689 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
5691 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
5693 * A pointer to the contents in the success state.
5694 * Reading from this pointer when `result_ok` is not set is undefined.
5696 struct LDKNodeAnnouncementInfo *result;
5698 * A pointer to the contents in the error state.
5699 * Reading from this pointer when `result_ok` is set is undefined.
5701 struct LDKDecodeError *err;
5702 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
5705 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
5706 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5707 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5709 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
5711 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
5712 * `err` or `result` depending on the state of `result_ok`.
5714 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
5716 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
5719 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
5724 * A user-defined name for a node, which may be used when displaying the node in a graph.
5726 * Since node aliases are provided by third parties, they are a potential avenue for injection
5727 * attacks. Care must be taken when processing.
5729 typedef struct MUST_USE_STRUCT LDKNodeAlias {
5731 * A pointer to the opaque Rust object.
5732 * Nearly everywhere, inner must be non-null, however in places where
5733 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5735 LDKnativeNodeAlias *inner;
5737 * Indicates that this is the only struct which contains the same pointer.
5738 * Rust functions which take ownership of an object provided via an argument require
5739 * this to be true and invalidate the object pointed to by inner.
5745 * The contents of CResult_NodeAliasDecodeErrorZ
5747 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
5749 * A pointer to the contents in the success state.
5750 * Reading from this pointer when `result_ok` is not set is undefined.
5752 struct LDKNodeAlias *result;
5754 * A pointer to the contents in the error state.
5755 * Reading from this pointer when `result_ok` is set is undefined.
5757 struct LDKDecodeError *err;
5758 } LDKCResult_NodeAliasDecodeErrorZPtr;
5761 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
5762 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
5763 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5765 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
5767 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
5768 * `err` or `result` depending on the state of `result_ok`.
5770 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
5772 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
5775 } LDKCResult_NodeAliasDecodeErrorZ;
5780 * Details about a node in the network, known from the network announcement.
5782 typedef struct MUST_USE_STRUCT LDKNodeInfo {
5784 * A pointer to the opaque Rust object.
5785 * Nearly everywhere, inner must be non-null, however in places where
5786 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5788 LDKnativeNodeInfo *inner;
5790 * Indicates that this is the only struct which contains the same pointer.
5791 * Rust functions which take ownership of an object provided via an argument require
5792 * this to be true and invalidate the object pointed to by inner.
5798 * The contents of CResult_NodeInfoDecodeErrorZ
5800 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
5802 * A pointer to the contents in the success state.
5803 * Reading from this pointer when `result_ok` is not set is undefined.
5805 struct LDKNodeInfo *result;
5807 * A pointer to the contents in the error state.
5808 * Reading from this pointer when `result_ok` is set is undefined.
5810 struct LDKDecodeError *err;
5811 } LDKCResult_NodeInfoDecodeErrorZPtr;
5814 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
5815 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
5816 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5818 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
5820 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
5821 * `err` or `result` depending on the state of `result_ok`.
5823 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
5825 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
5828 } LDKCResult_NodeInfoDecodeErrorZ;
5831 * The contents of CResult_NetworkGraphDecodeErrorZ
5833 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
5835 * A pointer to the contents in the success state.
5836 * Reading from this pointer when `result_ok` is not set is undefined.
5838 struct LDKNetworkGraph *result;
5840 * A pointer to the contents in the error state.
5841 * Reading from this pointer when `result_ok` is set is undefined.
5843 struct LDKDecodeError *err;
5844 } LDKCResult_NetworkGraphDecodeErrorZPtr;
5847 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
5848 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
5849 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5851 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
5853 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
5854 * `err` or `result` depending on the state of `result_ok`.
5856 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
5858 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
5861 } LDKCResult_NetworkGraphDecodeErrorZ;
5864 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
5866 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
5868 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
5870 LDKCOption_CVec_NetAddressZZ_Some,
5872 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
5874 LDKCOption_CVec_NetAddressZZ_None,
5876 * Must be last for serialization purposes
5878 LDKCOption_CVec_NetAddressZZ_Sentinel,
5879 } LDKCOption_CVec_NetAddressZZ_Tag;
5881 typedef struct LDKCOption_CVec_NetAddressZZ {
5882 LDKCOption_CVec_NetAddressZZ_Tag tag;
5885 struct LDKCVec_NetAddressZ some;
5888 } LDKCOption_CVec_NetAddressZZ;
5891 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
5893 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
5895 * A pointer to the contents in the success state.
5896 * Reading from this pointer when `result_ok` is not set is undefined.
5898 struct LDKDelayedPaymentOutputDescriptor *result;
5900 * A pointer to the contents in the error state.
5901 * Reading from this pointer when `result_ok` is set is undefined.
5903 struct LDKDecodeError *err;
5904 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
5907 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5908 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5909 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5911 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
5913 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
5914 * `err` or `result` depending on the state of `result_ok`.
5916 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
5918 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
5921 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
5924 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
5926 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
5928 * A pointer to the contents in the success state.
5929 * Reading from this pointer when `result_ok` is not set is undefined.
5931 struct LDKStaticPaymentOutputDescriptor *result;
5933 * A pointer to the contents in the error state.
5934 * Reading from this pointer when `result_ok` is set is undefined.
5936 struct LDKDecodeError *err;
5937 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
5940 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5941 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5942 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5944 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
5946 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
5947 * `err` or `result` depending on the state of `result_ok`.
5949 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
5951 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
5954 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
5957 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
5959 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
5961 * A pointer to the contents in the success state.
5962 * Reading from this pointer when `result_ok` is not set is undefined.
5964 struct LDKSpendableOutputDescriptor *result;
5966 * A pointer to the contents in the error state.
5967 * Reading from this pointer when `result_ok` is set is undefined.
5969 struct LDKDecodeError *err;
5970 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
5973 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
5974 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
5975 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5977 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
5979 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
5980 * `err` or `result` depending on the state of `result_ok`.
5982 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
5984 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
5987 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
5990 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
5991 * This corresponds to std::vector in C++
5993 typedef struct LDKCVec_PaymentPreimageZ {
5995 * The elements in the array.
5996 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5998 struct LDKThirtyTwoBytes *data;
6000 * The number of elements pointed to by `data`.
6003 } LDKCVec_PaymentPreimageZ;
6006 * A tuple of 2 elements. See the individual fields for the types contained.
6008 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
6010 * The element at position 0
6012 struct LDKSignature a;
6014 * The element at position 1
6016 struct LDKCVec_SignatureZ b;
6017 } LDKC2Tuple_SignatureCVec_SignatureZZ;
6020 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
6022 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
6024 * A pointer to the contents in the success state.
6025 * Reading from this pointer when `result_ok` is not set is undefined.
6027 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
6029 * Note that this value is always NULL, as there are no contents in the Err variant
6032 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
6035 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
6036 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
6037 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6039 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
6041 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
6042 * `err` or `result` depending on the state of `result_ok`.
6044 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
6046 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
6049 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
6052 * The contents of CResult_SignatureNoneZ
6054 typedef union LDKCResult_SignatureNoneZPtr {
6056 * A pointer to the contents in the success state.
6057 * Reading from this pointer when `result_ok` is not set is undefined.
6059 struct LDKSignature *result;
6061 * Note that this value is always NULL, as there are no contents in the Err variant
6064 } LDKCResult_SignatureNoneZPtr;
6067 * A CResult_SignatureNoneZ represents the result of a fallible operation,
6068 * containing a crate::c_types::Signature on success and a () on failure.
6069 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6071 typedef struct LDKCResult_SignatureNoneZ {
6073 * The contents of this CResult_SignatureNoneZ, accessible via either
6074 * `err` or `result` depending on the state of `result_ok`.
6076 union LDKCResult_SignatureNoneZPtr contents;
6078 * Whether this CResult_SignatureNoneZ represents a success state.
6081 } LDKCResult_SignatureNoneZ;
6084 * A tuple of 2 elements. See the individual fields for the types contained.
6086 typedef struct LDKC2Tuple_SignatureSignatureZ {
6088 * The element at position 0
6090 struct LDKSignature a;
6092 * The element at position 1
6094 struct LDKSignature b;
6095 } LDKC2Tuple_SignatureSignatureZ;
6098 * The contents of CResult_C2Tuple_SignatureSignatureZNoneZ
6100 typedef union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr {
6102 * A pointer to the contents in the success state.
6103 * Reading from this pointer when `result_ok` is not set is undefined.
6105 struct LDKC2Tuple_SignatureSignatureZ *result;
6107 * Note that this value is always NULL, as there are no contents in the Err variant
6110 } LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr;
6113 * A CResult_C2Tuple_SignatureSignatureZNoneZ represents the result of a fallible operation,
6114 * containing a crate::c_types::derived::C2Tuple_SignatureSignatureZ on success and a () on failure.
6115 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6117 typedef struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ {
6119 * The contents of this CResult_C2Tuple_SignatureSignatureZNoneZ, accessible via either
6120 * `err` or `result` depending on the state of `result_ok`.
6122 union LDKCResult_C2Tuple_SignatureSignatureZNoneZPtr contents;
6124 * Whether this CResult_C2Tuple_SignatureSignatureZNoneZ represents a success state.
6127 } LDKCResult_C2Tuple_SignatureSignatureZNoneZ;
6130 * The contents of CResult_SecretKeyNoneZ
6132 typedef union LDKCResult_SecretKeyNoneZPtr {
6134 * A pointer to the contents in the success state.
6135 * Reading from this pointer when `result_ok` is not set is undefined.
6137 struct LDKSecretKey *result;
6139 * Note that this value is always NULL, as there are no contents in the Err variant
6142 } LDKCResult_SecretKeyNoneZPtr;
6145 * A CResult_SecretKeyNoneZ represents the result of a fallible operation,
6146 * containing a crate::c_types::SecretKey on success and a () on failure.
6147 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6149 typedef struct LDKCResult_SecretKeyNoneZ {
6151 * The contents of this CResult_SecretKeyNoneZ, accessible via either
6152 * `err` or `result` depending on the state of `result_ok`.
6154 union LDKCResult_SecretKeyNoneZPtr contents;
6156 * Whether this CResult_SecretKeyNoneZ represents a success state.
6159 } LDKCResult_SecretKeyNoneZ;
6164 * This class tracks the per-transaction information needed to build a closing transaction and will
6165 * actually build it and sign.
6167 * This class can be used inside a signer implementation to generate a signature given the relevant
6170 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
6172 * A pointer to the opaque Rust object.
6173 * Nearly everywhere, inner must be non-null, however in places where
6174 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6176 LDKnativeClosingTransaction *inner;
6178 * Indicates that this is the only struct which contains the same pointer.
6179 * Rust functions which take ownership of an object provided via an argument require
6180 * this to be true and invalidate the object pointed to by inner.
6183 } LDKClosingTransaction;
6188 * The unsigned part of a channel_announcement
6190 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
6192 * A pointer to the opaque Rust object.
6193 * Nearly everywhere, inner must be non-null, however in places where
6194 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6196 LDKnativeUnsignedChannelAnnouncement *inner;
6198 * Indicates that this is the only struct which contains the same pointer.
6199 * Rust functions which take ownership of an object provided via an argument require
6200 * this to be true and invalidate the object pointed to by inner.
6203 } LDKUnsignedChannelAnnouncement;
6206 * A trait to sign lightning channel transactions as described in BOLT 3.
6208 * Signing services could be implemented on a hardware wallet. In this case,
6209 * the current Sign would be a front-end on top of a communication
6210 * channel connected to your secure device and lightning key material wouldn't
6211 * reside on a hot server. Nevertheless, a this deployment would still need
6212 * to trust the ChannelManager to avoid loss of funds as this latest component
6213 * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys.
6215 * A more secure iteration would be to use hashlock (or payment points) to pair
6216 * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager
6217 * at the price of more state and computation on the hardware wallet side. In the future,
6218 * we are looking forward to design such interface.
6220 * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted
6221 * to act, as liveness and breach reply correctness are always going to be hard requirements
6222 * of LN security model, orthogonal of key management issues.
6224 typedef struct LDKBaseSign {
6226 * An opaque pointer which is passed to your function implementations as an argument.
6227 * This has no meaning in the LDK, and can be NULL or any other value.
6231 * Gets the per-commitment point for a specific commitment number
6233 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
6235 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
6237 * Gets the commitment secret for a specific commitment number as part of the revocation process
6239 * An external signer implementation should error here if the commitment was already signed
6240 * and should refuse to sign it in the future.
6242 * May be called more than once for the same index.
6244 * Note that the commitment number starts at (1 << 48) - 1 and counts backwards.
6246 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
6248 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
6250 * This is required in order for the signer to make sure that releasing a commitment
6251 * secret won't leave us without a broadcastable holder transaction.
6252 * Policy checks should be implemented in this function, including checking the amount
6253 * sent to us and checking the HTLCs.
6255 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
6256 * A validating signer should ensure that an HTLC output is removed only when the matching
6257 * preimage is provided, or when the value to holder is restored.
6259 * NOTE: all the relevant preimages will be provided, but there may also be additional
6260 * irrelevant or duplicate preimages.
6262 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages);
6264 * Gets the holder's channel public keys and basepoints
6266 struct LDKChannelPublicKeys pubkeys;
6268 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
6269 * Note that this takes a pointer to this object, not the this_ptr like other methods do
6270 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
6272 void (*set_pubkeys)(const struct LDKBaseSign*NONNULL_PTR );
6274 * Gets an arbitrary identifier describing the set of keys which are provided back to you in
6275 * some SpendableOutputDescriptor types. This should be sufficient to identify this
6276 * Sign object uniquely and lookup or re-derive its keys.
6278 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
6280 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
6282 * Note that if signing fails or is rejected, the channel will be force-closed.
6284 * Policy checks should be implemented in this function, including checking the amount
6285 * sent to us and checking the HTLCs.
6287 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
6288 * A validating signer should ensure that an HTLC output is removed only when the matching
6289 * preimage is provided, or when the value to holder is restored.
6291 * NOTE: all the relevant preimages will be provided, but there may also be additional
6292 * irrelevant or duplicate preimages.
6294 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages);
6296 * Validate the counterparty's revocation.
6298 * This is required in order for the signer to make sure that the state has moved
6299 * forward and it is safe to sign the next counterparty commitment.
6301 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
6303 * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions.
6304 * This will only ever be called with a non-revoked commitment_tx. This will be called with the
6305 * latest commitment_tx when we initiate a force-close.
6306 * This will be called with the previous latest, just to get claiming HTLC signatures, if we are
6307 * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to
6309 * This may be called multiple times for the same transaction.
6311 * An external signer implementation should check that the commitment has not been revoked.
6313 * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case.
6315 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
6317 * Create a signature for the given input in a transaction spending an HTLC transaction output
6318 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
6320 * A justice transaction may claim multiple outputs at the same time if timelocks are
6321 * similar, but only a signature for the input at index `input` should be signed for here.
6322 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
6323 * to an upcoming timelock expiration.
6325 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6327 * per_commitment_key is revocation secret which was provided by our counterparty when they
6328 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
6329 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
6332 struct LDKCResult_SignatureNoneZ (*sign_justice_revoked_output)(const void *this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32]);
6334 * Create a signature for the given input in a transaction spending a commitment transaction
6335 * HTLC output when our counterparty broadcasts an old state.
6337 * A justice transaction may claim multiple outputs at the same time if timelocks are
6338 * similar, but only a signature for the input at index `input` should be signed for here.
6339 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
6340 * to an upcoming timelock expiration.
6342 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6344 * per_commitment_key is revocation secret which was provided by our counterparty when they
6345 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
6346 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
6349 * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script
6350 * (which is committed to in the BIP 143 signatures).
6352 struct LDKCResult_SignatureNoneZ (*sign_justice_revoked_htlc)(const void *this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc);
6354 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
6355 * transaction, either offered or received.
6357 * Such a transaction may claim multiples offered outputs at same time if we know the
6358 * preimage for each when we create it, but only the input at index `input` should be
6359 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
6360 * needed with regards to an upcoming timelock expiration.
6362 * Witness_script is either a offered or received script as defined in BOLT3 for HTLC
6365 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
6367 * Per_commitment_point is the dynamic point corresponding to the channel state
6368 * detected onchain. It has been generated by our counterparty and is used to derive
6369 * channel state keys, which are then included in the witness script and committed to in the
6370 * BIP 143 signature.
6372 struct LDKCResult_SignatureNoneZ (*sign_counterparty_htlc_transaction)(const void *this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc);
6374 * Create a signature for a (proposed) closing transaction.
6376 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
6377 * chosen to forgo their output as dust.
6379 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
6381 * Signs a channel announcement message with our funding key and our node secret key (aka
6382 * node_id or network_key), proving it comes from one of the channel participants.
6384 * The first returned signature should be from our node secret key, the second from our
6387 * Note that if this fails or is rejected, the channel will not be publicly announced and
6388 * our counterparty may (though likely will not) close the channel on us for violating the
6391 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ (*sign_channel_announcement)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
6393 * Set the counterparty static channel data, including basepoints,
6394 * counterparty_selected/holder_selected_contest_delay and funding outpoint.
6395 * This is done as soon as the funding outpoint is known. Since these are static channel data,
6396 * they MUST NOT be allowed to change to different values once set.
6398 * channel_parameters.is_populated() MUST be true.
6400 * We bind holder_selected_contest_delay late here for API convenience.
6402 * Will be called before any signatures are applied.
6404 void (*ready_channel)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
6406 * Frees any resources associated with this object given its this_arg pointer.
6407 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6409 void (*free)(void *this_arg);
6413 * A cloneable signer.
6415 * Although we require signers to be cloneable, it may be useful for developers to be able to use
6416 * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait,
6417 * which implies Sized, into this derived trait.
6419 typedef struct LDKSign {
6421 * An opaque pointer which is passed to your function implementations as an argument.
6422 * This has no meaning in the LDK, and can be NULL or any other value.
6426 * Implementation of BaseSign for this object.
6428 struct LDKBaseSign BaseSign;
6430 * Serialize the object into a byte array
6432 struct LDKCVec_u8Z (*write)(const void *this_arg);
6434 * Called, if set, after this Sign has been cloned into a duplicate object.
6435 * The new Sign is provided, and should be mutated as needed to perform a
6436 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
6438 void (*cloned)(struct LDKSign *NONNULL_PTR new_Sign);
6440 * Frees any resources associated with this object given its this_arg pointer.
6441 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6443 void (*free)(void *this_arg);
6447 * The contents of CResult_SignDecodeErrorZ
6449 typedef union LDKCResult_SignDecodeErrorZPtr {
6451 * A pointer to the contents in the success state.
6452 * Reading from this pointer when `result_ok` is not set is undefined.
6454 struct LDKSign *result;
6456 * A pointer to the contents in the error state.
6457 * Reading from this pointer when `result_ok` is set is undefined.
6459 struct LDKDecodeError *err;
6460 } LDKCResult_SignDecodeErrorZPtr;
6463 * A CResult_SignDecodeErrorZ represents the result of a fallible operation,
6464 * containing a crate::lightning::chain::keysinterface::Sign on success and a crate::lightning::ln::msgs::DecodeError on failure.
6465 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6467 typedef struct LDKCResult_SignDecodeErrorZ {
6469 * The contents of this CResult_SignDecodeErrorZ, accessible via either
6470 * `err` or `result` depending on the state of `result_ok`.
6472 union LDKCResult_SignDecodeErrorZPtr contents;
6474 * Whether this CResult_SignDecodeErrorZ represents a success state.
6477 } LDKCResult_SignDecodeErrorZ;
6480 * Integer in the range `0..32`
6482 typedef struct LDKu5 {
6487 * A dynamically-allocated array of crate::c_types::u5s of arbitrary size.
6488 * This corresponds to std::vector in C++
6490 typedef struct LDKCVec_u5Z {
6492 * The elements in the array.
6493 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6497 * The number of elements pointed to by `data`.
6503 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
6504 * allows recovering the exact public key which created the signature given the message.
6506 typedef struct LDKRecoverableSignature {
6508 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
6511 uint8_t serialized_form[68];
6512 } LDKRecoverableSignature;
6515 * The contents of CResult_RecoverableSignatureNoneZ
6517 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
6519 * A pointer to the contents in the success state.
6520 * Reading from this pointer when `result_ok` is not set is undefined.
6522 struct LDKRecoverableSignature *result;
6524 * Note that this value is always NULL, as there are no contents in the Err variant
6527 } LDKCResult_RecoverableSignatureNoneZPtr;
6530 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
6531 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
6532 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6534 typedef struct LDKCResult_RecoverableSignatureNoneZ {
6536 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
6537 * `err` or `result` depending on the state of `result_ok`.
6539 union LDKCResult_RecoverableSignatureNoneZPtr contents;
6541 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
6544 } LDKCResult_RecoverableSignatureNoneZ;
6547 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
6548 * This corresponds to std::vector in C++
6550 typedef struct LDKCVec_CVec_u8ZZ {
6552 * The elements in the array.
6553 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6555 struct LDKCVec_u8Z *data;
6557 * The number of elements pointed to by `data`.
6560 } LDKCVec_CVec_u8ZZ;
6563 * The contents of CResult_CVec_CVec_u8ZZNoneZ
6565 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
6567 * A pointer to the contents in the success state.
6568 * Reading from this pointer when `result_ok` is not set is undefined.
6570 struct LDKCVec_CVec_u8ZZ *result;
6572 * Note that this value is always NULL, as there are no contents in the Err variant
6575 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
6578 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
6579 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
6580 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6582 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
6584 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
6585 * `err` or `result` depending on the state of `result_ok`.
6587 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
6589 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
6592 } LDKCResult_CVec_CVec_u8ZZNoneZ;
6597 * A simple implementation of Sign that just keeps the private keys in memory.
6599 * This implementation performs no policy checks and is insufficient by itself as
6600 * a secure external signer.
6602 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
6604 * A pointer to the opaque Rust object.
6605 * Nearly everywhere, inner must be non-null, however in places where
6606 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6608 LDKnativeInMemorySigner *inner;
6610 * Indicates that this is the only struct which contains the same pointer.
6611 * Rust functions which take ownership of an object provided via an argument require
6612 * this to be true and invalidate the object pointed to by inner.
6615 } LDKInMemorySigner;
6618 * The contents of CResult_InMemorySignerDecodeErrorZ
6620 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
6622 * A pointer to the contents in the success state.
6623 * Reading from this pointer when `result_ok` is not set is undefined.
6625 struct LDKInMemorySigner *result;
6627 * A pointer to the contents in the error state.
6628 * Reading from this pointer when `result_ok` is set is undefined.
6630 struct LDKDecodeError *err;
6631 } LDKCResult_InMemorySignerDecodeErrorZPtr;
6634 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
6635 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
6636 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6638 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
6640 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
6641 * `err` or `result` depending on the state of `result_ok`.
6643 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
6645 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
6648 } LDKCResult_InMemorySignerDecodeErrorZ;
6651 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
6652 * This corresponds to std::vector in C++
6654 typedef struct LDKCVec_TxOutZ {
6656 * The elements in the array.
6657 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6659 struct LDKTxOut *data;
6661 * The number of elements pointed to by `data`.
6667 * The contents of CResult_TransactionNoneZ
6669 typedef union LDKCResult_TransactionNoneZPtr {
6671 * A pointer to the contents in the success state.
6672 * Reading from this pointer when `result_ok` is not set is undefined.
6674 struct LDKTransaction *result;
6676 * Note that this value is always NULL, as there are no contents in the Err variant
6679 } LDKCResult_TransactionNoneZPtr;
6682 * A CResult_TransactionNoneZ represents the result of a fallible operation,
6683 * containing a crate::c_types::Transaction on success and a () on failure.
6684 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6686 typedef struct LDKCResult_TransactionNoneZ {
6688 * The contents of this CResult_TransactionNoneZ, accessible via either
6689 * `err` or `result` depending on the state of `result_ok`.
6691 union LDKCResult_TransactionNoneZPtr contents;
6693 * Whether this CResult_TransactionNoneZ represents a success state.
6696 } LDKCResult_TransactionNoneZ;
6701 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
6702 * on-chain transactions to ensure no loss of funds occurs.
6704 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
6705 * information and are actively monitoring the chain.
6707 * Pending Events or updated HTLCs which have not yet been read out by
6708 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
6709 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
6710 * gotten are fully handled before re-serializing the new state.
6712 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
6713 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
6714 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
6715 * returned block hash and the the current chain and then reconnecting blocks to get to the
6716 * best chain) upon deserializing the object!
6718 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
6720 * A pointer to the opaque Rust object.
6721 * Nearly everywhere, inner must be non-null, however in places where
6722 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6724 LDKnativeChannelMonitor *inner;
6726 * Indicates that this is the only struct which contains the same pointer.
6727 * Rust functions which take ownership of an object provided via an argument require
6728 * this to be true and invalidate the object pointed to by inner.
6731 } LDKChannelMonitor;
6734 * A tuple of 2 elements. See the individual fields for the types contained.
6736 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
6738 * The element at position 0
6740 struct LDKThirtyTwoBytes a;
6742 * The element at position 1
6744 struct LDKChannelMonitor b;
6745 } LDKC2Tuple_BlockHashChannelMonitorZ;
6748 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
6749 * This corresponds to std::vector in C++
6751 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
6753 * The elements in the array.
6754 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6756 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
6758 * The number of elements pointed to by `data`.
6761 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
6764 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
6766 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
6768 * A pointer to the contents in the success state.
6769 * Reading from this pointer when `result_ok` is not set is undefined.
6771 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
6773 * A pointer to the contents in the error state.
6774 * Reading from this pointer when `result_ok` is set is undefined.
6776 enum LDKIOError *err;
6777 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
6780 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
6781 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
6782 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6784 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
6786 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
6787 * `err` or `result` depending on the state of `result_ok`.
6789 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
6791 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
6794 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
6797 * An enum which can either contain a u16 or not
6799 typedef enum LDKCOption_u16Z_Tag {
6801 * When we're in this state, this COption_u16Z contains a u16
6803 LDKCOption_u16Z_Some,
6805 * When we're in this state, this COption_u16Z contains nothing
6807 LDKCOption_u16Z_None,
6809 * Must be last for serialization purposes
6811 LDKCOption_u16Z_Sentinel,
6812 } LDKCOption_u16Z_Tag;
6814 typedef struct LDKCOption_u16Z {
6815 LDKCOption_u16Z_Tag tag;
6824 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
6827 typedef enum LDKAPIError_Tag {
6829 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
6830 * are documented, but generally indicates some precondition of a function was violated.
6832 LDKAPIError_APIMisuseError,
6834 * Due to a high feerate, we were unable to complete the request.
6835 * For example, this may be returned if the feerate implies we cannot open a channel at the
6836 * requested value, but opening a larger channel would succeed.
6838 LDKAPIError_FeeRateTooHigh,
6840 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
6841 * too-many-hops, etc).
6843 LDKAPIError_RouteError,
6845 * We were unable to complete the request as the Channel required to do so is unable to
6846 * complete the request (or was not found). This can take many forms, including disconnected
6847 * peer, channel at capacity, channel shutting down, etc.
6849 LDKAPIError_ChannelUnavailable,
6851 * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
6852 * attempted action to fail.
6854 LDKAPIError_MonitorUpdateFailed,
6856 * [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
6857 * with the channel counterparty as negotiated in [`InitFeatures`].
6859 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
6860 * a channel or cooperatively close one with this peer (and will have to force-close instead).
6862 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
6863 * [`InitFeatures`]: crate::ln::features::InitFeatures
6865 LDKAPIError_IncompatibleShutdownScript,
6867 * Must be last for serialization purposes
6869 LDKAPIError_Sentinel,
6872 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
6874 * A human-readable error message
6877 } LDKAPIError_LDKAPIMisuseError_Body;
6879 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
6881 * A human-readable error message
6885 * The feerate which was too high.
6888 } LDKAPIError_LDKFeeRateTooHigh_Body;
6890 typedef struct LDKAPIError_LDKRouteError_Body {
6892 * A human-readable error message
6895 } LDKAPIError_LDKRouteError_Body;
6897 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
6899 * A human-readable error message
6902 } LDKAPIError_LDKChannelUnavailable_Body;
6904 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
6906 * The incompatible shutdown script.
6908 struct LDKShutdownScript script;
6909 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
6911 typedef struct MUST_USE_STRUCT LDKAPIError {
6912 LDKAPIError_Tag tag;
6914 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
6915 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
6916 LDKAPIError_LDKRouteError_Body route_error;
6917 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
6918 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
6923 * The contents of CResult_NoneAPIErrorZ
6925 typedef union LDKCResult_NoneAPIErrorZPtr {
6927 * Note that this value is always NULL, as there are no contents in the OK variant
6931 * A pointer to the contents in the error state.
6932 * Reading from this pointer when `result_ok` is set is undefined.
6934 struct LDKAPIError *err;
6935 } LDKCResult_NoneAPIErrorZPtr;
6938 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
6939 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
6940 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6942 typedef struct LDKCResult_NoneAPIErrorZ {
6944 * The contents of this CResult_NoneAPIErrorZ, accessible via either
6945 * `err` or `result` depending on the state of `result_ok`.
6947 union LDKCResult_NoneAPIErrorZPtr contents;
6949 * Whether this CResult_NoneAPIErrorZ represents a success state.
6952 } LDKCResult_NoneAPIErrorZ;
6955 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
6956 * This corresponds to std::vector in C++
6958 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
6960 * The elements in the array.
6961 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6963 struct LDKCResult_NoneAPIErrorZ *data;
6965 * The number of elements pointed to by `data`.
6968 } LDKCVec_CResult_NoneAPIErrorZZ;
6971 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
6972 * This corresponds to std::vector in C++
6974 typedef struct LDKCVec_APIErrorZ {
6976 * The elements in the array.
6977 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6979 struct LDKAPIError *data;
6981 * The number of elements pointed to by `data`.
6984 } LDKCVec_APIErrorZ;
6987 * The contents of CResult__u832APIErrorZ
6989 typedef union LDKCResult__u832APIErrorZPtr {
6991 * A pointer to the contents in the success state.
6992 * Reading from this pointer when `result_ok` is not set is undefined.
6994 struct LDKThirtyTwoBytes *result;
6996 * A pointer to the contents in the error state.
6997 * Reading from this pointer when `result_ok` is set is undefined.
6999 struct LDKAPIError *err;
7000 } LDKCResult__u832APIErrorZPtr;
7003 * A CResult__u832APIErrorZ represents the result of a fallible operation,
7004 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7005 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7007 typedef struct LDKCResult__u832APIErrorZ {
7009 * The contents of this CResult__u832APIErrorZ, accessible via either
7010 * `err` or `result` depending on the state of `result_ok`.
7012 union LDKCResult__u832APIErrorZPtr contents;
7014 * Whether this CResult__u832APIErrorZ represents a success state.
7017 } LDKCResult__u832APIErrorZ;
7020 * If a payment fails to send, it can be in one of several states. This enum is returned as the
7021 * Err() type describing which state the payment is in, see the description of individual enum
7024 typedef enum LDKPaymentSendFailure_Tag {
7026 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
7027 * send the payment at all. No channel state has been changed or messages sent to peers, and
7028 * once you've changed the parameter at error, you can freely retry the payment in full.
7030 LDKPaymentSendFailure_ParameterError,
7032 * A parameter in a single path which was passed to send_payment was invalid, preventing us
7033 * from attempting to send the payment at all. No channel state has been changed or messages
7034 * sent to peers, and once you've changed the parameter at error, you can freely retry the
7037 * The results here are ordered the same as the paths in the route object which was passed to
7040 LDKPaymentSendFailure_PathParameterError,
7042 * All paths which were attempted failed to send, with no channel state change taking place.
7043 * You can freely retry the payment in full (though you probably want to do so over different
7044 * paths than the ones selected).
7046 LDKPaymentSendFailure_AllFailedRetrySafe,
7048 * Some paths which were attempted failed to send, though possibly not all. At least some
7049 * paths have irrevocably committed to the HTLC and retrying the payment in full would result
7050 * in over-/re-payment.
7052 * The results here are ordered the same as the paths in the route object which was passed to
7053 * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
7054 * retried (though there is currently no API with which to do so).
7056 * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
7057 * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
7058 * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
7059 * with the latest update_id.
7061 LDKPaymentSendFailure_PartialFailure,
7063 * Must be last for serialization purposes
7065 LDKPaymentSendFailure_Sentinel,
7066 } LDKPaymentSendFailure_Tag;
7068 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
7070 * The errors themselves, in the same order as the route hops.
7072 struct LDKCVec_CResult_NoneAPIErrorZZ results;
7074 * If some paths failed without irrevocably committing to the new HTLC(s), this will
7075 * contain a [`RouteParameters`] object which can be used to calculate a new route that
7076 * will pay all remaining unpaid balance.
7078 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
7080 struct LDKRouteParameters failed_paths_retry;
7082 * The payment id for the payment, which is now at least partially pending.
7084 struct LDKThirtyTwoBytes payment_id;
7085 } LDKPaymentSendFailure_LDKPartialFailure_Body;
7087 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
7088 LDKPaymentSendFailure_Tag tag;
7091 struct LDKAPIError parameter_error;
7094 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
7097 struct LDKCVec_APIErrorZ all_failed_retry_safe;
7099 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
7101 } LDKPaymentSendFailure;
7104 * The contents of CResult_PaymentIdPaymentSendFailureZ
7106 typedef union LDKCResult_PaymentIdPaymentSendFailureZPtr {
7108 * A pointer to the contents in the success state.
7109 * Reading from this pointer when `result_ok` is not set is undefined.
7111 struct LDKThirtyTwoBytes *result;
7113 * A pointer to the contents in the error state.
7114 * Reading from this pointer when `result_ok` is set is undefined.
7116 struct LDKPaymentSendFailure *err;
7117 } LDKCResult_PaymentIdPaymentSendFailureZPtr;
7120 * A CResult_PaymentIdPaymentSendFailureZ represents the result of a fallible operation,
7121 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7122 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7124 typedef struct LDKCResult_PaymentIdPaymentSendFailureZ {
7126 * The contents of this CResult_PaymentIdPaymentSendFailureZ, accessible via either
7127 * `err` or `result` depending on the state of `result_ok`.
7129 union LDKCResult_PaymentIdPaymentSendFailureZPtr contents;
7131 * Whether this CResult_PaymentIdPaymentSendFailureZ represents a success state.
7134 } LDKCResult_PaymentIdPaymentSendFailureZ;
7137 * The contents of CResult_NonePaymentSendFailureZ
7139 typedef union LDKCResult_NonePaymentSendFailureZPtr {
7141 * Note that this value is always NULL, as there are no contents in the OK variant
7145 * A pointer to the contents in the error state.
7146 * Reading from this pointer when `result_ok` is set is undefined.
7148 struct LDKPaymentSendFailure *err;
7149 } LDKCResult_NonePaymentSendFailureZPtr;
7152 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
7153 * containing a () on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7154 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7156 typedef struct LDKCResult_NonePaymentSendFailureZ {
7158 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
7159 * `err` or `result` depending on the state of `result_ok`.
7161 union LDKCResult_NonePaymentSendFailureZPtr contents;
7163 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
7166 } LDKCResult_NonePaymentSendFailureZ;
7169 * A tuple of 2 elements. See the individual fields for the types contained.
7171 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
7173 * The element at position 0
7175 struct LDKThirtyTwoBytes a;
7177 * The element at position 1
7179 struct LDKThirtyTwoBytes b;
7180 } LDKC2Tuple_PaymentHashPaymentIdZ;
7183 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
7185 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
7187 * A pointer to the contents in the success state.
7188 * Reading from this pointer when `result_ok` is not set is undefined.
7190 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
7192 * A pointer to the contents in the error state.
7193 * Reading from this pointer when `result_ok` is set is undefined.
7195 struct LDKPaymentSendFailure *err;
7196 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
7199 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
7200 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::channelmanager::PaymentSendFailure on failure.
7201 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7203 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
7205 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
7206 * `err` or `result` depending on the state of `result_ok`.
7208 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
7210 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
7213 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
7216 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
7217 * This corresponds to std::vector in C++
7219 typedef struct LDKCVec_ThirtyTwoBytesZ {
7221 * The elements in the array.
7222 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7224 struct LDKThirtyTwoBytes *data;
7226 * The number of elements pointed to by `data`.
7229 } LDKCVec_ThirtyTwoBytesZ;
7232 * A tuple of 2 elements. See the individual fields for the types contained.
7234 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
7236 * The element at position 0
7238 struct LDKThirtyTwoBytes a;
7240 * The element at position 1
7242 struct LDKThirtyTwoBytes b;
7243 } LDKC2Tuple_PaymentHashPaymentSecretZ;
7246 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
7248 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
7250 * A pointer to the contents in the success state.
7251 * Reading from this pointer when `result_ok` is not set is undefined.
7253 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
7255 * Note that this value is always NULL, as there are no contents in the Err variant
7258 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
7261 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
7262 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
7263 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7265 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
7267 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
7268 * `err` or `result` depending on the state of `result_ok`.
7270 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
7272 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
7275 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
7278 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
7280 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
7282 * A pointer to the contents in the success state.
7283 * Reading from this pointer when `result_ok` is not set is undefined.
7285 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
7287 * A pointer to the contents in the error state.
7288 * Reading from this pointer when `result_ok` is set is undefined.
7290 struct LDKAPIError *err;
7291 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
7294 * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
7295 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
7296 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7298 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
7300 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
7301 * `err` or `result` depending on the state of `result_ok`.
7303 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
7305 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
7308 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
7311 * The contents of CResult_PaymentSecretNoneZ
7313 typedef union LDKCResult_PaymentSecretNoneZPtr {
7315 * A pointer to the contents in the success state.
7316 * Reading from this pointer when `result_ok` is not set is undefined.
7318 struct LDKThirtyTwoBytes *result;
7320 * Note that this value is always NULL, as there are no contents in the Err variant
7323 } LDKCResult_PaymentSecretNoneZPtr;
7326 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
7327 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
7328 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7330 typedef struct LDKCResult_PaymentSecretNoneZ {
7332 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
7333 * `err` or `result` depending on the state of `result_ok`.
7335 union LDKCResult_PaymentSecretNoneZPtr contents;
7337 * Whether this CResult_PaymentSecretNoneZ represents a success state.
7340 } LDKCResult_PaymentSecretNoneZ;
7343 * The contents of CResult_PaymentSecretAPIErrorZ
7345 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
7347 * A pointer to the contents in the success state.
7348 * Reading from this pointer when `result_ok` is not set is undefined.
7350 struct LDKThirtyTwoBytes *result;
7352 * A pointer to the contents in the error state.
7353 * Reading from this pointer when `result_ok` is set is undefined.
7355 struct LDKAPIError *err;
7356 } LDKCResult_PaymentSecretAPIErrorZPtr;
7359 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
7360 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7361 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7363 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
7365 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
7366 * `err` or `result` depending on the state of `result_ok`.
7368 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
7370 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
7373 } LDKCResult_PaymentSecretAPIErrorZ;
7376 * The contents of CResult_PaymentPreimageAPIErrorZ
7378 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
7380 * A pointer to the contents in the success state.
7381 * Reading from this pointer when `result_ok` is not set is undefined.
7383 struct LDKThirtyTwoBytes *result;
7385 * A pointer to the contents in the error state.
7386 * Reading from this pointer when `result_ok` is set is undefined.
7388 struct LDKAPIError *err;
7389 } LDKCResult_PaymentPreimageAPIErrorZPtr;
7392 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
7393 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7394 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7396 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
7398 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
7399 * `err` or `result` depending on the state of `result_ok`.
7401 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
7403 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
7406 } LDKCResult_PaymentPreimageAPIErrorZ;
7411 * Information needed for constructing an invoice route hint for this channel.
7413 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
7415 * A pointer to the opaque Rust object.
7416 * Nearly everywhere, inner must be non-null, however in places where
7417 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7419 LDKnativeCounterpartyForwardingInfo *inner;
7421 * Indicates that this is the only struct which contains the same pointer.
7422 * Rust functions which take ownership of an object provided via an argument require
7423 * this to be true and invalidate the object pointed to by inner.
7426 } LDKCounterpartyForwardingInfo;
7429 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
7431 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
7433 * A pointer to the contents in the success state.
7434 * Reading from this pointer when `result_ok` is not set is undefined.
7436 struct LDKCounterpartyForwardingInfo *result;
7438 * A pointer to the contents in the error state.
7439 * Reading from this pointer when `result_ok` is set is undefined.
7441 struct LDKDecodeError *err;
7442 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
7445 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
7446 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7447 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7449 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
7451 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
7452 * `err` or `result` depending on the state of `result_ok`.
7454 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
7456 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
7459 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
7464 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
7465 * to better separate parameters.
7467 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
7469 * A pointer to the opaque Rust object.
7470 * Nearly everywhere, inner must be non-null, however in places where
7471 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7473 LDKnativeChannelCounterparty *inner;
7475 * Indicates that this is the only struct which contains the same pointer.
7476 * Rust functions which take ownership of an object provided via an argument require
7477 * this to be true and invalidate the object pointed to by inner.
7480 } LDKChannelCounterparty;
7483 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
7485 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
7487 * A pointer to the contents in the success state.
7488 * Reading from this pointer when `result_ok` is not set is undefined.
7490 struct LDKChannelCounterparty *result;
7492 * A pointer to the contents in the error state.
7493 * Reading from this pointer when `result_ok` is set is undefined.
7495 struct LDKDecodeError *err;
7496 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
7499 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
7500 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
7501 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7503 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
7505 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
7506 * `err` or `result` depending on the state of `result_ok`.
7508 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
7510 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
7513 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
7516 * The contents of CResult_ChannelDetailsDecodeErrorZ
7518 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
7520 * A pointer to the contents in the success state.
7521 * Reading from this pointer when `result_ok` is not set is undefined.
7523 struct LDKChannelDetails *result;
7525 * A pointer to the contents in the error state.
7526 * Reading from this pointer when `result_ok` is set is undefined.
7528 struct LDKDecodeError *err;
7529 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
7532 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
7533 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
7534 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7536 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
7538 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
7539 * `err` or `result` depending on the state of `result_ok`.
7541 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
7543 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
7546 } LDKCResult_ChannelDetailsDecodeErrorZ;
7551 * Route hints used in constructing invoices for [phantom node payents].
7553 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
7555 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
7557 * A pointer to the opaque Rust object.
7558 * Nearly everywhere, inner must be non-null, however in places where
7559 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7561 LDKnativePhantomRouteHints *inner;
7563 * Indicates that this is the only struct which contains the same pointer.
7564 * Rust functions which take ownership of an object provided via an argument require
7565 * this to be true and invalidate the object pointed to by inner.
7568 } LDKPhantomRouteHints;
7571 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
7573 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
7575 * A pointer to the contents in the success state.
7576 * Reading from this pointer when `result_ok` is not set is undefined.
7578 struct LDKPhantomRouteHints *result;
7580 * A pointer to the contents in the error state.
7581 * Reading from this pointer when `result_ok` is set is undefined.
7583 struct LDKDecodeError *err;
7584 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
7587 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
7588 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
7589 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7591 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
7593 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
7594 * `err` or `result` depending on the state of `result_ok`.
7596 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
7598 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
7601 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
7604 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
7605 * This corresponds to std::vector in C++
7607 typedef struct LDKCVec_ChannelMonitorZ {
7609 * The elements in the array.
7610 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7612 struct LDKChannelMonitor *data;
7614 * The number of elements pointed to by `data`.
7617 } LDKCVec_ChannelMonitorZ;
7622 * An update generated by the underlying Channel itself which contains some new information the
7623 * ChannelMonitor should be made aware of.
7625 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
7627 * A pointer to the opaque Rust object.
7628 * Nearly everywhere, inner must be non-null, however in places where
7629 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7631 LDKnativeChannelMonitorUpdate *inner;
7633 * Indicates that this is the only struct which contains the same pointer.
7634 * Rust functions which take ownership of an object provided via an argument require
7635 * this to be true and invalidate the object pointed to by inner.
7638 } LDKChannelMonitorUpdate;
7641 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
7642 * blocks are connected and disconnected.
7644 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
7645 * responsible for maintaining a set of monitors such that they can be updated accordingly as
7646 * channel state changes and HTLCs are resolved. See method documentation for specific
7649 * Implementations **must** ensure that updates are successfully applied and persisted upon method
7650 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
7651 * without taking any further action such as persisting the current state.
7653 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
7654 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
7655 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
7656 * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
7657 * multiple instances.
7659 * [`PermanentFailure`]: ChannelMonitorUpdateErr::PermanentFailure
7661 typedef struct LDKWatch {
7663 * An opaque pointer which is passed to your function implementations as an argument.
7664 * This has no meaning in the LDK, and can be NULL or any other value.
7668 * Watches a channel identified by `funding_txo` using `monitor`.
7670 * Implementations are responsible for watching the chain for the funding transaction along
7671 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
7672 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
7674 * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if
7675 * the given `funding_txo` has previously been registered via `watch_channel`.
7677 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
7678 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
7679 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
7681 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
7683 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
7685 * Implementations must call [`update_monitor`] with the given update. See
7686 * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
7688 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
7690 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update);
7692 * Returns any monitor events since the last call. Subsequent calls must only return new
7695 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
7696 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
7699 * For details on asynchronous [`ChannelMonitor`] updating and returning
7700 * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
7702 struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
7704 * Frees any resources associated with this object given its this_arg pointer.
7705 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7707 void (*free)(void *this_arg);
7711 * An interface to send a transaction to the Bitcoin network.
7713 typedef struct LDKBroadcasterInterface {
7715 * An opaque pointer which is passed to your function implementations as an argument.
7716 * This has no meaning in the LDK, and can be NULL or any other value.
7720 * Sends a transaction out to (hopefully) be mined.
7722 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
7724 * Frees any resources associated with this object given its this_arg pointer.
7725 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7727 void (*free)(void *this_arg);
7728 } LDKBroadcasterInterface;
7731 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
7732 * own the memory pointed to by data.
7734 typedef struct LDKu8slice {
7736 * A pointer to the byte buffer
7738 const uint8_t *data;
7740 * The number of bytes pointed to by `data`.
7746 * A trait to describe an object which can get user secrets and key material.
7748 typedef struct LDKKeysInterface {
7750 * An opaque pointer which is passed to your function implementations as an argument.
7751 * This has no meaning in the LDK, and can be NULL or any other value.
7755 * Get node secret key based on the provided [`Recipient`].
7757 * The node_id/network_key is the public key that corresponds to this secret key.
7759 * This method must return the same value each time it is called with a given `Recipient`
7762 struct LDKCResult_SecretKeyNoneZ (*get_node_secret)(const void *this_arg, enum LDKRecipient recipient);
7764 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
7766 * This method should return a different value each time it is called, to avoid linking
7767 * on-chain funds across channels as controlled to the same user.
7769 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
7771 * Get a script pubkey which we will send funds to when closing a channel.
7773 * This method should return a different value each time it is called, to avoid linking
7774 * on-chain funds across channels as controlled to the same user.
7776 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
7778 * Get a new set of Sign for per-channel secrets. These MUST be unique even if you
7779 * restarted with some stale data!
7781 * This method must return a different value each time it is called.
7783 struct LDKSign (*get_channel_signer)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis);
7785 * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting
7786 * onion packets and for temporary channel IDs. There is no requirement that these be
7787 * persisted anywhere, though they must be unique across restarts.
7789 * This method must return a different value each time it is called.
7791 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
7793 * Reads a `Signer` for this `KeysInterface` from the given input stream.
7794 * This is only called during deserialization of other objects which contain
7795 * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s).
7796 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
7797 * contain no versioning scheme. You may wish to include your own version prefix and ensure
7798 * you've read all of the provided bytes to ensure no corruption occurred.
7800 struct LDKCResult_SignDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
7803 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
7804 * this trait to parse the invoice and make sure they're signing what they expect, rather than
7805 * blindly signing the hash.
7806 * The hrp is ascii bytes, while the invoice data is base32.
7808 * The secret key used to sign the invoice is dependent on the [`Recipient`].
7810 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z invoice_data, enum LDKRecipient receipient);
7812 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
7814 * If the implementor of this trait supports [phantom node payments], then every node that is
7815 * intended to be included in the phantom invoice route hints must return the same value from
7818 * This method must return the same value each time it is called.
7820 * [phantom node payments]: PhantomKeysManager
7822 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
7824 * Frees any resources associated with this object given its this_arg pointer.
7825 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7827 void (*free)(void *this_arg);
7831 * A trait which should be implemented to provide feerate information on a number of time
7834 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
7835 * called from inside the library in response to chain events, P2P events, or timer events).
7837 typedef struct LDKFeeEstimator {
7839 * An opaque pointer which is passed to your function implementations as an argument.
7840 * This has no meaning in the LDK, and can be NULL or any other value.
7844 * Gets estimated satoshis of fee required per 1000 Weight-Units.
7846 * LDK will wrap this method and ensure that the value returned is no smaller than 253
7847 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
7849 * The following unit conversions can be used to convert to sats/KW:
7850 * * satoshis-per-byte * 250
7851 * * satoshis-per-kbyte / 4
7853 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
7855 * Frees any resources associated with this object given its this_arg pointer.
7856 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7858 void (*free)(void *this_arg);
7864 * Manager which keeps track of a number of channels and sends messages to the appropriate
7865 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
7867 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
7868 * to individual Channels.
7870 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
7871 * all peers during write/read (though does not modify this instance, only the instance being
7872 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
7873 * called funding_transaction_generated for outbound channels).
7875 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
7876 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
7877 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
7878 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
7879 * the serialization process). If the deserialized version is out-of-date compared to the
7880 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
7881 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
7883 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
7884 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
7885 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
7886 * block_connected() to step towards your best block) upon deserialization before using the
7889 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
7890 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
7891 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
7892 * offline for a full minute. In order to track this, you must call
7893 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
7895 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
7896 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
7897 * essentially you should default to using a SimpleRefChannelManager, and use a
7898 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
7899 * you're using lightning-net-tokio.
7901 typedef struct MUST_USE_STRUCT LDKChannelManager {
7903 * A pointer to the opaque Rust object.
7904 * Nearly everywhere, inner must be non-null, however in places where
7905 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7907 LDKnativeChannelManager *inner;
7909 * Indicates that this is the only struct which contains the same pointer.
7910 * Rust functions which take ownership of an object provided via an argument require
7911 * this to be true and invalidate the object pointed to by inner.
7914 } LDKChannelManager;
7917 * A tuple of 2 elements. See the individual fields for the types contained.
7919 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
7921 * The element at position 0
7923 struct LDKThirtyTwoBytes a;
7925 * The element at position 1
7927 struct LDKChannelManager b;
7928 } LDKC2Tuple_BlockHashChannelManagerZ;
7931 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
7933 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
7935 * A pointer to the contents in the success state.
7936 * Reading from this pointer when `result_ok` is not set is undefined.
7938 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
7940 * A pointer to the contents in the error state.
7941 * Reading from this pointer when `result_ok` is set is undefined.
7943 struct LDKDecodeError *err;
7944 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
7947 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
7948 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
7949 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7951 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
7953 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
7954 * `err` or `result` depending on the state of `result_ok`.
7956 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
7958 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
7961 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
7966 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
7967 * with our counterparty.
7969 typedef struct MUST_USE_STRUCT LDKChannelConfig {
7971 * A pointer to the opaque Rust object.
7972 * Nearly everywhere, inner must be non-null, however in places where
7973 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7975 LDKnativeChannelConfig *inner;
7977 * Indicates that this is the only struct which contains the same pointer.
7978 * Rust functions which take ownership of an object provided via an argument require
7979 * this to be true and invalidate the object pointed to by inner.
7985 * The contents of CResult_ChannelConfigDecodeErrorZ
7987 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
7989 * A pointer to the contents in the success state.
7990 * Reading from this pointer when `result_ok` is not set is undefined.
7992 struct LDKChannelConfig *result;
7994 * A pointer to the contents in the error state.
7995 * Reading from this pointer when `result_ok` is set is undefined.
7997 struct LDKDecodeError *err;
7998 } LDKCResult_ChannelConfigDecodeErrorZPtr;
8001 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
8002 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
8003 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8005 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
8007 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
8008 * `err` or `result` depending on the state of `result_ok`.
8010 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
8012 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
8015 } LDKCResult_ChannelConfigDecodeErrorZ;
8018 * The contents of CResult_OutPointDecodeErrorZ
8020 typedef union LDKCResult_OutPointDecodeErrorZPtr {
8022 * A pointer to the contents in the success state.
8023 * Reading from this pointer when `result_ok` is not set is undefined.
8025 struct LDKOutPoint *result;
8027 * A pointer to the contents in the error state.
8028 * Reading from this pointer when `result_ok` is set is undefined.
8030 struct LDKDecodeError *err;
8031 } LDKCResult_OutPointDecodeErrorZPtr;
8034 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
8035 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
8036 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8038 typedef struct LDKCResult_OutPointDecodeErrorZ {
8040 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
8041 * `err` or `result` depending on the state of `result_ok`.
8043 union LDKCResult_OutPointDecodeErrorZPtr contents;
8045 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
8048 } LDKCResult_OutPointDecodeErrorZ;
8051 * Defines a type identifier for sending messages over the wire.
8053 * Messages implementing this trait specify a type and must be [`Writeable`].
8055 typedef struct LDKType {
8057 * An opaque pointer which is passed to your function implementations as an argument.
8058 * This has no meaning in the LDK, and can be NULL or any other value.
8062 * Returns the type identifying the message payload.
8064 uint16_t (*type_id)(const void *this_arg);
8066 * Return a human-readable "debug" string describing this object
8068 struct LDKStr (*debug_str)(const void *this_arg);
8070 * Serialize the object into a byte array
8072 struct LDKCVec_u8Z (*write)(const void *this_arg);
8074 * Frees any resources associated with this object given its this_arg pointer.
8075 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8077 void (*free)(void *this_arg);
8081 * An enum which can either contain a crate::lightning::ln::wire::Type or not
8083 typedef enum LDKCOption_TypeZ_Tag {
8085 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
8087 LDKCOption_TypeZ_Some,
8089 * When we're in this state, this COption_TypeZ contains nothing
8091 LDKCOption_TypeZ_None,
8093 * Must be last for serialization purposes
8095 LDKCOption_TypeZ_Sentinel,
8096 } LDKCOption_TypeZ_Tag;
8098 typedef struct LDKCOption_TypeZ {
8099 LDKCOption_TypeZ_Tag tag;
8102 struct LDKType some;
8108 * The contents of CResult_COption_TypeZDecodeErrorZ
8110 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
8112 * A pointer to the contents in the success state.
8113 * Reading from this pointer when `result_ok` is not set is undefined.
8115 struct LDKCOption_TypeZ *result;
8117 * A pointer to the contents in the error state.
8118 * Reading from this pointer when `result_ok` is set is undefined.
8120 struct LDKDecodeError *err;
8121 } LDKCResult_COption_TypeZDecodeErrorZPtr;
8124 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
8125 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8126 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8128 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
8130 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
8131 * `err` or `result` depending on the state of `result_ok`.
8133 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
8135 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
8138 } LDKCResult_COption_TypeZDecodeErrorZ;
8141 * An error that may occur when making a payment.
8143 typedef enum LDKPaymentError_Tag {
8145 * An error resulting from the provided [`Invoice`] or payment hash.
8147 LDKPaymentError_Invoice,
8149 * An error occurring when finding a route.
8151 LDKPaymentError_Routing,
8153 * An error occurring when sending a payment.
8155 LDKPaymentError_Sending,
8157 * Must be last for serialization purposes
8159 LDKPaymentError_Sentinel,
8160 } LDKPaymentError_Tag;
8162 typedef struct MUST_USE_STRUCT LDKPaymentError {
8163 LDKPaymentError_Tag tag;
8166 struct LDKStr invoice;
8169 struct LDKLightningError routing;
8172 struct LDKPaymentSendFailure sending;
8178 * The contents of CResult_PaymentIdPaymentErrorZ
8180 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
8182 * A pointer to the contents in the success state.
8183 * Reading from this pointer when `result_ok` is not set is undefined.
8185 struct LDKThirtyTwoBytes *result;
8187 * A pointer to the contents in the error state.
8188 * Reading from this pointer when `result_ok` is set is undefined.
8190 struct LDKPaymentError *err;
8191 } LDKCResult_PaymentIdPaymentErrorZPtr;
8194 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
8195 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
8196 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8198 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
8200 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
8201 * `err` or `result` depending on the state of `result_ok`.
8203 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
8205 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
8208 } LDKCResult_PaymentIdPaymentErrorZ;
8211 * Sub-errors which don't have specific information in them use this type.
8213 typedef struct LDKError {
8215 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
8221 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
8222 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
8224 typedef enum LDKParseError_Tag {
8225 LDKParseError_Bech32Error,
8226 LDKParseError_ParseAmountError,
8227 LDKParseError_MalformedSignature,
8228 LDKParseError_BadPrefix,
8229 LDKParseError_UnknownCurrency,
8230 LDKParseError_UnknownSiPrefix,
8231 LDKParseError_MalformedHRP,
8232 LDKParseError_TooShortDataPart,
8233 LDKParseError_UnexpectedEndOfTaggedFields,
8234 LDKParseError_DescriptionDecodeError,
8235 LDKParseError_PaddingError,
8236 LDKParseError_IntegerOverflowError,
8237 LDKParseError_InvalidSegWitProgramLength,
8238 LDKParseError_InvalidPubKeyHashLength,
8239 LDKParseError_InvalidScriptHashLength,
8240 LDKParseError_InvalidRecoveryId,
8241 LDKParseError_InvalidSliceLength,
8243 * Not an error, but used internally to signal that a part of the invoice should be ignored
8244 * according to BOLT11
8248 * Must be last for serialization purposes
8250 LDKParseError_Sentinel,
8251 } LDKParseError_Tag;
8253 typedef struct MUST_USE_STRUCT LDKParseError {
8254 LDKParseError_Tag tag;
8257 struct LDKBech32Error bech32_error;
8260 struct LDKError parse_amount_error;
8263 enum LDKSecp256k1Error malformed_signature;
8266 struct LDKError description_decode_error;
8269 struct LDKStr invalid_slice_length;
8275 * The contents of CResult_SiPrefixParseErrorZ
8277 typedef union LDKCResult_SiPrefixParseErrorZPtr {
8279 * A pointer to the contents in the success state.
8280 * Reading from this pointer when `result_ok` is not set is undefined.
8282 enum LDKSiPrefix *result;
8284 * A pointer to the contents in the error state.
8285 * Reading from this pointer when `result_ok` is set is undefined.
8287 struct LDKParseError *err;
8288 } LDKCResult_SiPrefixParseErrorZPtr;
8291 * A CResult_SiPrefixParseErrorZ represents the result of a fallible operation,
8292 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::ParseError on failure.
8293 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8295 typedef struct LDKCResult_SiPrefixParseErrorZ {
8297 * The contents of this CResult_SiPrefixParseErrorZ, accessible via either
8298 * `err` or `result` depending on the state of `result_ok`.
8300 union LDKCResult_SiPrefixParseErrorZPtr contents;
8302 * Whether this CResult_SiPrefixParseErrorZ represents a success state.
8305 } LDKCResult_SiPrefixParseErrorZ;
8310 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
8312 * There are three ways to construct an `Invoice`:
8313 * 1. using `InvoiceBuilder`
8314 * 2. using `Invoice::from_signed(SignedRawInvoice)`
8315 * 3. using `str::parse::<Invoice>(&str)`
8317 typedef struct MUST_USE_STRUCT LDKInvoice {
8319 * A pointer to the opaque Rust object.
8320 * Nearly everywhere, inner must be non-null, however in places where
8321 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8323 LDKnativeInvoice *inner;
8325 * Indicates that this is the only struct which contains the same pointer.
8326 * Rust functions which take ownership of an object provided via an argument require
8327 * this to be true and invalidate the object pointed to by inner.
8333 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
8334 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
8335 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
8337 typedef enum LDKParseOrSemanticError_Tag {
8339 * The invoice couldn't be decoded
8341 LDKParseOrSemanticError_ParseError,
8343 * The invoice could be decoded but violates the BOLT11 standard
8345 LDKParseOrSemanticError_SemanticError,
8347 * Must be last for serialization purposes
8349 LDKParseOrSemanticError_Sentinel,
8350 } LDKParseOrSemanticError_Tag;
8352 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
8353 LDKParseOrSemanticError_Tag tag;
8356 struct LDKParseError parse_error;
8359 enum LDKSemanticError semantic_error;
8362 } LDKParseOrSemanticError;
8365 * The contents of CResult_InvoiceParseOrSemanticErrorZ
8367 typedef union LDKCResult_InvoiceParseOrSemanticErrorZPtr {
8369 * A pointer to the contents in the success state.
8370 * Reading from this pointer when `result_ok` is not set is undefined.
8372 struct LDKInvoice *result;
8374 * A pointer to the contents in the error state.
8375 * Reading from this pointer when `result_ok` is set is undefined.
8377 struct LDKParseOrSemanticError *err;
8378 } LDKCResult_InvoiceParseOrSemanticErrorZPtr;
8381 * A CResult_InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
8382 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
8383 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8385 typedef struct LDKCResult_InvoiceParseOrSemanticErrorZ {
8387 * The contents of this CResult_InvoiceParseOrSemanticErrorZ, accessible via either
8388 * `err` or `result` depending on the state of `result_ok`.
8390 union LDKCResult_InvoiceParseOrSemanticErrorZPtr contents;
8392 * Whether this CResult_InvoiceParseOrSemanticErrorZ represents a success state.
8395 } LDKCResult_InvoiceParseOrSemanticErrorZ;
8400 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
8404 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
8406 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
8408 * A pointer to the opaque Rust object.
8409 * Nearly everywhere, inner must be non-null, however in places where
8410 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8412 LDKnativeSignedRawInvoice *inner;
8414 * Indicates that this is the only struct which contains the same pointer.
8415 * Rust functions which take ownership of an object provided via an argument require
8416 * this to be true and invalidate the object pointed to by inner.
8419 } LDKSignedRawInvoice;
8422 * The contents of CResult_SignedRawInvoiceParseErrorZ
8424 typedef union LDKCResult_SignedRawInvoiceParseErrorZPtr {
8426 * A pointer to the contents in the success state.
8427 * Reading from this pointer when `result_ok` is not set is undefined.
8429 struct LDKSignedRawInvoice *result;
8431 * A pointer to the contents in the error state.
8432 * Reading from this pointer when `result_ok` is set is undefined.
8434 struct LDKParseError *err;
8435 } LDKCResult_SignedRawInvoiceParseErrorZPtr;
8438 * A CResult_SignedRawInvoiceParseErrorZ represents the result of a fallible operation,
8439 * containing a crate::lightning_invoice::SignedRawInvoice on success and a crate::lightning_invoice::ParseError on failure.
8440 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8442 typedef struct LDKCResult_SignedRawInvoiceParseErrorZ {
8444 * The contents of this CResult_SignedRawInvoiceParseErrorZ, accessible via either
8445 * `err` or `result` depending on the state of `result_ok`.
8447 union LDKCResult_SignedRawInvoiceParseErrorZPtr contents;
8449 * Whether this CResult_SignedRawInvoiceParseErrorZ represents a success state.
8452 } LDKCResult_SignedRawInvoiceParseErrorZ;
8457 * Represents an syntactically correct Invoice for a payment on the lightning network,
8458 * but without the signature information.
8459 * De- and encoding should not lead to information loss but may lead to different hashes.
8461 * For methods without docs see the corresponding methods in `Invoice`.
8463 typedef struct MUST_USE_STRUCT LDKRawInvoice {
8465 * A pointer to the opaque Rust object.
8466 * Nearly everywhere, inner must be non-null, however in places where
8467 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8469 LDKnativeRawInvoice *inner;
8471 * Indicates that this is the only struct which contains the same pointer.
8472 * Rust functions which take ownership of an object provided via an argument require
8473 * this to be true and invalidate the object pointed to by inner.
8481 * Recoverable signature
8483 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
8485 * A pointer to the opaque Rust object.
8486 * Nearly everywhere, inner must be non-null, however in places where
8487 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8489 LDKnativeInvoiceSignature *inner;
8491 * Indicates that this is the only struct which contains the same pointer.
8492 * Rust functions which take ownership of an object provided via an argument require
8493 * this to be true and invalidate the object pointed to by inner.
8496 } LDKInvoiceSignature;
8499 * A tuple of 3 elements. See the individual fields for the types contained.
8501 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
8503 * The element at position 0
8505 struct LDKRawInvoice a;
8507 * The element at position 1
8509 struct LDKThirtyTwoBytes b;
8511 * The element at position 2
8513 struct LDKInvoiceSignature c;
8514 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
8521 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
8523 * A pointer to the opaque Rust object.
8524 * Nearly everywhere, inner must be non-null, however in places where
8525 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8527 LDKnativePayeePubKey *inner;
8529 * Indicates that this is the only struct which contains the same pointer.
8530 * Rust functions which take ownership of an object provided via an argument require
8531 * this to be true and invalidate the object pointed to by inner.
8537 * The contents of CResult_PayeePubKeyErrorZ
8539 typedef union LDKCResult_PayeePubKeyErrorZPtr {
8541 * A pointer to the contents in the success state.
8542 * Reading from this pointer when `result_ok` is not set is undefined.
8544 struct LDKPayeePubKey *result;
8546 * A pointer to the contents in the error state.
8547 * Reading from this pointer when `result_ok` is set is undefined.
8549 enum LDKSecp256k1Error *err;
8550 } LDKCResult_PayeePubKeyErrorZPtr;
8553 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
8554 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
8555 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8557 typedef struct LDKCResult_PayeePubKeyErrorZ {
8559 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
8560 * `err` or `result` depending on the state of `result_ok`.
8562 union LDKCResult_PayeePubKeyErrorZPtr contents;
8564 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
8567 } LDKCResult_PayeePubKeyErrorZ;
8572 * Private routing information
8575 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
8578 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
8580 * A pointer to the opaque Rust object.
8581 * Nearly everywhere, inner must be non-null, however in places where
8582 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8584 LDKnativePrivateRoute *inner;
8586 * Indicates that this is the only struct which contains the same pointer.
8587 * Rust functions which take ownership of an object provided via an argument require
8588 * this to be true and invalidate the object pointed to by inner.
8594 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
8595 * This corresponds to std::vector in C++
8597 typedef struct LDKCVec_PrivateRouteZ {
8599 * The elements in the array.
8600 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8602 struct LDKPrivateRoute *data;
8604 * The number of elements pointed to by `data`.
8607 } LDKCVec_PrivateRouteZ;
8612 * A timestamp that refers to a date after 1 January 1970.
8616 * The Unix timestamp representing the stored time has to be positive and no greater than
8617 * [`MAX_TIMESTAMP`].
8619 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
8621 * A pointer to the opaque Rust object.
8622 * Nearly everywhere, inner must be non-null, however in places where
8623 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8625 LDKnativePositiveTimestamp *inner;
8627 * Indicates that this is the only struct which contains the same pointer.
8628 * Rust functions which take ownership of an object provided via an argument require
8629 * this to be true and invalidate the object pointed to by inner.
8632 } LDKPositiveTimestamp;
8635 * The contents of CResult_PositiveTimestampCreationErrorZ
8637 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
8639 * A pointer to the contents in the success state.
8640 * Reading from this pointer when `result_ok` is not set is undefined.
8642 struct LDKPositiveTimestamp *result;
8644 * A pointer to the contents in the error state.
8645 * Reading from this pointer when `result_ok` is set is undefined.
8647 enum LDKCreationError *err;
8648 } LDKCResult_PositiveTimestampCreationErrorZPtr;
8651 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
8652 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
8653 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8655 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
8657 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
8658 * `err` or `result` depending on the state of `result_ok`.
8660 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
8662 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
8665 } LDKCResult_PositiveTimestampCreationErrorZ;
8668 * The contents of CResult_NoneSemanticErrorZ
8670 typedef union LDKCResult_NoneSemanticErrorZPtr {
8672 * Note that this value is always NULL, as there are no contents in the OK variant
8676 * A pointer to the contents in the error state.
8677 * Reading from this pointer when `result_ok` is set is undefined.
8679 enum LDKSemanticError *err;
8680 } LDKCResult_NoneSemanticErrorZPtr;
8683 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
8684 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
8685 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8687 typedef struct LDKCResult_NoneSemanticErrorZ {
8689 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
8690 * `err` or `result` depending on the state of `result_ok`.
8692 union LDKCResult_NoneSemanticErrorZPtr contents;
8694 * Whether this CResult_NoneSemanticErrorZ represents a success state.
8697 } LDKCResult_NoneSemanticErrorZ;
8700 * The contents of CResult_InvoiceSemanticErrorZ
8702 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
8704 * A pointer to the contents in the success state.
8705 * Reading from this pointer when `result_ok` is not set is undefined.
8707 struct LDKInvoice *result;
8709 * A pointer to the contents in the error state.
8710 * Reading from this pointer when `result_ok` is set is undefined.
8712 enum LDKSemanticError *err;
8713 } LDKCResult_InvoiceSemanticErrorZPtr;
8716 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
8717 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
8718 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8720 typedef struct LDKCResult_InvoiceSemanticErrorZ {
8722 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
8723 * `err` or `result` depending on the state of `result_ok`.
8725 union LDKCResult_InvoiceSemanticErrorZPtr contents;
8727 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
8730 } LDKCResult_InvoiceSemanticErrorZ;
8735 * Description string
8738 * The description can be at most 639 __bytes__ long
8740 typedef struct MUST_USE_STRUCT LDKDescription {
8742 * A pointer to the opaque Rust object.
8743 * Nearly everywhere, inner must be non-null, however in places where
8744 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8746 LDKnativeDescription *inner;
8748 * Indicates that this is the only struct which contains the same pointer.
8749 * Rust functions which take ownership of an object provided via an argument require
8750 * this to be true and invalidate the object pointed to by inner.
8756 * The contents of CResult_DescriptionCreationErrorZ
8758 typedef union LDKCResult_DescriptionCreationErrorZPtr {
8760 * A pointer to the contents in the success state.
8761 * Reading from this pointer when `result_ok` is not set is undefined.
8763 struct LDKDescription *result;
8765 * A pointer to the contents in the error state.
8766 * Reading from this pointer when `result_ok` is set is undefined.
8768 enum LDKCreationError *err;
8769 } LDKCResult_DescriptionCreationErrorZPtr;
8772 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
8773 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
8774 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8776 typedef struct LDKCResult_DescriptionCreationErrorZ {
8778 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
8779 * `err` or `result` depending on the state of `result_ok`.
8781 union LDKCResult_DescriptionCreationErrorZPtr contents;
8783 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
8786 } LDKCResult_DescriptionCreationErrorZ;
8789 * The contents of CResult_PrivateRouteCreationErrorZ
8791 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
8793 * A pointer to the contents in the success state.
8794 * Reading from this pointer when `result_ok` is not set is undefined.
8796 struct LDKPrivateRoute *result;
8798 * A pointer to the contents in the error state.
8799 * Reading from this pointer when `result_ok` is set is undefined.
8801 enum LDKCreationError *err;
8802 } LDKCResult_PrivateRouteCreationErrorZPtr;
8805 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
8806 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
8807 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8809 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
8811 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
8812 * `err` or `result` depending on the state of `result_ok`.
8814 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
8816 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
8819 } LDKCResult_PrivateRouteCreationErrorZ;
8822 * The contents of CResult_StringErrorZ
8824 typedef union LDKCResult_StringErrorZPtr {
8826 * A pointer to the contents in the success state.
8827 * Reading from this pointer when `result_ok` is not set is undefined.
8829 struct LDKStr *result;
8831 * A pointer to the contents in the error state.
8832 * Reading from this pointer when `result_ok` is set is undefined.
8834 enum LDKSecp256k1Error *err;
8835 } LDKCResult_StringErrorZPtr;
8838 * A CResult_StringErrorZ represents the result of a fallible operation,
8839 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
8840 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8842 typedef struct LDKCResult_StringErrorZ {
8844 * The contents of this CResult_StringErrorZ, accessible via either
8845 * `err` or `result` depending on the state of `result_ok`.
8847 union LDKCResult_StringErrorZPtr contents;
8849 * Whether this CResult_StringErrorZ represents a success state.
8852 } LDKCResult_StringErrorZ;
8855 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
8857 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
8859 * A pointer to the contents in the success state.
8860 * Reading from this pointer when `result_ok` is not set is undefined.
8862 struct LDKChannelMonitorUpdate *result;
8864 * A pointer to the contents in the error state.
8865 * Reading from this pointer when `result_ok` is set is undefined.
8867 struct LDKDecodeError *err;
8868 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
8871 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
8872 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
8873 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8875 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
8877 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
8878 * `err` or `result` depending on the state of `result_ok`.
8880 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
8882 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
8885 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
8888 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
8890 typedef enum LDKCOption_MonitorEventZ_Tag {
8892 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
8894 LDKCOption_MonitorEventZ_Some,
8896 * When we're in this state, this COption_MonitorEventZ contains nothing
8898 LDKCOption_MonitorEventZ_None,
8900 * Must be last for serialization purposes
8902 LDKCOption_MonitorEventZ_Sentinel,
8903 } LDKCOption_MonitorEventZ_Tag;
8905 typedef struct LDKCOption_MonitorEventZ {
8906 LDKCOption_MonitorEventZ_Tag tag;
8909 struct LDKMonitorEvent some;
8912 } LDKCOption_MonitorEventZ;
8915 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
8917 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
8919 * A pointer to the contents in the success state.
8920 * Reading from this pointer when `result_ok` is not set is undefined.
8922 struct LDKCOption_MonitorEventZ *result;
8924 * A pointer to the contents in the error state.
8925 * Reading from this pointer when `result_ok` is set is undefined.
8927 struct LDKDecodeError *err;
8928 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
8931 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
8932 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
8933 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8935 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
8937 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
8938 * `err` or `result` depending on the state of `result_ok`.
8940 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
8942 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
8945 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
8948 * The contents of CResult_HTLCUpdateDecodeErrorZ
8950 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
8952 * A pointer to the contents in the success state.
8953 * Reading from this pointer when `result_ok` is not set is undefined.
8955 struct LDKHTLCUpdate *result;
8957 * A pointer to the contents in the error state.
8958 * Reading from this pointer when `result_ok` is set is undefined.
8960 struct LDKDecodeError *err;
8961 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
8964 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
8965 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
8966 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8968 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
8970 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
8971 * `err` or `result` depending on the state of `result_ok`.
8973 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
8975 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
8978 } LDKCResult_HTLCUpdateDecodeErrorZ;
8981 * A tuple of 2 elements. See the individual fields for the types contained.
8983 typedef struct LDKC2Tuple_OutPointScriptZ {
8985 * The element at position 0
8987 struct LDKOutPoint a;
8989 * The element at position 1
8991 struct LDKCVec_u8Z b;
8992 } LDKC2Tuple_OutPointScriptZ;
8995 * A tuple of 2 elements. See the individual fields for the types contained.
8997 typedef struct LDKC2Tuple_u32ScriptZ {
8999 * The element at position 0
9003 * The element at position 1
9005 struct LDKCVec_u8Z b;
9006 } LDKC2Tuple_u32ScriptZ;
9009 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
9010 * This corresponds to std::vector in C++
9012 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
9014 * The elements in the array.
9015 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9017 struct LDKC2Tuple_u32ScriptZ *data;
9019 * The number of elements pointed to by `data`.
9022 } LDKCVec_C2Tuple_u32ScriptZZ;
9025 * A tuple of 2 elements. See the individual fields for the types contained.
9027 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
9029 * The element at position 0
9031 struct LDKThirtyTwoBytes a;
9033 * The element at position 1
9035 struct LDKCVec_C2Tuple_u32ScriptZZ b;
9036 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
9039 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
9040 * This corresponds to std::vector in C++
9042 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
9044 * The elements in the array.
9045 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9047 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
9049 * The number of elements pointed to by `data`.
9052 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
9055 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
9056 * This corresponds to std::vector in C++
9058 typedef struct LDKCVec_EventZ {
9060 * The elements in the array.
9061 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9063 struct LDKEvent *data;
9065 * The number of elements pointed to by `data`.
9071 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
9072 * This corresponds to std::vector in C++
9074 typedef struct LDKCVec_TransactionZ {
9076 * The elements in the array.
9077 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9079 struct LDKTransaction *data;
9081 * The number of elements pointed to by `data`.
9084 } LDKCVec_TransactionZ;
9087 * A tuple of 2 elements. See the individual fields for the types contained.
9089 typedef struct LDKC2Tuple_u32TxOutZ {
9091 * The element at position 0
9095 * The element at position 1
9098 } LDKC2Tuple_u32TxOutZ;
9101 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
9102 * This corresponds to std::vector in C++
9104 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
9106 * The elements in the array.
9107 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9109 struct LDKC2Tuple_u32TxOutZ *data;
9111 * The number of elements pointed to by `data`.
9114 } LDKCVec_C2Tuple_u32TxOutZZ;
9117 * A tuple of 2 elements. See the individual fields for the types contained.
9119 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
9121 * The element at position 0
9123 struct LDKThirtyTwoBytes a;
9125 * The element at position 1
9127 struct LDKCVec_C2Tuple_u32TxOutZZ b;
9128 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
9131 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
9132 * This corresponds to std::vector in C++
9134 typedef struct LDKCVec_TransactionOutputsZ {
9136 * The elements in the array.
9137 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9139 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
9141 * The number of elements pointed to by `data`.
9144 } LDKCVec_TransactionOutputsZ;
9147 * Details about the balance(s) available for spending once the channel appears on chain.
9149 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
9152 typedef enum LDKBalance_Tag {
9154 * The channel is not yet closed (or the commitment or closing transaction has not yet
9155 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
9158 LDKBalance_ClaimableOnChannelClose,
9160 * The channel has been closed, and the given balance is ours but awaiting confirmations until
9161 * we consider it spendable.
9163 LDKBalance_ClaimableAwaitingConfirmations,
9165 * The channel has been closed, and the given balance should be ours but awaiting spending
9166 * transaction confirmation. If the spending transaction does not confirm in time, it is
9167 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
9169 * Once the spending transaction confirms, before it has reached enough confirmations to be
9170 * considered safe from chain reorganizations, the balance will instead be provided via
9171 * [`Balance::ClaimableAwaitingConfirmations`].
9173 LDKBalance_ContentiousClaimable,
9175 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
9176 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
9177 * likely to be claimed by our counterparty before we do.
9179 LDKBalance_MaybeClaimableHTLCAwaitingTimeout,
9181 * Must be last for serialization purposes
9183 LDKBalance_Sentinel,
9186 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
9188 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9189 * required to do so.
9191 uint64_t claimable_amount_satoshis;
9192 } LDKBalance_LDKClaimableOnChannelClose_Body;
9194 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
9196 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
9197 * were spent in broadcasting the transaction.
9199 uint64_t claimable_amount_satoshis;
9201 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
9204 uint32_t confirmation_height;
9205 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
9207 typedef struct LDKBalance_LDKContentiousClaimable_Body {
9209 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9210 * required to do so.
9212 uint64_t claimable_amount_satoshis;
9214 * The height at which the counterparty may be able to claim the balance if we have not
9217 uint32_t timeout_height;
9218 } LDKBalance_LDKContentiousClaimable_Body;
9220 typedef struct LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body {
9222 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9223 * required to do so.
9225 uint64_t claimable_amount_satoshis;
9227 * The height at which we will be able to claim the balance if our counterparty has not
9230 uint32_t claimable_height;
9231 } LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body;
9233 typedef struct MUST_USE_STRUCT LDKBalance {
9236 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
9237 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
9238 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
9239 LDKBalance_LDKMaybeClaimableHTLCAwaitingTimeout_Body maybe_claimable_htlc_awaiting_timeout;
9244 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
9245 * This corresponds to std::vector in C++
9247 typedef struct LDKCVec_BalanceZ {
9249 * The elements in the array.
9250 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9252 struct LDKBalance *data;
9254 * The number of elements pointed to by `data`.
9260 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
9262 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
9264 * A pointer to the contents in the success state.
9265 * Reading from this pointer when `result_ok` is not set is undefined.
9267 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
9269 * A pointer to the contents in the error state.
9270 * Reading from this pointer when `result_ok` is set is undefined.
9272 struct LDKDecodeError *err;
9273 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
9276 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
9277 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9278 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9280 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
9282 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
9283 * `err` or `result` depending on the state of `result_ok`.
9285 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
9287 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
9290 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
9293 * A tuple of 2 elements. See the individual fields for the types contained.
9295 typedef struct LDKC2Tuple_PublicKeyTypeZ {
9297 * The element at position 0
9299 struct LDKPublicKey a;
9301 * The element at position 1
9304 } LDKC2Tuple_PublicKeyTypeZ;
9307 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
9308 * This corresponds to std::vector in C++
9310 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
9312 * The elements in the array.
9313 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9315 struct LDKC2Tuple_PublicKeyTypeZ *data;
9317 * The number of elements pointed to by `data`.
9320 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
9323 * An enum which can either contain a crate::lightning::ln::msgs::NetAddress or not
9325 typedef enum LDKCOption_NetAddressZ_Tag {
9327 * When we're in this state, this COption_NetAddressZ contains a crate::lightning::ln::msgs::NetAddress
9329 LDKCOption_NetAddressZ_Some,
9331 * When we're in this state, this COption_NetAddressZ contains nothing
9333 LDKCOption_NetAddressZ_None,
9335 * Must be last for serialization purposes
9337 LDKCOption_NetAddressZ_Sentinel,
9338 } LDKCOption_NetAddressZ_Tag;
9340 typedef struct LDKCOption_NetAddressZ {
9341 LDKCOption_NetAddressZ_Tag tag;
9344 struct LDKNetAddress some;
9347 } LDKCOption_NetAddressZ;
9352 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
9353 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
9356 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
9358 * A pointer to the opaque Rust object.
9359 * Nearly everywhere, inner must be non-null, however in places where
9360 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9362 LDKnativePeerHandleError *inner;
9364 * Indicates that this is the only struct which contains the same pointer.
9365 * Rust functions which take ownership of an object provided via an argument require
9366 * this to be true and invalidate the object pointed to by inner.
9369 } LDKPeerHandleError;
9372 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
9374 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
9376 * A pointer to the contents in the success state.
9377 * Reading from this pointer when `result_ok` is not set is undefined.
9379 struct LDKCVec_u8Z *result;
9381 * A pointer to the contents in the error state.
9382 * Reading from this pointer when `result_ok` is set is undefined.
9384 struct LDKPeerHandleError *err;
9385 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
9388 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
9389 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9390 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9392 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
9394 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
9395 * `err` or `result` depending on the state of `result_ok`.
9397 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
9399 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
9402 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
9405 * The contents of CResult_NonePeerHandleErrorZ
9407 typedef union LDKCResult_NonePeerHandleErrorZPtr {
9409 * Note that this value is always NULL, as there are no contents in the OK variant
9413 * A pointer to the contents in the error state.
9414 * Reading from this pointer when `result_ok` is set is undefined.
9416 struct LDKPeerHandleError *err;
9417 } LDKCResult_NonePeerHandleErrorZPtr;
9420 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
9421 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9422 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9424 typedef struct LDKCResult_NonePeerHandleErrorZ {
9426 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
9427 * `err` or `result` depending on the state of `result_ok`.
9429 union LDKCResult_NonePeerHandleErrorZPtr contents;
9431 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
9434 } LDKCResult_NonePeerHandleErrorZ;
9437 * The contents of CResult_boolPeerHandleErrorZ
9439 typedef union LDKCResult_boolPeerHandleErrorZPtr {
9441 * A pointer to the contents in the success state.
9442 * Reading from this pointer when `result_ok` is not set is undefined.
9446 * A pointer to the contents in the error state.
9447 * Reading from this pointer when `result_ok` is set is undefined.
9449 struct LDKPeerHandleError *err;
9450 } LDKCResult_boolPeerHandleErrorZPtr;
9453 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
9454 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
9455 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9457 typedef struct LDKCResult_boolPeerHandleErrorZ {
9459 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
9460 * `err` or `result` depending on the state of `result_ok`.
9462 union LDKCResult_boolPeerHandleErrorZPtr contents;
9464 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
9467 } LDKCResult_boolPeerHandleErrorZ;
9470 * All-encompassing standard error type that processing can return
9472 typedef enum LDKGraphSyncError_Tag {
9474 * Error trying to read the update data, typically due to an erroneous data length indication
9475 * that is greater than the actual amount of data provided
9477 LDKGraphSyncError_DecodeError,
9479 * Error applying the patch to the network graph, usually the result of updates that are too
9480 * old or missing prerequisite data to the application of updates out of order
9482 LDKGraphSyncError_LightningError,
9484 * Must be last for serialization purposes
9486 LDKGraphSyncError_Sentinel,
9487 } LDKGraphSyncError_Tag;
9489 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
9490 LDKGraphSyncError_Tag tag;
9493 struct LDKDecodeError decode_error;
9496 struct LDKLightningError lightning_error;
9499 } LDKGraphSyncError;
9502 * The contents of CResult_u32GraphSyncErrorZ
9504 typedef union LDKCResult_u32GraphSyncErrorZPtr {
9506 * A pointer to the contents in the success state.
9507 * Reading from this pointer when `result_ok` is not set is undefined.
9511 * A pointer to the contents in the error state.
9512 * Reading from this pointer when `result_ok` is set is undefined.
9514 struct LDKGraphSyncError *err;
9515 } LDKCResult_u32GraphSyncErrorZPtr;
9518 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
9519 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
9520 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9522 typedef struct LDKCResult_u32GraphSyncErrorZ {
9524 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
9525 * `err` or `result` depending on the state of `result_ok`.
9527 union LDKCResult_u32GraphSyncErrorZPtr contents;
9529 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
9532 } LDKCResult_u32GraphSyncErrorZ;
9535 * The contents of CResult_NetAddressDecodeErrorZ
9537 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
9539 * A pointer to the contents in the success state.
9540 * Reading from this pointer when `result_ok` is not set is undefined.
9542 struct LDKNetAddress *result;
9544 * A pointer to the contents in the error state.
9545 * Reading from this pointer when `result_ok` is set is undefined.
9547 struct LDKDecodeError *err;
9548 } LDKCResult_NetAddressDecodeErrorZPtr;
9551 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
9552 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
9553 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9555 typedef struct LDKCResult_NetAddressDecodeErrorZ {
9557 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
9558 * `err` or `result` depending on the state of `result_ok`.
9560 union LDKCResult_NetAddressDecodeErrorZPtr contents;
9562 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
9565 } LDKCResult_NetAddressDecodeErrorZ;
9570 * An update_add_htlc message to be sent or received from a peer
9572 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
9574 * A pointer to the opaque Rust object.
9575 * Nearly everywhere, inner must be non-null, however in places where
9576 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9578 LDKnativeUpdateAddHTLC *inner;
9580 * Indicates that this is the only struct which contains the same pointer.
9581 * Rust functions which take ownership of an object provided via an argument require
9582 * this to be true and invalidate the object pointed to by inner.
9588 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
9589 * This corresponds to std::vector in C++
9591 typedef struct LDKCVec_UpdateAddHTLCZ {
9593 * The elements in the array.
9594 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9596 struct LDKUpdateAddHTLC *data;
9598 * The number of elements pointed to by `data`.
9601 } LDKCVec_UpdateAddHTLCZ;
9606 * An update_fulfill_htlc message to be sent or received from a peer
9608 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
9610 * A pointer to the opaque Rust object.
9611 * Nearly everywhere, inner must be non-null, however in places where
9612 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9614 LDKnativeUpdateFulfillHTLC *inner;
9616 * Indicates that this is the only struct which contains the same pointer.
9617 * Rust functions which take ownership of an object provided via an argument require
9618 * this to be true and invalidate the object pointed to by inner.
9621 } LDKUpdateFulfillHTLC;
9624 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
9625 * This corresponds to std::vector in C++
9627 typedef struct LDKCVec_UpdateFulfillHTLCZ {
9629 * The elements in the array.
9630 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9632 struct LDKUpdateFulfillHTLC *data;
9634 * The number of elements pointed to by `data`.
9637 } LDKCVec_UpdateFulfillHTLCZ;
9642 * An update_fail_htlc message to be sent or received from a peer
9644 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
9646 * A pointer to the opaque Rust object.
9647 * Nearly everywhere, inner must be non-null, however in places where
9648 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9650 LDKnativeUpdateFailHTLC *inner;
9652 * Indicates that this is the only struct which contains the same pointer.
9653 * Rust functions which take ownership of an object provided via an argument require
9654 * this to be true and invalidate the object pointed to by inner.
9657 } LDKUpdateFailHTLC;
9660 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
9661 * This corresponds to std::vector in C++
9663 typedef struct LDKCVec_UpdateFailHTLCZ {
9665 * The elements in the array.
9666 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9668 struct LDKUpdateFailHTLC *data;
9670 * The number of elements pointed to by `data`.
9673 } LDKCVec_UpdateFailHTLCZ;
9678 * An update_fail_malformed_htlc message to be sent or received from a peer
9680 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
9682 * A pointer to the opaque Rust object.
9683 * Nearly everywhere, inner must be non-null, however in places where
9684 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9686 LDKnativeUpdateFailMalformedHTLC *inner;
9688 * Indicates that this is the only struct which contains the same pointer.
9689 * Rust functions which take ownership of an object provided via an argument require
9690 * this to be true and invalidate the object pointed to by inner.
9693 } LDKUpdateFailMalformedHTLC;
9696 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
9697 * This corresponds to std::vector in C++
9699 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
9701 * The elements in the array.
9702 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9704 struct LDKUpdateFailMalformedHTLC *data;
9706 * The number of elements pointed to by `data`.
9709 } LDKCVec_UpdateFailMalformedHTLCZ;
9712 * The contents of CResult_AcceptChannelDecodeErrorZ
9714 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
9716 * A pointer to the contents in the success state.
9717 * Reading from this pointer when `result_ok` is not set is undefined.
9719 struct LDKAcceptChannel *result;
9721 * A pointer to the contents in the error state.
9722 * Reading from this pointer when `result_ok` is set is undefined.
9724 struct LDKDecodeError *err;
9725 } LDKCResult_AcceptChannelDecodeErrorZPtr;
9728 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
9729 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
9730 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9732 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
9734 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
9735 * `err` or `result` depending on the state of `result_ok`.
9737 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
9739 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
9742 } LDKCResult_AcceptChannelDecodeErrorZ;
9745 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
9747 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
9749 * A pointer to the contents in the success state.
9750 * Reading from this pointer when `result_ok` is not set is undefined.
9752 struct LDKAnnouncementSignatures *result;
9754 * A pointer to the contents in the error state.
9755 * Reading from this pointer when `result_ok` is set is undefined.
9757 struct LDKDecodeError *err;
9758 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
9761 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
9762 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
9763 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9765 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
9767 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
9768 * `err` or `result` depending on the state of `result_ok`.
9770 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
9772 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
9775 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
9778 * The contents of CResult_ChannelReestablishDecodeErrorZ
9780 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
9782 * A pointer to the contents in the success state.
9783 * Reading from this pointer when `result_ok` is not set is undefined.
9785 struct LDKChannelReestablish *result;
9787 * A pointer to the contents in the error state.
9788 * Reading from this pointer when `result_ok` is set is undefined.
9790 struct LDKDecodeError *err;
9791 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
9794 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
9795 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
9796 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9798 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
9800 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
9801 * `err` or `result` depending on the state of `result_ok`.
9803 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
9805 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
9808 } LDKCResult_ChannelReestablishDecodeErrorZ;
9811 * The contents of CResult_ClosingSignedDecodeErrorZ
9813 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
9815 * A pointer to the contents in the success state.
9816 * Reading from this pointer when `result_ok` is not set is undefined.
9818 struct LDKClosingSigned *result;
9820 * A pointer to the contents in the error state.
9821 * Reading from this pointer when `result_ok` is set is undefined.
9823 struct LDKDecodeError *err;
9824 } LDKCResult_ClosingSignedDecodeErrorZPtr;
9827 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
9828 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9829 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9831 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
9833 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
9834 * `err` or `result` depending on the state of `result_ok`.
9836 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
9838 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
9841 } LDKCResult_ClosingSignedDecodeErrorZ;
9846 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
9847 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
9850 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
9852 * A pointer to the opaque Rust object.
9853 * Nearly everywhere, inner must be non-null, however in places where
9854 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9856 LDKnativeClosingSignedFeeRange *inner;
9858 * Indicates that this is the only struct which contains the same pointer.
9859 * Rust functions which take ownership of an object provided via an argument require
9860 * this to be true and invalidate the object pointed to by inner.
9863 } LDKClosingSignedFeeRange;
9866 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
9868 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
9870 * A pointer to the contents in the success state.
9871 * Reading from this pointer when `result_ok` is not set is undefined.
9873 struct LDKClosingSignedFeeRange *result;
9875 * A pointer to the contents in the error state.
9876 * Reading from this pointer when `result_ok` is set is undefined.
9878 struct LDKDecodeError *err;
9879 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
9882 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
9883 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
9884 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9886 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
9888 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
9889 * `err` or `result` depending on the state of `result_ok`.
9891 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
9893 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
9896 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
9901 * A commitment_signed message to be sent or received from a peer
9903 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
9905 * A pointer to the opaque Rust object.
9906 * Nearly everywhere, inner must be non-null, however in places where
9907 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9909 LDKnativeCommitmentSigned *inner;
9911 * Indicates that this is the only struct which contains the same pointer.
9912 * Rust functions which take ownership of an object provided via an argument require
9913 * this to be true and invalidate the object pointed to by inner.
9916 } LDKCommitmentSigned;
9919 * The contents of CResult_CommitmentSignedDecodeErrorZ
9921 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
9923 * A pointer to the contents in the success state.
9924 * Reading from this pointer when `result_ok` is not set is undefined.
9926 struct LDKCommitmentSigned *result;
9928 * A pointer to the contents in the error state.
9929 * Reading from this pointer when `result_ok` is set is undefined.
9931 struct LDKDecodeError *err;
9932 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
9935 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
9936 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
9937 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9939 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
9941 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
9942 * `err` or `result` depending on the state of `result_ok`.
9944 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
9946 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
9949 } LDKCResult_CommitmentSignedDecodeErrorZ;
9952 * The contents of CResult_FundingCreatedDecodeErrorZ
9954 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
9956 * A pointer to the contents in the success state.
9957 * Reading from this pointer when `result_ok` is not set is undefined.
9959 struct LDKFundingCreated *result;
9961 * A pointer to the contents in the error state.
9962 * Reading from this pointer when `result_ok` is set is undefined.
9964 struct LDKDecodeError *err;
9965 } LDKCResult_FundingCreatedDecodeErrorZPtr;
9968 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
9969 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
9970 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9972 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
9974 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
9975 * `err` or `result` depending on the state of `result_ok`.
9977 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
9979 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
9982 } LDKCResult_FundingCreatedDecodeErrorZ;
9985 * The contents of CResult_FundingSignedDecodeErrorZ
9987 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
9989 * A pointer to the contents in the success state.
9990 * Reading from this pointer when `result_ok` is not set is undefined.
9992 struct LDKFundingSigned *result;
9994 * A pointer to the contents in the error state.
9995 * Reading from this pointer when `result_ok` is set is undefined.
9997 struct LDKDecodeError *err;
9998 } LDKCResult_FundingSignedDecodeErrorZPtr;
10001 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
10002 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
10003 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10005 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
10007 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
10008 * `err` or `result` depending on the state of `result_ok`.
10010 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
10012 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
10015 } LDKCResult_FundingSignedDecodeErrorZ;
10018 * The contents of CResult_ChannelReadyDecodeErrorZ
10020 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
10022 * A pointer to the contents in the success state.
10023 * Reading from this pointer when `result_ok` is not set is undefined.
10025 struct LDKChannelReady *result;
10027 * A pointer to the contents in the error state.
10028 * Reading from this pointer when `result_ok` is set is undefined.
10030 struct LDKDecodeError *err;
10031 } LDKCResult_ChannelReadyDecodeErrorZPtr;
10034 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
10035 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
10036 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10038 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
10040 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
10041 * `err` or `result` depending on the state of `result_ok`.
10043 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
10045 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
10048 } LDKCResult_ChannelReadyDecodeErrorZ;
10053 * An init message to be sent or received from a peer
10055 typedef struct MUST_USE_STRUCT LDKInit {
10057 * A pointer to the opaque Rust object.
10058 * Nearly everywhere, inner must be non-null, however in places where
10059 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10061 LDKnativeInit *inner;
10063 * Indicates that this is the only struct which contains the same pointer.
10064 * Rust functions which take ownership of an object provided via an argument require
10065 * this to be true and invalidate the object pointed to by inner.
10071 * The contents of CResult_InitDecodeErrorZ
10073 typedef union LDKCResult_InitDecodeErrorZPtr {
10075 * A pointer to the contents in the success state.
10076 * Reading from this pointer when `result_ok` is not set is undefined.
10078 struct LDKInit *result;
10080 * A pointer to the contents in the error state.
10081 * Reading from this pointer when `result_ok` is set is undefined.
10083 struct LDKDecodeError *err;
10084 } LDKCResult_InitDecodeErrorZPtr;
10087 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
10088 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
10089 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10091 typedef struct LDKCResult_InitDecodeErrorZ {
10093 * The contents of this CResult_InitDecodeErrorZ, accessible via either
10094 * `err` or `result` depending on the state of `result_ok`.
10096 union LDKCResult_InitDecodeErrorZPtr contents;
10098 * Whether this CResult_InitDecodeErrorZ represents a success state.
10101 } LDKCResult_InitDecodeErrorZ;
10104 * The contents of CResult_OpenChannelDecodeErrorZ
10106 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
10108 * A pointer to the contents in the success state.
10109 * Reading from this pointer when `result_ok` is not set is undefined.
10111 struct LDKOpenChannel *result;
10113 * A pointer to the contents in the error state.
10114 * Reading from this pointer when `result_ok` is set is undefined.
10116 struct LDKDecodeError *err;
10117 } LDKCResult_OpenChannelDecodeErrorZPtr;
10120 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
10121 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
10122 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10124 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
10126 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
10127 * `err` or `result` depending on the state of `result_ok`.
10129 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
10131 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
10134 } LDKCResult_OpenChannelDecodeErrorZ;
10137 * The contents of CResult_RevokeAndACKDecodeErrorZ
10139 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
10141 * A pointer to the contents in the success state.
10142 * Reading from this pointer when `result_ok` is not set is undefined.
10144 struct LDKRevokeAndACK *result;
10146 * A pointer to the contents in the error state.
10147 * Reading from this pointer when `result_ok` is set is undefined.
10149 struct LDKDecodeError *err;
10150 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
10153 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
10154 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
10155 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10157 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
10159 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
10160 * `err` or `result` depending on the state of `result_ok`.
10162 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
10164 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
10167 } LDKCResult_RevokeAndACKDecodeErrorZ;
10170 * The contents of CResult_ShutdownDecodeErrorZ
10172 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
10174 * A pointer to the contents in the success state.
10175 * Reading from this pointer when `result_ok` is not set is undefined.
10177 struct LDKShutdown *result;
10179 * A pointer to the contents in the error state.
10180 * Reading from this pointer when `result_ok` is set is undefined.
10182 struct LDKDecodeError *err;
10183 } LDKCResult_ShutdownDecodeErrorZPtr;
10186 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
10187 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
10188 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10190 typedef struct LDKCResult_ShutdownDecodeErrorZ {
10192 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
10193 * `err` or `result` depending on the state of `result_ok`.
10195 union LDKCResult_ShutdownDecodeErrorZPtr contents;
10197 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
10200 } LDKCResult_ShutdownDecodeErrorZ;
10203 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
10205 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
10207 * A pointer to the contents in the success state.
10208 * Reading from this pointer when `result_ok` is not set is undefined.
10210 struct LDKUpdateFailHTLC *result;
10212 * A pointer to the contents in the error state.
10213 * Reading from this pointer when `result_ok` is set is undefined.
10215 struct LDKDecodeError *err;
10216 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
10219 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
10220 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10221 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10223 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
10225 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
10226 * `err` or `result` depending on the state of `result_ok`.
10228 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
10230 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
10233 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
10236 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
10238 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
10240 * A pointer to the contents in the success state.
10241 * Reading from this pointer when `result_ok` is not set is undefined.
10243 struct LDKUpdateFailMalformedHTLC *result;
10245 * A pointer to the contents in the error state.
10246 * Reading from this pointer when `result_ok` is set is undefined.
10248 struct LDKDecodeError *err;
10249 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
10252 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
10253 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10254 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10256 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
10258 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
10259 * `err` or `result` depending on the state of `result_ok`.
10261 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
10263 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
10266 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
10271 * An update_fee message to be sent or received from a peer
10273 typedef struct MUST_USE_STRUCT LDKUpdateFee {
10275 * A pointer to the opaque Rust object.
10276 * Nearly everywhere, inner must be non-null, however in places where
10277 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10279 LDKnativeUpdateFee *inner;
10281 * Indicates that this is the only struct which contains the same pointer.
10282 * Rust functions which take ownership of an object provided via an argument require
10283 * this to be true and invalidate the object pointed to by inner.
10289 * The contents of CResult_UpdateFeeDecodeErrorZ
10291 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
10293 * A pointer to the contents in the success state.
10294 * Reading from this pointer when `result_ok` is not set is undefined.
10296 struct LDKUpdateFee *result;
10298 * A pointer to the contents in the error state.
10299 * Reading from this pointer when `result_ok` is set is undefined.
10301 struct LDKDecodeError *err;
10302 } LDKCResult_UpdateFeeDecodeErrorZPtr;
10305 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
10306 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
10307 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10309 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
10311 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
10312 * `err` or `result` depending on the state of `result_ok`.
10314 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
10316 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
10319 } LDKCResult_UpdateFeeDecodeErrorZ;
10322 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
10324 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
10326 * A pointer to the contents in the success state.
10327 * Reading from this pointer when `result_ok` is not set is undefined.
10329 struct LDKUpdateFulfillHTLC *result;
10331 * A pointer to the contents in the error state.
10332 * Reading from this pointer when `result_ok` is set is undefined.
10334 struct LDKDecodeError *err;
10335 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
10338 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
10339 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10340 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10342 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
10344 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
10345 * `err` or `result` depending on the state of `result_ok`.
10347 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
10349 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
10352 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
10355 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
10357 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
10359 * A pointer to the contents in the success state.
10360 * Reading from this pointer when `result_ok` is not set is undefined.
10362 struct LDKUpdateAddHTLC *result;
10364 * A pointer to the contents in the error state.
10365 * Reading from this pointer when `result_ok` is set is undefined.
10367 struct LDKDecodeError *err;
10368 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
10371 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
10372 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
10373 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10375 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
10377 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
10378 * `err` or `result` depending on the state of `result_ok`.
10380 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
10382 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
10385 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
10390 * A ping message to be sent or received from a peer
10392 typedef struct MUST_USE_STRUCT LDKPing {
10394 * A pointer to the opaque Rust object.
10395 * Nearly everywhere, inner must be non-null, however in places where
10396 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10398 LDKnativePing *inner;
10400 * Indicates that this is the only struct which contains the same pointer.
10401 * Rust functions which take ownership of an object provided via an argument require
10402 * this to be true and invalidate the object pointed to by inner.
10408 * The contents of CResult_PingDecodeErrorZ
10410 typedef union LDKCResult_PingDecodeErrorZPtr {
10412 * A pointer to the contents in the success state.
10413 * Reading from this pointer when `result_ok` is not set is undefined.
10415 struct LDKPing *result;
10417 * A pointer to the contents in the error state.
10418 * Reading from this pointer when `result_ok` is set is undefined.
10420 struct LDKDecodeError *err;
10421 } LDKCResult_PingDecodeErrorZPtr;
10424 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
10425 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
10426 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10428 typedef struct LDKCResult_PingDecodeErrorZ {
10430 * The contents of this CResult_PingDecodeErrorZ, accessible via either
10431 * `err` or `result` depending on the state of `result_ok`.
10433 union LDKCResult_PingDecodeErrorZPtr contents;
10435 * Whether this CResult_PingDecodeErrorZ represents a success state.
10438 } LDKCResult_PingDecodeErrorZ;
10443 * A pong message to be sent or received from a peer
10445 typedef struct MUST_USE_STRUCT LDKPong {
10447 * A pointer to the opaque Rust object.
10448 * Nearly everywhere, inner must be non-null, however in places where
10449 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10451 LDKnativePong *inner;
10453 * Indicates that this is the only struct which contains the same pointer.
10454 * Rust functions which take ownership of an object provided via an argument require
10455 * this to be true and invalidate the object pointed to by inner.
10461 * The contents of CResult_PongDecodeErrorZ
10463 typedef union LDKCResult_PongDecodeErrorZPtr {
10465 * A pointer to the contents in the success state.
10466 * Reading from this pointer when `result_ok` is not set is undefined.
10468 struct LDKPong *result;
10470 * A pointer to the contents in the error state.
10471 * Reading from this pointer when `result_ok` is set is undefined.
10473 struct LDKDecodeError *err;
10474 } LDKCResult_PongDecodeErrorZPtr;
10477 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
10478 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
10479 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10481 typedef struct LDKCResult_PongDecodeErrorZ {
10483 * The contents of this CResult_PongDecodeErrorZ, accessible via either
10484 * `err` or `result` depending on the state of `result_ok`.
10486 union LDKCResult_PongDecodeErrorZPtr contents;
10488 * Whether this CResult_PongDecodeErrorZ represents a success state.
10491 } LDKCResult_PongDecodeErrorZ;
10494 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
10496 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
10498 * A pointer to the contents in the success state.
10499 * Reading from this pointer when `result_ok` is not set is undefined.
10501 struct LDKUnsignedChannelAnnouncement *result;
10503 * A pointer to the contents in the error state.
10504 * Reading from this pointer when `result_ok` is set is undefined.
10506 struct LDKDecodeError *err;
10507 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
10510 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
10511 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10512 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10514 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
10516 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
10517 * `err` or `result` depending on the state of `result_ok`.
10519 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
10521 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
10524 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
10527 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
10529 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
10531 * A pointer to the contents in the success state.
10532 * Reading from this pointer when `result_ok` is not set is undefined.
10534 struct LDKChannelAnnouncement *result;
10536 * A pointer to the contents in the error state.
10537 * Reading from this pointer when `result_ok` is set is undefined.
10539 struct LDKDecodeError *err;
10540 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
10543 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
10544 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10545 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10547 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
10549 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
10550 * `err` or `result` depending on the state of `result_ok`.
10552 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
10554 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
10557 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
10562 * The unsigned part of a channel_update
10564 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
10566 * A pointer to the opaque Rust object.
10567 * Nearly everywhere, inner must be non-null, however in places where
10568 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10570 LDKnativeUnsignedChannelUpdate *inner;
10572 * Indicates that this is the only struct which contains the same pointer.
10573 * Rust functions which take ownership of an object provided via an argument require
10574 * this to be true and invalidate the object pointed to by inner.
10577 } LDKUnsignedChannelUpdate;
10580 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
10582 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
10584 * A pointer to the contents in the success state.
10585 * Reading from this pointer when `result_ok` is not set is undefined.
10587 struct LDKUnsignedChannelUpdate *result;
10589 * A pointer to the contents in the error state.
10590 * Reading from this pointer when `result_ok` is set is undefined.
10592 struct LDKDecodeError *err;
10593 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
10596 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
10597 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10598 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10600 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
10602 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
10603 * `err` or `result` depending on the state of `result_ok`.
10605 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
10607 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
10610 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
10613 * The contents of CResult_ChannelUpdateDecodeErrorZ
10615 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
10617 * A pointer to the contents in the success state.
10618 * Reading from this pointer when `result_ok` is not set is undefined.
10620 struct LDKChannelUpdate *result;
10622 * A pointer to the contents in the error state.
10623 * Reading from this pointer when `result_ok` is set is undefined.
10625 struct LDKDecodeError *err;
10626 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
10629 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
10630 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10631 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10633 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
10635 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
10636 * `err` or `result` depending on the state of `result_ok`.
10638 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
10640 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
10643 } LDKCResult_ChannelUpdateDecodeErrorZ;
10646 * The contents of CResult_ErrorMessageDecodeErrorZ
10648 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
10650 * A pointer to the contents in the success state.
10651 * Reading from this pointer when `result_ok` is not set is undefined.
10653 struct LDKErrorMessage *result;
10655 * A pointer to the contents in the error state.
10656 * Reading from this pointer when `result_ok` is set is undefined.
10658 struct LDKDecodeError *err;
10659 } LDKCResult_ErrorMessageDecodeErrorZPtr;
10662 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
10663 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10664 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10666 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
10668 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
10669 * `err` or `result` depending on the state of `result_ok`.
10671 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
10673 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
10676 } LDKCResult_ErrorMessageDecodeErrorZ;
10679 * The contents of CResult_WarningMessageDecodeErrorZ
10681 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
10683 * A pointer to the contents in the success state.
10684 * Reading from this pointer when `result_ok` is not set is undefined.
10686 struct LDKWarningMessage *result;
10688 * A pointer to the contents in the error state.
10689 * Reading from this pointer when `result_ok` is set is undefined.
10691 struct LDKDecodeError *err;
10692 } LDKCResult_WarningMessageDecodeErrorZPtr;
10695 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
10696 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
10697 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10699 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
10701 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
10702 * `err` or `result` depending on the state of `result_ok`.
10704 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
10706 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
10709 } LDKCResult_WarningMessageDecodeErrorZ;
10714 * The unsigned part of a node_announcement
10716 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
10718 * A pointer to the opaque Rust object.
10719 * Nearly everywhere, inner must be non-null, however in places where
10720 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10722 LDKnativeUnsignedNodeAnnouncement *inner;
10724 * Indicates that this is the only struct which contains the same pointer.
10725 * Rust functions which take ownership of an object provided via an argument require
10726 * this to be true and invalidate the object pointed to by inner.
10729 } LDKUnsignedNodeAnnouncement;
10732 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
10734 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
10736 * A pointer to the contents in the success state.
10737 * Reading from this pointer when `result_ok` is not set is undefined.
10739 struct LDKUnsignedNodeAnnouncement *result;
10741 * A pointer to the contents in the error state.
10742 * Reading from this pointer when `result_ok` is set is undefined.
10744 struct LDKDecodeError *err;
10745 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
10748 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10749 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10750 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10752 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
10754 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
10755 * `err` or `result` depending on the state of `result_ok`.
10757 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
10759 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
10762 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
10765 * The contents of CResult_NodeAnnouncementDecodeErrorZ
10767 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
10769 * A pointer to the contents in the success state.
10770 * Reading from this pointer when `result_ok` is not set is undefined.
10772 struct LDKNodeAnnouncement *result;
10774 * A pointer to the contents in the error state.
10775 * Reading from this pointer when `result_ok` is set is undefined.
10777 struct LDKDecodeError *err;
10778 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
10781 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
10782 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
10783 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10785 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
10787 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
10788 * `err` or `result` depending on the state of `result_ok`.
10790 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
10792 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
10795 } LDKCResult_NodeAnnouncementDecodeErrorZ;
10798 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
10800 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
10802 * A pointer to the contents in the success state.
10803 * Reading from this pointer when `result_ok` is not set is undefined.
10805 struct LDKQueryShortChannelIds *result;
10807 * A pointer to the contents in the error state.
10808 * Reading from this pointer when `result_ok` is set is undefined.
10810 struct LDKDecodeError *err;
10811 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
10814 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
10815 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
10816 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10818 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
10820 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
10821 * `err` or `result` depending on the state of `result_ok`.
10823 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
10825 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
10828 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
10833 * A reply_short_channel_ids_end message is sent as a reply to a
10834 * query_short_channel_ids message. The query recipient makes a best
10835 * effort to respond based on their local network view which may not be
10836 * a perfect view of the network.
10838 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
10840 * A pointer to the opaque Rust object.
10841 * Nearly everywhere, inner must be non-null, however in places where
10842 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10844 LDKnativeReplyShortChannelIdsEnd *inner;
10846 * Indicates that this is the only struct which contains the same pointer.
10847 * Rust functions which take ownership of an object provided via an argument require
10848 * this to be true and invalidate the object pointed to by inner.
10851 } LDKReplyShortChannelIdsEnd;
10854 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
10856 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
10858 * A pointer to the contents in the success state.
10859 * Reading from this pointer when `result_ok` is not set is undefined.
10861 struct LDKReplyShortChannelIdsEnd *result;
10863 * A pointer to the contents in the error state.
10864 * Reading from this pointer when `result_ok` is set is undefined.
10866 struct LDKDecodeError *err;
10867 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
10870 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
10871 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
10872 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10874 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
10876 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
10877 * `err` or `result` depending on the state of `result_ok`.
10879 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
10881 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
10884 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
10887 * The contents of CResult_QueryChannelRangeDecodeErrorZ
10889 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
10891 * A pointer to the contents in the success state.
10892 * Reading from this pointer when `result_ok` is not set is undefined.
10894 struct LDKQueryChannelRange *result;
10896 * A pointer to the contents in the error state.
10897 * Reading from this pointer when `result_ok` is set is undefined.
10899 struct LDKDecodeError *err;
10900 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
10903 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
10904 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10905 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10907 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
10909 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
10910 * `err` or `result` depending on the state of `result_ok`.
10912 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
10914 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
10917 } LDKCResult_QueryChannelRangeDecodeErrorZ;
10920 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
10922 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
10924 * A pointer to the contents in the success state.
10925 * Reading from this pointer when `result_ok` is not set is undefined.
10927 struct LDKReplyChannelRange *result;
10929 * A pointer to the contents in the error state.
10930 * Reading from this pointer when `result_ok` is set is undefined.
10932 struct LDKDecodeError *err;
10933 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
10936 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
10937 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
10938 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10940 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
10942 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
10943 * `err` or `result` depending on the state of `result_ok`.
10945 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
10947 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
10950 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
10953 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
10955 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
10957 * A pointer to the contents in the success state.
10958 * Reading from this pointer when `result_ok` is not set is undefined.
10960 struct LDKGossipTimestampFilter *result;
10962 * A pointer to the contents in the error state.
10963 * Reading from this pointer when `result_ok` is set is undefined.
10965 struct LDKDecodeError *err;
10966 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
10969 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
10970 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
10971 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10973 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
10975 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
10976 * `err` or `result` depending on the state of `result_ok`.
10978 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
10980 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
10983 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
10986 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
10987 * This corresponds to std::vector in C++
10989 typedef struct LDKCVec_PhantomRouteHintsZ {
10991 * The elements in the array.
10992 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10994 struct LDKPhantomRouteHints *data;
10996 * The number of elements pointed to by `data`.
10999 } LDKCVec_PhantomRouteHintsZ;
11002 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
11005 typedef enum LDKSignOrCreationError_Tag {
11007 * An error occurred during signing
11009 LDKSignOrCreationError_SignError,
11011 * An error occurred while building the transaction
11013 LDKSignOrCreationError_CreationError,
11015 * Must be last for serialization purposes
11017 LDKSignOrCreationError_Sentinel,
11018 } LDKSignOrCreationError_Tag;
11020 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
11021 LDKSignOrCreationError_Tag tag;
11024 enum LDKCreationError creation_error;
11027 } LDKSignOrCreationError;
11030 * The contents of CResult_InvoiceSignOrCreationErrorZ
11032 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
11034 * A pointer to the contents in the success state.
11035 * Reading from this pointer when `result_ok` is not set is undefined.
11037 struct LDKInvoice *result;
11039 * A pointer to the contents in the error state.
11040 * Reading from this pointer when `result_ok` is set is undefined.
11042 struct LDKSignOrCreationError *err;
11043 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
11046 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
11047 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
11048 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11050 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
11052 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
11053 * `err` or `result` depending on the state of `result_ok`.
11055 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
11057 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
11060 } LDKCResult_InvoiceSignOrCreationErrorZ;
11065 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
11067 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
11068 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
11069 * the return value of [`Filter::register_output`].
11071 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
11072 * may have been spent there. See [`Filter::register_output`] for details.
11074 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
11075 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
11077 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
11079 * A pointer to the opaque Rust object.
11080 * Nearly everywhere, inner must be non-null, however in places where
11081 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11083 LDKnativeWatchedOutput *inner;
11085 * Indicates that this is the only struct which contains the same pointer.
11086 * Rust functions which take ownership of an object provided via an argument require
11087 * this to be true and invalidate the object pointed to by inner.
11090 } LDKWatchedOutput;
11093 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
11096 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
11097 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
11098 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
11099 * receiving full blocks from a chain source, any further filtering is unnecessary.
11101 * After an output has been registered, subsequent block retrievals from the chain source must not
11102 * exclude any transactions matching the new criteria nor any in-block descendants of such
11105 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
11106 * should not block on I/O. Implementations should instead queue the newly monitored data to be
11107 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
11108 * invocation that has called the `Filter` must return [`TemporaryFailure`].
11110 * [`TemporaryFailure`]: ChannelMonitorUpdateErr::TemporaryFailure
11111 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
11112 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
11114 typedef struct LDKFilter {
11116 * An opaque pointer which is passed to your function implementations as an argument.
11117 * This has no meaning in the LDK, and can be NULL or any other value.
11121 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
11122 * a spending condition.
11124 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
11126 * Registers interest in spends of a transaction output.
11128 * Optionally, when `output.block_hash` is set, should return any transaction spending the
11129 * output that is found in the corresponding block along with its index.
11131 * This return value is useful for Electrum clients in order to supply in-block descendant
11132 * transactions which otherwise were not included. This is not necessary for other clients if
11133 * such descendant transactions were already included (e.g., when a BIP 157 client provides the
11136 struct LDKCOption_C2Tuple_usizeTransactionZZ (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
11138 * Frees any resources associated with this object given its this_arg pointer.
11139 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11141 void (*free)(void *this_arg);
11145 * An enum which can either contain a crate::lightning::chain::Filter or not
11147 typedef enum LDKCOption_FilterZ_Tag {
11149 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
11151 LDKCOption_FilterZ_Some,
11153 * When we're in this state, this COption_FilterZ contains nothing
11155 LDKCOption_FilterZ_None,
11157 * Must be last for serialization purposes
11159 LDKCOption_FilterZ_Sentinel,
11160 } LDKCOption_FilterZ_Tag;
11162 typedef struct LDKCOption_FilterZ {
11163 LDKCOption_FilterZ_Tag tag;
11166 struct LDKFilter some;
11169 } LDKCOption_FilterZ;
11174 * A read-only reference to a current ChannelMonitor.
11176 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
11179 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
11181 * A pointer to the opaque Rust object.
11182 * Nearly everywhere, inner must be non-null, however in places where
11183 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11185 LDKnativeLockedChannelMonitor *inner;
11187 * Indicates that this is the only struct which contains the same pointer.
11188 * Rust functions which take ownership of an object provided via an argument require
11189 * this to be true and invalidate the object pointed to by inner.
11192 } LDKLockedChannelMonitor;
11195 * The contents of CResult_LockedChannelMonitorNoneZ
11197 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
11199 * A pointer to the contents in the success state.
11200 * Reading from this pointer when `result_ok` is not set is undefined.
11202 struct LDKLockedChannelMonitor *result;
11204 * Note that this value is always NULL, as there are no contents in the Err variant
11207 } LDKCResult_LockedChannelMonitorNoneZPtr;
11210 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
11211 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
11212 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11214 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
11216 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
11217 * `err` or `result` depending on the state of `result_ok`.
11219 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
11221 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
11224 } LDKCResult_LockedChannelMonitorNoneZ;
11227 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
11228 * This corresponds to std::vector in C++
11230 typedef struct LDKCVec_OutPointZ {
11232 * The elements in the array.
11233 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11235 struct LDKOutPoint *data;
11237 * The number of elements pointed to by `data`.
11240 } LDKCVec_OutPointZ;
11243 * A trait indicating an object may generate message send events
11245 typedef struct LDKMessageSendEventsProvider {
11247 * An opaque pointer which is passed to your function implementations as an argument.
11248 * This has no meaning in the LDK, and can be NULL or any other value.
11252 * Gets the list of pending events which were generated by previous actions, clearing the list
11255 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
11257 * Frees any resources associated with this object given its this_arg pointer.
11258 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11260 void (*free)(void *this_arg);
11261 } LDKMessageSendEventsProvider;
11264 * A trait implemented for objects handling events from [`EventsProvider`].
11266 typedef struct LDKEventHandler {
11268 * An opaque pointer which is passed to your function implementations as an argument.
11269 * This has no meaning in the LDK, and can be NULL or any other value.
11273 * Handles the given [`Event`].
11275 * See [`EventsProvider`] for details that must be considered when implementing this method.
11277 void (*handle_event)(const void *this_arg, const struct LDKEvent *NONNULL_PTR event);
11279 * Frees any resources associated with this object given its this_arg pointer.
11280 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11282 void (*free)(void *this_arg);
11286 * A trait indicating an object may generate events.
11288 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
11292 * See [`process_pending_events`] for requirements around event processing.
11294 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
11295 * event since the last invocation. The handler must either act upon the event immediately
11296 * or preserve it for later handling.
11298 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
11299 * consult the provider's documentation on the implication of processing events and how a handler
11300 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
11301 * [`ChainMonitor::process_pending_events`]).
11303 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
11306 * [`process_pending_events`]: Self::process_pending_events
11307 * [`handle_event`]: EventHandler::handle_event
11308 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
11309 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
11311 typedef struct LDKEventsProvider {
11313 * An opaque pointer which is passed to your function implementations as an argument.
11314 * This has no meaning in the LDK, and can be NULL or any other value.
11318 * Processes any events generated since the last call using the given event handler.
11320 * Subsequent calls must only process new events. However, handlers must be capable of handling
11321 * duplicate events across process restarts. This may occur if the provider was recovered from
11322 * an old state (i.e., it hadn't been successfully persisted after processing pending events).
11324 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
11326 * Frees any resources associated with this object given its this_arg pointer.
11327 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11329 void (*free)(void *this_arg);
11330 } LDKEventsProvider;
11335 * Lightning TLV uses a custom variable-length integer called BigSize. It is similar to Bitcoin's
11336 * variable-length integers except that it is serialized in big-endian instead of little-endian.
11338 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
11339 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
11340 * you're looking for an example of a variable-length integer to use for your own project, move
11341 * along, this is a rather poor design.
11343 typedef struct MUST_USE_STRUCT LDKBigSize {
11345 * A pointer to the opaque Rust object.
11346 * Nearly everywhere, inner must be non-null, however in places where
11347 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11349 LDKnativeBigSize *inner;
11351 * Indicates that this is the only struct which contains the same pointer.
11352 * Rust functions which take ownership of an object provided via an argument require
11353 * this to be true and invalidate the object pointed to by inner.
11361 * Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`].
11363 typedef struct MUST_USE_STRUCT LDKChannelUsage {
11365 * A pointer to the opaque Rust object.
11366 * Nearly everywhere, inner must be non-null, however in places where
11367 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11369 LDKnativeChannelUsage *inner;
11371 * Indicates that this is the only struct which contains the same pointer.
11372 * Rust functions which take ownership of an object provided via an argument require
11373 * this to be true and invalidate the object pointed to by inner.
11379 * An interface used to score payment channels for path finding.
11381 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
11383 typedef struct LDKScore {
11385 * An opaque pointer which is passed to your function implementations as an argument.
11386 * This has no meaning in the LDK, and can be NULL or any other value.
11390 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
11391 * given channel in the direction from `source` to `target`.
11393 * The channel's capacity (less any other MPP parts that are also being considered for use in
11394 * the same payment) is given by `capacity_msat`. It may be determined from various sources
11395 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
11396 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
11397 * Thus, implementations should be overflow-safe.
11399 uint64_t (*channel_penalty_msat)(const void *this_arg, uint64_t short_channel_id, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, struct LDKChannelUsage usage);
11401 * Handles updating channel penalties after failing to route through a channel.
11403 void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
11405 * Handles updating channel penalties after successfully routing along a path.
11407 void (*payment_path_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
11409 * Handles updating channel penalties after a probe over the given path failed.
11411 void (*probe_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
11413 * Handles updating channel penalties after a probe over the given path succeeded.
11415 void (*probe_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
11417 * Serialize the object into a byte array
11419 struct LDKCVec_u8Z (*write)(const void *this_arg);
11421 * Frees any resources associated with this object given its this_arg pointer.
11422 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11424 void (*free)(void *this_arg);
11430 * A concrete implementation of [`LockableScore`] which supports multi-threading.
11432 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
11434 * A pointer to the opaque Rust object.
11435 * Nearly everywhere, inner must be non-null, however in places where
11436 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11438 LDKnativeMultiThreadedLockableScore *inner;
11440 * Indicates that this is the only struct which contains the same pointer.
11441 * Rust functions which take ownership of an object provided via an argument require
11442 * this to be true and invalidate the object pointed to by inner.
11445 } LDKMultiThreadedLockableScore;
11448 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`MultiThreadedLockableScore`] to disk.
11450 typedef struct LDKPersister {
11452 * An opaque pointer which is passed to your function implementations as an argument.
11453 * This has no meaning in the LDK, and can be NULL or any other value.
11457 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
11459 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
11461 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
11463 struct LDKCResult_NoneErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
11465 * Persist the given [`MultiThreadedLockableScore`] to disk, returning an error if persistence failed.
11467 struct LDKCResult_NoneErrorZ (*persist_scorer)(const void *this_arg, const struct LDKMultiThreadedLockableScore *NONNULL_PTR scorer);
11469 * Frees any resources associated with this object given its this_arg pointer.
11470 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11472 void (*free)(void *this_arg);
11478 * Configuration we set when applicable.
11480 * Default::default() provides sane defaults.
11482 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
11484 * A pointer to the opaque Rust object.
11485 * Nearly everywhere, inner must be non-null, however in places where
11486 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11488 LDKnativeChannelHandshakeConfig *inner;
11490 * Indicates that this is the only struct which contains the same pointer.
11491 * Rust functions which take ownership of an object provided via an argument require
11492 * this to be true and invalidate the object pointed to by inner.
11495 } LDKChannelHandshakeConfig;
11500 * Optional channel limits which are applied during channel creation.
11502 * These limits are only applied to our counterparty's limits, not our own.
11504 * Use 0/<type>::max_value() as appropriate to skip checking.
11506 * Provides sane defaults for most configurations.
11508 * Most additional limits are disabled except those with which specify a default in individual
11509 * field documentation. Note that this may result in barely-usable channels, but since they
11510 * are applied mostly only to incoming channels that's not much of a problem.
11512 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
11514 * A pointer to the opaque Rust object.
11515 * Nearly everywhere, inner must be non-null, however in places where
11516 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11518 LDKnativeChannelHandshakeLimits *inner;
11520 * Indicates that this is the only struct which contains the same pointer.
11521 * Rust functions which take ownership of an object provided via an argument require
11522 * this to be true and invalidate the object pointed to by inner.
11525 } LDKChannelHandshakeLimits;
11530 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
11532 * Default::default() provides sane defaults for most configurations
11533 * (but currently with 0 relay fees!)
11535 typedef struct MUST_USE_STRUCT LDKUserConfig {
11537 * A pointer to the opaque Rust object.
11538 * Nearly everywhere, inner must be non-null, however in places where
11539 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11541 LDKnativeUserConfig *inner;
11543 * Indicates that this is the only struct which contains the same pointer.
11544 * Rust functions which take ownership of an object provided via an argument require
11545 * this to be true and invalidate the object pointed to by inner.
11553 * The best known block as identified by its hash and height.
11555 typedef struct MUST_USE_STRUCT LDKBestBlock {
11557 * A pointer to the opaque Rust object.
11558 * Nearly everywhere, inner must be non-null, however in places where
11559 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11561 LDKnativeBestBlock *inner;
11563 * Indicates that this is the only struct which contains the same pointer.
11564 * Rust functions which take ownership of an object provided via an argument require
11565 * this to be true and invalidate the object pointed to by inner.
11571 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
11574 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
11575 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
11576 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
11579 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
11580 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
11581 * other similar filtering.
11583 typedef struct LDKListen {
11585 * An opaque pointer which is passed to your function implementations as an argument.
11586 * This has no meaning in the LDK, and can be NULL or any other value.
11590 * Notifies the listener that a block was added at the given height, with the transaction data
11591 * possibly filtered.
11593 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
11595 * Notifies the listener that a block was added at the given height.
11597 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
11599 * Notifies the listener that a block was removed at the given height.
11601 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
11603 * Frees any resources associated with this object given its this_arg pointer.
11604 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11606 void (*free)(void *this_arg);
11610 * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
11611 * unconfirmed during a chain reorganization.
11613 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
11614 * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity
11615 * related to registered transactions and outputs. Upon notification, it would pass along the
11616 * matching transactions using this interface.
11620 * The intended use is as follows:
11621 * - Call [`transactions_confirmed`] to process any on-chain activity of interest.
11622 * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`]
11623 * that has been reorganized out of the chain.
11624 * - Call [`best_block_updated`] whenever a new chain tip becomes available.
11628 * Clients must call these methods in chain order. Specifically:
11629 * - Transactions confirmed in a block must be given before transactions confirmed in a later
11631 * - Dependent transactions within the same block must be given in topological order, possibly in
11633 * - Unconfirmed transactions must be given after the original confirmations and before any
11636 * See individual method documentation for further details.
11638 * [`transactions_confirmed`]: Self::transactions_confirmed
11639 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11640 * [`best_block_updated`]: Self::best_block_updated
11641 * [`get_relevant_txids`]: Self::get_relevant_txids
11643 typedef struct LDKConfirm {
11645 * An opaque pointer which is passed to your function implementations as an argument.
11646 * This has no meaning in the LDK, and can be NULL or any other value.
11650 * Processes transactions confirmed in a block with a given header and height.
11652 * Should be called for any transactions registered by [`Filter::register_tx`] or any
11653 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
11654 * appearing in the same block do not need to be included in the same call; instead, multiple
11655 * calls with additional transactions may be made so long as they are made in [chain order].
11657 * May be called before or after [`best_block_updated`] for the corresponding block. However,
11658 * in the event of a chain reorganization, it must not be called with a `header` that is no
11659 * longer in the chain as of the last call to [`best_block_updated`].
11661 * [chain order]: Confirm#Order
11662 * [`best_block_updated`]: Self::best_block_updated
11664 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
11666 * Processes a transaction that is no longer confirmed as result of a chain reorganization.
11668 * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
11669 * reorganized out of the best chain. Once called, the given transaction should not be returned
11670 * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
11672 * [`get_relevant_txids`]: Self::get_relevant_txids
11673 * [`transactions_confirmed`]: Self::transactions_confirmed
11675 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
11677 * Processes an update to the best header connected at the given height.
11679 * Should be called when a new header is available but may be skipped for intermediary blocks
11680 * if they become available at the same time.
11682 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
11684 * Returns transactions that should be monitored for reorganization out of the chain.
11686 * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
11687 * confirmations to be safe from a chain reorganization. Should not include any transactions
11688 * passed to [`transaction_unconfirmed`] unless later reconfirmed.
11690 * May be called to determine the subset of transactions that must still be monitored for
11691 * reorganization. Will be idempotent between calls but may change as a result of calls to the
11692 * other interface methods. Thus, this is useful to determine which transactions may need to be
11693 * given to [`transaction_unconfirmed`].
11695 * [`transactions_confirmed`]: Self::transactions_confirmed
11696 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
11698 struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
11700 * Frees any resources associated with this object given its this_arg pointer.
11701 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11703 void (*free)(void *this_arg);
11709 * An opaque identifier describing a specific [`Persist`] method call.
11711 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
11713 * A pointer to the opaque Rust object.
11714 * Nearly everywhere, inner must be non-null, however in places where
11715 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11717 LDKnativeMonitorUpdateId *inner;
11719 * Indicates that this is the only struct which contains the same pointer.
11720 * Rust functions which take ownership of an object provided via an argument require
11721 * this to be true and invalidate the object pointed to by inner.
11724 } LDKMonitorUpdateId;
11727 * `Persist` defines behavior for persisting channel monitors: this could mean
11728 * writing once to disk, and/or uploading to one or more backup services.
11730 * Each method can return three possible values:
11731 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
11732 * implementation should return `Ok(())`, indicating normal channel operation should continue.
11733 * * If persistence happens asynchronously, implementations should first ensure the
11734 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
11735 * `Err(ChannelMonitorUpdateErr::TemporaryFailure)` while the update continues in the
11736 * background. Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be
11737 * called with the corresponding [`MonitorUpdateId`].
11739 * Note that unlike the direct [`chain::Watch`] interface,
11740 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
11742 * * If persistence fails for some reason, implementations should return
11743 * `Err(ChannelMonitorUpdateErr::PermanentFailure)`, in which case the channel will likely be
11744 * closed without broadcasting the latest state. See
11745 * [`ChannelMonitorUpdateErr::PermanentFailure`] for more details.
11747 typedef struct LDKPersist {
11749 * An opaque pointer which is passed to your function implementations as an argument.
11750 * This has no meaning in the LDK, and can be NULL or any other value.
11754 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
11755 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
11757 * The data can be stored any way you want, but the identifier provided by LDK is the
11758 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
11759 * and the stored channel data). Note that you **must** persist every new monitor to disk.
11761 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
11762 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
11764 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
11765 * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
11767 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11768 * [`Writeable::write`]: crate::util::ser::Writeable::write
11770 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
11772 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
11775 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
11776 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
11779 * During blockchain synchronization operations, this may be called with no
11780 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
11781 * Note that after the full [`ChannelMonitor`] is persisted any previous
11782 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
11783 * applied to the persisted [`ChannelMonitor`] as they were already applied.
11785 * If an implementer chooses to persist the updates only, they need to make
11786 * sure that all the updates are applied to the `ChannelMonitors` *before*
11787 * the set of channel monitors is given to the `ChannelManager`
11788 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
11789 * applying a monitor update to a monitor. If full `ChannelMonitors` are
11790 * persisted, then there is no need to persist individual updates.
11792 * Note that there could be a performance tradeoff between persisting complete
11793 * channel monitors on every update vs. persisting only updates and applying
11794 * them in batches. The size of each monitor grows `O(number of state updates)`
11795 * whereas updates are small and `O(1)`.
11797 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
11798 * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
11800 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
11801 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
11802 * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
11804 * [`Writeable::write`]: crate::util::ser::Writeable::write
11806 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
11808 struct LDKCResult_NoneChannelMonitorUpdateErrZ (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
11810 * Frees any resources associated with this object given its this_arg pointer.
11811 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11813 void (*free)(void *this_arg);
11819 * An implementation of [`chain::Watch`] for monitoring channels.
11821 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
11822 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
11823 * or used independently to monitor channels remotely. See the [module-level documentation] for
11826 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
11827 * [module-level documentation]: crate::chain::chainmonitor
11829 typedef struct MUST_USE_STRUCT LDKChainMonitor {
11831 * A pointer to the opaque Rust object.
11832 * Nearly everywhere, inner must be non-null, however in places where
11833 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11835 LDKnativeChainMonitor *inner;
11837 * Indicates that this is the only struct which contains the same pointer.
11838 * Rust functions which take ownership of an object provided via an argument require
11839 * this to be true and invalidate the object pointed to by inner.
11847 * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key
11848 * and derives keys from that.
11850 * Your node_id is seed/0'
11851 * ChannelMonitor closes may use seed/1'
11852 * Cooperative closes may use seed/2'
11853 * The two close keys may be needed to claim on-chain funds!
11855 * This struct cannot be used for nodes that wish to support receiving phantom payments;
11856 * [`PhantomKeysManager`] must be used instead.
11858 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
11859 * previously issued invoices and attempts to pay previous invoices will fail.
11861 typedef struct MUST_USE_STRUCT LDKKeysManager {
11863 * A pointer to the opaque Rust object.
11864 * Nearly everywhere, inner must be non-null, however in places where
11865 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11867 LDKnativeKeysManager *inner;
11869 * Indicates that this is the only struct which contains the same pointer.
11870 * Rust functions which take ownership of an object provided via an argument require
11871 * this to be true and invalidate the object pointed to by inner.
11879 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
11882 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
11883 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
11884 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
11885 * itself without ever needing to forward to this fake node.
11887 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
11888 * provide some fault tolerance, because payers will automatically retry paying other provided
11889 * nodes in the case that one node goes down.
11891 * Note that multi-path payments are not supported in phantom invoices for security reasons.
11892 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
11893 * invoices and attempts to pay previous invoices will fail.
11895 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
11897 * A pointer to the opaque Rust object.
11898 * Nearly everywhere, inner must be non-null, however in places where
11899 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11901 LDKnativePhantomKeysManager *inner;
11903 * Indicates that this is the only struct which contains the same pointer.
11904 * Rust functions which take ownership of an object provided via an argument require
11905 * this to be true and invalidate the object pointed to by inner.
11908 } LDKPhantomKeysManager;
11913 * Chain-related parameters used to construct a new `ChannelManager`.
11915 * Typically, the block-specific parameters are derived from the best block hash for the network,
11916 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
11917 * are not needed when deserializing a previously constructed `ChannelManager`.
11919 typedef struct MUST_USE_STRUCT LDKChainParameters {
11921 * A pointer to the opaque Rust object.
11922 * Nearly everywhere, inner must be non-null, however in places where
11923 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11925 LDKnativeChainParameters *inner;
11927 * Indicates that this is the only struct which contains the same pointer.
11928 * Rust functions which take ownership of an object provided via an argument require
11929 * this to be true and invalidate the object pointed to by inner.
11932 } LDKChainParameters;
11935 * A 3-byte byte array.
11937 typedef struct LDKThreeBytes {
11945 * A trait to describe an object which can receive channel messages.
11947 * Messages MAY be called in parallel when they originate from different their_node_ids, however
11948 * they MUST NOT be called in parallel when the two calls have the same their_node_id.
11950 typedef struct LDKChannelMessageHandler {
11952 * An opaque pointer which is passed to your function implementations as an argument.
11953 * This has no meaning in the LDK, and can be NULL or any other value.
11957 * Handle an incoming open_channel message from the given peer.
11959 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
11961 * Handle an incoming accept_channel message from the given peer.
11963 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
11965 * Handle an incoming funding_created message from the given peer.
11967 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
11969 * Handle an incoming funding_signed message from the given peer.
11971 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
11973 * Handle an incoming channel_ready message from the given peer.
11975 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
11977 * Handle an incoming shutdown message from the given peer.
11979 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg);
11981 * Handle an incoming closing_signed message from the given peer.
11983 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
11985 * Handle an incoming update_add_htlc message from the given peer.
11987 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
11989 * Handle an incoming update_fulfill_htlc message from the given peer.
11991 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
11993 * Handle an incoming update_fail_htlc message from the given peer.
11995 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
11997 * Handle an incoming update_fail_malformed_htlc message from the given peer.
11999 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
12001 * Handle an incoming commitment_signed message from the given peer.
12003 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
12005 * Handle an incoming revoke_and_ack message from the given peer.
12007 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
12009 * Handle an incoming update_fee message from the given peer.
12011 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
12013 * Handle an incoming announcement_signatures message from the given peer.
12015 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
12017 * Indicates a connection to the peer failed/an existing connection was lost. If no connection
12018 * is believed to be possible in the future (eg they're sending us messages we don't
12019 * understand or indicate they require unknown feature bits), no_connection_possible is set
12020 * and any outstanding channels should be failed.
12022 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible);
12024 * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
12026 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
12028 * Handle an incoming channel_reestablish message from the given peer.
12030 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
12032 * Handle an incoming channel update from the given peer.
12034 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
12036 * Handle an incoming error message from the given peer.
12038 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
12040 * Implementation of MessageSendEventsProvider for this object.
12042 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
12044 * Frees any resources associated with this object given its this_arg pointer.
12045 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12047 void (*free)(void *this_arg);
12048 } LDKChannelMessageHandler;
12053 * Arguments for the creation of a ChannelManager that are not deserialized.
12055 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
12057 * 1) Deserialize all stored [`ChannelMonitor`]s.
12058 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
12059 * `<(BlockHash, ChannelManager)>::read(reader, args)`
12060 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
12061 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
12062 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
12063 * same way you would handle a [`chain::Filter`] call using
12064 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
12065 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
12066 * 5) Disconnect/connect blocks on the [`ChannelManager`].
12067 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
12068 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
12069 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
12071 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
12072 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
12074 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
12075 * call any other methods on the newly-deserialized [`ChannelManager`].
12077 * Note that because some channels may be closed during deserialization, it is critical that you
12078 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
12079 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
12080 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
12081 * not force-close the same channels but consider them live), you may end up revoking a state for
12082 * which you've already broadcasted the transaction.
12084 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
12086 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
12088 * A pointer to the opaque Rust object.
12089 * Nearly everywhere, inner must be non-null, however in places where
12090 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12092 LDKnativeChannelManagerReadArgs *inner;
12094 * Indicates that this is the only struct which contains the same pointer.
12095 * Rust functions which take ownership of an object provided via an argument require
12096 * this to be true and invalidate the object pointed to by inner.
12099 } LDKChannelManagerReadArgs;
12104 * A set of keys that were HKDF-expanded from an initial call to
12105 * [`KeysInterface::get_inbound_payment_key_material`].
12107 * [`KeysInterface::get_inbound_payment_key_material`]: crate::chain::keysinterface::KeysInterface::get_inbound_payment_key_material
12109 typedef struct MUST_USE_STRUCT LDKExpandedKey {
12111 * A pointer to the opaque Rust object.
12112 * Nearly everywhere, inner must be non-null, however in places where
12113 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12115 LDKnativeExpandedKey *inner;
12117 * Indicates that this is the only struct which contains the same pointer.
12118 * Rust functions which take ownership of an object provided via an argument require
12119 * this to be true and invalidate the object pointed to by inner.
12127 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
12128 * This is used to convince the recipient that the channel is at a certain commitment
12129 * number even if they lost that data due to a local failure. Of course, the peer may lie
12130 * and even later commitments may have been revoked.
12132 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
12134 * A pointer to the opaque Rust object.
12135 * Nearly everywhere, inner must be non-null, however in places where
12136 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12138 LDKnativeDataLossProtect *inner;
12140 * Indicates that this is the only struct which contains the same pointer.
12141 * Rust functions which take ownership of an object provided via an argument require
12142 * this to be true and invalidate the object pointed to by inner.
12145 } LDKDataLossProtect;
12148 * A trait to describe an object which can receive routing messages.
12150 * # Implementor DoS Warnings
12152 * For `gossip_queries` messages there are potential DoS vectors when handling
12153 * inbound queries. Implementors using an on-disk network graph should be aware of
12154 * repeated disk I/O for queries accessing different parts of the network graph.
12156 typedef struct LDKRoutingMessageHandler {
12158 * An opaque pointer which is passed to your function implementations as an argument.
12159 * This has no meaning in the LDK, and can be NULL or any other value.
12163 * Handle an incoming node_announcement message, returning true if it should be forwarded on,
12164 * false or returning an Err otherwise.
12166 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
12168 * Handle a channel_announcement message, returning true if it should be forwarded on, false
12169 * or returning an Err otherwise.
12171 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
12173 * Handle an incoming channel_update message, returning true if it should be forwarded on,
12174 * false or returning an Err otherwise.
12176 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
12178 * Gets a subset of the channel announcements and updates required to dump our routing table
12179 * to a remote node, starting at the short_channel_id indicated by starting_point and
12180 * including the batch_amount entries immediately higher in numerical value than starting_point.
12182 struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcements)(const void *this_arg, uint64_t starting_point, uint8_t batch_amount);
12184 * Gets a subset of the node announcements required to dump our routing table to a remote node,
12185 * starting at the node *after* the provided publickey and including batch_amount entries
12186 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
12187 * If None is provided for starting_point, we start at the first node.
12189 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
12191 struct LDKCVec_NodeAnnouncementZ (*get_next_node_announcements)(const void *this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount);
12193 * Called when a connection is established with a peer. This can be used to
12194 * perform routing table synchronization using a strategy defined by the
12197 void (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
12199 * Handles the reply of a query we initiated to learn about channels
12200 * for a given range of blocks. We can expect to receive one or more
12201 * replies to a single query.
12203 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
12205 * Handles the reply of a query we initiated asking for routing gossip
12206 * messages for a list of channels. We should receive this message when
12207 * a node has completed its best effort to send us the pertaining routing
12210 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
12212 * Handles when a peer asks us to send a list of short_channel_ids
12213 * for the requested range of blocks.
12215 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
12217 * Handles when a peer asks us to send routing gossip messages for a
12218 * list of short_channel_ids.
12220 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
12222 * Implementation of MessageSendEventsProvider for this object.
12224 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
12226 * Frees any resources associated with this object given its this_arg pointer.
12227 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12229 void (*free)(void *this_arg);
12230 } LDKRoutingMessageHandler;
12233 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
12236 typedef struct LDKCustomMessageReader {
12238 * An opaque pointer which is passed to your function implementations as an argument.
12239 * This has no meaning in the LDK, and can be NULL or any other value.
12243 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
12244 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
12245 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
12246 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
12248 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
12250 * Frees any resources associated with this object given its this_arg pointer.
12251 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12253 void (*free)(void *this_arg);
12254 } LDKCustomMessageReader;
12257 * Handler for BOLT1-compliant messages.
12259 typedef struct LDKCustomMessageHandler {
12261 * An opaque pointer which is passed to your function implementations as an argument.
12262 * This has no meaning in the LDK, and can be NULL or any other value.
12266 * Called with the message type that was received and the buffer to be read.
12267 * Can return a `MessageHandlingError` if the message could not be handled.
12269 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
12271 * Gets the list of pending messages which were generated by the custom message
12272 * handler, clearing the list in the process. The first tuple element must
12273 * correspond to the intended recipients node ids. If no connection to one of the
12274 * specified node does not exist, the message is simply not sent to it.
12276 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
12278 * Implementation of CustomMessageReader for this object.
12280 struct LDKCustomMessageReader CustomMessageReader;
12282 * Frees any resources associated with this object given its this_arg pointer.
12283 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12285 void (*free)(void *this_arg);
12286 } LDKCustomMessageHandler;
12291 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
12292 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
12294 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
12296 * A pointer to the opaque Rust object.
12297 * Nearly everywhere, inner must be non-null, however in places where
12298 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12300 LDKnativeIgnoringMessageHandler *inner;
12302 * Indicates that this is the only struct which contains the same pointer.
12303 * Rust functions which take ownership of an object provided via an argument require
12304 * this to be true and invalidate the object pointed to by inner.
12307 } LDKIgnoringMessageHandler;
12312 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
12313 * You can provide one of these as the route_handler in a MessageHandler.
12315 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
12317 * A pointer to the opaque Rust object.
12318 * Nearly everywhere, inner must be non-null, however in places where
12319 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12321 LDKnativeErroringMessageHandler *inner;
12323 * Indicates that this is the only struct which contains the same pointer.
12324 * Rust functions which take ownership of an object provided via an argument require
12325 * this to be true and invalidate the object pointed to by inner.
12328 } LDKErroringMessageHandler;
12333 * Provides references to trait impls which handle different types of messages.
12335 typedef struct MUST_USE_STRUCT LDKMessageHandler {
12337 * A pointer to the opaque Rust object.
12338 * Nearly everywhere, inner must be non-null, however in places where
12339 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12341 LDKnativeMessageHandler *inner;
12343 * Indicates that this is the only struct which contains the same pointer.
12344 * Rust functions which take ownership of an object provided via an argument require
12345 * this to be true and invalidate the object pointed to by inner.
12348 } LDKMessageHandler;
12351 * Provides an object which can be used to send data to and which uniquely identifies a connection
12352 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
12353 * implement Hash to meet the PeerManager API.
12355 * For efficiency, Clone should be relatively cheap for this type.
12357 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
12358 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
12359 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
12360 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
12361 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
12362 * to simply use another value which is guaranteed to be globally unique instead.
12364 typedef struct LDKSocketDescriptor {
12366 * An opaque pointer which is passed to your function implementations as an argument.
12367 * This has no meaning in the LDK, and can be NULL or any other value.
12371 * Attempts to send some data from the given slice to the peer.
12373 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
12374 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
12375 * called and further write attempts may occur until that time.
12377 * If the returned size is smaller than `data.len()`, a
12378 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
12379 * written. Additionally, until a `send_data` event completes fully, no further
12380 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
12381 * prevent denial-of-service issues, you should not read or buffer any data from the socket
12384 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
12385 * (indicating that read events should be paused to prevent DoS in the send buffer),
12386 * `resume_read` may be set indicating that read events on this descriptor should resume. A
12387 * `resume_read` of false carries no meaning, and should not cause any action.
12389 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
12391 * Disconnect the socket pointed to by this SocketDescriptor.
12393 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
12394 * call (doing so is a noop).
12396 void (*disconnect_socket)(void *this_arg);
12398 * Checks if two objects are equal given this object's this_arg pointer and another object.
12400 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
12402 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
12403 * This is used, for example, for inclusion of this object in a hash map.
12405 uint64_t (*hash)(const void *this_arg);
12407 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
12408 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
12409 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
12411 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
12413 * Frees any resources associated with this object given its this_arg pointer.
12414 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12416 void (*free)(void *this_arg);
12417 } LDKSocketDescriptor;
12422 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
12423 * socket events into messages which it passes on to its [`MessageHandler`].
12425 * Locks are taken internally, so you must never assume that reentrancy from a
12426 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
12428 * Calls to [`read_event`] will decode relevant messages and pass them to the
12429 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
12430 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
12431 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
12432 * calls only after previous ones have returned.
12434 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
12435 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
12436 * essentially you should default to using a SimpleRefPeerManager, and use a
12437 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
12438 * you're using lightning-net-tokio.
12440 * [`read_event`]: PeerManager::read_event
12442 typedef struct MUST_USE_STRUCT LDKPeerManager {
12444 * A pointer to the opaque Rust object.
12445 * Nearly everywhere, inner must be non-null, however in places where
12446 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12448 LDKnativePeerManager *inner;
12450 * Indicates that this is the only struct which contains the same pointer.
12451 * Rust functions which take ownership of an object provided via an argument require
12452 * this to be true and invalidate the object pointed to by inner.
12460 * Static channel fields used to build transactions given per-commitment fields, organized by
12461 * broadcaster/countersignatory.
12463 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
12464 * as_holder_broadcastable and as_counterparty_broadcastable functions.
12466 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
12468 * A pointer to the opaque Rust object.
12469 * Nearly everywhere, inner must be non-null, however in places where
12470 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12472 LDKnativeDirectedChannelTransactionParameters *inner;
12474 * Indicates that this is the only struct which contains the same pointer.
12475 * Rust functions which take ownership of an object provided via an argument require
12476 * this to be true and invalidate the object pointed to by inner.
12479 } LDKDirectedChannelTransactionParameters;
12482 * Integer in the range `0..=16`
12484 typedef struct LDKWitnessVersion {
12486 } LDKWitnessVersion;
12491 * A read-only view of [`NetworkGraph`].
12493 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
12495 * A pointer to the opaque Rust object.
12496 * Nearly everywhere, inner must be non-null, however in places where
12497 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12499 LDKnativeReadOnlyNetworkGraph *inner;
12501 * Indicates that this is the only struct which contains the same pointer.
12502 * Rust functions which take ownership of an object provided via an argument require
12503 * this to be true and invalidate the object pointed to by inner.
12506 } LDKReadOnlyNetworkGraph;
12511 * Receives and validates network updates from peers,
12512 * stores authentic and relevant data as a network graph.
12513 * This network graph is then used for routing payments.
12514 * Provides interface to help with initial routing sync by
12515 * serving historical announcements.
12517 * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the
12518 * [`NetworkGraph`].
12520 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
12522 * A pointer to the opaque Rust object.
12523 * Nearly everywhere, inner must be non-null, however in places where
12524 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12526 LDKnativeP2PGossipSync *inner;
12528 * Indicates that this is the only struct which contains the same pointer.
12529 * Rust functions which take ownership of an object provided via an argument require
12530 * this to be true and invalidate the object pointed to by inner.
12533 } LDKP2PGossipSync;
12538 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
12539 * source node to a target node.
12541 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
12543 * A pointer to the opaque Rust object.
12544 * Nearly everywhere, inner must be non-null, however in places where
12545 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12547 LDKnativeDirectedChannelInfo *inner;
12549 * Indicates that this is the only struct which contains the same pointer.
12550 * Rust functions which take ownership of an object provided via an argument require
12551 * this to be true and invalidate the object pointed to by inner.
12554 } LDKDirectedChannelInfo;
12557 * The effective capacity of a channel for routing purposes.
12559 * While this may be smaller than the actual channel capacity, amounts greater than
12560 * [`Self::as_msat`] should not be routed through the channel.
12562 typedef enum LDKEffectiveCapacity_Tag {
12564 * The available liquidity in the channel known from being a channel counterparty, and thus a
12567 LDKEffectiveCapacity_ExactLiquidity,
12569 * The maximum HTLC amount in one direction as advertised on the gossip network.
12571 LDKEffectiveCapacity_MaximumHTLC,
12573 * The total capacity of the channel as determined by the funding transaction.
12575 LDKEffectiveCapacity_Total,
12577 * A capacity sufficient to route any payment, typically used for private channels provided by
12580 LDKEffectiveCapacity_Infinite,
12582 * A capacity that is unknown possibly because either the chain state is unavailable to know
12583 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
12585 LDKEffectiveCapacity_Unknown,
12587 * Must be last for serialization purposes
12589 LDKEffectiveCapacity_Sentinel,
12590 } LDKEffectiveCapacity_Tag;
12592 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
12594 * Either the inbound or outbound liquidity depending on the direction, denominated in
12597 uint64_t liquidity_msat;
12598 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
12600 typedef struct LDKEffectiveCapacity_LDKMaximumHTLC_Body {
12602 * The maximum HTLC amount denominated in millisatoshi.
12604 uint64_t amount_msat;
12605 } LDKEffectiveCapacity_LDKMaximumHTLC_Body;
12607 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
12609 * The funding amount denominated in millisatoshi.
12611 uint64_t capacity_msat;
12613 * The maximum HTLC amount denominated in millisatoshi.
12615 struct LDKCOption_u64Z htlc_maximum_msat;
12616 } LDKEffectiveCapacity_LDKTotal_Body;
12618 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
12619 LDKEffectiveCapacity_Tag tag;
12621 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
12622 LDKEffectiveCapacity_LDKMaximumHTLC_Body maximum_htlc;
12623 LDKEffectiveCapacity_LDKTotal_Body total;
12625 } LDKEffectiveCapacity;
12628 * A scorer that is accessed under a lock.
12630 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
12631 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
12632 * implementations. Internal locking would be detrimental to route finding performance and could
12633 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
12635 * [`find_route`]: crate::routing::router::find_route
12637 typedef struct LDKLockableScore {
12639 * An opaque pointer which is passed to your function implementations as an argument.
12640 * This has no meaning in the LDK, and can be NULL or any other value.
12644 * Returns the locked scorer.
12646 struct LDKScore (*lock)(const void *this_arg);
12648 * Frees any resources associated with this object given its this_arg pointer.
12649 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12651 void (*free)(void *this_arg);
12652 } LDKLockableScore;
12657 * Parameters for configuring [`ProbabilisticScorer`].
12659 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
12660 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
12662 * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
12665 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringParameters {
12667 * A pointer to the opaque Rust object.
12668 * Nearly everywhere, inner must be non-null, however in places where
12669 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12671 LDKnativeProbabilisticScoringParameters *inner;
12673 * Indicates that this is the only struct which contains the same pointer.
12674 * Rust functions which take ownership of an object provided via an argument require
12675 * this to be true and invalidate the object pointed to by inner.
12678 } LDKProbabilisticScoringParameters;
12683 * FilesystemPersister persists channel data on disk, where each channel's
12684 * data is stored in a file named after its funding outpoint.
12686 * Warning: this module does the best it can with calls to persist data, but it
12687 * can only guarantee that the data is passed to the drive. It is up to the
12688 * drive manufacturers to do the actual persistence properly, which they often
12689 * don't (especially on consumer-grade hardware). Therefore, it is up to the
12690 * user to validate their entire storage stack, to ensure the writes are
12692 * Corollary: especially when dealing with larger amounts of money, it is best
12693 * practice to have multiple channel data backups and not rely only on one
12694 * FilesystemPersister.
12696 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
12698 * A pointer to the opaque Rust object.
12699 * Nearly everywhere, inner must be non-null, however in places where
12700 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12702 LDKnativeFilesystemPersister *inner;
12704 * Indicates that this is the only struct which contains the same pointer.
12705 * Rust functions which take ownership of an object provided via an argument require
12706 * this to be true and invalidate the object pointed to by inner.
12709 } LDKFilesystemPersister;
12714 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
12715 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
12716 * responsibilities are:
12717 * * Processing [`Event`]s with a user-provided [`EventHandler`].
12718 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
12719 * writing it to disk/backups by invoking the callback given to it at startup.
12720 * [`ChannelManager`] persistence should be done in the background.
12721 * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
12722 * at the appropriate intervals.
12723 * * Calling [`NetworkGraph::remove_stale_channels`] (if a [`GossipSync`] with a [`NetworkGraph`]
12724 * is provided to [`BackgroundProcessor::start`]).
12726 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
12727 * upon as doing so may result in high latency.
12731 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
12732 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
12733 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
12734 * unilateral chain closure fees are at risk.
12736 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
12737 * [`Event`]: lightning::util::events::Event
12738 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
12740 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
12742 * A pointer to the opaque Rust object.
12743 * Nearly everywhere, inner must be non-null, however in places where
12744 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12746 LDKnativeBackgroundProcessor *inner;
12748 * Indicates that this is the only struct which contains the same pointer.
12749 * Rust functions which take ownership of an object provided via an argument require
12750 * this to be true and invalidate the object pointed to by inner.
12753 } LDKBackgroundProcessor;
12758 * Rapid Gossip Sync struct
12759 * See [crate-level documentation] for usage.
12761 * [crate-level documentation]: crate
12763 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
12765 * A pointer to the opaque Rust object.
12766 * Nearly everywhere, inner must be non-null, however in places where
12767 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12769 LDKnativeRapidGossipSync *inner;
12771 * Indicates that this is the only struct which contains the same pointer.
12772 * Rust functions which take ownership of an object provided via an argument require
12773 * this to be true and invalidate the object pointed to by inner.
12776 } LDKRapidGossipSync;
12779 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
12781 typedef enum LDKGossipSync_Tag {
12783 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
12787 * Rapid gossip sync from a trusted server.
12789 LDKGossipSync_Rapid,
12793 LDKGossipSync_None,
12795 * Must be last for serialization purposes
12797 LDKGossipSync_Sentinel,
12798 } LDKGossipSync_Tag;
12800 typedef struct MUST_USE_STRUCT LDKGossipSync {
12801 LDKGossipSync_Tag tag;
12805 * Note that this field is expected to be a reference.
12807 struct LDKP2PGossipSync p2p;
12811 * Note that this field is expected to be a reference.
12813 struct LDKRapidGossipSync rapid;
12821 * Data of the `RawInvoice` that is encoded in the data part
12823 typedef struct MUST_USE_STRUCT LDKRawDataPart {
12825 * A pointer to the opaque Rust object.
12826 * Nearly everywhere, inner must be non-null, however in places where
12827 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12829 LDKnativeRawDataPart *inner;
12831 * Indicates that this is the only struct which contains the same pointer.
12832 * Rust functions which take ownership of an object provided via an argument require
12833 * this to be true and invalidate the object pointed to by inner.
12843 typedef struct MUST_USE_STRUCT LDKSha256 {
12845 * A pointer to the opaque Rust object.
12846 * Nearly everywhere, inner must be non-null, however in places where
12847 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12849 LDKnativeSha256 *inner;
12851 * Indicates that this is the only struct which contains the same pointer.
12852 * Rust functions which take ownership of an object provided via an argument require
12853 * this to be true and invalidate the object pointed to by inner.
12861 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
12864 typedef struct MUST_USE_STRUCT LDKExpiryTime {
12866 * A pointer to the opaque Rust object.
12867 * Nearly everywhere, inner must be non-null, however in places where
12868 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12870 LDKnativeExpiryTime *inner;
12872 * Indicates that this is the only struct which contains the same pointer.
12873 * Rust functions which take ownership of an object provided via an argument require
12874 * this to be true and invalidate the object pointed to by inner.
12882 * `min_final_cltv_expiry` to use for the last HTLC in the route
12884 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiry {
12886 * A pointer to the opaque Rust object.
12887 * Nearly everywhere, inner must be non-null, however in places where
12888 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12890 LDKnativeMinFinalCltvExpiry *inner;
12892 * Indicates that this is the only struct which contains the same pointer.
12893 * Rust functions which take ownership of an object provided via an argument require
12894 * this to be true and invalidate the object pointed to by inner.
12897 } LDKMinFinalCltvExpiry;
12900 * A 20-byte byte array.
12902 typedef struct LDKTwentyBytes {
12910 * Fallback address in case no LN payment is possible
12912 typedef enum LDKFallback_Tag {
12913 LDKFallback_SegWitProgram,
12914 LDKFallback_PubKeyHash,
12915 LDKFallback_ScriptHash,
12917 * Must be last for serialization purposes
12919 LDKFallback_Sentinel,
12922 typedef struct LDKFallback_LDKSegWitProgram_Body {
12923 struct LDKu5 version;
12924 struct LDKCVec_u8Z program;
12925 } LDKFallback_LDKSegWitProgram_Body;
12927 typedef struct MUST_USE_STRUCT LDKFallback {
12928 LDKFallback_Tag tag;
12930 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
12932 struct LDKTwentyBytes pub_key_hash;
12935 struct LDKTwentyBytes script_hash;
12941 * A trait defining behavior of an [`Invoice`] payer.
12943 typedef struct LDKPayer {
12945 * An opaque pointer which is passed to your function implementations as an argument.
12946 * This has no meaning in the LDK, and can be NULL or any other value.
12950 * Returns the payer's node id.
12952 struct LDKPublicKey (*node_id)(const void *this_arg);
12954 * Returns the payer's channels.
12956 struct LDKCVec_ChannelDetailsZ (*first_hops)(const void *this_arg);
12958 * Sends a payment over the Lightning Network using the given [`Route`].
12960 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
12962 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
12964 * Sends a spontaneous payment over the Lightning Network using the given [`Route`].
12966 struct LDKCResult_PaymentIdPaymentSendFailureZ (*send_spontaneous_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage);
12968 * Retries a failed payment path for the [`PaymentId`] using the given [`Route`].
12970 struct LDKCResult_NonePaymentSendFailureZ (*retry_payment)(const void *this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id);
12972 * Signals that no further retries for the given payment will occur.
12974 void (*abandon_payment)(const void *this_arg, struct LDKThirtyTwoBytes payment_id);
12976 * Frees any resources associated with this object given its this_arg pointer.
12977 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12979 void (*free)(void *this_arg);
12983 * A trait defining behavior for routing an [`Invoice`] payment.
12985 typedef struct LDKRouter {
12987 * An opaque pointer which is passed to your function implementations as an argument.
12988 * This has no meaning in the LDK, and can be NULL or any other value.
12992 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
12994 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
12996 struct LDKCResult_RouteLightningErrorZ (*find_route)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, const uint8_t (*payment_hash)[32], struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKScore *NONNULL_PTR scorer);
12998 * Frees any resources associated with this object given its this_arg pointer.
12999 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13001 void (*free)(void *this_arg);
13007 * A utility for paying [`Invoice`]s and sending spontaneous payments.
13009 * See [module-level documentation] for details.
13011 * [module-level documentation]: crate::payment
13013 typedef struct MUST_USE_STRUCT LDKInvoicePayer {
13015 * A pointer to the opaque Rust object.
13016 * Nearly everywhere, inner must be non-null, however in places where
13017 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13019 LDKnativeInvoicePayer *inner;
13021 * Indicates that this is the only struct which contains the same pointer.
13022 * Rust functions which take ownership of an object provided via an argument require
13023 * this to be true and invalidate the object pointed to by inner.
13029 * Strategies available to retry payment path failures for an [`Invoice`].
13032 typedef enum LDKRetry_Tag {
13034 * Max number of attempts to retry payment.
13036 * Note that this is the number of *path* failures, not full payment retries. For multi-path
13037 * payments, if this is less than the total number of paths, we will never even retry all of the
13042 * Time elapsed before abandoning retries for a payment.
13046 * Must be last for serialization purposes
13051 typedef struct MUST_USE_STRUCT LDKRetry {
13055 uintptr_t attempts;
13066 * A [`Router`] implemented using [`find_route`].
13068 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
13070 * A pointer to the opaque Rust object.
13071 * Nearly everywhere, inner must be non-null, however in places where
13072 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13074 LDKnativeDefaultRouter *inner;
13076 * Indicates that this is the only struct which contains the same pointer.
13077 * Rust functions which take ownership of an object provided via an argument require
13078 * this to be true and invalidate the object pointed to by inner.
13081 } LDKDefaultRouter;
13083 extern const uintptr_t MAX_BUF_SIZE;
13085 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
13087 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
13089 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
13091 extern const uint32_t ANTI_REORG_DELAY;
13093 extern const uint16_t BREAKDOWN_TIMEOUT;
13095 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
13097 extern const uint32_t MIN_FINAL_CLTV_EXPIRY;
13099 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
13101 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
13103 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
13105 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
13107 extern const uint64_t MAX_TIMESTAMP;
13109 extern const uint64_t DEFAULT_EXPIRY_TIME;
13111 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY;
13113 extern const uint8_t TAG_PAYMENT_HASH;
13115 extern const uint8_t TAG_DESCRIPTION;
13117 extern const uint8_t TAG_PAYEE_PUB_KEY;
13119 extern const uint8_t TAG_DESCRIPTION_HASH;
13121 extern const uint8_t TAG_EXPIRY_TIME;
13123 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY;
13125 extern const uint8_t TAG_FALLBACK;
13127 extern const uint8_t TAG_PRIVATE_ROUTE;
13129 extern const uint8_t TAG_PAYMENT_SECRET;
13131 extern const uint8_t TAG_FEATURES;
13133 struct LDKStr _ldk_get_compiled_version(void);
13135 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
13138 * Creates a new Bech32Error which has the same data as `orig`
13140 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
13143 * Releases any memory held by the given `Bech32Error` (which is currently none)
13145 void Bech32Error_free(struct LDKBech32Error o);
13148 * Frees the data buffer, if data_is_owned is set and datalen > 0.
13150 void Transaction_free(struct LDKTransaction _res);
13153 * Convenience function for constructing a new TxOut
13155 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
13158 * Frees the data pointed to by script_pubkey.
13160 void TxOut_free(struct LDKTxOut _res);
13163 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
13165 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
13168 * Frees the data buffer, if chars_is_owned is set and len > 0.
13170 void Str_free(struct LDKStr _res);
13172 #if defined(LDK_DEBUG_BUILD)
13174 * This function exists for memory safety testing purposes. It should never be used in production
13177 const void *__unmangle_inner_ptr(const void *ptr);
13181 * Creates a new CResult_NoneNoneZ in the success state.
13183 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
13186 * Creates a new CResult_NoneNoneZ in the error state.
13188 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
13191 * Checks if the given object is currently in the success state
13193 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
13196 * Frees any resources used by the CResult_NoneNoneZ.
13198 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
13201 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
13202 * but with all dynamically-allocated buffers duplicated in new buffers.
13204 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
13207 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
13209 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
13212 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
13214 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
13217 * Checks if the given object is currently in the success state
13219 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
13222 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
13224 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
13227 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
13228 * but with all dynamically-allocated buffers duplicated in new buffers.
13230 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
13233 * Creates a new CResult_SecretKeyErrorZ in the success state.
13235 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o);
13238 * Creates a new CResult_SecretKeyErrorZ in the error state.
13240 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e);
13243 * Checks if the given object is currently in the success state
13245 bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o);
13248 * Frees any resources used by the CResult_SecretKeyErrorZ.
13250 void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res);
13253 * Creates a new CResult_SecretKeyErrorZ which has the same data as `orig`
13254 * but with all dynamically-allocated buffers duplicated in new buffers.
13256 struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_clone(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR orig);
13259 * Creates a new CResult_PublicKeyErrorZ in the success state.
13261 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
13264 * Creates a new CResult_PublicKeyErrorZ in the error state.
13266 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
13269 * Checks if the given object is currently in the success state
13271 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
13274 * Frees any resources used by the CResult_PublicKeyErrorZ.
13276 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
13279 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
13280 * but with all dynamically-allocated buffers duplicated in new buffers.
13282 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
13285 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
13287 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
13290 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
13292 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
13295 * Checks if the given object is currently in the success state
13297 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
13300 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
13302 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
13305 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
13306 * but with all dynamically-allocated buffers duplicated in new buffers.
13308 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
13311 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
13313 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
13316 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
13318 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
13321 * Checks if the given object is currently in the success state
13323 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
13326 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
13328 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
13331 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
13332 * but with all dynamically-allocated buffers duplicated in new buffers.
13334 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
13337 * Creates a new CResult_TxCreationKeysErrorZ in the success state.
13339 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o);
13342 * Creates a new CResult_TxCreationKeysErrorZ in the error state.
13344 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e);
13347 * Checks if the given object is currently in the success state
13349 bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o);
13352 * Frees any resources used by the CResult_TxCreationKeysErrorZ.
13354 void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res);
13357 * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig`
13358 * but with all dynamically-allocated buffers duplicated in new buffers.
13360 struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig);
13363 * Constructs a new COption_u32Z containing a u32
13365 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
13368 * Constructs a new COption_u32Z containing nothing
13370 struct LDKCOption_u32Z COption_u32Z_none(void);
13373 * Frees any resources associated with the u32, if we are in the Some state
13375 void COption_u32Z_free(struct LDKCOption_u32Z _res);
13378 * Creates a new COption_u32Z which has the same data as `orig`
13379 * but with all dynamically-allocated buffers duplicated in new buffers.
13381 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
13384 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
13386 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
13389 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
13391 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
13394 * Checks if the given object is currently in the success state
13396 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
13399 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
13401 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
13404 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
13405 * but with all dynamically-allocated buffers duplicated in new buffers.
13407 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
13410 * Constructs a new COption_NoneZ containing a
13412 enum LDKCOption_NoneZ COption_NoneZ_some(void);
13415 * Constructs a new COption_NoneZ containing nothing
13417 enum LDKCOption_NoneZ COption_NoneZ_none(void);
13420 * Frees any resources associated with the , if we are in the Some state
13422 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
13425 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
13427 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
13430 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
13432 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
13435 * Checks if the given object is currently in the success state
13437 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
13440 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
13442 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
13445 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
13446 * but with all dynamically-allocated buffers duplicated in new buffers.
13448 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
13451 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
13453 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
13456 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
13458 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
13461 * Checks if the given object is currently in the success state
13463 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
13466 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
13468 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
13471 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
13472 * but with all dynamically-allocated buffers duplicated in new buffers.
13474 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
13477 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13479 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
13482 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
13484 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
13487 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
13489 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13492 * Checks if the given object is currently in the success state
13494 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13497 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
13499 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
13502 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
13503 * but with all dynamically-allocated buffers duplicated in new buffers.
13505 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13508 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
13510 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
13513 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
13515 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13518 * Checks if the given object is currently in the success state
13520 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13523 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
13525 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
13528 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
13529 * but with all dynamically-allocated buffers duplicated in new buffers.
13531 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13534 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
13536 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
13539 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
13541 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
13544 * Checks if the given object is currently in the success state
13546 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
13549 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
13551 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
13554 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
13556 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
13559 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
13561 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
13564 * Checks if the given object is currently in the success state
13566 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
13569 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
13571 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
13574 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
13575 * but with all dynamically-allocated buffers duplicated in new buffers.
13577 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
13580 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
13582 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
13585 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
13587 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
13590 * Checks if the given object is currently in the success state
13592 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
13595 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
13597 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
13600 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
13602 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
13605 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
13607 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
13610 * Checks if the given object is currently in the success state
13612 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
13615 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
13617 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
13620 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
13621 * but with all dynamically-allocated buffers duplicated in new buffers.
13623 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
13626 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
13628 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
13631 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
13633 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
13636 * Checks if the given object is currently in the success state
13638 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
13641 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
13643 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
13646 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
13647 * but with all dynamically-allocated buffers duplicated in new buffers.
13649 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
13652 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
13654 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
13657 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
13659 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
13662 * Checks if the given object is currently in the success state
13664 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
13667 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
13669 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
13672 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
13673 * but with all dynamically-allocated buffers duplicated in new buffers.
13675 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
13678 * Creates a new CResult_NoneErrorZ in the success state.
13680 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
13683 * Creates a new CResult_NoneErrorZ in the error state.
13685 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
13688 * Checks if the given object is currently in the success state
13690 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
13693 * Frees any resources used by the CResult_NoneErrorZ.
13695 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
13698 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
13699 * but with all dynamically-allocated buffers duplicated in new buffers.
13701 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
13704 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
13706 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
13709 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
13711 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
13714 * Checks if the given object is currently in the success state
13716 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
13719 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
13721 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
13724 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
13725 * but with all dynamically-allocated buffers duplicated in new buffers.
13727 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
13730 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13732 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
13735 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13737 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
13740 * Creates a new CResult_RouteDecodeErrorZ in the success state.
13742 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
13745 * Creates a new CResult_RouteDecodeErrorZ in the error state.
13747 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
13750 * Checks if the given object is currently in the success state
13752 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
13755 * Frees any resources used by the CResult_RouteDecodeErrorZ.
13757 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
13760 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
13761 * but with all dynamically-allocated buffers duplicated in new buffers.
13763 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
13766 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
13768 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
13771 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
13773 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
13776 * Checks if the given object is currently in the success state
13778 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
13781 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
13783 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
13786 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
13787 * but with all dynamically-allocated buffers duplicated in new buffers.
13789 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
13792 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13794 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
13797 * Constructs a new COption_u64Z containing a u64
13799 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
13802 * Constructs a new COption_u64Z containing nothing
13804 struct LDKCOption_u64Z COption_u64Z_none(void);
13807 * Frees any resources associated with the u64, if we are in the Some state
13809 void COption_u64Z_free(struct LDKCOption_u64Z _res);
13812 * Creates a new COption_u64Z which has the same data as `orig`
13813 * but with all dynamically-allocated buffers duplicated in new buffers.
13815 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
13818 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13820 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
13823 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
13825 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
13828 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
13830 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
13833 * Checks if the given object is currently in the success state
13835 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
13838 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
13840 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
13843 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
13844 * but with all dynamically-allocated buffers duplicated in new buffers.
13846 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
13849 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13851 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
13854 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
13856 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
13859 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
13861 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
13864 * Checks if the given object is currently in the success state
13866 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
13869 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
13871 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
13874 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
13875 * but with all dynamically-allocated buffers duplicated in new buffers.
13877 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
13880 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
13882 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
13885 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
13887 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
13890 * Checks if the given object is currently in the success state
13892 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
13895 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
13897 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
13900 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
13901 * but with all dynamically-allocated buffers duplicated in new buffers.
13903 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
13906 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13908 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
13911 * Creates a new CResult_RouteLightningErrorZ in the success state.
13913 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
13916 * Creates a new CResult_RouteLightningErrorZ in the error state.
13918 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
13921 * Checks if the given object is currently in the success state
13923 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
13926 * Frees any resources used by the CResult_RouteLightningErrorZ.
13928 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
13931 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
13932 * but with all dynamically-allocated buffers duplicated in new buffers.
13934 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
13937 * Frees the buffer pointed to by `data` if `datalen` is non-0.
13939 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
13942 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
13944 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
13947 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
13949 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
13952 * Checks if the given object is currently in the success state
13954 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
13957 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
13959 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
13962 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
13963 * but with all dynamically-allocated buffers duplicated in new buffers.
13965 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
13968 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason
13970 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
13973 * Constructs a new COption_ClosureReasonZ containing nothing
13975 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
13978 * Frees any resources associated with the crate::lightning::util::events::ClosureReason, if we are in the Some state
13980 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
13983 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
13984 * but with all dynamically-allocated buffers duplicated in new buffers.
13986 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
13989 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
13991 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
13994 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
13996 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
13999 * Checks if the given object is currently in the success state
14001 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
14004 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
14006 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
14009 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
14010 * but with all dynamically-allocated buffers duplicated in new buffers.
14012 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
14015 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::util::events::HTLCDestination
14017 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
14020 * Constructs a new COption_HTLCDestinationZ containing nothing
14022 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
14025 * Frees any resources associated with the crate::lightning::util::events::HTLCDestination, if we are in the Some state
14027 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
14030 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
14031 * but with all dynamically-allocated buffers duplicated in new buffers.
14033 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
14036 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
14038 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
14041 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
14043 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
14046 * Checks if the given object is currently in the success state
14048 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
14051 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
14053 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
14056 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
14057 * but with all dynamically-allocated buffers duplicated in new buffers.
14059 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
14062 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
14064 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
14067 * Constructs a new COption_NetworkUpdateZ containing nothing
14069 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
14072 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
14074 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
14077 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
14078 * but with all dynamically-allocated buffers duplicated in new buffers.
14080 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
14083 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14085 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
14088 * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event
14090 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
14093 * Constructs a new COption_EventZ containing nothing
14095 struct LDKCOption_EventZ COption_EventZ_none(void);
14098 * Frees any resources associated with the crate::lightning::util::events::Event, if we are in the Some state
14100 void COption_EventZ_free(struct LDKCOption_EventZ _res);
14103 * Creates a new COption_EventZ which has the same data as `orig`
14104 * but with all dynamically-allocated buffers duplicated in new buffers.
14106 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
14109 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
14111 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
14114 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
14116 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
14119 * Checks if the given object is currently in the success state
14121 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
14124 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
14126 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
14129 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
14130 * but with all dynamically-allocated buffers duplicated in new buffers.
14132 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
14135 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14137 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
14140 * Creates a new CResult_TxOutAccessErrorZ in the success state.
14142 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o);
14145 * Creates a new CResult_TxOutAccessErrorZ in the error state.
14147 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e);
14150 * Checks if the given object is currently in the success state
14152 bool CResult_TxOutAccessErrorZ_is_ok(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR o);
14155 * Frees any resources used by the CResult_TxOutAccessErrorZ.
14157 void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res);
14160 * Creates a new CResult_TxOutAccessErrorZ which has the same data as `orig`
14161 * but with all dynamically-allocated buffers duplicated in new buffers.
14163 struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_clone(const struct LDKCResult_TxOutAccessErrorZ *NONNULL_PTR orig);
14166 * Creates a new tuple which has the same data as `orig`
14167 * but with all dynamically-allocated buffers duplicated in new buffers.
14169 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
14172 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
14174 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
14177 * Frees any resources used by the C2Tuple_usizeTransactionZ.
14179 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
14182 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14184 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
14187 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14189 void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
14192 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
14194 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
14197 * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
14199 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
14202 * Checks if the given object is currently in the success state
14204 bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o);
14207 * Frees any resources used by the CResult_NoneChannelMonitorUpdateErrZ.
14209 void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
14212 * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
14213 * but with all dynamically-allocated buffers duplicated in new buffers.
14215 struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
14218 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14220 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
14223 * Creates a new tuple which has the same data as `orig`
14224 * but with all dynamically-allocated buffers duplicated in new buffers.
14226 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
14229 * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
14231 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
14234 * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
14236 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
14239 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14241 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
14244 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing a crate::c_types::derived::C2Tuple_usizeTransactionZ
14246 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_some(struct LDKC2Tuple_usizeTransactionZ o);
14249 * Constructs a new COption_C2Tuple_usizeTransactionZZ containing nothing
14251 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_none(void);
14254 * Frees any resources associated with the crate::c_types::derived::C2Tuple_usizeTransactionZ, if we are in the Some state
14256 void COption_C2Tuple_usizeTransactionZZ_free(struct LDKCOption_C2Tuple_usizeTransactionZZ _res);
14259 * Creates a new COption_C2Tuple_usizeTransactionZZ which has the same data as `orig`
14260 * but with all dynamically-allocated buffers duplicated in new buffers.
14262 struct LDKCOption_C2Tuple_usizeTransactionZZ COption_C2Tuple_usizeTransactionZZ_clone(const struct LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR orig);
14265 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
14267 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
14270 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
14272 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
14275 * Checks if the given object is currently in the success state
14277 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
14280 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
14282 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
14285 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
14286 * but with all dynamically-allocated buffers duplicated in new buffers.
14288 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
14291 * Creates a new tuple which has the same data as `orig`
14292 * but with all dynamically-allocated buffers duplicated in new buffers.
14294 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
14297 * Creates a new C2Tuple_u64u64Z from the contained elements.
14299 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
14302 * Frees any resources used by the C2Tuple_u64u64Z.
14304 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
14307 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
14309 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
14312 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
14314 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
14317 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
14319 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
14322 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
14323 * but with all dynamically-allocated buffers duplicated in new buffers.
14325 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
14328 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14330 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
14333 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
14335 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
14338 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
14340 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
14343 * Checks if the given object is currently in the success state
14345 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
14348 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
14350 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
14353 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
14355 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
14358 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
14360 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14363 * Checks if the given object is currently in the success state
14365 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
14368 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
14370 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
14373 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
14374 * but with all dynamically-allocated buffers duplicated in new buffers.
14376 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
14379 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
14381 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
14384 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
14386 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14389 * Checks if the given object is currently in the success state
14391 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
14394 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
14396 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
14399 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
14400 * but with all dynamically-allocated buffers duplicated in new buffers.
14402 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
14405 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
14407 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
14410 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
14412 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14415 * Checks if the given object is currently in the success state
14417 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
14420 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
14422 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
14425 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
14426 * but with all dynamically-allocated buffers duplicated in new buffers.
14428 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
14431 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
14433 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
14436 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
14438 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14441 * Checks if the given object is currently in the success state
14443 bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
14446 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
14448 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
14451 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
14452 * but with all dynamically-allocated buffers duplicated in new buffers.
14454 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
14457 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
14459 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
14462 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
14464 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
14467 * Checks if the given object is currently in the success state
14469 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
14472 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
14474 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
14477 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
14478 * but with all dynamically-allocated buffers duplicated in new buffers.
14480 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
14483 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
14485 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
14488 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
14490 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
14493 * Checks if the given object is currently in the success state
14495 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
14498 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
14500 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
14503 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
14504 * but with all dynamically-allocated buffers duplicated in new buffers.
14506 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
14509 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
14511 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
14514 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
14516 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
14519 * Checks if the given object is currently in the success state
14521 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
14524 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
14526 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
14529 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
14530 * but with all dynamically-allocated buffers duplicated in new buffers.
14532 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
14535 * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access
14537 struct LDKCOption_AccessZ COption_AccessZ_some(struct LDKAccess o);
14540 * Constructs a new COption_AccessZ containing nothing
14542 struct LDKCOption_AccessZ COption_AccessZ_none(void);
14545 * Frees any resources associated with the crate::lightning::chain::Access, if we are in the Some state
14547 void COption_AccessZ_free(struct LDKCOption_AccessZ _res);
14550 * Creates a new CResult_boolLightningErrorZ in the success state.
14552 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
14555 * Creates a new CResult_boolLightningErrorZ in the error state.
14557 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
14560 * Checks if the given object is currently in the success state
14562 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
14565 * Frees any resources used by the CResult_boolLightningErrorZ.
14567 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
14570 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
14571 * but with all dynamically-allocated buffers duplicated in new buffers.
14573 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
14576 * Creates a new tuple which has the same data as `orig`
14577 * but with all dynamically-allocated buffers duplicated in new buffers.
14579 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
14582 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
14584 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
14587 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
14589 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
14592 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14594 void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
14597 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14599 void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res);
14602 * Creates a new CResult_NoneLightningErrorZ in the success state.
14604 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
14607 * Creates a new CResult_NoneLightningErrorZ in the error state.
14609 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
14612 * Checks if the given object is currently in the success state
14614 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
14617 * Frees any resources used by the CResult_NoneLightningErrorZ.
14619 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
14622 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
14623 * but with all dynamically-allocated buffers duplicated in new buffers.
14625 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
14628 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
14630 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
14633 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
14635 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
14638 * Checks if the given object is currently in the success state
14640 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
14643 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
14645 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
14648 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
14649 * but with all dynamically-allocated buffers duplicated in new buffers.
14651 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
14654 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
14656 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
14659 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
14661 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
14664 * Checks if the given object is currently in the success state
14666 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
14669 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
14671 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
14674 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
14675 * but with all dynamically-allocated buffers duplicated in new buffers.
14677 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
14680 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
14682 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
14685 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
14687 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
14690 * Checks if the given object is currently in the success state
14692 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
14695 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
14697 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
14700 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
14701 * but with all dynamically-allocated buffers duplicated in new buffers.
14703 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
14706 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14708 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
14711 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
14713 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
14716 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
14718 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
14721 * Checks if the given object is currently in the success state
14723 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
14726 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
14728 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
14731 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
14732 * but with all dynamically-allocated buffers duplicated in new buffers.
14734 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
14737 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
14739 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
14742 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
14744 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
14747 * Checks if the given object is currently in the success state
14749 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
14752 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
14754 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
14757 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
14758 * but with all dynamically-allocated buffers duplicated in new buffers.
14760 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
14763 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
14765 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
14768 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
14770 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
14773 * Checks if the given object is currently in the success state
14775 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
14778 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
14780 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
14783 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
14784 * but with all dynamically-allocated buffers duplicated in new buffers.
14786 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
14789 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
14791 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
14794 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
14796 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
14799 * Checks if the given object is currently in the success state
14801 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
14804 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
14806 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
14809 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
14811 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
14814 * Constructs a new COption_CVec_NetAddressZZ containing nothing
14816 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
14819 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
14821 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
14824 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
14825 * but with all dynamically-allocated buffers duplicated in new buffers.
14827 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
14830 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
14832 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
14835 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
14837 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14840 * Checks if the given object is currently in the success state
14842 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14845 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
14847 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
14850 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
14851 * but with all dynamically-allocated buffers duplicated in new buffers.
14853 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14856 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
14858 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
14861 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
14863 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14866 * Checks if the given object is currently in the success state
14868 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14871 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
14873 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
14876 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
14877 * but with all dynamically-allocated buffers duplicated in new buffers.
14879 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14882 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
14884 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
14887 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
14889 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
14892 * Checks if the given object is currently in the success state
14894 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
14897 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
14899 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
14902 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
14903 * but with all dynamically-allocated buffers duplicated in new buffers.
14905 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
14908 * Frees the buffer pointed to by `data` if `datalen` is non-0.
14910 void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res);
14913 * Creates a new tuple which has the same data as `orig`
14914 * but with all dynamically-allocated buffers duplicated in new buffers.
14916 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
14919 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
14921 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
14924 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
14926 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
14929 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
14931 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
14934 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
14936 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
14939 * Checks if the given object is currently in the success state
14941 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
14944 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
14946 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
14949 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
14950 * but with all dynamically-allocated buffers duplicated in new buffers.
14952 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
14955 * Creates a new CResult_SignatureNoneZ in the success state.
14957 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
14960 * Creates a new CResult_SignatureNoneZ in the error state.
14962 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
14965 * Checks if the given object is currently in the success state
14967 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
14970 * Frees any resources used by the CResult_SignatureNoneZ.
14972 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
14975 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
14976 * but with all dynamically-allocated buffers duplicated in new buffers.
14978 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
14981 * Creates a new tuple which has the same data as `orig`
14982 * but with all dynamically-allocated buffers duplicated in new buffers.
14984 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_clone(const struct LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR orig);
14987 * Creates a new C2Tuple_SignatureSignatureZ from the contained elements.
14989 struct LDKC2Tuple_SignatureSignatureZ C2Tuple_SignatureSignatureZ_new(struct LDKSignature a, struct LDKSignature b);
14992 * Frees any resources used by the C2Tuple_SignatureSignatureZ.
14994 void C2Tuple_SignatureSignatureZ_free(struct LDKC2Tuple_SignatureSignatureZ _res);
14997 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the success state.
14999 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_ok(struct LDKC2Tuple_SignatureSignatureZ o);
15002 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the error state.
15004 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_err(void);
15007 * Checks if the given object is currently in the success state
15009 bool CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR o);
15012 * Frees any resources used by the CResult_C2Tuple_SignatureSignatureZNoneZ.
15014 void CResult_C2Tuple_SignatureSignatureZNoneZ_free(struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res);
15017 * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ which has the same data as `orig`
15018 * but with all dynamically-allocated buffers duplicated in new buffers.
15020 struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ CResult_C2Tuple_SignatureSignatureZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR orig);
15023 * Creates a new CResult_SecretKeyNoneZ in the success state.
15025 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_ok(struct LDKSecretKey o);
15028 * Creates a new CResult_SecretKeyNoneZ in the error state.
15030 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_err(void);
15033 * Checks if the given object is currently in the success state
15035 bool CResult_SecretKeyNoneZ_is_ok(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR o);
15038 * Frees any resources used by the CResult_SecretKeyNoneZ.
15040 void CResult_SecretKeyNoneZ_free(struct LDKCResult_SecretKeyNoneZ _res);
15043 * Creates a new CResult_SecretKeyNoneZ which has the same data as `orig`
15044 * but with all dynamically-allocated buffers duplicated in new buffers.
15046 struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_clone(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR orig);
15049 * Creates a new CResult_SignDecodeErrorZ in the success state.
15051 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_ok(struct LDKSign o);
15054 * Creates a new CResult_SignDecodeErrorZ in the error state.
15056 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_err(struct LDKDecodeError e);
15059 * Checks if the given object is currently in the success state
15061 bool CResult_SignDecodeErrorZ_is_ok(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR o);
15064 * Frees any resources used by the CResult_SignDecodeErrorZ.
15066 void CResult_SignDecodeErrorZ_free(struct LDKCResult_SignDecodeErrorZ _res);
15069 * Creates a new CResult_SignDecodeErrorZ which has the same data as `orig`
15070 * but with all dynamically-allocated buffers duplicated in new buffers.
15072 struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig);
15075 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15077 void CVec_u5Z_free(struct LDKCVec_u5Z _res);
15080 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
15082 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
15085 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
15087 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
15090 * Checks if the given object is currently in the success state
15092 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
15095 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
15097 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
15100 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
15101 * but with all dynamically-allocated buffers duplicated in new buffers.
15103 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
15106 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15108 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
15111 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15113 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
15116 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
15118 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
15121 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
15123 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
15126 * Checks if the given object is currently in the success state
15128 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
15131 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
15133 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
15136 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
15137 * but with all dynamically-allocated buffers duplicated in new buffers.
15139 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
15142 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
15144 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
15147 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
15149 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
15152 * Checks if the given object is currently in the success state
15154 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
15157 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
15159 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
15162 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
15163 * but with all dynamically-allocated buffers duplicated in new buffers.
15165 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
15168 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15170 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
15173 * Creates a new CResult_TransactionNoneZ in the success state.
15175 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
15178 * Creates a new CResult_TransactionNoneZ in the error state.
15180 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
15183 * Checks if the given object is currently in the success state
15185 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
15188 * Frees any resources used by the CResult_TransactionNoneZ.
15190 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
15193 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
15194 * but with all dynamically-allocated buffers duplicated in new buffers.
15196 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
15199 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
15201 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
15204 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
15206 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
15209 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15211 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
15214 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
15216 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
15219 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
15221 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
15224 * Checks if the given object is currently in the success state
15226 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
15229 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
15231 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
15234 * Constructs a new COption_u16Z containing a u16
15236 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
15239 * Constructs a new COption_u16Z containing nothing
15241 struct LDKCOption_u16Z COption_u16Z_none(void);
15244 * Frees any resources associated with the u16, if we are in the Some state
15246 void COption_u16Z_free(struct LDKCOption_u16Z _res);
15249 * Creates a new COption_u16Z which has the same data as `orig`
15250 * but with all dynamically-allocated buffers duplicated in new buffers.
15252 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
15255 * Creates a new CResult_NoneAPIErrorZ in the success state.
15257 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
15260 * Creates a new CResult_NoneAPIErrorZ in the error state.
15262 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
15265 * Checks if the given object is currently in the success state
15267 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
15270 * Frees any resources used by the CResult_NoneAPIErrorZ.
15272 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
15275 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
15276 * but with all dynamically-allocated buffers duplicated in new buffers.
15278 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
15281 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15283 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
15286 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15288 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
15291 * Creates a new CResult__u832APIErrorZ in the success state.
15293 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
15296 * Creates a new CResult__u832APIErrorZ in the error state.
15298 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
15301 * Checks if the given object is currently in the success state
15303 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
15306 * Frees any resources used by the CResult__u832APIErrorZ.
15308 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
15311 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
15312 * but with all dynamically-allocated buffers duplicated in new buffers.
15314 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
15317 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state.
15319 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
15322 * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state.
15324 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
15327 * Checks if the given object is currently in the success state
15329 bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o);
15332 * Frees any resources used by the CResult_PaymentIdPaymentSendFailureZ.
15334 void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res);
15337 * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig`
15338 * but with all dynamically-allocated buffers duplicated in new buffers.
15340 struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig);
15343 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
15345 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
15348 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
15350 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
15353 * Checks if the given object is currently in the success state
15355 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
15358 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
15360 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
15363 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
15364 * but with all dynamically-allocated buffers duplicated in new buffers.
15366 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
15369 * Creates a new tuple which has the same data as `orig`
15370 * but with all dynamically-allocated buffers duplicated in new buffers.
15372 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
15375 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
15377 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
15380 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
15382 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
15385 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
15387 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
15390 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
15392 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
15395 * Checks if the given object is currently in the success state
15397 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
15400 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
15402 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
15405 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
15406 * but with all dynamically-allocated buffers duplicated in new buffers.
15408 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
15411 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15413 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
15416 * Creates a new tuple which has the same data as `orig`
15417 * but with all dynamically-allocated buffers duplicated in new buffers.
15419 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
15422 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
15424 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
15427 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
15429 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
15432 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
15434 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
15437 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
15439 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
15442 * Checks if the given object is currently in the success state
15444 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
15447 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
15449 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
15452 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
15453 * but with all dynamically-allocated buffers duplicated in new buffers.
15455 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
15458 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
15460 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
15463 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
15465 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
15468 * Checks if the given object is currently in the success state
15470 bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
15473 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
15475 void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
15478 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
15479 * but with all dynamically-allocated buffers duplicated in new buffers.
15481 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
15484 * Creates a new CResult_PaymentSecretNoneZ in the success state.
15486 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
15489 * Creates a new CResult_PaymentSecretNoneZ in the error state.
15491 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
15494 * Checks if the given object is currently in the success state
15496 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
15499 * Frees any resources used by the CResult_PaymentSecretNoneZ.
15501 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
15504 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
15505 * but with all dynamically-allocated buffers duplicated in new buffers.
15507 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
15510 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
15512 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
15515 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
15517 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
15520 * Checks if the given object is currently in the success state
15522 bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o);
15525 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
15527 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
15530 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
15531 * but with all dynamically-allocated buffers duplicated in new buffers.
15533 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
15536 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
15538 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
15541 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
15543 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
15546 * Checks if the given object is currently in the success state
15548 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
15551 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
15553 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
15556 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
15557 * but with all dynamically-allocated buffers duplicated in new buffers.
15559 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
15562 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
15564 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
15567 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
15569 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
15572 * Checks if the given object is currently in the success state
15574 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
15577 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
15579 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
15582 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
15583 * but with all dynamically-allocated buffers duplicated in new buffers.
15585 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
15588 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
15590 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
15593 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
15595 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
15598 * Checks if the given object is currently in the success state
15600 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
15603 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
15605 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
15608 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
15609 * but with all dynamically-allocated buffers duplicated in new buffers.
15611 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
15614 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
15616 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
15619 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
15621 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
15624 * Checks if the given object is currently in the success state
15626 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
15629 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
15631 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
15634 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
15635 * but with all dynamically-allocated buffers duplicated in new buffers.
15637 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
15640 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
15642 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
15645 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
15647 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
15650 * Checks if the given object is currently in the success state
15652 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
15655 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
15657 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
15660 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
15661 * but with all dynamically-allocated buffers duplicated in new buffers.
15663 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
15666 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15668 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
15671 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
15673 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
15676 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
15678 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
15681 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
15683 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
15686 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
15688 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
15691 * Checks if the given object is currently in the success state
15693 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
15696 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
15698 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
15701 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
15703 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
15706 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
15708 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
15711 * Checks if the given object is currently in the success state
15713 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
15716 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
15718 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
15721 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
15722 * but with all dynamically-allocated buffers duplicated in new buffers.
15724 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
15727 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
15729 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
15732 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
15734 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
15737 * Checks if the given object is currently in the success state
15739 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
15742 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
15744 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
15747 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
15748 * but with all dynamically-allocated buffers duplicated in new buffers.
15750 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
15753 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
15755 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
15758 * Constructs a new COption_TypeZ containing nothing
15760 struct LDKCOption_TypeZ COption_TypeZ_none(void);
15763 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
15765 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
15768 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
15770 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
15773 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
15775 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
15778 * Checks if the given object is currently in the success state
15780 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
15783 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
15785 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
15788 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
15790 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
15793 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
15795 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
15798 * Checks if the given object is currently in the success state
15800 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
15803 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
15805 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
15808 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
15809 * but with all dynamically-allocated buffers duplicated in new buffers.
15811 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
15814 * Creates a new CResult_SiPrefixParseErrorZ in the success state.
15816 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o);
15819 * Creates a new CResult_SiPrefixParseErrorZ in the error state.
15821 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e);
15824 * Checks if the given object is currently in the success state
15826 bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o);
15829 * Frees any resources used by the CResult_SiPrefixParseErrorZ.
15831 void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res);
15834 * Creates a new CResult_SiPrefixParseErrorZ which has the same data as `orig`
15835 * but with all dynamically-allocated buffers duplicated in new buffers.
15837 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig);
15840 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the success state.
15842 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o);
15845 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the error state.
15847 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
15850 * Checks if the given object is currently in the success state
15852 bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
15855 * Frees any resources used by the CResult_InvoiceParseOrSemanticErrorZ.
15857 void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res);
15860 * Creates a new CResult_InvoiceParseOrSemanticErrorZ which has the same data as `orig`
15861 * but with all dynamically-allocated buffers duplicated in new buffers.
15863 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
15866 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the success state.
15868 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o);
15871 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the error state.
15873 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e);
15876 * Checks if the given object is currently in the success state
15878 bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o);
15881 * Frees any resources used by the CResult_SignedRawInvoiceParseErrorZ.
15883 void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res);
15886 * Creates a new CResult_SignedRawInvoiceParseErrorZ which has the same data as `orig`
15887 * but with all dynamically-allocated buffers duplicated in new buffers.
15889 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig);
15892 * Creates a new tuple which has the same data as `orig`
15893 * but with all dynamically-allocated buffers duplicated in new buffers.
15895 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
15898 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
15900 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
15903 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
15905 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
15908 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
15910 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
15913 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
15915 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
15918 * Checks if the given object is currently in the success state
15920 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
15923 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
15925 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
15928 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
15929 * but with all dynamically-allocated buffers duplicated in new buffers.
15931 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
15934 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15936 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
15939 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
15941 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
15944 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
15946 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
15949 * Checks if the given object is currently in the success state
15951 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
15954 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
15956 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
15959 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
15960 * but with all dynamically-allocated buffers duplicated in new buffers.
15962 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
15965 * Creates a new CResult_NoneSemanticErrorZ in the success state.
15967 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
15970 * Creates a new CResult_NoneSemanticErrorZ in the error state.
15972 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
15975 * Checks if the given object is currently in the success state
15977 bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o);
15980 * Frees any resources used by the CResult_NoneSemanticErrorZ.
15982 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
15985 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
15986 * but with all dynamically-allocated buffers duplicated in new buffers.
15988 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
15991 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
15993 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
15996 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
15998 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
16001 * Checks if the given object is currently in the success state
16003 bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o);
16006 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
16008 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
16011 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
16012 * but with all dynamically-allocated buffers duplicated in new buffers.
16014 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
16017 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
16019 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
16022 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
16024 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
16027 * Checks if the given object is currently in the success state
16029 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
16032 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
16034 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
16037 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
16038 * but with all dynamically-allocated buffers duplicated in new buffers.
16040 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
16043 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
16045 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
16048 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
16050 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
16053 * Checks if the given object is currently in the success state
16055 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
16058 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
16060 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
16063 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
16064 * but with all dynamically-allocated buffers duplicated in new buffers.
16066 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
16069 * Creates a new CResult_StringErrorZ in the success state.
16071 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
16074 * Creates a new CResult_StringErrorZ in the error state.
16076 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
16079 * Checks if the given object is currently in the success state
16081 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
16084 * Frees any resources used by the CResult_StringErrorZ.
16086 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
16089 * Creates a new CResult_StringErrorZ which has the same data as `orig`
16090 * but with all dynamically-allocated buffers duplicated in new buffers.
16092 struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig);
16095 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
16097 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
16100 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
16102 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16105 * Checks if the given object is currently in the success state
16107 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
16110 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
16112 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
16115 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
16116 * but with all dynamically-allocated buffers duplicated in new buffers.
16118 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
16121 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
16123 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
16126 * Constructs a new COption_MonitorEventZ containing nothing
16128 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
16131 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
16133 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
16136 * Creates a new COption_MonitorEventZ which has the same data as `orig`
16137 * but with all dynamically-allocated buffers duplicated in new buffers.
16139 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
16142 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
16144 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
16147 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
16149 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
16152 * Checks if the given object is currently in the success state
16154 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
16157 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
16159 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
16162 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
16163 * but with all dynamically-allocated buffers duplicated in new buffers.
16165 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
16168 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
16170 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
16173 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
16175 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
16178 * Checks if the given object is currently in the success state
16180 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
16183 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
16185 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
16188 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
16189 * but with all dynamically-allocated buffers duplicated in new buffers.
16191 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
16194 * Creates a new tuple which has the same data as `orig`
16195 * but with all dynamically-allocated buffers duplicated in new buffers.
16197 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
16200 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
16202 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
16205 * Frees any resources used by the C2Tuple_OutPointScriptZ.
16207 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
16210 * Creates a new tuple which has the same data as `orig`
16211 * but with all dynamically-allocated buffers duplicated in new buffers.
16213 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
16216 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
16218 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
16221 * Frees any resources used by the C2Tuple_u32ScriptZ.
16223 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
16226 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16228 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
16231 * Creates a new tuple which has the same data as `orig`
16232 * but with all dynamically-allocated buffers duplicated in new buffers.
16234 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
16237 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
16239 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
16242 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
16244 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
16247 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16249 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
16252 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16254 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
16257 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16259 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
16262 * Creates a new tuple which has the same data as `orig`
16263 * but with all dynamically-allocated buffers duplicated in new buffers.
16265 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
16268 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
16270 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
16273 * Frees any resources used by the C2Tuple_u32TxOutZ.
16275 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
16278 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16280 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
16283 * Creates a new tuple which has the same data as `orig`
16284 * but with all dynamically-allocated buffers duplicated in new buffers.
16286 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
16289 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
16291 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
16294 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
16296 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
16299 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16301 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
16304 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16306 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
16309 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
16311 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
16314 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
16316 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
16319 * Checks if the given object is currently in the success state
16321 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
16324 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
16326 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
16329 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
16331 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
16334 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
16336 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
16339 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16341 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
16344 * Constructs a new COption_NetAddressZ containing a crate::lightning::ln::msgs::NetAddress
16346 struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o);
16349 * Constructs a new COption_NetAddressZ containing nothing
16351 struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void);
16354 * Frees any resources associated with the crate::lightning::ln::msgs::NetAddress, if we are in the Some state
16356 void COption_NetAddressZ_free(struct LDKCOption_NetAddressZ _res);
16359 * Creates a new COption_NetAddressZ which has the same data as `orig`
16360 * but with all dynamically-allocated buffers duplicated in new buffers.
16362 struct LDKCOption_NetAddressZ COption_NetAddressZ_clone(const struct LDKCOption_NetAddressZ *NONNULL_PTR orig);
16365 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
16367 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
16370 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
16372 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
16375 * Checks if the given object is currently in the success state
16377 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
16380 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
16382 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
16385 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
16386 * but with all dynamically-allocated buffers duplicated in new buffers.
16388 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
16391 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
16393 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
16396 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
16398 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
16401 * Checks if the given object is currently in the success state
16403 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
16406 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
16408 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
16411 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
16412 * but with all dynamically-allocated buffers duplicated in new buffers.
16414 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
16417 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
16419 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
16422 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
16424 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
16427 * Checks if the given object is currently in the success state
16429 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
16432 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
16434 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
16437 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
16438 * but with all dynamically-allocated buffers duplicated in new buffers.
16440 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
16443 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
16445 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
16448 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
16450 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
16453 * Checks if the given object is currently in the success state
16455 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
16458 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
16460 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
16463 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
16465 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
16468 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
16470 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
16473 * Checks if the given object is currently in the success state
16475 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
16478 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
16480 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
16483 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
16484 * but with all dynamically-allocated buffers duplicated in new buffers.
16486 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
16489 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16491 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
16494 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16496 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
16499 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16501 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
16504 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16506 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
16509 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
16511 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
16514 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
16516 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
16519 * Checks if the given object is currently in the success state
16521 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
16524 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
16526 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
16529 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
16530 * but with all dynamically-allocated buffers duplicated in new buffers.
16532 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
16535 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
16537 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
16540 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
16542 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
16545 * Checks if the given object is currently in the success state
16547 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
16550 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
16552 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
16555 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
16556 * but with all dynamically-allocated buffers duplicated in new buffers.
16558 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
16561 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
16563 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
16566 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
16568 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
16571 * Checks if the given object is currently in the success state
16573 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
16576 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
16578 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
16581 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
16582 * but with all dynamically-allocated buffers duplicated in new buffers.
16584 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
16587 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
16589 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
16592 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
16594 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
16597 * Checks if the given object is currently in the success state
16599 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
16602 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
16604 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
16607 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
16608 * but with all dynamically-allocated buffers duplicated in new buffers.
16610 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
16613 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
16615 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
16618 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
16620 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
16623 * Checks if the given object is currently in the success state
16625 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
16628 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
16630 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
16633 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
16634 * but with all dynamically-allocated buffers duplicated in new buffers.
16636 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
16639 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
16641 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
16644 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
16646 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
16649 * Checks if the given object is currently in the success state
16651 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
16654 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
16656 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
16659 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
16660 * but with all dynamically-allocated buffers duplicated in new buffers.
16662 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
16665 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
16667 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
16670 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
16672 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
16675 * Checks if the given object is currently in the success state
16677 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
16680 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
16682 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
16685 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
16686 * but with all dynamically-allocated buffers duplicated in new buffers.
16688 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
16691 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
16693 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
16696 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
16698 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
16701 * Checks if the given object is currently in the success state
16703 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
16706 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
16708 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
16711 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
16712 * but with all dynamically-allocated buffers duplicated in new buffers.
16714 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
16717 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
16719 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
16722 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
16724 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
16727 * Checks if the given object is currently in the success state
16729 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
16732 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
16734 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
16737 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
16738 * but with all dynamically-allocated buffers duplicated in new buffers.
16740 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
16743 * Creates a new CResult_InitDecodeErrorZ in the success state.
16745 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
16748 * Creates a new CResult_InitDecodeErrorZ in the error state.
16750 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
16753 * Checks if the given object is currently in the success state
16755 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
16758 * Frees any resources used by the CResult_InitDecodeErrorZ.
16760 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
16763 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
16764 * but with all dynamically-allocated buffers duplicated in new buffers.
16766 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
16769 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
16771 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
16774 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
16776 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
16779 * Checks if the given object is currently in the success state
16781 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
16784 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
16786 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
16789 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
16790 * but with all dynamically-allocated buffers duplicated in new buffers.
16792 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
16795 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
16797 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
16800 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
16802 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
16805 * Checks if the given object is currently in the success state
16807 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
16810 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
16812 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
16815 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
16816 * but with all dynamically-allocated buffers duplicated in new buffers.
16818 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
16821 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
16823 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
16826 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
16828 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
16831 * Checks if the given object is currently in the success state
16833 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
16836 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
16838 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
16841 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
16842 * but with all dynamically-allocated buffers duplicated in new buffers.
16844 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
16847 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
16849 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
16852 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
16854 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16857 * Checks if the given object is currently in the success state
16859 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
16862 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
16864 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
16867 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
16868 * but with all dynamically-allocated buffers duplicated in new buffers.
16870 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
16873 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
16875 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
16878 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
16880 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16883 * Checks if the given object is currently in the success state
16885 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
16888 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
16890 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
16893 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
16894 * but with all dynamically-allocated buffers duplicated in new buffers.
16896 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
16899 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
16901 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
16904 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
16906 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
16909 * Checks if the given object is currently in the success state
16911 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
16914 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
16916 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
16919 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
16920 * but with all dynamically-allocated buffers duplicated in new buffers.
16922 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
16925 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
16927 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
16930 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
16932 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16935 * Checks if the given object is currently in the success state
16937 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
16940 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
16942 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
16945 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
16946 * but with all dynamically-allocated buffers duplicated in new buffers.
16948 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
16951 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
16953 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
16956 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
16958 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
16961 * Checks if the given object is currently in the success state
16963 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
16966 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
16968 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
16971 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
16972 * but with all dynamically-allocated buffers duplicated in new buffers.
16974 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
16977 * Creates a new CResult_PingDecodeErrorZ in the success state.
16979 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
16982 * Creates a new CResult_PingDecodeErrorZ in the error state.
16984 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
16987 * Checks if the given object is currently in the success state
16989 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
16992 * Frees any resources used by the CResult_PingDecodeErrorZ.
16994 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
16997 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
16998 * but with all dynamically-allocated buffers duplicated in new buffers.
17000 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
17003 * Creates a new CResult_PongDecodeErrorZ in the success state.
17005 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
17008 * Creates a new CResult_PongDecodeErrorZ in the error state.
17010 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
17013 * Checks if the given object is currently in the success state
17015 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
17018 * Frees any resources used by the CResult_PongDecodeErrorZ.
17020 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
17023 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
17024 * but with all dynamically-allocated buffers duplicated in new buffers.
17026 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
17029 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
17031 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
17034 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
17036 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
17039 * Checks if the given object is currently in the success state
17041 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
17044 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
17046 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
17049 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
17050 * but with all dynamically-allocated buffers duplicated in new buffers.
17052 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
17055 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
17057 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
17060 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
17062 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
17065 * Checks if the given object is currently in the success state
17067 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
17070 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
17072 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
17075 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
17076 * but with all dynamically-allocated buffers duplicated in new buffers.
17078 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
17081 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
17083 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
17086 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
17088 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
17091 * Checks if the given object is currently in the success state
17093 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
17096 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
17098 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
17101 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
17102 * but with all dynamically-allocated buffers duplicated in new buffers.
17104 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
17107 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
17109 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
17112 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
17114 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
17117 * Checks if the given object is currently in the success state
17119 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
17122 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
17124 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
17127 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
17128 * but with all dynamically-allocated buffers duplicated in new buffers.
17130 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
17133 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
17135 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
17138 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
17140 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
17143 * Checks if the given object is currently in the success state
17145 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
17148 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
17150 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
17153 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
17154 * but with all dynamically-allocated buffers duplicated in new buffers.
17156 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
17159 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
17161 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
17164 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
17166 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
17169 * Checks if the given object is currently in the success state
17171 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
17174 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
17176 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
17179 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
17180 * but with all dynamically-allocated buffers duplicated in new buffers.
17182 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
17185 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
17187 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
17190 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
17192 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
17195 * Checks if the given object is currently in the success state
17197 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
17200 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
17202 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
17205 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
17206 * but with all dynamically-allocated buffers duplicated in new buffers.
17208 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
17211 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
17213 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
17216 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
17218 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
17221 * Checks if the given object is currently in the success state
17223 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
17226 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
17228 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
17231 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
17232 * but with all dynamically-allocated buffers duplicated in new buffers.
17234 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
17237 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
17239 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
17242 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
17244 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
17247 * Checks if the given object is currently in the success state
17249 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
17252 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
17254 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
17257 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
17258 * but with all dynamically-allocated buffers duplicated in new buffers.
17260 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
17263 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
17265 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
17268 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
17270 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
17273 * Checks if the given object is currently in the success state
17275 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
17278 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
17280 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
17283 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
17284 * but with all dynamically-allocated buffers duplicated in new buffers.
17286 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
17289 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
17291 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
17294 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
17296 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
17299 * Checks if the given object is currently in the success state
17301 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
17304 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
17306 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
17309 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
17310 * but with all dynamically-allocated buffers duplicated in new buffers.
17312 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
17315 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
17317 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
17320 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
17322 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
17325 * Checks if the given object is currently in the success state
17327 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
17330 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
17332 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
17335 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
17336 * but with all dynamically-allocated buffers duplicated in new buffers.
17338 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
17341 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
17343 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
17346 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
17348 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
17351 * Checks if the given object is currently in the success state
17353 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
17356 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
17358 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
17361 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
17362 * but with all dynamically-allocated buffers duplicated in new buffers.
17364 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
17367 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17369 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
17372 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
17374 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
17377 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
17379 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
17382 * Checks if the given object is currently in the success state
17384 bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
17387 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
17389 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
17392 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
17393 * but with all dynamically-allocated buffers duplicated in new buffers.
17395 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
17398 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
17400 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
17403 * Constructs a new COption_FilterZ containing nothing
17405 struct LDKCOption_FilterZ COption_FilterZ_none(void);
17408 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
17410 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
17413 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
17415 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
17418 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
17420 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
17423 * Checks if the given object is currently in the success state
17425 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
17428 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
17430 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
17433 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17435 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
17438 * Frees any resources used by the PaymentPurpose
17440 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
17443 * Creates a copy of the PaymentPurpose
17445 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
17448 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
17450 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
17453 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
17455 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
17458 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
17460 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
17463 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
17465 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
17468 * Frees any resources used by the ClosureReason
17470 void ClosureReason_free(struct LDKClosureReason this_ptr);
17473 * Creates a copy of the ClosureReason
17475 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
17478 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
17480 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
17483 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
17485 struct LDKClosureReason ClosureReason_holder_force_closed(void);
17488 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
17490 struct LDKClosureReason ClosureReason_cooperative_closure(void);
17493 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
17495 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
17498 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
17500 struct LDKClosureReason ClosureReason_funding_timed_out(void);
17503 * Utility method to constructs a new ProcessingError-variant ClosureReason
17505 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
17508 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
17510 struct LDKClosureReason ClosureReason_disconnected_peer(void);
17513 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
17515 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
17518 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
17520 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
17523 * Read a ClosureReason from a byte array, created by ClosureReason_write
17525 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
17528 * Frees any resources used by the HTLCDestination
17530 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
17533 * Creates a copy of the HTLCDestination
17535 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
17538 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
17540 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
17543 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
17545 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
17548 * Utility method to constructs a new FailedPayment-variant HTLCDestination
17550 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
17553 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
17555 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
17558 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
17560 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
17563 * Frees any resources used by the Event
17565 void Event_free(struct LDKEvent this_ptr);
17568 * Creates a copy of the Event
17570 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
17573 * Utility method to constructs a new FundingGenerationReady-variant Event
17575 struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, uint64_t user_channel_id);
17578 * Utility method to constructs a new PaymentReceived-variant Event
17580 struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
17583 * Utility method to constructs a new PaymentClaimed-variant Event
17585 struct LDKEvent Event_payment_claimed(struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
17588 * Utility method to constructs a new PaymentSent-variant Event
17590 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
17593 * Utility method to constructs a new PaymentFailed-variant Event
17595 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
17598 * Utility method to constructs a new PaymentPathSuccessful-variant Event
17600 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
17603 * Utility method to constructs a new PaymentPathFailed-variant Event
17605 struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest, struct LDKCOption_NetworkUpdateZ network_update, bool all_paths_failed, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry);
17608 * Utility method to constructs a new ProbeSuccessful-variant Event
17610 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
17613 * Utility method to constructs a new ProbeFailed-variant Event
17615 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id);
17618 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
17620 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
17623 * Utility method to constructs a new SpendableOutputs-variant Event
17625 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
17628 * Utility method to constructs a new PaymentForwarded-variant Event
17630 struct LDKEvent Event_payment_forwarded(struct LDKThirtyTwoBytes prev_channel_id, struct LDKThirtyTwoBytes next_channel_id, struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx);
17633 * Utility method to constructs a new ChannelClosed-variant Event
17635 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, uint64_t user_channel_id, struct LDKClosureReason reason);
17638 * Utility method to constructs a new DiscardFunding-variant Event
17640 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
17643 * Utility method to constructs a new OpenChannelRequest-variant Event
17645 struct LDKEvent Event_open_channel_request(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type);
17648 * Utility method to constructs a new HTLCHandlingFailed-variant Event
17650 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
17653 * Serialize the Event object into a byte array which can be read by Event_read
17655 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
17658 * Read a Event from a byte array, created by Event_write
17660 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
17663 * Frees any resources used by the MessageSendEvent
17665 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
17668 * Creates a copy of the MessageSendEvent
17670 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
17673 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
17675 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
17678 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
17680 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
17683 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
17685 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
17688 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
17690 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
17693 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
17695 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
17698 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
17700 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
17703 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
17705 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
17708 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
17710 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
17713 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
17715 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
17718 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
17720 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
17723 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
17725 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
17728 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
17730 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
17733 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
17735 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
17738 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
17740 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
17743 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
17745 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
17748 * Utility method to constructs a new HandleError-variant MessageSendEvent
17750 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
17753 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
17755 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
17758 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
17760 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
17763 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
17765 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
17768 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
17770 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
17773 * Calls the free function if one is set
17775 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
17778 * Calls the free function if one is set
17780 void EventsProvider_free(struct LDKEventsProvider this_ptr);
17783 * Calls the free function if one is set
17785 void EventHandler_free(struct LDKEventHandler this_ptr);
17788 * Frees any resources used by the APIError
17790 void APIError_free(struct LDKAPIError this_ptr);
17793 * Creates a copy of the APIError
17795 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
17798 * Utility method to constructs a new APIMisuseError-variant APIError
17800 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
17803 * Utility method to constructs a new FeeRateTooHigh-variant APIError
17805 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
17808 * Utility method to constructs a new RouteError-variant APIError
17810 struct LDKAPIError APIError_route_error(struct LDKStr err);
17813 * Utility method to constructs a new ChannelUnavailable-variant APIError
17815 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
17818 * Utility method to constructs a new MonitorUpdateFailed-variant APIError
17820 struct LDKAPIError APIError_monitor_update_failed(void);
17823 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
17825 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
17828 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
17830 void BigSize_free(struct LDKBigSize this_obj);
17832 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
17834 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
17837 * Constructs a new BigSize given each field
17839 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
17842 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
17844 void Hostname_free(struct LDKHostname this_obj);
17847 * Creates a copy of the Hostname
17849 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
17852 * Returns the length of the hostname.
17854 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
17857 * Creates a digital signature of a message given a SecretKey, like the node's secret.
17858 * A receiver knowing the PublicKey (e.g. the node's id) and the message can be sure that the signature was generated by the caller.
17859 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
17861 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
17864 * Recovers the PublicKey of the signer of the message given the message and the signature.
17866 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
17869 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
17870 * and the PublicKey.
17872 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
17875 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
17877 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z data_without_signature);
17880 * Calls the free function if one is set
17882 void Persister_free(struct LDKPersister this_ptr);
17885 * Creates a copy of the Level
17887 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
17890 * Utility method to constructs a new Gossip-variant Level
17892 enum LDKLevel Level_gossip(void);
17895 * Utility method to constructs a new Trace-variant Level
17897 enum LDKLevel Level_trace(void);
17900 * Utility method to constructs a new Debug-variant Level
17902 enum LDKLevel Level_debug(void);
17905 * Utility method to constructs a new Info-variant Level
17907 enum LDKLevel Level_info(void);
17910 * Utility method to constructs a new Warn-variant Level
17912 enum LDKLevel Level_warn(void);
17915 * Utility method to constructs a new Error-variant Level
17917 enum LDKLevel Level_error(void);
17920 * Checks if two Levels contain equal inner contents.
17921 * This ignores pointers and is_owned flags and looks at the values in fields.
17923 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
17926 * Checks if two Levels contain equal inner contents.
17928 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
17931 * Returns the most verbose logging level.
17933 MUST_USE_RES enum LDKLevel Level_max(void);
17936 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
17938 void Record_free(struct LDKRecord this_obj);
17941 * The verbosity level of the message.
17943 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
17946 * The verbosity level of the message.
17948 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
17951 * The message body.
17953 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
17956 * The message body.
17958 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17961 * The module path of the message.
17963 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
17966 * The module path of the message.
17968 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17971 * The source file containing the message.
17973 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
17976 * The source file containing the message.
17978 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
17981 * The line containing the message.
17983 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
17986 * The line containing the message.
17988 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
17991 * Creates a copy of the Record
17993 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
17996 * Calls the free function if one is set
17998 void Logger_free(struct LDKLogger this_ptr);
18001 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
18003 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
18006 * Confirmations we will wait for before considering the channel locked in.
18007 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
18008 * equivalent limit applied to outbound channels).
18010 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
18011 * transaction before operation. If you wish to accept channels with zero confirmations, see
18012 * [`UserConfig::manually_accept_inbound_channels`] and
18013 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
18015 * Default value: 6.
18017 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18018 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
18020 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18023 * Confirmations we will wait for before considering the channel locked in.
18024 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
18025 * equivalent limit applied to outbound channels).
18027 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
18028 * transaction before operation. If you wish to accept channels with zero confirmations, see
18029 * [`UserConfig::manually_accept_inbound_channels`] and
18030 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
18032 * Default value: 6.
18034 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
18035 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
18037 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
18040 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
18041 * the number of blocks we have to punish our counterparty if they broadcast a revoked
18044 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
18045 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
18046 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
18047 * possibly with time in between to RBF the spending transaction).
18049 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
18050 * case of an honest unilateral channel close, which implicitly decrease the economic value of
18053 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
18054 * can tweak config to ask for more security, not less.
18056 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18059 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
18060 * the number of blocks we have to punish our counterparty if they broadcast a revoked
18063 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
18064 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
18065 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
18066 * possibly with time in between to RBF the spending transaction).
18068 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
18069 * case of an honest unilateral channel close, which implicitly decrease the economic value of
18072 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
18073 * can tweak config to ask for more security, not less.
18075 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
18078 * Set to the smallest value HTLC we will accept to process.
18080 * This value is sent to our counterparty on channel-open and we close the channel any time
18081 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
18083 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
18086 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18089 * Set to the smallest value HTLC we will accept to process.
18091 * This value is sent to our counterparty on channel-open and we close the channel any time
18092 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
18094 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
18097 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
18100 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
18103 * This can be set to a value between 1-100, where the value corresponds to the percent of the
18104 * channel value in whole percentages.
18107 * * If configured to another value than the default value 10, any new channels created with
18108 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
18109 * `ChannelManager`.
18111 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
18112 * no way to configure the cap for the total value of outbound HTLCs in-flight.
18114 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
18115 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
18116 * restrict exposure to loss due to being offline for too long.
18117 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
18118 * for more information.
18120 * Default value: 10.
18121 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
18122 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
18124 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18127 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
18130 * This can be set to a value between 1-100, where the value corresponds to the percent of the
18131 * channel value in whole percentages.
18134 * * If configured to another value than the default value 10, any new channels created with
18135 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
18136 * `ChannelManager`.
18138 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
18139 * no way to configure the cap for the total value of outbound HTLCs in-flight.
18141 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
18142 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
18143 * restrict exposure to loss due to being offline for too long.
18144 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
18145 * for more information.
18147 * Default value: 10.
18148 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
18149 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
18151 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
18154 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
18155 * BOLTs) option for outbound private channels. This provides better privacy by not including
18156 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
18157 * relay HTLCs to us using the channel's SCID alias.
18159 * If this option is set, channels may be created that will not be readable by LDK versions
18160 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
18161 * [`DecodeError::InvalidValue`].
18163 * Note that setting this to true does *not* prevent us from opening channels with
18164 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
18165 * private channel without that option.
18167 * Ignored if the channel is negotiated to be announced, see
18168 * [`ChannelHandshakeConfig::announced_channel`] and
18169 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
18171 * Default value: false. This value is likely to change to true in the future.
18173 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
18174 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
18176 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18179 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
18180 * BOLTs) option for outbound private channels. This provides better privacy by not including
18181 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
18182 * relay HTLCs to us using the channel's SCID alias.
18184 * If this option is set, channels may be created that will not be readable by LDK versions
18185 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
18186 * [`DecodeError::InvalidValue`].
18188 * Note that setting this to true does *not* prevent us from opening channels with
18189 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
18190 * private channel without that option.
18192 * Ignored if the channel is negotiated to be announced, see
18193 * [`ChannelHandshakeConfig::announced_channel`] and
18194 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
18196 * Default value: false. This value is likely to change to true in the future.
18198 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
18199 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
18201 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
18204 * Set to announce the channel publicly and notify all nodes that they can route via this
18207 * This should only be set to true for nodes which expect to be online reliably.
18209 * As the node which funds a channel picks this value this will only apply for new outbound
18210 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
18212 * Default value: false.
18214 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18217 * Set to announce the channel publicly and notify all nodes that they can route via this
18220 * This should only be set to true for nodes which expect to be online reliably.
18222 * As the node which funds a channel picks this value this will only apply for new outbound
18223 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
18225 * Default value: false.
18227 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
18230 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
18231 * supports it, they will then enforce the mutual-close output to us matches what we provided
18232 * at intialization, preventing us from closing to an alternate pubkey.
18234 * This is set to true by default to provide a slight increase in security, though ultimately
18235 * any attacker who is able to take control of a channel can just as easily send the funds via
18236 * lightning payments, so we never require that our counterparties support this option.
18238 * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
18240 * Default value: true.
18242 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
18244 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
18247 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
18248 * supports it, they will then enforce the mutual-close output to us matches what we provided
18249 * at intialization, preventing us from closing to an alternate pubkey.
18251 * This is set to true by default to provide a slight increase in security, though ultimately
18252 * any attacker who is able to take control of a channel can just as easily send the funds via
18253 * lightning payments, so we never require that our counterparties support this option.
18255 * The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
18257 * Default value: true.
18259 * [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
18261 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
18264 * Constructs a new ChannelHandshakeConfig given each field
18266 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg, uint8_t max_inbound_htlc_value_in_flight_percent_of_channel_arg, bool negotiate_scid_privacy_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg);
18269 * Creates a copy of the ChannelHandshakeConfig
18271 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
18274 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
18276 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
18279 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
18281 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
18284 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
18285 * only applies to inbound channels.
18287 * Default value: 0.
18289 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18292 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
18293 * only applies to inbound channels.
18295 * Default value: 0.
18297 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
18300 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
18301 * only applies to inbound channels.
18303 * Default value: 2^24 - 1.
18305 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18308 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
18309 * only applies to inbound channels.
18311 * Default value: 2^24 - 1.
18313 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
18316 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
18317 * you to limit the maximum minimum-size they can require.
18319 * Default value: u64::max_value.
18321 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18324 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
18325 * you to limit the maximum minimum-size they can require.
18327 * Default value: u64::max_value.
18329 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
18332 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
18333 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
18335 * Default value: 0.
18337 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18340 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
18341 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
18343 * Default value: 0.
18345 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
18348 * The remote node will require we keep a certain amount in direct payment to ourselves at all
18349 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
18350 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
18352 * Default value: u64::max_value.
18354 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18357 * The remote node will require we keep a certain amount in direct payment to ourselves at all
18358 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
18359 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
18361 * Default value: u64::max_value.
18363 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
18366 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
18367 * time. This allows you to set a minimum such value.
18369 * Default value: 0.
18371 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18374 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
18375 * time. This allows you to set a minimum such value.
18377 * Default value: 0.
18379 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
18382 * Before a channel is usable the funding transaction will need to be confirmed by at least a
18383 * certain number of blocks, specified by the node which is not the funder (as the funder can
18384 * assume they aren't going to double-spend themselves).
18385 * This config allows you to set a limit on the maximum amount of time to wait.
18387 * Default value: 144, or roughly one day and only applies to outbound channels.
18389 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18392 * Before a channel is usable the funding transaction will need to be confirmed by at least a
18393 * certain number of blocks, specified by the node which is not the funder (as the funder can
18394 * assume they aren't going to double-spend themselves).
18395 * This config allows you to set a limit on the maximum amount of time to wait.
18397 * Default value: 144, or roughly one day and only applies to outbound channels.
18399 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
18402 * Whether we implicitly trust funding transactions generated by us for our own outbound
18403 * channels to not be double-spent.
18405 * If this is set, we assume that our own funding transactions are *never* double-spent, and
18406 * thus we can trust them without any confirmations. This is generally a reasonable
18407 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
18408 * control of the signing keys).
18410 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
18411 * double-spend the funding transaction to RBF with an alternative channel open.
18413 * This only applies if our counterparty set their confirmations-required value to 0, and we
18414 * always trust our own funding transaction at 1 confirmation irrespective of this value.
18415 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
18416 * `true` (0) and `false` (1).
18418 * Default value: true
18420 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18423 * Whether we implicitly trust funding transactions generated by us for our own outbound
18424 * channels to not be double-spent.
18426 * If this is set, we assume that our own funding transactions are *never* double-spent, and
18427 * thus we can trust them without any confirmations. This is generally a reasonable
18428 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
18429 * control of the signing keys).
18431 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
18432 * double-spend the funding transaction to RBF with an alternative channel open.
18434 * This only applies if our counterparty set their confirmations-required value to 0, and we
18435 * always trust our own funding transaction at 1 confirmation irrespective of this value.
18436 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
18437 * `true` (0) and `false` (1).
18439 * Default value: true
18441 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
18444 * Set to force an incoming channel to match our announced channel preference in
18445 * [`ChannelHandshakeConfig::announced_channel`].
18447 * For a node which is not online reliably, this should be set to true and
18448 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
18449 * channels will ever be opened.
18451 * Default value: true.
18453 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18456 * Set to force an incoming channel to match our announced channel preference in
18457 * [`ChannelHandshakeConfig::announced_channel`].
18459 * For a node which is not online reliably, this should be set to true and
18460 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
18461 * channels will ever be opened.
18463 * Default value: true.
18465 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
18468 * Set to the amount of time we're willing to wait to claim money back to us.
18470 * Not checking this value would be a security issue, as our peer would be able to set it to
18471 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
18473 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
18474 * reduce the loss of having useless locked funds (if your peer accepts)
18476 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
18479 * Set to the amount of time we're willing to wait to claim money back to us.
18481 * Not checking this value would be a security issue, as our peer would be able to set it to
18482 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
18484 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
18485 * reduce the loss of having useless locked funds (if your peer accepts)
18487 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
18490 * Constructs a new ChannelHandshakeLimits given each field
18492 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_funding_satoshis_arg, uint64_t max_htlc_minimum_msat_arg, uint64_t min_max_htlc_value_in_flight_msat_arg, uint64_t max_channel_reserve_satoshis_arg, uint16_t min_max_accepted_htlcs_arg, uint32_t max_minimum_depth_arg, bool trust_own_funding_0conf_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg);
18495 * Creates a copy of the ChannelHandshakeLimits
18497 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
18500 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
18502 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
18505 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
18507 void ChannelConfig_free(struct LDKChannelConfig this_obj);
18510 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
18511 * over the channel.
18512 * This may be allowed to change at runtime in a later update, however doing so must result in
18513 * update messages sent to notify all nodes of our updated relay fee.
18515 * Default value: 0.
18517 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18520 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
18521 * over the channel.
18522 * This may be allowed to change at runtime in a later update, however doing so must result in
18523 * update messages sent to notify all nodes of our updated relay fee.
18525 * Default value: 0.
18527 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
18530 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
18531 * excess of [`forwarding_fee_proportional_millionths`].
18532 * This may be allowed to change at runtime in a later update, however doing so must result in
18533 * update messages sent to notify all nodes of our updated relay fee.
18535 * The default value of a single satoshi roughly matches the market rate on many routing nodes
18536 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
18539 * Default value: 1000.
18541 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
18543 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18546 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
18547 * excess of [`forwarding_fee_proportional_millionths`].
18548 * This may be allowed to change at runtime in a later update, however doing so must result in
18549 * update messages sent to notify all nodes of our updated relay fee.
18551 * The default value of a single satoshi roughly matches the market rate on many routing nodes
18552 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
18555 * Default value: 1000.
18557 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
18559 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
18562 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
18563 * the channel this config applies to.
18565 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
18566 * HTLC balance when a channel appears on-chain whereas
18567 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
18568 * (non-HTLC-encumbered) balance.
18570 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
18571 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
18572 * commitment transaction at least once per this many blocks (minus some margin to allow us
18573 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
18574 * the spending transaction).
18576 * Default value: 72 (12 hours at an average of 6 blocks/hour).
18577 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
18578 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
18580 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
18582 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18585 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
18586 * the channel this config applies to.
18588 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
18589 * HTLC balance when a channel appears on-chain whereas
18590 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
18591 * (non-HTLC-encumbered) balance.
18593 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
18594 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
18595 * commitment transaction at least once per this many blocks (minus some margin to allow us
18596 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
18597 * the spending transaction).
18599 * Default value: 72 (12 hours at an average of 6 blocks/hour).
18600 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
18601 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
18603 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
18605 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
18608 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
18609 * small to claim on-chain.
18611 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
18612 * not be claimable on-chain, instead being turned into additional miner fees if either
18613 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
18614 * to such payments may be sustantial if there are many dust HTLCs present when the
18615 * channel is force-closed.
18617 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
18618 * exposure across all three types per-channel. Setting this too low may prevent the
18619 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
18620 * important to prevent stealing of dust HTLCs by miners.
18622 * Default value: 5_000_000 msat.
18624 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18627 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
18628 * small to claim on-chain.
18630 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
18631 * not be claimable on-chain, instead being turned into additional miner fees if either
18632 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
18633 * to such payments may be sustantial if there are many dust HTLCs present when the
18634 * channel is force-closed.
18636 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
18637 * exposure across all three types per-channel. Setting this too low may prevent the
18638 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
18639 * important to prevent stealing of dust HTLCs by miners.
18641 * Default value: 5_000_000 msat.
18643 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
18646 * The additional fee we're willing to pay to avoid waiting for the counterparty's
18647 * `to_self_delay` to reclaim funds.
18649 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
18650 * closing transaction which both sides find acceptable, ultimately paid by the channel
18651 * funder/initiator.
18653 * When we are the funder, because we have to pay the channel closing fee, we bound the
18654 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
18655 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
18656 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
18657 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
18660 * When we are not the funder, we require the closing transaction fee pay at least our
18661 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
18662 * Thus, this value is ignored when we are not the funder.
18664 * Default value: 1000 satoshis.
18666 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
18667 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
18669 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
18672 * The additional fee we're willing to pay to avoid waiting for the counterparty's
18673 * `to_self_delay` to reclaim funds.
18675 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
18676 * closing transaction which both sides find acceptable, ultimately paid by the channel
18677 * funder/initiator.
18679 * When we are the funder, because we have to pay the channel closing fee, we bound the
18680 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
18681 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
18682 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
18683 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
18686 * When we are not the funder, we require the closing transaction fee pay at least our
18687 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
18688 * Thus, this value is ignored when we are not the funder.
18690 * Default value: 1000 satoshis.
18692 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
18693 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
18695 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
18698 * Constructs a new ChannelConfig given each field
18700 MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t forwarding_fee_proportional_millionths_arg, uint32_t forwarding_fee_base_msat_arg, uint16_t cltv_expiry_delta_arg, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg);
18703 * Creates a copy of the ChannelConfig
18705 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
18708 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
18710 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
18713 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
18715 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
18718 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
18720 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
18723 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
18725 void UserConfig_free(struct LDKUserConfig this_obj);
18728 * Channel handshake config that we propose to our counterparty.
18730 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18733 * Channel handshake config that we propose to our counterparty.
18735 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
18738 * Limits applied to our counterparty's proposed channel handshake config settings.
18740 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18743 * Limits applied to our counterparty's proposed channel handshake config settings.
18745 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
18748 * Channel config which affects behavior during channel lifetime.
18750 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18753 * Channel config which affects behavior during channel lifetime.
18755 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
18758 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
18759 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
18760 * node which is not online reliably.
18762 * For nodes which are not online reliably, you should set all channels to *not* be announced
18763 * (using [`ChannelHandshakeConfig::announced_channel`] and
18764 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
18765 * ensure you are not exposed to any forwarding risk.
18767 * Note that because you cannot change a channel's announced state after creation, there is no
18768 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
18769 * from a publicly-announced forwarding node to a private non-forwarding node you must close
18770 * all your channels and open new ones. For privacy, you should also change your node_id
18771 * (swapping all private and public key material for new ones) at that time.
18773 * Default value: false.
18775 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18778 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
18779 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
18780 * node which is not online reliably.
18782 * For nodes which are not online reliably, you should set all channels to *not* be announced
18783 * (using [`ChannelHandshakeConfig::announced_channel`] and
18784 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
18785 * ensure you are not exposed to any forwarding risk.
18787 * Note that because you cannot change a channel's announced state after creation, there is no
18788 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
18789 * from a publicly-announced forwarding node to a private non-forwarding node you must close
18790 * all your channels and open new ones. For privacy, you should also change your node_id
18791 * (swapping all private and public key material for new ones) at that time.
18793 * Default value: false.
18795 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18798 * If this is set to false, we do not accept inbound requests to open a new channel.
18799 * Default value: true.
18801 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18804 * If this is set to false, we do not accept inbound requests to open a new channel.
18805 * Default value: true.
18807 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18810 * If this is set to true, the user needs to manually accept inbound requests to open a new
18813 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
18814 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
18815 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
18816 * user explicitly chooses to accept the request.
18818 * Default value: false.
18820 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
18821 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
18822 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
18824 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
18827 * If this is set to true, the user needs to manually accept inbound requests to open a new
18830 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
18831 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
18832 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
18833 * user explicitly chooses to accept the request.
18835 * Default value: false.
18837 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
18838 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
18839 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
18841 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
18844 * Constructs a new UserConfig given each field
18846 MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig channel_handshake_config_arg, struct LDKChannelHandshakeLimits channel_handshake_limits_arg, struct LDKChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg);
18849 * Creates a copy of the UserConfig
18851 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
18854 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
18856 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
18859 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
18861 void BestBlock_free(struct LDKBestBlock this_obj);
18864 * Creates a copy of the BestBlock
18866 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
18869 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
18872 MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
18875 * Returns a `BestBlock` as identified by the given block hash and height.
18877 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
18880 * Returns the best block hash.
18882 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
18885 * Returns the best block height.
18887 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
18890 * Creates a copy of the AccessError
18892 enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
18895 * Utility method to constructs a new UnknownChain-variant AccessError
18897 enum LDKAccessError AccessError_unknown_chain(void);
18900 * Utility method to constructs a new UnknownTx-variant AccessError
18902 enum LDKAccessError AccessError_unknown_tx(void);
18905 * Calls the free function if one is set
18907 void Access_free(struct LDKAccess this_ptr);
18910 * Calls the free function if one is set
18912 void Listen_free(struct LDKListen this_ptr);
18915 * Calls the free function if one is set
18917 void Confirm_free(struct LDKConfirm this_ptr);
18920 * Creates a copy of the ChannelMonitorUpdateErr
18922 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
18925 * Utility method to constructs a new TemporaryFailure-variant ChannelMonitorUpdateErr
18927 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
18930 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateErr
18932 enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
18935 * Calls the free function if one is set
18937 void Watch_free(struct LDKWatch this_ptr);
18940 * Calls the free function if one is set
18942 void Filter_free(struct LDKFilter this_ptr);
18945 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
18947 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
18950 * First block where the transaction output may have been spent.
18952 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
18954 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18957 * First block where the transaction output may have been spent.
18959 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
18961 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
18964 * Outpoint identifying the transaction output.
18966 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18969 * Outpoint identifying the transaction output.
18971 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
18974 * Spending condition of the transaction output.
18976 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
18979 * Spending condition of the transaction output.
18981 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
18984 * Constructs a new WatchedOutput given each field
18986 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
18989 * Creates a copy of the WatchedOutput
18991 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
18994 * Checks if two WatchedOutputs contain equal inner contents.
18996 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
18999 * Calls the free function if one is set
19001 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
19004 * Creates a copy of the ConfirmationTarget
19006 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
19009 * Utility method to constructs a new Background-variant ConfirmationTarget
19011 enum LDKConfirmationTarget ConfirmationTarget_background(void);
19014 * Utility method to constructs a new Normal-variant ConfirmationTarget
19016 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
19019 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
19021 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
19024 * Checks if two ConfirmationTargets contain equal inner contents.
19025 * This ignores pointers and is_owned flags and looks at the values in fields.
19027 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
19030 * Calls the free function if one is set
19032 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
19035 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
19037 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
19040 * Creates a copy of the MonitorUpdateId
19042 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
19045 * Checks if two MonitorUpdateIds contain equal inner contents.
19047 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
19050 * Checks if two MonitorUpdateIds contain equal inner contents.
19051 * This ignores pointers and is_owned flags and looks at the values in fields.
19052 * Two objects with NULL inner values will be considered "equal" here.
19054 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
19057 * Calls the free function if one is set
19059 void Persist_free(struct LDKPersist this_ptr);
19062 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
19064 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
19067 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
19069 void ChainMonitor_free(struct LDKChainMonitor this_obj);
19072 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
19074 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
19075 * will call back to it indicating transactions and outputs of interest. This allows clients to
19076 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
19077 * always need to fetch full blocks absent another means for determining which blocks contain
19078 * transactions relevant to the watched channels.
19080 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
19083 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
19084 * claims which are awaiting confirmation.
19086 * Includes the balances from each [`ChannelMonitor`] *except* those included in
19087 * `ignored_channels`, allowing you to filter out balances from channels which are still open
19088 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
19090 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
19091 * inclusion in the return value.
19093 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
19096 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
19097 * such [`ChannelMonitor`] is currently being monitored for.
19099 * Note that the result holds a mutex over our monitor set, and should not be held
19102 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
19105 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
19107 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
19108 * monitoring for on-chain state resolutions.
19110 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
19113 * Indicates the persistence of a [`ChannelMonitor`] has completed after
19114 * [`ChannelMonitorUpdateErr::TemporaryFailure`] was returned from an update operation.
19116 * Thus, the anticipated use is, at a high level:
19117 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
19118 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
19119 * returning [`ChannelMonitorUpdateErr::TemporaryFailure`],
19120 * 2) once all remote copies are updated, you call this function with the
19121 * `completed_update_id` that completed, and once all pending updates have completed the
19122 * channel will be re-enabled.
19124 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
19125 * registered [`ChannelMonitor`]s.
19127 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKMonitorUpdateId completed_update_id);
19130 * Constructs a new Listen which calls the relevant methods on this_arg.
19131 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
19133 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
19136 * Constructs a new Confirm which calls the relevant methods on this_arg.
19137 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
19139 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
19142 * Constructs a new Watch which calls the relevant methods on this_arg.
19143 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
19145 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
19148 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
19149 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
19151 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
19154 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
19156 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
19159 * The sequence number of this update. Updates *must* be replayed in-order according to this
19160 * sequence number (and updates may panic if they are not). The update_id values are strictly
19161 * increasing and increase by one for each new update, with one exception specified below.
19163 * This sequence number is also used to track up to which points updates which returned
19164 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
19165 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
19167 * The only instance where update_id values are not strictly increasing is the case where we
19168 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
19169 * its docs for more details.
19171 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
19174 * The sequence number of this update. Updates *must* be replayed in-order according to this
19175 * sequence number (and updates may panic if they are not). The update_id values are strictly
19176 * increasing and increase by one for each new update, with one exception specified below.
19178 * This sequence number is also used to track up to which points updates which returned
19179 * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
19180 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
19182 * The only instance where update_id values are not strictly increasing is the case where we
19183 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
19184 * its docs for more details.
19186 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
19189 * Creates a copy of the ChannelMonitorUpdate
19191 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
19194 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
19196 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
19199 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
19201 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
19204 * Frees any resources used by the MonitorEvent
19206 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
19209 * Creates a copy of the MonitorEvent
19211 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
19214 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
19216 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
19219 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
19221 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
19224 * Utility method to constructs a new UpdateCompleted-variant MonitorEvent
19226 struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
19229 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
19231 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
19234 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
19236 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
19239 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
19241 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
19244 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
19246 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
19249 * Creates a copy of the HTLCUpdate
19251 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
19254 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
19256 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
19259 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
19261 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
19264 * Frees any resources used by the Balance
19266 void Balance_free(struct LDKBalance this_ptr);
19269 * Creates a copy of the Balance
19271 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
19274 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
19276 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
19279 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
19281 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
19284 * Utility method to constructs a new ContentiousClaimable-variant Balance
19286 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
19289 * Utility method to constructs a new MaybeClaimableHTLCAwaitingTimeout-variant Balance
19291 struct LDKBalance Balance_maybe_claimable_htlcawaiting_timeout(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
19294 * Checks if two Balances contain equal inner contents.
19295 * This ignores pointers and is_owned flags and looks at the values in fields.
19297 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
19300 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
19302 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
19305 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
19307 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
19310 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
19313 * panics if the given update is not the next update by update_id.
19315 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
19318 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
19321 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19324 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
19326 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19329 * Gets a list of txids, with their output scripts (in the order they appear in the
19330 * transaction), which we must learn about spends of via block_connected().
19332 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19335 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
19336 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
19337 * have been registered.
19339 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
19342 * Get the list of HTLCs who's status has been updated on chain. This should be called by
19343 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
19345 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19348 * Gets the list of pending events which were generated by previous actions, clearing the list
19351 * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to
19352 * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do
19353 * no internal locking in ChannelMonitors.
19355 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19358 * Gets the `node_id` of the counterparty for this channel.
19360 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
19363 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
19365 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19368 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
19369 * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
19370 * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
19371 * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
19372 * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
19373 * broadcast them if counterparty don't close channel with his higher commitment transaction after a
19374 * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
19375 * out-of-band the other node operator to coordinate with him if option is available to you.
19376 * In any-case, choice is up to the user.
19378 MUST_USE_RES struct LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger);
19381 * Processes transactions in a newly connected block, which may result in any of the following:
19382 * - update the monitor's state against resolved HTLCs
19383 * - punish the counterparty in the case of seeing a revoked commitment transaction
19384 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
19385 * - detect settled outputs for later spending
19386 * - schedule and bump any in-flight claims
19388 * Returns any new outputs to watch from `txdata`; after called, these are also included in
19389 * [`get_outputs_to_watch`].
19391 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
19393 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_block_connected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
19396 * Determines if the disconnected block contained any transactions of interest and updates
19399 void ChannelMonitor_block_disconnected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
19402 * Processes transactions confirmed in a block with the given header and height, returning new
19403 * outputs to watch. See [`block_connected`] for details.
19405 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
19406 * blocks. See [`chain::Confirm`] for calling expectations.
19408 * [`block_connected`]: Self::block_connected
19410 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_transactions_confirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
19413 * Processes a transaction that was reorganized out of the chain.
19415 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
19416 * than blocks. See [`chain::Confirm`] for calling expectations.
19418 * [`block_disconnected`]: Self::block_disconnected
19420 void ChannelMonitor_transaction_unconfirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
19423 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
19424 * [`block_connected`] for details.
19426 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
19427 * blocks. See [`chain::Confirm`] for calling expectations.
19429 * [`block_connected`]: Self::block_connected
19431 MUST_USE_RES struct LDKCVec_TransactionOutputsZ ChannelMonitor_best_block_updated(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
19434 * Returns the set of txids that should be monitored for re-organization out of the chain.
19436 MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19439 * Gets the latest best block which was connected either via the [`chain::Listen`] or
19440 * [`chain::Confirm`] interfaces.
19442 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19445 * Gets the balances in this channel which are either claimable by us if we were to
19446 * force-close the channel now or which are claimable on-chain (possibly awaiting
19449 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
19450 * included here until an [`Event::SpendableOutputs`] event has been generated for the
19451 * balance, or until our counterparty has claimed the balance and accrued several
19452 * confirmations on the claim transaction.
19454 * Note that the balances available when you or your counterparty have broadcasted revoked
19455 * state(s) may not be fully captured here.
19457 * See [`Balance`] for additional details on the types of claimable balances which
19458 * may be returned here and their meanings.
19460 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
19463 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
19465 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg);
19468 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
19470 void OutPoint_free(struct LDKOutPoint this_obj);
19473 * The referenced transaction's txid.
19475 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
19478 * The referenced transaction's txid.
19480 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19483 * The index of the referenced output in its transaction's vout.
19485 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
19488 * The index of the referenced output in its transaction's vout.
19490 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
19493 * Constructs a new OutPoint given each field
19495 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
19498 * Creates a copy of the OutPoint
19500 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
19503 * Checks if two OutPoints contain equal inner contents.
19504 * This ignores pointers and is_owned flags and looks at the values in fields.
19505 * Two objects with NULL inner values will be considered "equal" here.
19507 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
19510 * Checks if two OutPoints contain equal inner contents.
19512 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
19515 * Convert an `OutPoint` to a lightning channel id.
19517 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
19520 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
19522 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
19525 * Read a OutPoint from a byte array, created by OutPoint_write
19527 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
19530 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
19532 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
19535 * The outpoint which is spendable
19537 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19540 * The outpoint which is spendable
19542 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19545 * Per commitment point to derive delayed_payment_key by key holder
19547 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19550 * Per commitment point to derive delayed_payment_key by key holder
19552 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19555 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
19556 * the witness_script.
19558 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19561 * The nSequence value which must be set in the spending input to satisfy the OP_CSV in
19562 * the witness_script.
19564 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
19567 * The output which is referenced by the given outpoint
19569 * Returns a copy of the field.
19571 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19574 * The output which is referenced by the given outpoint
19576 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
19579 * The revocation point specific to the commitment transaction which was broadcast. Used to
19580 * derive the witnessScript for this output.
19582 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19585 * The revocation point specific to the commitment transaction which was broadcast. Used to
19586 * derive the witnessScript for this output.
19588 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
19591 * Arbitrary identification information returned by a call to
19592 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19593 * the channel to spend the output.
19595 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
19598 * Arbitrary identification information returned by a call to
19599 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19600 * the channel to spend the output.
19602 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19605 * The value of the channel which this output originated from, possibly indirectly.
19607 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19610 * The value of the channel which this output originated from, possibly indirectly.
19612 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
19615 * Constructs a new DelayedPaymentOutputDescriptor given each field
19617 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);
19620 * Creates a copy of the DelayedPaymentOutputDescriptor
19622 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
19625 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
19627 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
19630 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
19632 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
19635 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
19637 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
19640 * The outpoint which is spendable
19642 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19645 * The outpoint which is spendable
19647 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
19650 * The output which is referenced by the given outpoint
19652 * Returns a copy of the field.
19654 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19657 * The output which is referenced by the given outpoint
19659 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
19662 * Arbitrary identification information returned by a call to
19663 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19664 * the channel to spend the output.
19666 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
19669 * Arbitrary identification information returned by a call to
19670 * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in
19671 * the channel to spend the output.
19673 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19676 * The value of the channel which this transactions spends.
19678 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
19681 * The value of the channel which this transactions spends.
19683 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
19686 * Constructs a new StaticPaymentOutputDescriptor given each field
19688 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);
19691 * Creates a copy of the StaticPaymentOutputDescriptor
19693 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
19696 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
19698 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
19701 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
19703 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
19706 * Frees any resources used by the SpendableOutputDescriptor
19708 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
19711 * Creates a copy of the SpendableOutputDescriptor
19713 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
19716 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
19718 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
19721 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
19723 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
19726 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
19728 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
19731 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
19733 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
19736 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
19738 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
19741 * Calls the free function if one is set
19743 void BaseSign_free(struct LDKBaseSign this_ptr);
19746 * Creates a copy of a Sign
19748 struct LDKSign Sign_clone(const struct LDKSign *NONNULL_PTR orig);
19751 * Calls the free function if one is set
19753 void Sign_free(struct LDKSign this_ptr);
19756 * Creates a copy of the Recipient
19758 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
19761 * Utility method to constructs a new Node-variant Recipient
19763 enum LDKRecipient Recipient_node(void);
19766 * Utility method to constructs a new PhantomNode-variant Recipient
19768 enum LDKRecipient Recipient_phantom_node(void);
19771 * Calls the free function if one is set
19773 void KeysInterface_free(struct LDKKeysInterface this_ptr);
19776 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
19778 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
19781 * Private key of anchor tx
19783 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19786 * Private key of anchor tx
19788 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19791 * Holder secret key for blinded revocation pubkey
19793 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19796 * Holder secret key for blinded revocation pubkey
19798 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19801 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
19803 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19806 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions
19808 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19811 * Holder secret key used in HTLC tx
19813 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19816 * Holder secret key used in HTLC tx
19818 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19821 * Holder htlc secret key used in commitment tx htlc outputs
19823 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19826 * Holder htlc secret key used in commitment tx htlc outputs
19828 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
19833 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
19838 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
19841 * Creates a copy of the InMemorySigner
19843 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
19846 * Create a new InMemorySigner
19848 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);
19851 * Counterparty pubkeys.
19852 * Will panic if ready_channel wasn't called.
19854 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19857 * The contest_delay value specified by our counterparty and applied on holder-broadcastable
19858 * transactions, ie the amount of time that we have to wait to recover our funds if we
19859 * broadcast a transaction.
19860 * Will panic if ready_channel wasn't called.
19862 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19865 * The contest_delay value specified by us and applied on transactions broadcastable
19866 * by our counterparty, ie the amount of time that they have to wait to recover their funds
19867 * if they broadcast a transaction.
19868 * Will panic if ready_channel wasn't called.
19870 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19873 * Whether the holder is the initiator
19874 * Will panic if ready_channel wasn't called.
19876 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19880 * Will panic if ready_channel wasn't called.
19882 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19885 * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or
19886 * building transactions.
19888 * Will panic if ready_channel wasn't called.
19890 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19893 * Whether anchors should be used.
19894 * Will panic if ready_channel wasn't called.
19896 MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19899 * Sign the single input of spend_tx at index `input_idx` which spends the output
19900 * described by descriptor, returning the witness stack for the input.
19902 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
19903 * is not spending the outpoint described by `descriptor.outpoint`,
19904 * or if an output descriptor script_pubkey does not match the one we can spend.
19906 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);
19909 * Sign the single input of spend_tx at index `input_idx` which spends the output
19910 * described by descriptor, returning the witness stack for the input.
19912 * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig,
19913 * is not spending the outpoint described by `descriptor.outpoint`, does not have a
19914 * sequence set to `descriptor.to_self_delay`, or if an output descriptor
19915 * script_pubkey does not match the one we can spend.
19917 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);
19920 * Constructs a new BaseSign which calls the relevant methods on this_arg.
19921 * This copies the `inner` pointer in this_arg and thus the returned BaseSign must be freed before this_arg is
19923 struct LDKBaseSign InMemorySigner_as_BaseSign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19926 * Constructs a new Sign which calls the relevant methods on this_arg.
19927 * This copies the `inner` pointer in this_arg and thus the returned Sign must be freed before this_arg is
19929 struct LDKSign InMemorySigner_as_Sign(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
19932 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
19934 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
19937 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
19939 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKSecretKey arg);
19942 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
19944 void KeysManager_free(struct LDKKeysManager this_obj);
19947 * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your
19948 * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
19949 * starting_time isn't strictly required to actually be a time, but it must absolutely,
19950 * without a doubt, be unique to this instance. ie if you start multiple times with the same
19951 * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to
19952 * simply use the current time (with very high precision).
19954 * The seed MUST be backed up safely prior to use so that the keys can be re-created, however,
19955 * obviously, starting_time should be unique every time you reload the library - it is only
19956 * used to generate new ephemeral key data (which will be stored by the individual channel if
19959 * Note that the seed is required to recover certain on-chain funds independent of
19960 * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any
19961 * channel, and some on-chain during-closing funds.
19963 * Note that until the 0.1 release there is no guarantee of backward compatibility between
19964 * versions. Once the library is more fully supported, the docs will be updated to include a
19965 * detailed description of the guarantee.
19967 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
19970 * Derive an old Sign containing per-channel secrets based on a key derivation parameters.
19972 * Key derivation parameters are accessible through a per-channel secrets
19973 * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of
19974 * onchain output detection for which a corresponding delayed_payment_key must be derived.
19976 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]);
19979 * Creates a Transaction which spends the given descriptors to the given outputs, plus an
19980 * output to the given change destination (if sufficient change value remains). The
19981 * transaction will have a feerate, at least, of the given value.
19983 * Returns `Err(())` if the output value is greater than the input value minus required fee,
19984 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
19985 * does not match the one we can spend.
19987 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
19989 * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used
19990 * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
19992 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);
19995 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
19996 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
19998 struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg);
20001 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
20003 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
20006 * Constructs a new KeysInterface which calls the relevant methods on this_arg.
20007 * This copies the `inner` pointer in this_arg and thus the returned KeysInterface must be freed before this_arg is
20009 struct LDKKeysInterface PhantomKeysManager_as_KeysInterface(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
20012 * Constructs a `PhantomKeysManager` given a 32-byte seed and an additional `cross_node_seed`
20013 * that is shared across all nodes that intend to participate in [phantom node payments] together.
20015 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
20016 * `starting_time_nanos`.
20018 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
20019 * same across restarts, or else inbound payments may fail.
20021 * [phantom node payments]: PhantomKeysManager
20023 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]);
20026 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
20028 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);
20031 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
20033 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]);
20036 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
20038 void ChannelManager_free(struct LDKChannelManager this_obj);
20041 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
20043 void ChainParameters_free(struct LDKChainParameters this_obj);
20046 * The network for determining the `chain_hash` in Lightning messages.
20048 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
20051 * The network for determining the `chain_hash` in Lightning messages.
20053 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
20056 * The hash and height of the latest block successfully connected.
20058 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
20060 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
20063 * The hash and height of the latest block successfully connected.
20065 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
20067 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
20070 * Constructs a new ChainParameters given each field
20072 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
20075 * Creates a copy of the ChainParameters
20077 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
20080 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
20082 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
20085 * Base routing fee in millisatoshis.
20087 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
20090 * Base routing fee in millisatoshis.
20092 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
20095 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
20097 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
20100 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
20102 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
20105 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
20106 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
20107 * `cltv_expiry_delta` for more details.
20109 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
20112 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
20113 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
20114 * `cltv_expiry_delta` for more details.
20116 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
20119 * Constructs a new CounterpartyForwardingInfo given each field
20121 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);
20124 * Creates a copy of the CounterpartyForwardingInfo
20126 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
20129 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
20131 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
20134 * The node_id of our counterparty
20136 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
20139 * The node_id of our counterparty
20141 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20144 * The Features the channel counterparty provided upon last connection.
20145 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
20146 * many routing-relevant features are present in the init context.
20148 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
20151 * The Features the channel counterparty provided upon last connection.
20152 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
20153 * many routing-relevant features are present in the init context.
20155 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
20158 * The value, in satoshis, that must always be held in the channel for our counterparty. This
20159 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
20160 * claiming at least this value on chain.
20162 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
20164 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
20166 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
20169 * The value, in satoshis, that must always be held in the channel for our counterparty. This
20170 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
20171 * claiming at least this value on chain.
20173 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
20175 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
20177 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
20180 * Information on the fees and requirements that the counterparty requires when forwarding
20181 * payments to us through this channel.
20183 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20185 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
20188 * Information on the fees and requirements that the counterparty requires when forwarding
20189 * payments to us through this channel.
20191 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20193 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
20196 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
20197 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
20198 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
20200 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
20203 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
20204 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
20205 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
20207 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20210 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
20212 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
20215 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
20217 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20220 * Constructs a new ChannelCounterparty given each field
20222 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);
20225 * Creates a copy of the ChannelCounterparty
20227 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
20230 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
20232 void ChannelDetails_free(struct LDKChannelDetails this_obj);
20235 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
20236 * thereafter this is the txid of the funding transaction xor the funding transaction output).
20237 * Note that this means this value is *not* persistent - it can change once during the
20238 * lifetime of the channel.
20240 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
20243 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
20244 * thereafter this is the txid of the funding transaction xor the funding transaction output).
20245 * Note that this means this value is *not* persistent - it can change once during the
20246 * lifetime of the channel.
20248 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
20251 * Parameters which apply to our counterparty. See individual fields for more information.
20253 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20256 * Parameters which apply to our counterparty. See individual fields for more information.
20258 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
20261 * The Channel's funding transaction output, if we've negotiated the funding transaction with
20262 * our counterparty already.
20264 * Note that, if this has been set, `channel_id` will be equivalent to
20265 * `funding_txo.unwrap().to_channel_id()`.
20267 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20269 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20272 * The Channel's funding transaction output, if we've negotiated the funding transaction with
20273 * our counterparty already.
20275 * Note that, if this has been set, `channel_id` will be equivalent to
20276 * `funding_txo.unwrap().to_channel_id()`.
20278 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20280 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
20283 * The features which this channel operates with. See individual features for more info.
20285 * `None` until negotiation completes and the channel type is finalized.
20287 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20289 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20292 * The features which this channel operates with. See individual features for more info.
20294 * `None` until negotiation completes and the channel type is finalized.
20296 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20298 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
20301 * The position of the funding transaction in the chain. None if the funding transaction has
20302 * not yet been confirmed and the channel fully opened.
20304 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
20305 * payments instead of this. See [`get_inbound_payment_scid`].
20307 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
20308 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
20310 * [`inbound_scid_alias`]: Self::inbound_scid_alias
20311 * [`outbound_scid_alias`]: Self::outbound_scid_alias
20312 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
20313 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
20314 * [`confirmations_required`]: Self::confirmations_required
20316 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20319 * The position of the funding transaction in the chain. None if the funding transaction has
20320 * not yet been confirmed and the channel fully opened.
20322 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
20323 * payments instead of this. See [`get_inbound_payment_scid`].
20325 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
20326 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
20328 * [`inbound_scid_alias`]: Self::inbound_scid_alias
20329 * [`outbound_scid_alias`]: Self::outbound_scid_alias
20330 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
20331 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
20332 * [`confirmations_required`]: Self::confirmations_required
20334 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20337 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
20338 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
20339 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
20342 * This will be `None` as long as the channel is not available for routing outbound payments.
20344 * [`short_channel_id`]: Self::short_channel_id
20345 * [`confirmations_required`]: Self::confirmations_required
20347 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20350 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
20351 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
20352 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
20355 * This will be `None` as long as the channel is not available for routing outbound payments.
20357 * [`short_channel_id`]: Self::short_channel_id
20358 * [`confirmations_required`]: Self::confirmations_required
20360 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20363 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
20364 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
20365 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
20366 * when they see a payment to be routed to us.
20368 * Our counterparty may choose to rotate this value at any time, though will always recognize
20369 * previous values for inbound payment forwarding.
20371 * [`short_channel_id`]: Self::short_channel_id
20373 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20376 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
20377 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
20378 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
20379 * when they see a payment to be routed to us.
20381 * Our counterparty may choose to rotate this value at any time, though will always recognize
20382 * previous values for inbound payment forwarding.
20384 * [`short_channel_id`]: Self::short_channel_id
20386 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20389 * The value, in satoshis, of this channel as appears in the funding output
20391 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20394 * The value, in satoshis, of this channel as appears in the funding output
20396 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20399 * The value, in satoshis, that must always be held in the channel for us. This value ensures
20400 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
20401 * this value on chain.
20403 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
20405 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20407 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
20409 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20412 * The value, in satoshis, that must always be held in the channel for us. This value ensures
20413 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
20414 * this value on chain.
20416 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
20418 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20420 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
20422 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20425 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
20427 uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20430 * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound.
20432 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20435 * Our total balance. This is the amount we would get if we close the channel.
20436 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
20437 * amount is not likely to be recoverable on close.
20439 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
20440 * balance is not available for inclusion in new outbound HTLCs). This further does not include
20441 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
20442 * This does not consider any on-chain fees.
20444 * See also [`ChannelDetails::outbound_capacity_msat`]
20446 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20449 * Our total balance. This is the amount we would get if we close the channel.
20450 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
20451 * amount is not likely to be recoverable on close.
20453 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
20454 * balance is not available for inclusion in new outbound HTLCs). This further does not include
20455 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
20456 * This does not consider any on-chain fees.
20458 * See also [`ChannelDetails::outbound_capacity_msat`]
20460 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20463 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
20464 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
20465 * available for inclusion in new outbound HTLCs). This further does not include any pending
20466 * outgoing HTLCs which are awaiting some other resolution to be sent.
20468 * See also [`ChannelDetails::balance_msat`]
20470 * This value is not exact. Due to various in-flight changes, feerate changes, and our
20471 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
20472 * should be able to spend nearly this amount.
20474 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20477 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
20478 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
20479 * available for inclusion in new outbound HTLCs). This further does not include any pending
20480 * outgoing HTLCs which are awaiting some other resolution to be sent.
20482 * See also [`ChannelDetails::balance_msat`]
20484 * This value is not exact. Due to various in-flight changes, feerate changes, and our
20485 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
20486 * should be able to spend nearly this amount.
20488 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20491 * The available outbound capacity for sending a single HTLC to the remote peer. This is
20492 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
20493 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
20494 * to use a limit as close as possible to the HTLC limit we can currently send.
20496 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
20498 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20501 * The available outbound capacity for sending a single HTLC to the remote peer. This is
20502 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
20503 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
20504 * to use a limit as close as possible to the HTLC limit we can currently send.
20506 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
20508 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20511 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
20512 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
20513 * available for inclusion in new inbound HTLCs).
20514 * Note that there are some corner cases not fully handled here, so the actual available
20515 * inbound capacity may be slightly higher than this.
20517 * This value is not exact. Due to various in-flight changes, feerate changes, and our
20518 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
20519 * However, our counterparty should be able to spend nearly this amount.
20521 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20524 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
20525 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
20526 * available for inclusion in new inbound HTLCs).
20527 * Note that there are some corner cases not fully handled here, so the actual available
20528 * inbound capacity may be slightly higher than this.
20530 * This value is not exact. Due to various in-flight changes, feerate changes, and our
20531 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
20532 * However, our counterparty should be able to spend nearly this amount.
20534 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
20537 * The number of required confirmations on the funding transaction before the funding will be
20538 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
20539 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
20540 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
20541 * [`ChannelHandshakeLimits::max_minimum_depth`].
20543 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20545 * [`is_outbound`]: ChannelDetails::is_outbound
20546 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
20547 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
20549 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20552 * The number of required confirmations on the funding transaction before the funding will be
20553 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
20554 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
20555 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
20556 * [`ChannelHandshakeLimits::max_minimum_depth`].
20558 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20560 * [`is_outbound`]: ChannelDetails::is_outbound
20561 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
20562 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
20564 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
20567 * The number of blocks (after our commitment transaction confirms) that we will need to wait
20568 * until we can claim our funds after we force-close the channel. During this time our
20569 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
20570 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
20571 * time to claim our non-HTLC-encumbered funds.
20573 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20575 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20578 * The number of blocks (after our commitment transaction confirms) that we will need to wait
20579 * until we can claim our funds after we force-close the channel. During this time our
20580 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
20581 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
20582 * time to claim our non-HTLC-encumbered funds.
20584 * This value will be `None` for outbound channels until the counterparty accepts the channel.
20586 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
20589 * True if the channel was initiated (and thus funded) by us.
20591 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20594 * True if the channel was initiated (and thus funded) by us.
20596 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20599 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
20600 * channel is not currently being shut down. `channel_ready` message exchange implies the
20601 * required confirmation count has been reached (and we were connected to the peer at some
20602 * point after the funding transaction received enough confirmations). The required
20603 * confirmation count is provided in [`confirmations_required`].
20605 * [`confirmations_required`]: ChannelDetails::confirmations_required
20607 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20610 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
20611 * channel is not currently being shut down. `channel_ready` message exchange implies the
20612 * required confirmation count has been reached (and we were connected to the peer at some
20613 * point after the funding transaction received enough confirmations). The required
20614 * confirmation count is provided in [`confirmations_required`].
20616 * [`confirmations_required`]: ChannelDetails::confirmations_required
20618 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20621 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
20622 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
20624 * This is a strict superset of `is_channel_ready`.
20626 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20629 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
20630 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
20632 * This is a strict superset of `is_channel_ready`.
20634 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20637 * True if this channel is (or will be) publicly-announced.
20639 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20642 * True if this channel is (or will be) publicly-announced.
20644 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
20647 * The smallest value HTLC (in msat) we will accept, for this channel. This field
20648 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
20650 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20653 * The smallest value HTLC (in msat) we will accept, for this channel. This field
20654 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
20656 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20659 * The largest value HTLC (in msat) we currently will accept, for this channel.
20661 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20664 * The largest value HTLC (in msat) we currently will accept, for this channel.
20666 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
20669 * Set of configurable parameters that affect channel operation.
20671 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
20673 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20675 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
20678 * Set of configurable parameters that affect channel operation.
20680 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
20682 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
20684 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
20687 * Constructs a new ChannelDetails given each field
20689 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z outbound_scid_alias_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, uint64_t user_channel_id_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, bool is_usable_arg, bool is_public_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg, struct LDKChannelConfig config_arg);
20692 * Creates a copy of the ChannelDetails
20694 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
20697 * Gets the current SCID which should be used to identify this channel for inbound payments.
20698 * This should be used for providing invoice hints or in any other context where our
20699 * counterparty will forward a payment to us.
20701 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
20702 * [`ChannelDetails::short_channel_id`]. See those for more information.
20704 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
20707 * Gets the current SCID which should be used to identify this channel for outbound payments.
20708 * This should be used in [`Route`]s to describe the first hop or in other contexts where
20709 * we're sending or forwarding a payment outbound over this channel.
20711 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
20712 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
20714 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
20717 * Frees any resources used by the PaymentSendFailure
20719 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
20722 * Creates a copy of the PaymentSendFailure
20724 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
20727 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
20729 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
20732 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
20734 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
20737 * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
20739 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
20742 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
20744 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
20747 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
20749 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
20752 * The list of channels to be included in the invoice route hints.
20754 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20757 * The list of channels to be included in the invoice route hints.
20759 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
20762 * A fake scid used for representing the phantom node's fake channel in generating the invoice
20765 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20768 * A fake scid used for representing the phantom node's fake channel in generating the invoice
20771 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
20774 * The pubkey of the real backing node that would ultimately receive the payment.
20776 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
20779 * The pubkey of the real backing node that would ultimately receive the payment.
20781 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
20784 * Constructs a new PhantomRouteHints given each field
20786 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
20789 * Creates a copy of the PhantomRouteHints
20791 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
20794 * Constructs a new ChannelManager to hold several channels and route between them.
20796 * This is the main \"logic hub\" for all channel-related actions, and implements
20797 * ChannelMessageHandler.
20799 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
20801 * Users need to notify the new ChannelManager when a new block is connected or
20802 * disconnected using its `block_connected` and `block_disconnected` methods, starting
20803 * from after `params.latest_hash`.
20805 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);
20808 * Gets the current configuration applied to all new channels, as
20810 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
20813 * Creates a new outbound channel to the given remote node and with the given value.
20815 * `user_channel_id` will be provided back as in
20816 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
20817 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0
20818 * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here.
20819 * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise
20822 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
20823 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
20825 * Note that we do not check if you are currently connected to the given peer. If no
20826 * connection is available, the outbound `open_channel` message may fail to send, resulting in
20827 * the channel eventually being silently forgotten (dropped on reload).
20829 * Returns the new Channel's temporary `channel_id`. This ID will appear as
20830 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
20831 * [`ChannelDetails::channel_id`] until after
20832 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
20833 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
20834 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
20836 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
20837 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
20838 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
20840 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
20842 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);
20845 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
20846 * more information.
20848 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
20851 * Gets the list of usable channels, in random order. Useful as an argument to [`find_route`]
20852 * to ensure non-announced channels are used.
20854 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
20855 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
20858 * [`find_route`]: crate::routing::router::find_route
20860 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
20863 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
20864 * will be accepted on the given channel, and after additional timeout/the closing of all
20865 * pending HTLCs, the channel will be closed on chain.
20867 * * If we are the channel initiator, we will pay between our [`Background`] and
20868 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
20870 * * If our counterparty is the channel initiator, we will require a channel closing
20871 * transaction feerate of at least our [`Background`] feerate or the feerate which
20872 * would appear on a force-closure transaction, whichever is lower. We will allow our
20873 * counterparty to pay as much fee as they'd like, however.
20875 * May generate a SendShutdown message event on success, which should be relayed.
20877 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
20878 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20879 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20881 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);
20884 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
20885 * will be accepted on the given channel, and after additional timeout/the closing of all
20886 * pending HTLCs, the channel will be closed on chain.
20888 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
20889 * the channel being closed or not:
20890 * * If we are the channel initiator, we will pay at least this feerate on the closing
20891 * transaction. The upper-bound is set by
20892 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
20893 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
20894 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
20895 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
20896 * will appear on a force-closure transaction, whichever is lower).
20898 * May generate a SendShutdown message event on success, which should be relayed.
20900 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
20901 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
20902 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
20904 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);
20907 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
20908 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
20909 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
20912 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
20915 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
20916 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
20917 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
20919 * You can always get the latest local transaction(s) to broadcast from
20920 * [`ChannelMonitor::get_latest_holder_commitment_txn`].
20922 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id);
20925 * Force close all channels, immediately broadcasting the latest local commitment transaction
20926 * for each to the chain and rejecting new HTLCs on each.
20928 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
20931 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
20932 * local transaction(s).
20934 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
20937 * Sends a payment along a given route.
20939 * Value parameters are provided via the last hop in route, see documentation for RouteHop
20940 * fields for more info.
20942 * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative
20943 * payment), we don't do anything to stop you! We always try to ensure that if the provided
20944 * next hop knows the preimage to payment_hash they can claim an additional amount as
20945 * specified in the last hop in the route! Thus, you should probably do your own
20946 * payment_preimage tracking (which you should already be doing as they represent \"proof of
20947 * payment\") and prevent double-sends yourself.
20949 * May generate SendHTLCs message(s) event on success, which should be relayed.
20951 * Each path may have a different return value, and PaymentSendValue may return a Vec with
20952 * each entry matching the corresponding-index entry in the route paths, see
20953 * PaymentSendFailure for more info.
20955 * In general, a path may raise:
20956 * * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
20957 * node public key) is specified.
20958 * * APIError::ChannelUnavailable if the next-hop channel is not available for updates
20959 * (including due to previous monitor update failure or new permanent monitor update
20961 * * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
20962 * relevant updates.
20964 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
20965 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
20966 * different route unless you intend to pay twice!
20968 * payment_secret is unrelated to payment_hash (or PaymentPreimage) and exists to authenticate
20969 * the sender to the recipient and prevent payment-probing (deanonymization) attacks. For
20970 * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route
20971 * must not contain multiple paths as multi-path payments require a recipient-provided
20973 * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature
20974 * bit set (either as required or as available). If multiple paths are present in the Route,
20975 * we assume the invoice had the basic_mpp feature set.
20977 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
20979 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);
20982 * Retries a payment along the given [`Route`].
20984 * Errors returned are a superset of those returned from [`send_payment`], so see
20985 * [`send_payment`] documentation for more details on errors. This method will also error if the
20986 * retry amount puts the payment more than 10% over the payment's total amount, if the payment
20987 * for the given `payment_id` cannot be found (likely due to timeout or success), or if
20988 * further retries have been disabled with [`abandon_payment`].
20990 * [`send_payment`]: [`ChannelManager::send_payment`]
20991 * [`abandon_payment`]: [`ChannelManager::abandon_payment`]
20993 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);
20996 * Signals that no further retries for the given payment will occur.
20998 * After this method returns, any future calls to [`retry_payment`] for the given `payment_id`
20999 * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated,
21000 * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining
21001 * pending HTLCs for this payment.
21003 * Note that calling this method does *not* prevent a payment from succeeding. You must still
21004 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
21005 * determine the ultimate status of a payment.
21007 * [`retry_payment`]: Self::retry_payment
21008 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
21009 * [`Event::PaymentSent`]: events::Event::PaymentSent
21011 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
21014 * Send a spontaneous payment, which is a payment that does not require the recipient to have
21015 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
21016 * the preimage, it must be a cryptographically secure random value that no intermediate node
21017 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
21018 * never reach the recipient.
21020 * See [`send_payment`] documentation for more details on the return value of this function.
21022 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
21023 * [`send_payment`] for more information about the risks of duplicate preimage usage.
21025 * Note that `route` must have exactly one path.
21027 * [`send_payment`]: Self::send_payment
21029 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
21031 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);
21034 * Send a payment that is probing the given route for liquidity. We calculate the
21035 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
21036 * us to easily discern them from real payments.
21038 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ hops);
21041 * Call this upon creation of a funding transaction for the given channel.
21043 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
21044 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
21046 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
21047 * across the p2p network.
21049 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
21050 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
21052 * May panic if the output found in the funding transaction is duplicative with some other
21053 * channel (note that this should be trivially prevented by using unique funding transaction
21054 * keys per-channel).
21056 * Do NOT broadcast the funding transaction yourself. When we have safely received our
21057 * counterparty's signature the funding transaction will automatically be broadcast via the
21058 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
21060 * Note that this includes RBF or similar transaction replacement strategies - lightning does
21061 * not currently support replacing a funding transaction on an existing channel. Instead,
21062 * create a new channel with a conflicting funding transaction.
21064 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
21065 * the wallet software generating the funding transaction to apply anti-fee sniping as
21066 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
21067 * for more details.
21069 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
21070 * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
21072 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);
21075 * Regenerates channel_announcements and generates a signed node_announcement from the given
21076 * arguments, providing them in corresponding events via
21077 * [`get_and_clear_pending_msg_events`], if at least one public channel has been confirmed
21078 * on-chain. This effectively re-broadcasts all channel announcements and sends our node
21079 * announcement to ensure that the lightning P2P network is aware of the channels we have and
21080 * our network addresses.
21082 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
21083 * node to humans. They carry no in-protocol meaning.
21085 * `addresses` represent the set (possibly empty) of socket addresses on which this node
21086 * accepts incoming connections. These will be included in the node_announcement, publicly
21087 * tying these addresses together and to this node. If you wish to preserve user privacy,
21088 * addresses should likely contain only Tor Onion addresses.
21090 * Panics if `addresses` is absurdly large (more than 100).
21092 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
21094 void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
21097 * Atomically updates the [`ChannelConfig`] for the given channels.
21099 * Once the updates are applied, each eligible channel (advertised with a known short channel
21100 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
21101 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
21102 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
21104 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
21105 * `counterparty_node_id` is provided.
21107 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
21108 * below [`MIN_CLTV_EXPIRY_DELTA`].
21110 * If an error is returned, none of the updates should be considered applied.
21112 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
21113 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
21114 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
21115 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
21116 * [`ChannelUpdate`]: msgs::ChannelUpdate
21117 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
21118 * [`APIMisuseError`]: APIError::APIMisuseError
21120 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config);
21123 * Processes HTLCs which are pending waiting on random forward delay.
21125 * Should only really ever be called in response to a PendingHTLCsForwardable event.
21126 * Will likely generate further events.
21128 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
21131 * Performs actions which should happen on startup and roughly once per minute thereafter.
21133 * This currently includes:
21134 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
21135 * * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
21136 * than a minute, informing the network that they should no longer attempt to route over
21138 * * Expiring a channel's previous `ChannelConfig` if necessary to only allow forwarding HTLCs
21139 * with the current `ChannelConfig`.
21141 * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
21142 * estimate fetches.
21144 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
21147 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
21148 * after a PaymentReceived event, failing the HTLC back to its origin and freeing resources
21149 * along the path (including in our own channel on which we received it).
21151 * Note that in some cases around unclean shutdown, it is possible the payment may have
21152 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
21153 * second copy of) the [`events::Event::PaymentReceived`] event. Alternatively, the payment
21154 * may have already been failed automatically by LDK if it was nearing its expiration time.
21156 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
21157 * [`ChannelManager::claim_funds`]), you should still monitor for
21158 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
21159 * startup during which time claims that were in-progress at shutdown may be replayed.
21161 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
21164 * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any
21165 * [`MessageSendEvent`]s needed to claim the payment.
21167 * Note that calling this method does *not* guarantee that the payment has been claimed. You
21168 * *must* wait for an [`Event::PaymentClaimed`] event which upon a successful claim will be
21169 * provided to your [`EventHandler`] when [`process_pending_events`] is next called.
21171 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
21172 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentReceived`
21173 * event matches your expectation. If you fail to do so and call this method, you may provide
21174 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
21176 * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived
21177 * [`Event::PaymentClaimed`]: crate::util::events::Event::PaymentClaimed
21178 * [`process_pending_events`]: EventsProvider::process_pending_events
21179 * [`create_inbound_payment`]: Self::create_inbound_payment
21180 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
21181 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
21183 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
21186 * Gets the node_id held by this ChannelManager
21188 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
21191 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
21193 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
21194 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
21197 * The `user_channel_id` parameter will be provided back in
21198 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
21199 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
21201 * Note that this method will return an error and reject the channel, if it requires support
21202 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
21203 * used to accept such channels.
21205 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
21206 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
21208 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);
21211 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
21212 * it as confirmed immediately.
21214 * The `user_channel_id` parameter will be provided back in
21215 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
21216 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
21218 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
21219 * and (if the counterparty agrees), enables forwarding of payments immediately.
21221 * This fully trusts that the counterparty has honestly and correctly constructed the funding
21222 * transaction and blindly assumes that it will eventually confirm.
21224 * If it does not confirm before we decide to close the channel, or if the funding transaction
21225 * does not pay to the correct script the correct amount, *you will lose funds*.
21227 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
21228 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
21230 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);
21233 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
21236 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
21237 * [`PaymentHash`] and [`PaymentPreimage`] for you.
21239 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which
21240 * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be
21241 * passed directly to [`claim_funds`].
21243 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
21245 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
21246 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
21250 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
21251 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
21253 * Errors if `min_value_msat` is greater than total bitcoin supply.
21255 * [`claim_funds`]: Self::claim_funds
21256 * [`PaymentReceived`]: events::Event::PaymentReceived
21257 * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage
21258 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
21260 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);
21263 * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
21264 * serialized state with LDK node(s) running 0.0.103 and earlier.
21266 * May panic if `invoice_expiry_delta_secs` is greater than one year.
21269 * This method is deprecated and will be removed soon.
21271 * [`create_inbound_payment`]: Self::create_inbound_payment
21273 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);
21276 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
21277 * stored external to LDK.
21279 * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a
21280 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
21281 * the `min_value_msat` provided here, if one is provided.
21283 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
21284 * note that LDK will not stop you from registering duplicate payment hashes for inbound
21287 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
21288 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
21289 * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the
21290 * sender \"proof-of-payment\" unless they have paid the required amount.
21292 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
21293 * in excess of the current time. This should roughly match the expiry time set in the invoice.
21294 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
21295 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
21296 * invoices when no timeout is set.
21298 * Note that we use block header time to time-out pending inbound payments (with some margin
21299 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
21300 * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry.
21301 * If you need exact expiry semantics, you should enforce them upon receipt of
21302 * [`PaymentReceived`].
21304 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry`
21305 * set to at least [`MIN_FINAL_CLTV_EXPIRY`].
21307 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
21308 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
21312 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
21313 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
21315 * Errors if `min_value_msat` is greater than total bitcoin supply.
21317 * [`create_inbound_payment`]: Self::create_inbound_payment
21318 * [`PaymentReceived`]: events::Event::PaymentReceived
21320 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);
21323 * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
21324 * serialized state with LDK node(s) running 0.0.103 and earlier.
21326 * May panic if `invoice_expiry_delta_secs` is greater than one year.
21329 * This method is deprecated and will be removed soon.
21331 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
21333 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);
21336 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
21337 * previously returned from [`create_inbound_payment`].
21339 * [`create_inbound_payment`]: Self::create_inbound_payment
21341 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);
21344 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
21345 * are used when constructing the phantom invoice's route hints.
21347 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
21349 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
21352 * Gets route hints for use in receiving [phantom node payments].
21354 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
21356 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
21359 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
21360 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
21362 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
21365 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
21366 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
21368 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
21371 * Constructs a new Listen which calls the relevant methods on this_arg.
21372 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
21374 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
21377 * Constructs a new Confirm which calls the relevant methods on this_arg.
21378 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
21380 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
21383 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
21384 * indicating whether persistence is necessary. Only one listener on
21385 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
21388 * Note that this method is not available with the `no-std` feature.
21390 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
21393 * Blocks until ChannelManager needs to be persisted. Only one listener on
21394 * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken
21397 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
21400 * Gets the latest best block which was connected either via the [`chain::Listen`] or
21401 * [`chain::Confirm`] interfaces.
21403 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
21406 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
21407 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
21409 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
21412 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
21414 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
21417 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
21419 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
21422 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
21424 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
21427 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
21429 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
21432 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
21434 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
21437 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
21439 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
21442 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
21444 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
21447 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
21449 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
21452 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
21454 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
21457 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
21459 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
21462 * The keys provider which will give us relevant keys. Some keys will be loaded during
21463 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
21466 const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21469 * The keys provider which will give us relevant keys. Some keys will be loaded during
21470 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
21473 void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val);
21476 * The fee_estimator for use in the ChannelManager in the future.
21478 * No calls to the FeeEstimator will be made during deserialization.
21480 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21483 * The fee_estimator for use in the ChannelManager in the future.
21485 * No calls to the FeeEstimator will be made during deserialization.
21487 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
21490 * The chain::Watch for use in the ChannelManager in the future.
21492 * No calls to the chain::Watch will be made during deserialization. It is assumed that
21493 * you have deserialized ChannelMonitors separately and will add them to your
21494 * chain::Watch after deserializing this ChannelManager.
21496 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21499 * The chain::Watch for use in the ChannelManager in the future.
21501 * No calls to the chain::Watch will be made during deserialization. It is assumed that
21502 * you have deserialized ChannelMonitors separately and will add them to your
21503 * chain::Watch after deserializing this ChannelManager.
21505 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
21508 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
21509 * used to broadcast the latest local commitment transactions of channels which must be
21510 * force-closed during deserialization.
21512 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21515 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
21516 * used to broadcast the latest local commitment transactions of channels which must be
21517 * force-closed during deserialization.
21519 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
21522 * The Logger for use in the ChannelManager and which may be used to log information during
21525 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21528 * The Logger for use in the ChannelManager and which may be used to log information during
21531 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
21534 * Default settings used for new channels. Any existing channels will continue to use the
21535 * runtime settings which were stored when the ChannelManager was serialized.
21537 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
21540 * Default settings used for new channels. Any existing channels will continue to use the
21541 * runtime settings which were stored when the ChannelManager was serialized.
21543 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
21546 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
21547 * HashMap for you. This is primarily useful for C bindings where it is not practical to
21548 * populate a HashMap directly from C.
21550 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);
21553 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
21555 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
21558 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
21560 void ExpandedKey_free(struct LDKExpandedKey this_obj);
21563 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
21565 * It is recommended to cache this value and not regenerate it for each new inbound payment.
21567 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
21570 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
21571 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
21572 * a `ChannelManager`.
21574 * `keys` is generated by calling [`KeysInterface::get_inbound_payment_key_material`] and then
21575 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
21576 * regenerate it for each new inbound payment.
21578 * `current_time` is a Unix timestamp representing the current time.
21580 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
21582 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);
21585 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
21586 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
21587 * without a `ChannelManager`.
21589 * See [`create`] for information on the `keys` and `current_time` parameters.
21591 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
21593 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);
21596 * Frees any resources used by the DecodeError, if is_owned is set and inner is non-NULL.
21598 void DecodeError_free(struct LDKDecodeError this_obj);
21601 * Creates a copy of the DecodeError
21603 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
21606 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
21608 void Init_free(struct LDKInit this_obj);
21611 * The relevant features which the sender supports
21613 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
21616 * The relevant features which the sender supports
21618 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
21621 * The receipient's network address. This adds the option to report a remote IP address
21622 * back to a connecting peer using the init message. A node can decide to use that information
21623 * to discover a potential update to its public IPv4 address (NAT) and use
21624 * that for a node_announcement update message containing the new address.
21626 struct LDKCOption_NetAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
21629 * The receipient's network address. This adds the option to report a remote IP address
21630 * back to a connecting peer using the init message. A node can decide to use that information
21631 * to discover a potential update to its public IPv4 address (NAT) and use
21632 * that for a node_announcement update message containing the new address.
21634 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_NetAddressZ val);
21637 * Constructs a new Init given each field
21639 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_NetAddressZ remote_network_address_arg);
21642 * Creates a copy of the Init
21644 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
21647 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
21649 void ErrorMessage_free(struct LDKErrorMessage this_obj);
21652 * The channel ID involved in the error.
21654 * All-0s indicates a general error unrelated to a specific channel, after which all channels
21655 * with the sending peer should be closed.
21657 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
21660 * The channel ID involved in the error.
21662 * All-0s indicates a general error unrelated to a specific channel, after which all channels
21663 * with the sending peer should be closed.
21665 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21668 * A possibly human-readable error description.
21669 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21670 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21671 * the terminal emulator or the logging subsystem.
21673 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
21676 * A possibly human-readable error description.
21677 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21678 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21679 * the terminal emulator or the logging subsystem.
21681 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
21684 * Constructs a new ErrorMessage given each field
21686 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
21689 * Creates a copy of the ErrorMessage
21691 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
21694 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
21696 void WarningMessage_free(struct LDKWarningMessage this_obj);
21699 * The channel ID involved in the warning.
21701 * All-0s indicates a warning unrelated to a specific channel.
21703 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
21706 * The channel ID involved in the warning.
21708 * All-0s indicates a warning unrelated to a specific channel.
21710 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21713 * A possibly human-readable warning description.
21714 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21715 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21716 * the terminal emulator or the logging subsystem.
21718 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
21721 * A possibly human-readable warning description.
21722 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
21723 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
21724 * the terminal emulator or the logging subsystem.
21726 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
21729 * Constructs a new WarningMessage given each field
21731 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
21734 * Creates a copy of the WarningMessage
21736 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
21739 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
21741 void Ping_free(struct LDKPing this_obj);
21744 * The desired response length
21746 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
21749 * The desired response length
21751 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
21754 * The ping packet size.
21755 * This field is not sent on the wire. byteslen zeros are sent.
21757 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
21760 * The ping packet size.
21761 * This field is not sent on the wire. byteslen zeros are sent.
21763 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
21766 * Constructs a new Ping given each field
21768 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
21771 * Creates a copy of the Ping
21773 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
21776 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
21778 void Pong_free(struct LDKPong this_obj);
21781 * The pong packet size.
21782 * This field is not sent on the wire. byteslen zeros are sent.
21784 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
21787 * The pong packet size.
21788 * This field is not sent on the wire. byteslen zeros are sent.
21790 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
21793 * Constructs a new Pong given each field
21795 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
21798 * Creates a copy of the Pong
21800 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
21803 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
21805 void OpenChannel_free(struct LDKOpenChannel this_obj);
21808 * The genesis hash of the blockchain where the channel is to be opened
21810 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
21813 * The genesis hash of the blockchain where the channel is to be opened
21815 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21818 * A temporary channel ID, until the funding outpoint is announced
21820 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
21823 * A temporary channel ID, until the funding outpoint is announced
21825 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21828 * The channel value
21830 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21833 * The channel value
21835 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21838 * The amount to push to the counterparty as part of the open, in milli-satoshi
21840 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21843 * The amount to push to the counterparty as part of the open, in milli-satoshi
21845 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21848 * The threshold below which outputs on transactions broadcast by sender will be omitted
21850 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21853 * The threshold below which outputs on transactions broadcast by sender will be omitted
21855 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21858 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21860 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21863 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
21865 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21868 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21870 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21873 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
21875 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21878 * The minimum HTLC size incoming to sender, in milli-satoshi
21880 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21883 * The minimum HTLC size incoming to sender, in milli-satoshi
21885 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
21888 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
21890 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21893 * The feerate per 1000-weight of sender generated transactions, until updated by update_fee
21895 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
21898 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21900 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21903 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
21905 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
21908 * The maximum number of inbound HTLCs towards sender
21910 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21913 * The maximum number of inbound HTLCs towards sender
21915 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
21918 * The sender's key controlling the funding transaction
21920 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21923 * The sender's key controlling the funding transaction
21925 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21928 * Used to derive a revocation key for transactions broadcast by counterparty
21930 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21933 * Used to derive a revocation key for transactions broadcast by counterparty
21935 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21938 * A payment key to sender for transactions broadcast by counterparty
21940 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21943 * A payment key to sender for transactions broadcast by counterparty
21945 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21948 * Used to derive a payment key to sender for transactions broadcast by sender
21950 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21953 * Used to derive a payment key to sender for transactions broadcast by sender
21955 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21958 * Used to derive an HTLC payment key to sender
21960 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21963 * Used to derive an HTLC payment key to sender
21965 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21968 * The first to-be-broadcast-by-sender transaction's per commitment point
21970 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21973 * The first to-be-broadcast-by-sender transaction's per commitment point
21975 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
21980 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21985 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
21988 * The channel type that this channel will represent. If none is set, we derive the channel
21989 * type from the intersection of our feature bits with our counterparty's feature bits from
21990 * the Init message.
21992 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21994 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
21997 * The channel type that this channel will represent. If none is set, we derive the channel
21998 * type from the intersection of our feature bits with our counterparty's feature bits from
21999 * the Init message.
22001 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22003 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
22006 * Creates a copy of the OpenChannel
22008 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
22011 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
22013 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
22016 * A temporary channel ID, until the funding outpoint is announced
22018 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
22021 * A temporary channel ID, until the funding outpoint is announced
22023 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22026 * The threshold below which outputs on transactions broadcast by sender will be omitted
22028 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22031 * The threshold below which outputs on transactions broadcast by sender will be omitted
22033 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
22036 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
22038 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22041 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
22043 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
22046 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
22048 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22051 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
22053 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
22056 * The minimum HTLC size incoming to sender, in milli-satoshi
22058 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22061 * The minimum HTLC size incoming to sender, in milli-satoshi
22063 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
22066 * Minimum depth of the funding transaction before the channel is considered open
22068 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22071 * Minimum depth of the funding transaction before the channel is considered open
22073 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
22076 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
22078 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22081 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
22083 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
22086 * The maximum number of inbound HTLCs towards sender
22088 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22091 * The maximum number of inbound HTLCs towards sender
22093 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
22096 * The sender's key controlling the funding transaction
22098 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22101 * The sender's key controlling the funding transaction
22103 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22106 * Used to derive a revocation key for transactions broadcast by counterparty
22108 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22111 * Used to derive a revocation key for transactions broadcast by counterparty
22113 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22116 * A payment key to sender for transactions broadcast by counterparty
22118 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22121 * A payment key to sender for transactions broadcast by counterparty
22123 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22126 * Used to derive a payment key to sender for transactions broadcast by sender
22128 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22131 * Used to derive a payment key to sender for transactions broadcast by sender
22133 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22136 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
22138 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22141 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
22143 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22146 * The first to-be-broadcast-by-sender transaction's per commitment point
22148 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22151 * The first to-be-broadcast-by-sender transaction's per commitment point
22153 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22156 * The channel type that this channel will represent. If none is set, we derive the channel
22157 * type from the intersection of our feature bits with our counterparty's feature bits from
22158 * the Init message.
22160 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
22162 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22164 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
22167 * The channel type that this channel will represent. If none is set, we derive the channel
22168 * type from the intersection of our feature bits with our counterparty's feature bits from
22169 * the Init message.
22171 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
22173 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22175 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
22178 * Creates a copy of the AcceptChannel
22180 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
22183 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
22185 void FundingCreated_free(struct LDKFundingCreated this_obj);
22188 * A temporary channel ID, until the funding is established
22190 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
22193 * A temporary channel ID, until the funding is established
22195 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22198 * The funding transaction ID
22200 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
22203 * The funding transaction ID
22205 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22208 * The specific output index funding this channel
22210 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
22213 * The specific output index funding this channel
22215 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
22218 * The signature of the channel initiator (funder) on the initial commitment transaction
22220 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
22223 * The signature of the channel initiator (funder) on the initial commitment transaction
22225 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
22228 * Constructs a new FundingCreated given each field
22230 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);
22233 * Creates a copy of the FundingCreated
22235 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
22238 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
22240 void FundingSigned_free(struct LDKFundingSigned this_obj);
22245 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
22250 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22253 * The signature of the channel acceptor (fundee) on the initial commitment transaction
22255 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
22258 * The signature of the channel acceptor (fundee) on the initial commitment transaction
22260 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
22263 * Constructs a new FundingSigned given each field
22265 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
22268 * Creates a copy of the FundingSigned
22270 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
22273 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
22275 void ChannelReady_free(struct LDKChannelReady this_obj);
22280 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
22285 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22288 * The per-commitment point of the second commitment transaction
22290 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
22293 * The per-commitment point of the second commitment transaction
22295 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22298 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
22299 * to be forwarded over this SCID and forward them to this messages' recipient.
22301 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
22304 * If set, provides a short_channel_id alias for this channel. The sender will accept payments
22305 * to be forwarded over this SCID and forward them to this messages' recipient.
22307 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
22310 * Constructs a new ChannelReady given each field
22312 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);
22315 * Creates a copy of the ChannelReady
22317 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
22320 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
22322 void Shutdown_free(struct LDKShutdown this_obj);
22327 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
22332 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22335 * The destination of this peer's funds on closing.
22336 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
22338 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
22341 * The destination of this peer's funds on closing.
22342 * Must be in one of these forms: p2pkh, p2sh, p2wpkh, p2wsh.
22344 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
22347 * Constructs a new Shutdown given each field
22349 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
22352 * Creates a copy of the Shutdown
22354 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
22357 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
22359 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
22362 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
22365 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
22368 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
22371 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
22374 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
22377 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
22380 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
22383 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
22386 * Constructs a new ClosingSignedFeeRange given each field
22388 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
22391 * Creates a copy of the ClosingSignedFeeRange
22393 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
22396 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
22398 void ClosingSigned_free(struct LDKClosingSigned this_obj);
22403 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
22408 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22411 * The proposed total fee for the closing transaction
22413 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
22416 * The proposed total fee for the closing transaction
22418 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
22421 * A signature on the closing transaction
22423 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
22426 * A signature on the closing transaction
22428 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
22431 * The minimum and maximum fees which the sender is willing to accept, provided only by new
22434 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22436 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
22439 * The minimum and maximum fees which the sender is willing to accept, provided only by new
22442 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22444 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
22447 * Constructs a new ClosingSigned given each field
22449 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);
22452 * Creates a copy of the ClosingSigned
22454 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
22457 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
22459 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
22464 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
22469 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22474 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
22479 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
22482 * The HTLC value in milli-satoshi
22484 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
22487 * The HTLC value in milli-satoshi
22489 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
22492 * The payment hash, the pre-image of which controls HTLC redemption
22494 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
22497 * The payment hash, the pre-image of which controls HTLC redemption
22499 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22502 * The expiry height of the HTLC
22504 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
22507 * The expiry height of the HTLC
22509 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
22512 * Creates a copy of the UpdateAddHTLC
22514 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
22517 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
22519 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
22524 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
22529 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22534 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
22539 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
22542 * The pre-image of the payment hash, allowing HTLC redemption
22544 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
22547 * The pre-image of the payment hash, allowing HTLC redemption
22549 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22552 * Constructs a new UpdateFulfillHTLC given each field
22554 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
22557 * Creates a copy of the UpdateFulfillHTLC
22559 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
22562 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
22564 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
22569 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
22574 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22579 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
22584 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
22587 * Creates a copy of the UpdateFailHTLC
22589 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
22592 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
22594 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
22599 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
22604 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22609 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
22614 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
22619 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
22624 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
22627 * Creates a copy of the UpdateFailMalformedHTLC
22629 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
22632 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
22634 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
22639 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
22644 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22647 * A signature on the commitment transaction
22649 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
22652 * A signature on the commitment transaction
22654 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
22657 * Signatures on the HTLC transactions
22659 * Returns a copy of the field.
22661 struct LDKCVec_SignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
22664 * Signatures on the HTLC transactions
22666 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
22669 * Constructs a new CommitmentSigned given each field
22671 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
22674 * Creates a copy of the CommitmentSigned
22676 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
22679 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
22681 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
22686 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
22691 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22694 * The secret corresponding to the per-commitment point
22696 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
22699 * The secret corresponding to the per-commitment point
22701 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22704 * The next sender-broadcast commitment transaction's per-commitment point
22706 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
22709 * The next sender-broadcast commitment transaction's per-commitment point
22711 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22714 * Constructs a new RevokeAndACK given each field
22716 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);
22719 * Creates a copy of the RevokeAndACK
22721 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
22724 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
22726 void UpdateFee_free(struct LDKUpdateFee this_obj);
22731 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
22736 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22739 * Fee rate per 1000-weight of the transaction
22741 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
22744 * Fee rate per 1000-weight of the transaction
22746 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
22749 * Constructs a new UpdateFee given each field
22751 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
22754 * Creates a copy of the UpdateFee
22756 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
22759 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
22761 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
22764 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
22765 * belonging to the recipient
22767 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
22770 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
22771 * belonging to the recipient
22773 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22776 * The sender's per-commitment point for their current commitment transaction
22778 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
22781 * The sender's per-commitment point for their current commitment transaction
22783 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22786 * Constructs a new DataLossProtect given each field
22788 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
22791 * Creates a copy of the DataLossProtect
22793 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
22796 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
22798 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
22803 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
22808 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22811 * The next commitment number for the sender
22813 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
22816 * The next commitment number for the sender
22818 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
22821 * The next commitment number for the recipient
22823 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
22826 * The next commitment number for the recipient
22828 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
22831 * Creates a copy of the ChannelReestablish
22833 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
22836 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
22838 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
22843 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
22848 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22851 * The short channel ID
22853 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22856 * The short channel ID
22858 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
22861 * A signature by the node key
22863 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22866 * A signature by the node key
22868 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
22871 * A signature by the funding key
22873 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
22876 * A signature by the funding key
22878 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
22881 * Constructs a new AnnouncementSignatures given each field
22883 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);
22886 * Creates a copy of the AnnouncementSignatures
22888 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
22891 * Frees any resources used by the NetAddress
22893 void NetAddress_free(struct LDKNetAddress this_ptr);
22896 * Creates a copy of the NetAddress
22898 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
22901 * Utility method to constructs a new IPv4-variant NetAddress
22903 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
22906 * Utility method to constructs a new IPv6-variant NetAddress
22908 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
22911 * Utility method to constructs a new OnionV2-variant NetAddress
22913 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
22916 * Utility method to constructs a new OnionV3-variant NetAddress
22918 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
22921 * Utility method to constructs a new Hostname-variant NetAddress
22923 struct LDKNetAddress NetAddress_hostname(struct LDKHostname hostname, uint16_t port);
22926 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
22928 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
22931 * Read a NetAddress from a byte array, created by NetAddress_write
22933 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
22936 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
22938 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
22941 * The advertised features
22943 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22946 * The advertised features
22948 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
22951 * A strictly monotonic announcement counter, with gaps allowed
22953 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22956 * A strictly monotonic announcement counter, with gaps allowed
22958 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
22961 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
22964 struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
22967 * The node_id this announcement originated from (don't rebroadcast the node_announcement back
22970 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22973 * An RGB color for UI purposes
22975 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
22978 * An RGB color for UI purposes
22980 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
22983 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
22986 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
22989 * An alias, for UI purposes. This should be sanitized before use. There is no guarantee
22992 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22995 * List of addresses on which this node is reachable
22997 * Returns a copy of the field.
22999 struct LDKCVec_NetAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
23002 * List of addresses on which this node is reachable
23004 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
23007 * Creates a copy of the UnsignedNodeAnnouncement
23009 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
23012 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
23014 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
23017 * The signature by the node key
23019 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
23022 * The signature by the node key
23024 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
23027 * The actual content of the announcement
23029 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
23032 * The actual content of the announcement
23034 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
23037 * Constructs a new NodeAnnouncement given each field
23039 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
23042 * Creates a copy of the NodeAnnouncement
23044 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
23047 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
23049 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
23052 * The advertised channel features
23054 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
23057 * The advertised channel features
23059 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
23062 * The genesis hash of the blockchain where the channel is to be opened
23064 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
23067 * The genesis hash of the blockchain where the channel is to be opened
23069 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23072 * The short channel ID
23074 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
23077 * The short channel ID
23079 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
23082 * One of the two node_ids which are endpoints of this channel
23084 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
23087 * One of the two node_ids which are endpoints of this channel
23089 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23092 * The other of the two node_ids which are endpoints of this channel
23094 struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
23097 * The other of the two node_ids which are endpoints of this channel
23099 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23102 * The funding key for the first node
23104 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
23107 * The funding key for the first node
23109 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23112 * The funding key for the second node
23114 struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
23117 * The funding key for the second node
23119 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23122 * Creates a copy of the UnsignedChannelAnnouncement
23124 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
23127 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
23129 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
23132 * Authentication of the announcement by the first public node
23134 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
23137 * Authentication of the announcement by the first public node
23139 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
23142 * Authentication of the announcement by the second public node
23144 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
23147 * Authentication of the announcement by the second public node
23149 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
23152 * Proof of funding UTXO ownership by the first public node
23154 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
23157 * Proof of funding UTXO ownership by the first public node
23159 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
23162 * Proof of funding UTXO ownership by the second public node
23164 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
23167 * Proof of funding UTXO ownership by the second public node
23169 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
23172 * The actual announcement
23174 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
23177 * The actual announcement
23179 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
23182 * Constructs a new ChannelAnnouncement given each field
23184 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);
23187 * Creates a copy of the ChannelAnnouncement
23189 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
23192 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
23194 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
23197 * The genesis hash of the blockchain where the channel is to be opened
23199 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
23202 * The genesis hash of the blockchain where the channel is to be opened
23204 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23207 * The short channel ID
23209 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23212 * The short channel ID
23214 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
23217 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
23219 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23222 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
23224 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
23229 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23234 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
23237 * The number of blocks such that if:
23238 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
23239 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
23240 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
23241 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
23242 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
23243 * forwarding. Note that the HTLC sender is the one who originally sets this value when
23244 * constructing the route.
23246 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23249 * The number of blocks such that if:
23250 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
23251 * then we need to fail the HTLC backwards. When forwarding an HTLC, cltv_expiry_delta determines
23252 * the outgoing HTLC's minimum cltv_expiry value -- so, if an incoming HTLC comes in with a
23253 * cltv_expiry of 100000, and the node we're forwarding to has a cltv_expiry_delta value of 10,
23254 * then we'll check that the outgoing HTLC's cltv_expiry value is at least 100010 before
23255 * forwarding. Note that the HTLC sender is the one who originally sets this value when
23256 * constructing the route.
23258 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
23261 * The minimum HTLC size incoming to sender, in milli-satoshi
23263 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23266 * The minimum HTLC size incoming to sender, in milli-satoshi
23268 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
23271 * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional.
23273 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23276 * The maximum HTLC value incoming to sender, in milli-satoshi. Used to be optional.
23278 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
23281 * The base HTLC fee charged by sender, in milli-satoshi
23283 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23286 * The base HTLC fee charged by sender, in milli-satoshi
23288 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
23291 * The amount to fee multiplier, in micro-satoshi
23293 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23296 * The amount to fee multiplier, in micro-satoshi
23298 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
23301 * Excess data which was signed as a part of the message which we do not (yet) understand how
23302 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
23305 * Returns a copy of the field.
23307 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
23310 * Excess data which was signed as a part of the message which we do not (yet) understand how
23311 * to decode. This is stored to ensure forward-compatibility as new fields are added to the
23314 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
23317 * Constructs a new UnsignedChannelUpdate given each field
23319 MUST_USE_RES struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_new(struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, uint32_t timestamp_arg, uint8_t flags_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, struct LDKCVec_u8Z excess_data_arg);
23322 * Creates a copy of the UnsignedChannelUpdate
23324 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
23327 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
23329 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
23332 * A signature of the channel update
23334 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
23337 * A signature of the channel update
23339 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
23342 * The actual channel update
23344 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
23347 * The actual channel update
23349 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
23352 * Constructs a new ChannelUpdate given each field
23354 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
23357 * Creates a copy of the ChannelUpdate
23359 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
23362 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
23364 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
23367 * The genesis hash of the blockchain being queried
23369 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
23372 * The genesis hash of the blockchain being queried
23374 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23377 * The height of the first block for the channel UTXOs being queried
23379 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
23382 * The height of the first block for the channel UTXOs being queried
23384 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
23387 * The number of blocks to include in the query results
23389 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
23392 * The number of blocks to include in the query results
23394 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
23397 * Constructs a new QueryChannelRange given each field
23399 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
23402 * Creates a copy of the QueryChannelRange
23404 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
23407 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
23409 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
23412 * The genesis hash of the blockchain being queried
23414 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
23417 * The genesis hash of the blockchain being queried
23419 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23422 * The height of the first block in the range of the reply
23424 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
23427 * The height of the first block in the range of the reply
23429 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
23432 * The number of blocks included in the range of the reply
23434 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
23437 * The number of blocks included in the range of the reply
23439 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
23442 * True when this is the final reply for a query
23444 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
23447 * True when this is the final reply for a query
23449 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
23452 * The short_channel_ids in the channel range
23454 * Returns a copy of the field.
23456 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
23459 * The short_channel_ids in the channel range
23461 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
23464 * Constructs a new ReplyChannelRange given each field
23466 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);
23469 * Creates a copy of the ReplyChannelRange
23471 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
23474 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
23476 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
23479 * The genesis hash of the blockchain being queried
23481 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
23484 * The genesis hash of the blockchain being queried
23486 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23489 * The short_channel_ids that are being queried
23491 * Returns a copy of the field.
23493 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
23496 * The short_channel_ids that are being queried
23498 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
23501 * Constructs a new QueryShortChannelIds given each field
23503 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
23506 * Creates a copy of the QueryShortChannelIds
23508 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
23511 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
23513 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
23516 * The genesis hash of the blockchain that was queried
23518 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
23521 * The genesis hash of the blockchain that was queried
23523 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23526 * Indicates if the query recipient maintains up-to-date channel
23527 * information for the chain_hash
23529 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
23532 * Indicates if the query recipient maintains up-to-date channel
23533 * information for the chain_hash
23535 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
23538 * Constructs a new ReplyShortChannelIdsEnd given each field
23540 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
23543 * Creates a copy of the ReplyShortChannelIdsEnd
23545 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
23548 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
23550 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
23553 * The genesis hash of the blockchain for channel and node information
23555 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
23558 * The genesis hash of the blockchain for channel and node information
23560 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23563 * The starting unix timestamp
23565 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
23568 * The starting unix timestamp
23570 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
23573 * The range of information in seconds
23575 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
23578 * The range of information in seconds
23580 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
23583 * Constructs a new GossipTimestampFilter given each field
23585 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
23588 * Creates a copy of the GossipTimestampFilter
23590 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
23593 * Frees any resources used by the ErrorAction
23595 void ErrorAction_free(struct LDKErrorAction this_ptr);
23598 * Creates a copy of the ErrorAction
23600 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
23603 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
23605 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
23608 * Utility method to constructs a new IgnoreError-variant ErrorAction
23610 struct LDKErrorAction ErrorAction_ignore_error(void);
23613 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
23615 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
23618 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
23620 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
23623 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
23625 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
23628 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
23630 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
23633 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
23635 void LightningError_free(struct LDKLightningError this_obj);
23638 * A human-readable message describing the error
23640 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
23643 * A human-readable message describing the error
23645 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
23648 * The action which should be taken against the offending peer.
23650 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
23653 * The action which should be taken against the offending peer.
23655 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
23658 * Constructs a new LightningError given each field
23660 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
23663 * Creates a copy of the LightningError
23665 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
23668 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
23670 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
23673 * update_add_htlc messages which should be sent
23675 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23678 * update_add_htlc messages which should be sent
23680 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
23683 * update_fulfill_htlc messages which should be sent
23685 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23688 * update_fulfill_htlc messages which should be sent
23690 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
23693 * update_fail_htlc messages which should be sent
23695 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23698 * update_fail_htlc messages which should be sent
23700 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
23703 * update_fail_malformed_htlc messages which should be sent
23705 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23708 * update_fail_malformed_htlc messages which should be sent
23710 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
23713 * An update_fee message which should be sent
23715 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23717 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23720 * An update_fee message which should be sent
23722 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23724 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
23727 * Finally, the commitment_signed message which should be sent
23729 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
23732 * Finally, the commitment_signed message which should be sent
23734 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
23737 * Constructs a new CommitmentUpdate given each field
23739 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);
23742 * Creates a copy of the CommitmentUpdate
23744 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
23747 * Calls the free function if one is set
23749 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
23752 * Calls the free function if one is set
23754 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
23757 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
23759 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
23762 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
23764 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
23767 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
23769 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
23772 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
23774 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
23777 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
23779 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
23782 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
23784 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
23787 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
23789 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
23792 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
23794 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
23797 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
23799 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
23802 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
23804 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
23807 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
23809 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
23812 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
23814 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
23817 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
23819 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
23822 * Read a FundingCreated from a byte array, created by FundingCreated_write
23824 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
23827 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
23829 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
23832 * Read a FundingSigned from a byte array, created by FundingSigned_write
23834 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
23837 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
23839 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
23842 * Read a ChannelReady from a byte array, created by ChannelReady_write
23844 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
23847 * Serialize the Init object into a byte array which can be read by Init_read
23849 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
23852 * Read a Init from a byte array, created by Init_write
23854 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
23857 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
23859 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
23862 * Read a OpenChannel from a byte array, created by OpenChannel_write
23864 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
23867 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
23869 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
23872 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
23874 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
23877 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
23879 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
23882 * Read a Shutdown from a byte array, created by Shutdown_write
23884 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
23887 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
23889 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
23892 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
23894 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
23897 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
23899 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
23902 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
23904 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
23907 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
23909 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
23912 * Read a UpdateFee from a byte array, created by UpdateFee_write
23914 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
23917 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
23919 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
23922 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
23924 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
23927 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
23929 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
23932 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
23934 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
23937 * Serialize the Ping object into a byte array which can be read by Ping_read
23939 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
23942 * Read a Ping from a byte array, created by Ping_write
23944 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
23947 * Serialize the Pong object into a byte array which can be read by Pong_read
23949 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
23952 * Read a Pong from a byte array, created by Pong_write
23954 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
23957 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
23959 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
23962 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
23964 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
23967 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
23969 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
23972 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
23974 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
23977 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
23979 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
23982 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
23984 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
23987 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
23989 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
23992 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
23994 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
23997 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
23999 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
24002 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
24004 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
24007 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
24009 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
24012 * Read a WarningMessage from a byte array, created by WarningMessage_write
24014 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
24017 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
24019 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
24022 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
24024 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
24027 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
24029 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
24032 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
24034 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
24037 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
24039 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
24042 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
24044 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
24047 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
24049 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
24052 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
24054 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
24057 *\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
24059 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
24062 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
24064 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
24067 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
24069 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
24072 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
24074 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
24077 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
24079 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
24082 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
24084 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
24087 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
24089 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
24092 * Calls the free function if one is set
24094 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
24097 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
24099 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
24102 * Constructs a new IgnoringMessageHandler given each field
24104 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
24107 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
24108 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
24110 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
24113 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
24114 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
24116 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
24119 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
24120 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
24122 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
24125 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
24126 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
24128 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
24131 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
24133 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
24136 * Constructs a new ErroringMessageHandler
24138 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
24141 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
24142 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
24144 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
24147 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
24148 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
24150 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
24153 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
24155 void MessageHandler_free(struct LDKMessageHandler this_obj);
24158 * A message handler which handles messages specific to channels. Usually this is just a
24159 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
24161 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
24163 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
24166 * A message handler which handles messages specific to channels. Usually this is just a
24167 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
24169 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
24171 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
24174 * A message handler which handles messages updating our knowledge of the network channel
24175 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
24177 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
24179 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
24182 * A message handler which handles messages updating our knowledge of the network channel
24183 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
24185 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
24187 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
24190 * Constructs a new MessageHandler given each field
24192 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg);
24195 * Creates a copy of a SocketDescriptor
24197 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
24200 * Calls the free function if one is set
24202 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
24205 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
24207 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
24210 * Used to indicate that we probably can't make any future connections to this peer (e.g.
24211 * because we required features that our peer was missing, or vice versa).
24213 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
24214 * any channels with this peer or check for new versions of LDK.
24216 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
24218 bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr);
24221 * Used to indicate that we probably can't make any future connections to this peer (e.g.
24222 * because we required features that our peer was missing, or vice versa).
24224 * While LDK's [`ChannelManager`] will not do it automatically, you likely wish to force-close
24225 * any channels with this peer or check for new versions of LDK.
24227 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
24229 void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val);
24232 * Constructs a new PeerHandleError given each field
24234 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg);
24237 * Creates a copy of the PeerHandleError
24239 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
24242 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
24244 void PeerManager_free(struct LDKPeerManager this_obj);
24247 * Constructs a new PeerManager with the given message handlers and node_id secret key
24248 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
24249 * cryptographically secure random bytes.
24251 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);
24254 * Get the list of node ids for peers which have completed the initial handshake.
24256 * For outbound connections, this will be the same as the their_node_id parameter passed in to
24257 * new_outbound_connection, however entries will only appear once the initial handshake has
24258 * completed and we are sure the remote peer has the private key for the given node_id.
24260 MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
24263 * Indicates a new outbound connection has been established to a node with the given node_id
24264 * and an optional remote network address.
24266 * The remote network address adds the option to report a remote IP address back to a connecting
24267 * peer using the init message.
24268 * The user should pass the remote network address of the host they are connected to.
24270 * If an `Err` is returned here you must disconnect the connection immediately.
24272 * Returns a small number of bytes to send to the remote node (currently always 50).
24274 * Panics if descriptor is duplicative with some other descriptor which has not yet been
24275 * [`socket_disconnected()`].
24277 * [`socket_disconnected()`]: PeerManager::socket_disconnected
24279 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);
24282 * Indicates a new inbound connection has been established to a node with an optional remote
24285 * The remote network address adds the option to report a remote IP address back to a connecting
24286 * peer using the init message.
24287 * The user should pass the remote network address of the host they are connected to.
24289 * May refuse the connection by returning an Err, but will never write bytes to the remote end
24290 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
24291 * the connection immediately.
24293 * Panics if descriptor is duplicative with some other descriptor which has not yet been
24294 * [`socket_disconnected()`].
24296 * [`socket_disconnected()`]: PeerManager::socket_disconnected
24298 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);
24301 * Indicates that there is room to write data to the given socket descriptor.
24303 * May return an Err to indicate that the connection should be closed.
24305 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
24306 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
24307 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
24308 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
24311 * [`send_data`]: SocketDescriptor::send_data
24312 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
24314 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
24317 * Indicates that data was read from the given socket descriptor.
24319 * May return an Err to indicate that the connection should be closed.
24321 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
24322 * Thus, however, you should call [`process_events`] after any `read_event` to generate
24323 * [`send_data`] calls to handle responses.
24325 * If `Ok(true)` is returned, further read_events should not be triggered until a
24326 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
24329 * [`send_data`]: SocketDescriptor::send_data
24330 * [`process_events`]: PeerManager::process_events
24332 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);
24335 * Checks for any events generated by our handlers and processes them. Includes sending most
24336 * response messages as well as messages generated by calls to handler functions directly (eg
24337 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
24339 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
24342 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
24343 * or one of the other clients provided in our language bindings.
24345 * Note that if there are any other calls to this function waiting on lock(s) this may return
24346 * without doing any work. All available events that need handling will be handled before the
24347 * other calls return.
24349 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
24350 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
24351 * [`send_data`]: SocketDescriptor::send_data
24353 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
24356 * Indicates that the given socket descriptor's connection is now closed.
24358 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
24361 * Disconnect a peer given its node id.
24363 * Set `no_connection_possible` to true to prevent any further connection with this peer,
24364 * force-closing any channels we have with it.
24366 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
24367 * peer. Thus, be very careful about reentrancy issues.
24369 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
24371 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, bool no_connection_possible);
24374 * Disconnects all currently-connected peers. This is useful on platforms where there may be
24375 * an indication that TCP sockets have stalled even if we weren't around to time them out
24376 * using regular ping/pongs.
24378 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
24381 * Send pings to each peer and disconnect those which did not respond to the last round of
24384 * This may be called on any timescale you want, however, roughly once every ten seconds is
24385 * preferred. The call rate determines both how often we send a ping to our peers and how much
24386 * time they have to respond before we disconnect them.
24388 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
24391 * [`send_data`]: SocketDescriptor::send_data
24393 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
24396 * Gets the weight for an HTLC-Success transaction.
24398 uint64_t htlc_success_tx_weight(bool opt_anchors);
24401 * Gets the weight for an HTLC-Timeout transaction.
24403 uint64_t htlc_timeout_tx_weight(bool opt_anchors);
24406 * Build the commitment secret from the seed and the commitment number
24408 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
24411 * Build a closing transaction
24413 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);
24416 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
24418 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
24421 * Creates a copy of the CounterpartyCommitmentSecrets
24423 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
24426 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
24428 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
24431 * Returns the minimum index of all stored secrets. Note that indexes start
24432 * at 1 << 48 and get decremented by one for each new secret.
24434 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
24437 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
24438 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
24440 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
24443 * Returns the secret at `idx`.
24444 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
24446 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24448 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
24451 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
24453 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
24456 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
24458 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
24461 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
24462 * from the base secret and the per_commitment_point.
24464 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
24465 * generated (ie our own).
24467 struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
24470 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
24471 * from the base point and the per_commitment_key. This is the public equivalent of
24472 * derive_private_key - using only public keys to derive a public key instead of private keys.
24474 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
24475 * generated (ie our own).
24477 struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
24480 * Derives a per-commitment-transaction revocation key from its constituent parts.
24482 * Only the cheating participant owns a valid witness to propagate a revoked
24483 * commitment transaction, thus per_commitment_secret always come from cheater
24484 * and revocation_base_secret always come from punisher, which is the broadcaster
24485 * of the transaction spending with this key knowledge.
24487 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
24488 * generated (ie our own).
24490 struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
24493 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
24494 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
24495 * public key instead of private keys.
24497 * Only the cheating participant owns a valid witness to propagate a revoked
24498 * commitment transaction, thus per_commitment_point always come from cheater
24499 * and revocation_base_point always come from punisher, which is the broadcaster
24500 * of the transaction spending with this key knowledge.
24502 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
24503 * generated (ie our own).
24505 struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
24508 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
24510 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
24513 * The broadcaster's per-commitment public key which was used to derive the other keys.
24515 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24518 * The broadcaster's per-commitment public key which was used to derive the other keys.
24520 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24523 * The revocation key which is used to allow the broadcaster of the commitment
24524 * transaction to provide their counterparty the ability to punish them if they broadcast
24527 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24530 * The revocation key which is used to allow the broadcaster of the commitment
24531 * transaction to provide their counterparty the ability to punish them if they broadcast
24534 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24537 * Broadcaster's HTLC Key
24539 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24542 * Broadcaster's HTLC Key
24544 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24547 * Countersignatory's HTLC Key
24549 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24552 * Countersignatory's HTLC Key
24554 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24557 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
24559 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
24562 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
24564 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24567 * Constructs a new TxCreationKeys given each field
24569 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);
24572 * Creates a copy of the TxCreationKeys
24574 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
24577 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
24579 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
24582 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
24584 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
24587 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
24589 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
24592 * The public key which is used to sign all commitment transactions, as it appears in the
24593 * on-chain channel lock-in 2-of-2 multisig output.
24595 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24598 * The public key which is used to sign all commitment transactions, as it appears in the
24599 * on-chain channel lock-in 2-of-2 multisig output.
24601 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24604 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
24605 * revocation keys. This is combined with the per-commitment-secret generated by the
24606 * counterparty to create a secret which the counterparty can reveal to revoke previous
24609 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24612 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
24613 * revocation keys. This is combined with the per-commitment-secret generated by the
24614 * counterparty to create a secret which the counterparty can reveal to revoke previous
24617 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24620 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
24621 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
24622 * static across every commitment transaction.
24624 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24627 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
24628 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
24629 * static across every commitment transaction.
24631 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24634 * The base point which is used (with derive_public_key) to derive a per-commitment payment
24635 * public key which receives non-HTLC-encumbered funds which are only available for spending
24636 * after some delay (or can be claimed via the revocation path).
24638 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24641 * The base point which is used (with derive_public_key) to derive a per-commitment payment
24642 * public key which receives non-HTLC-encumbered funds which are only available for spending
24643 * after some delay (or can be claimed via the revocation path).
24645 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24648 * The base point which is used (with derive_public_key) to derive a per-commitment public key
24649 * which is used to encumber HTLC-in-flight outputs.
24651 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
24654 * The base point which is used (with derive_public_key) to derive a per-commitment public key
24655 * which is used to encumber HTLC-in-flight outputs.
24657 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24660 * Constructs a new ChannelPublicKeys given each field
24662 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);
24665 * Creates a copy of the ChannelPublicKeys
24667 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
24670 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
24672 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
24675 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
24677 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
24680 * Create per-state keys from channel base points and the per-commitment point.
24681 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
24683 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);
24686 * Generate per-state keys from channel static keys.
24687 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
24689 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);
24692 * A script either spendable by the revocation
24693 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
24694 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
24696 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
24699 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
24701 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
24704 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
24705 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
24706 * need to compare this value to whether the commitment transaction in question is that of
24707 * the counterparty or our own.
24709 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24712 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
24713 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
24714 * need to compare this value to whether the commitment transaction in question is that of
24715 * the counterparty or our own.
24717 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
24720 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
24721 * this divided by 1000.
24723 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24726 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
24727 * this divided by 1000.
24729 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
24732 * The CLTV lock-time at which this HTLC expires.
24734 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24737 * The CLTV lock-time at which this HTLC expires.
24739 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
24742 * The hash of the preimage which unlocks this HTLC.
24744 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
24747 * The hash of the preimage which unlocks this HTLC.
24749 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24752 * The position within the commitment transactions' outputs. This may be None if the value is
24753 * below the dust limit (in which case no output appears in the commitment transaction and the
24754 * value is spent to additional transaction fees).
24756 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
24759 * The position within the commitment transactions' outputs. This may be None if the value is
24760 * below the dust limit (in which case no output appears in the commitment transaction and the
24761 * value is spent to additional transaction fees).
24763 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
24766 * Constructs a new HTLCOutputInCommitment given each field
24768 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);
24771 * Creates a copy of the HTLCOutputInCommitment
24773 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
24776 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
24778 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
24781 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
24783 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
24786 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
24787 * does not need to have its previous_output_index filled.
24789 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
24792 * Gets the redeemscript for a funding output from the two funding public keys.
24793 * Note that the order of funding public keys does not matter.
24795 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
24798 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
24799 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
24800 * transaction which needs signing, and can be used to construct an HTLC transaction which is
24801 * broadcastable given a counterparty HTLC signature.
24803 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
24804 * commitment transaction).
24806 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);
24809 * Gets the witnessScript for an anchor output from the funding public key.
24810 * The witness in the spending input must be:
24811 * <BIP 143 funding_signature>
24812 * After 16 blocks of confirmation, an alternative satisfying witness could be:
24814 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
24816 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
24819 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24821 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
24824 * Holder public keys
24826 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24829 * Holder public keys
24831 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
24834 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
24836 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24839 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
24841 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
24844 * Whether the holder is the initiator of this channel.
24845 * This is an input to the commitment number obscure factor computation.
24847 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24850 * Whether the holder is the initiator of this channel.
24851 * This is an input to the commitment number obscure factor computation.
24853 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
24856 * The late-bound counterparty channel transaction parameters.
24857 * These parameters are populated at the point in the protocol where the counterparty provides them.
24859 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24861 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24864 * The late-bound counterparty channel transaction parameters.
24865 * These parameters are populated at the point in the protocol where the counterparty provides them.
24867 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24869 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
24872 * The late-bound funding outpoint
24874 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24876 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24879 * The late-bound funding outpoint
24881 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24883 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
24886 * Are anchors used for this channel. Boolean is serialization backwards-compatible
24888 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
24891 * Are anchors used for this channel. Boolean is serialization backwards-compatible
24893 void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
24896 * Constructs a new ChannelTransactionParameters given each field
24898 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);
24901 * Creates a copy of the ChannelTransactionParameters
24903 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
24906 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24908 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
24911 * Counter-party public keys
24913 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
24916 * Counter-party public keys
24918 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
24921 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
24923 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
24926 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
24928 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
24931 * Constructs a new CounterpartyChannelTransactionParameters given each field
24933 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
24936 * Creates a copy of the CounterpartyChannelTransactionParameters
24938 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
24941 * Whether the late bound parameters are populated.
24943 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24946 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
24947 * given that the holder is the broadcaster.
24949 * self.is_populated() must be true before calling this function.
24951 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24954 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
24955 * given that the counterparty is the broadcaster.
24957 * self.is_populated() must be true before calling this function.
24959 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
24962 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
24964 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
24967 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
24969 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
24972 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
24974 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
24977 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
24979 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
24982 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
24984 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
24987 * Get the channel pubkeys for the broadcaster
24989 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24992 * Get the channel pubkeys for the countersignatory
24994 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
24997 * Get the contest delay applicable to the transactions.
24998 * Note that the contest delay was selected by the countersignatory.
25000 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
25003 * Whether the channel is outbound from the broadcaster.
25005 * The boolean representing the side that initiated the channel is
25006 * an input to the commitment number obscure factor computation.
25008 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
25011 * The funding outpoint
25013 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
25016 * Whether to use anchors for this channel
25018 MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
25021 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
25023 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
25026 * Our counterparty's signature for the transaction
25028 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
25031 * Our counterparty's signature for the transaction
25033 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
25036 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
25038 * Returns a copy of the field.
25040 struct LDKCVec_SignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
25043 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
25045 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
25048 * Creates a copy of the HolderCommitmentTransaction
25050 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
25053 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
25055 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
25058 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
25060 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
25063 * Create a new holder transaction with the given counterparty signatures.
25064 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
25066 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);
25069 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
25071 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
25074 * The commitment transaction
25076 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
25079 * The commitment transaction
25081 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
25084 * The txid for the commitment transaction.
25086 * This is provided as a performance optimization, instead of calling transaction.txid()
25089 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
25092 * The txid for the commitment transaction.
25094 * This is provided as a performance optimization, instead of calling transaction.txid()
25097 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25100 * Constructs a new BuiltCommitmentTransaction given each field
25102 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
25105 * Creates a copy of the BuiltCommitmentTransaction
25107 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
25110 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
25112 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
25115 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
25117 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
25120 * Get the SIGHASH_ALL sighash value of the transaction.
25122 * This can be used to verify a signature.
25124 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);
25127 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
25128 * because we are about to broadcast a holder transaction.
25130 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);
25133 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
25135 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
25138 * Creates a copy of the ClosingTransaction
25140 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
25143 * Checks if two ClosingTransactions contain equal inner contents.
25145 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
25148 * Construct an object of the class
25150 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);
25153 * Trust our pre-built transaction.
25155 * Applies a wrapper which allows access to the transaction.
25157 * This should only be used if you fully trust the builder of this object. It should not
25158 * be used by an external signer - instead use the verify function.
25160 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
25163 * Verify our pre-built transaction.
25165 * Applies a wrapper which allows access to the transaction.
25167 * An external validating signer must call this method before signing
25168 * or using the built transaction.
25170 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
25173 * The value to be sent to the holder, or zero if the output will be omitted
25175 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
25178 * The value to be sent to the counterparty, or zero if the output will be omitted
25180 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
25183 * The destination of the holder's output
25185 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
25188 * The destination of the counterparty's output
25190 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
25193 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
25195 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
25198 * The pre-built Bitcoin commitment transaction
25200 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
25203 * Get the SIGHASH_ALL sighash value of the transaction.
25205 * This can be used to verify a signature.
25207 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);
25210 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
25211 * because we are about to broadcast a holder transaction.
25213 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);
25216 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
25218 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
25221 * Creates a copy of the CommitmentTransaction
25223 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
25226 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
25228 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
25231 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
25233 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
25236 * The backwards-counting commitment number
25238 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
25241 * The value to be sent to the broadcaster
25243 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
25246 * The value to be sent to the counterparty
25248 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
25251 * The feerate paid per 1000-weight-unit in this commitment transaction.
25253 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
25256 * Trust our pre-built transaction and derived transaction creation public keys.
25258 * Applies a wrapper which allows access to these fields.
25260 * This should only be used if you fully trust the builder of this object. It should not
25261 * be used by an external signer - instead use the verify function.
25263 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
25266 * Verify our pre-built transaction and derived transaction creation public keys.
25268 * Applies a wrapper which allows access to these fields.
25270 * An external validating signer must call this method before signing
25271 * or using the built transaction.
25273 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);
25276 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
25278 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
25281 * The transaction ID of the built Bitcoin transaction
25283 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
25286 * The pre-built Bitcoin commitment transaction
25288 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
25291 * The pre-calculated transaction creation public keys.
25293 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
25296 * Should anchors be used.
25298 MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
25301 * Get a signature for each HTLC which was included in the commitment transaction (ie for
25302 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
25304 * The returned Vec has one entry for each HTLC, and in the same order.
25306 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
25308 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);
25311 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
25312 * shared secret first. This prevents on-chain observers from discovering how many commitment
25313 * transactions occurred in a channel before it was closed.
25315 * This function gets the shared secret from relevant channel public keys and can be used to
25316 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
25318 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
25321 * Checks if two InitFeaturess contain equal inner contents.
25322 * This ignores pointers and is_owned flags and looks at the values in fields.
25323 * Two objects with NULL inner values will be considered "equal" here.
25325 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
25328 * Checks if two NodeFeaturess contain equal inner contents.
25329 * This ignores pointers and is_owned flags and looks at the values in fields.
25330 * Two objects with NULL inner values will be considered "equal" here.
25332 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
25335 * Checks if two ChannelFeaturess contain equal inner contents.
25336 * This ignores pointers and is_owned flags and looks at the values in fields.
25337 * Two objects with NULL inner values will be considered "equal" here.
25339 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
25342 * Checks if two InvoiceFeaturess contain equal inner contents.
25343 * This ignores pointers and is_owned flags and looks at the values in fields.
25344 * Two objects with NULL inner values will be considered "equal" here.
25346 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
25349 * Checks if two ChannelTypeFeaturess contain equal inner contents.
25350 * This ignores pointers and is_owned flags and looks at the values in fields.
25351 * Two objects with NULL inner values will be considered "equal" here.
25353 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
25356 * Creates a copy of the InitFeatures
25358 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
25361 * Creates a copy of the NodeFeatures
25363 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
25366 * Creates a copy of the ChannelFeatures
25368 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
25371 * Creates a copy of the InvoiceFeatures
25373 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
25376 * Creates a copy of the ChannelTypeFeatures
25378 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
25381 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
25383 void InitFeatures_free(struct LDKInitFeatures this_obj);
25386 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
25388 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
25391 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
25393 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
25396 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
25398 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
25401 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
25403 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
25406 * Create a blank Features with no features set
25408 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
25411 * Creates a Features with the bits set which are known by the implementation
25413 MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
25416 * Returns true if this `Features` object contains unknown feature flags which are set as
25419 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25422 * Create a blank Features with no features set
25424 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
25427 * Creates a Features with the bits set which are known by the implementation
25429 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
25432 * Returns true if this `Features` object contains unknown feature flags which are set as
25435 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25438 * Create a blank Features with no features set
25440 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
25443 * Creates a Features with the bits set which are known by the implementation
25445 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
25448 * Returns true if this `Features` object contains unknown feature flags which are set as
25451 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
25454 * Create a blank Features with no features set
25456 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
25459 * Creates a Features with the bits set which are known by the implementation
25461 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
25464 * Returns true if this `Features` object contains unknown feature flags which are set as
25467 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25470 * Create a blank Features with no features set
25472 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
25475 * Creates a Features with the bits set which are known by the implementation
25477 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void);
25480 * Returns true if this `Features` object contains unknown feature flags which are set as
25483 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25486 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
25488 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
25491 * Read a InitFeatures from a byte array, created by InitFeatures_write
25493 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
25496 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
25498 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
25501 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
25503 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
25506 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
25508 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
25511 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
25513 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
25516 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
25518 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
25521 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
25523 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
25526 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
25528 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
25531 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
25533 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
25536 * Set this feature as optional.
25538 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25541 * Set this feature as required.
25543 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25546 * Checks if this feature is supported.
25548 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25551 * Set this feature as optional.
25553 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25556 * Set this feature as required.
25558 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25561 * Checks if this feature is supported.
25563 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25566 * Checks if this feature is required.
25568 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25571 * Checks if this feature is required.
25573 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25576 * Set this feature as optional.
25578 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25581 * Set this feature as required.
25583 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25586 * Checks if this feature is supported.
25588 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25591 * Set this feature as optional.
25593 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25596 * Set this feature as required.
25598 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25601 * Checks if this feature is supported.
25603 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25606 * Set this feature as optional.
25608 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25611 * Set this feature as required.
25613 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25616 * Checks if this feature is supported.
25618 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25621 * Checks if this feature is required.
25623 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25626 * Checks if this feature is required.
25628 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25631 * Set this feature as optional.
25633 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25636 * Set this feature as required.
25638 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25641 * Checks if this feature is supported.
25643 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25646 * Set this feature as optional.
25648 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25651 * Set this feature as required.
25653 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25656 * Checks if this feature is supported.
25658 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25661 * Checks if this feature is required.
25663 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25666 * Checks if this feature is required.
25668 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25671 * Set this feature as optional.
25673 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25676 * Set this feature as required.
25678 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25681 * Checks if this feature is supported.
25683 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25686 * Set this feature as optional.
25688 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25691 * Set this feature as required.
25693 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25696 * Checks if this feature is supported.
25698 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25701 * Set this feature as optional.
25703 void InvoiceFeatures_set_variable_length_onion_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25706 * Set this feature as required.
25708 void InvoiceFeatures_set_variable_length_onion_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25711 * Checks if this feature is supported.
25713 MUST_USE_RES bool InvoiceFeatures_supports_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25716 * Checks if this feature is required.
25718 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25721 * Checks if this feature is required.
25723 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25726 * Checks if this feature is required.
25728 MUST_USE_RES bool InvoiceFeatures_requires_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25731 * Set this feature as optional.
25733 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25736 * Set this feature as required.
25738 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25741 * Checks if this feature is supported.
25743 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25746 * Set this feature as optional.
25748 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25751 * Set this feature as required.
25753 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25756 * Checks if this feature is supported.
25758 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25761 * Set this feature as optional.
25763 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25766 * Set this feature as required.
25768 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25771 * Checks if this feature is supported.
25773 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25776 * Checks if this feature is required.
25778 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25781 * Checks if this feature is required.
25783 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25786 * Checks if this feature is required.
25788 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
25791 * Set this feature as optional.
25793 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25796 * Set this feature as required.
25798 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25801 * Checks if this feature is supported.
25803 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25806 * Set this feature as optional.
25808 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25811 * Set this feature as required.
25813 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25816 * Checks if this feature is supported.
25818 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25821 * Set this feature as optional.
25823 void InvoiceFeatures_set_payment_secret_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25826 * Set this feature as required.
25828 void InvoiceFeatures_set_payment_secret_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25831 * Checks if this feature is supported.
25833 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25836 * Checks if this feature is required.
25838 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25841 * Checks if this feature is required.
25843 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25846 * Checks if this feature is required.
25848 MUST_USE_RES bool InvoiceFeatures_requires_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25851 * Set this feature as optional.
25853 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25856 * Set this feature as required.
25858 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25861 * Checks if this feature is supported.
25863 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25866 * Set this feature as optional.
25868 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25871 * Set this feature as required.
25873 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25876 * Checks if this feature is supported.
25878 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25881 * Set this feature as optional.
25883 void InvoiceFeatures_set_basic_mpp_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25886 * Set this feature as required.
25888 void InvoiceFeatures_set_basic_mpp_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25891 * Checks if this feature is supported.
25893 MUST_USE_RES bool InvoiceFeatures_supports_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25896 * Checks if this feature is required.
25898 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25901 * Checks if this feature is required.
25903 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25906 * Checks if this feature is required.
25908 MUST_USE_RES bool InvoiceFeatures_requires_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
25911 * Set this feature as optional.
25913 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25916 * Set this feature as required.
25918 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25921 * Checks if this feature is supported.
25923 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25926 * Set this feature as optional.
25928 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25931 * Set this feature as required.
25933 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25936 * Checks if this feature is supported.
25938 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25941 * Checks if this feature is required.
25943 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25946 * Checks if this feature is required.
25948 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25951 * Set this feature as optional.
25953 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25956 * Set this feature as required.
25958 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
25961 * Checks if this feature is supported.
25963 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25966 * Set this feature as optional.
25968 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25971 * Set this feature as required.
25973 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
25976 * Checks if this feature is supported.
25978 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25981 * Checks if this feature is required.
25983 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
25986 * Checks if this feature is required.
25988 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
25991 * Set this feature as optional.
25993 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
25996 * Set this feature as required.
25998 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
26001 * Checks if this feature is supported.
26003 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26006 * Set this feature as optional.
26008 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26011 * Set this feature as required.
26013 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26016 * Checks if this feature is supported.
26018 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26021 * Checks if this feature is required.
26023 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26026 * Checks if this feature is required.
26028 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26031 * Set this feature as optional.
26033 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
26036 * Set this feature as required.
26038 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
26041 * Checks if this feature is supported.
26043 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26046 * Set this feature as optional.
26048 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26051 * Set this feature as required.
26053 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26056 * Checks if this feature is supported.
26058 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26061 * Set this feature as optional.
26063 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26066 * Set this feature as required.
26068 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26071 * Checks if this feature is supported.
26073 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26076 * Checks if this feature is required.
26078 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26081 * Checks if this feature is required.
26083 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26086 * Checks if this feature is required.
26088 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26091 * Set this feature as optional.
26093 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
26096 * Set this feature as required.
26098 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
26101 * Checks if this feature is supported.
26103 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26106 * Set this feature as optional.
26108 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26111 * Set this feature as required.
26113 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26116 * Checks if this feature is supported.
26118 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26121 * Set this feature as optional.
26123 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26126 * Set this feature as required.
26128 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26131 * Checks if this feature is supported.
26133 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26136 * Checks if this feature is required.
26138 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
26141 * Checks if this feature is required.
26143 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26146 * Checks if this feature is required.
26148 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
26151 * Set this feature as optional.
26153 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26156 * Set this feature as required.
26158 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
26161 * Checks if this feature is supported.
26163 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26166 * Checks if this feature is required.
26168 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
26171 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
26173 void ShutdownScript_free(struct LDKShutdownScript this_obj);
26176 * Creates a copy of the ShutdownScript
26178 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
26181 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
26183 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
26186 * The script that did not meet the requirements from [BOLT #2].
26188 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
26190 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
26193 * The script that did not meet the requirements from [BOLT #2].
26195 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
26197 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
26200 * Constructs a new InvalidShutdownScript given each field
26202 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
26205 * Creates a copy of the InvalidShutdownScript
26207 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
26210 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
26212 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
26215 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
26217 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
26220 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
26222 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
26225 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
26227 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
26230 * Generates a witness script pubkey from the given segwit version and program.
26232 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
26233 * [`ShutdownScript::new_p2wsh`] instead.
26237 * This function may return an error if `program` is invalid for the segwit `version`.
26239 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
26242 * Converts the shutdown script into the underlying [`Script`].
26244 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
26247 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
26249 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26251 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
26254 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
26256 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
26258 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
26261 * Calls the free function if one is set
26263 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
26266 * Calls the free function if one is set
26268 void Type_free(struct LDKType this_ptr);
26271 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
26273 void NodeId_free(struct LDKNodeId this_obj);
26276 * Creates a copy of the NodeId
26278 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
26281 * Create a new NodeId from a public key
26283 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
26286 * Get the public key slice from this NodeId
26288 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
26291 * Checks if two NodeIds contain equal inner contents.
26293 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
26296 * Serialize the NodeId object into a byte array which can be read by NodeId_read
26298 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
26301 * Read a NodeId from a byte array, created by NodeId_write
26303 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
26306 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
26308 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
26311 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
26313 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
26316 * Frees any resources used by the NetworkUpdate
26318 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
26321 * Creates a copy of the NetworkUpdate
26323 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
26326 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
26328 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
26331 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
26333 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
26336 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
26338 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
26341 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
26343 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
26346 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
26348 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
26351 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
26353 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
26356 * Creates a new tracker of the actual state of the network of channels and nodes,
26357 * assuming an existing Network Graph.
26358 * Chain monitor is used to make sure announced channels exist on-chain,
26359 * channel data is correct, and that the announcement is signed with
26360 * channel owners' keys.
26362 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_AccessZ chain_access, struct LDKLogger logger);
26365 * Adds a provider used to check new announcements. Does not affect
26366 * existing announcements unless they are updated.
26367 * Add, update or remove the provider would replace the current one.
26369 void P2PGossipSync_add_chain_access(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_AccessZ chain_access);
26372 * Constructs a new EventHandler which calls the relevant methods on this_arg.
26373 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
26375 struct LDKEventHandler NetworkGraph_as_EventHandler(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26378 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
26379 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
26381 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
26384 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
26385 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
26387 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
26390 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
26392 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
26395 * When the last update to the channel direction was issued.
26396 * Value is opaque, as set in the announcement.
26398 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26401 * When the last update to the channel direction was issued.
26402 * Value is opaque, as set in the announcement.
26404 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
26407 * Whether the channel can be currently used for payments (in this one direction).
26409 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26412 * Whether the channel can be currently used for payments (in this one direction).
26414 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
26417 * The difference in CLTV values that you must have when routing through this channel.
26419 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26422 * The difference in CLTV values that you must have when routing through this channel.
26424 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
26427 * The minimum value, which must be relayed to the next hop via the channel
26429 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26432 * The minimum value, which must be relayed to the next hop via the channel
26434 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
26437 * The maximum value which may be relayed to the next hop via the channel.
26439 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26442 * The maximum value which may be relayed to the next hop via the channel.
26444 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
26447 * Fees charged when the channel is used for routing
26449 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26452 * Fees charged when the channel is used for routing
26454 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
26457 * Most recent update for the channel received from the network
26458 * Mostly redundant with the data we store in fields explicitly.
26459 * Everything else is useful only for sending out for initial routing sync.
26460 * Not stored if contains excess data to prevent DoS.
26462 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26464 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
26467 * Most recent update for the channel received from the network
26468 * Mostly redundant with the data we store in fields explicitly.
26469 * Everything else is useful only for sending out for initial routing sync.
26470 * Not stored if contains excess data to prevent DoS.
26472 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26474 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
26477 * Constructs a new ChannelUpdateInfo given each field
26479 MUST_USE_RES struct LDKChannelUpdateInfo ChannelUpdateInfo_new(uint32_t last_update_arg, bool enabled_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKRoutingFees fees_arg, struct LDKChannelUpdate last_update_message_arg);
26482 * Creates a copy of the ChannelUpdateInfo
26484 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
26487 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
26489 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
26492 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
26494 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
26497 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
26499 void ChannelInfo_free(struct LDKChannelInfo this_obj);
26502 * Protocol features of a channel communicated during its announcement
26504 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26507 * Protocol features of a channel communicated during its announcement
26509 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
26512 * Source node of the first direction of a channel
26514 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26517 * Source node of the first direction of a channel
26519 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
26522 * Details about the first direction of a channel
26524 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26526 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26529 * Details about the first direction of a channel
26531 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26533 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
26536 * Source node of the second direction of a channel
26538 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26541 * Source node of the second direction of a channel
26543 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
26546 * Details about the second direction of a channel
26548 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26550 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26553 * Details about the second direction of a channel
26555 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26557 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
26560 * The channel capacity as seen on-chain, if chain lookup is available.
26562 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26565 * The channel capacity as seen on-chain, if chain lookup is available.
26567 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
26570 * An initial announcement of the channel
26571 * Mostly redundant with the data we store in fields explicitly.
26572 * Everything else is useful only for sending out for initial routing sync.
26573 * Not stored if contains excess data to prevent DoS.
26575 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26577 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
26580 * An initial announcement of the channel
26581 * Mostly redundant with the data we store in fields explicitly.
26582 * Everything else is useful only for sending out for initial routing sync.
26583 * Not stored if contains excess data to prevent DoS.
26585 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26587 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
26590 * Creates a copy of the ChannelInfo
26592 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
26595 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
26597 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26599 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
26602 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
26604 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
26607 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
26609 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
26612 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
26614 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
26617 * Creates a copy of the DirectedChannelInfo
26619 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
26622 * Returns information for the channel.
26624 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
26627 * Returns information for the direction.
26629 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26631 MUST_USE_RES struct LDKChannelUpdateInfo DirectedChannelInfo_direction(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
26634 * Returns the maximum HTLC amount allowed over the channel in the direction.
26636 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
26639 * Returns the [`EffectiveCapacity`] of the channel in the direction.
26641 * This is either the total capacity from the funding transaction, if known, or the
26642 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
26645 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
26648 * Frees any resources used by the EffectiveCapacity
26650 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
26653 * Creates a copy of the EffectiveCapacity
26655 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
26658 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
26660 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
26663 * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity
26665 struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat);
26668 * Utility method to constructs a new Total-variant EffectiveCapacity
26670 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, struct LDKCOption_u64Z htlc_maximum_msat);
26673 * Utility method to constructs a new Infinite-variant EffectiveCapacity
26675 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
26678 * Utility method to constructs a new Unknown-variant EffectiveCapacity
26680 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
26683 * Returns the effective capacity denominated in millisatoshi.
26685 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
26688 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
26690 void RoutingFees_free(struct LDKRoutingFees this_obj);
26693 * Flat routing fee in satoshis
26695 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
26698 * Flat routing fee in satoshis
26700 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
26703 * Liquidity-based routing fee in millionths of a routed amount.
26704 * In other words, 10000 is 1%.
26706 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
26709 * Liquidity-based routing fee in millionths of a routed amount.
26710 * In other words, 10000 is 1%.
26712 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
26715 * Constructs a new RoutingFees given each field
26717 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
26720 * Checks if two RoutingFeess contain equal inner contents.
26721 * This ignores pointers and is_owned flags and looks at the values in fields.
26722 * Two objects with NULL inner values will be considered "equal" here.
26724 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
26727 * Creates a copy of the RoutingFees
26729 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
26732 * Checks if two RoutingFeess contain equal inner contents.
26734 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
26737 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
26739 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
26742 * Read a RoutingFees from a byte array, created by RoutingFees_write
26744 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
26747 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
26749 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
26752 * Protocol features the node announced support for
26754 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26757 * Protocol features the node announced support for
26759 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
26762 * When the last known update to the node state was issued.
26763 * Value is opaque, as set in the announcement.
26765 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26768 * When the last known update to the node state was issued.
26769 * Value is opaque, as set in the announcement.
26771 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
26774 * Color assigned to the node
26776 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
26779 * Color assigned to the node
26781 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
26784 * Moniker assigned to the node.
26785 * May be invalid or malicious (eg control chars),
26786 * should not be exposed to the user.
26788 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26791 * Moniker assigned to the node.
26792 * May be invalid or malicious (eg control chars),
26793 * should not be exposed to the user.
26795 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
26798 * Internet-level addresses via which one can connect to the node
26800 * Returns a copy of the field.
26802 struct LDKCVec_NetAddressZ NodeAnnouncementInfo_get_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26805 * Internet-level addresses via which one can connect to the node
26807 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
26810 * An initial announcement of the node
26811 * Mostly redundant with the data we store in fields explicitly.
26812 * Everything else is useful only for sending out for initial routing sync.
26813 * Not stored if contains excess data to prevent DoS.
26815 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26817 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
26820 * An initial announcement of the node
26821 * Mostly redundant with the data we store in fields explicitly.
26822 * Everything else is useful only for sending out for initial routing sync.
26823 * Not stored if contains excess data to prevent DoS.
26825 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26827 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
26830 * Constructs a new NodeAnnouncementInfo given each field
26832 MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg);
26835 * Creates a copy of the NodeAnnouncementInfo
26837 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
26840 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
26842 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
26845 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
26847 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
26850 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
26852 void NodeAlias_free(struct LDKNodeAlias this_obj);
26854 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
26856 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26859 * Constructs a new NodeAlias given each field
26861 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
26864 * Creates a copy of the NodeAlias
26866 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
26869 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
26871 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
26874 * Read a NodeAlias from a byte array, created by NodeAlias_write
26876 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
26879 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
26881 void NodeInfo_free(struct LDKNodeInfo this_obj);
26884 * All valid channels a node has announced
26886 * Returns a copy of the field.
26888 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
26891 * All valid channels a node has announced
26893 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
26896 * Lowest fees enabling routing via any of the enabled, known channels to a node.
26897 * The two fields (flat and proportional fee) are independent,
26898 * meaning they don't have to refer to the same channel.
26900 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26902 struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
26905 * Lowest fees enabling routing via any of the enabled, known channels to a node.
26906 * The two fields (flat and proportional fee) are independent,
26907 * meaning they don't have to refer to the same channel.
26909 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26911 void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
26914 * More information about a node from node_announcement.
26915 * Optional because we store a Node entry after learning about it from
26916 * a channel announcement, but before receiving a node announcement.
26918 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26920 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
26923 * More information about a node from node_announcement.
26924 * Optional because we store a Node entry after learning about it from
26925 * a channel announcement, but before receiving a node announcement.
26927 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26929 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
26932 * Constructs a new NodeInfo given each field
26934 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
26937 * Creates a copy of the NodeInfo
26939 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
26942 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
26944 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
26947 * Read a NodeInfo from a byte array, created by NodeInfo_write
26949 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
26952 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
26954 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
26957 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
26959 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
26962 * Creates a new, empty, network graph.
26964 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKLogger logger);
26967 * Returns a read-only view of the network graph.
26969 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26972 * The unix timestamp provided by the most recent rapid gossip sync.
26973 * It will be set by the rapid sync process after every sync completion.
26975 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
26978 * Update the unix timestamp provided by the most recent rapid gossip sync.
26979 * This should be done automatically by the rapid sync process after every sync completion.
26981 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
26984 * For an already known node (from channel announcements), update its stored properties from a
26985 * given node announcement.
26987 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
26988 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
26989 * routing messages from a source using a protocol other than the lightning P2P protocol.
26991 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
26994 * For an already known node (from channel announcements), update its stored properties from a
26995 * given node announcement without verifying the associated signatures. Because we aren't
26996 * given the associated signatures here we cannot relay the node announcement to any of our
26999 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);
27002 * Store or update channel info from a channel announcement.
27004 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
27005 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
27006 * routing messages from a source using a protocol other than the lightning P2P protocol.
27008 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
27009 * the corresponding UTXO exists on chain and is correctly-formatted.
27011 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);
27014 * Store or update channel info from a channel announcement without verifying the associated
27015 * signatures. Because we aren't given the associated signatures here we cannot relay the
27016 * channel announcement to any of our peers.
27018 * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
27019 * the corresponding UTXO exists on chain and is correctly-formatted.
27021 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);
27024 * Update channel from partial announcement data received via rapid gossip sync
27026 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
27027 * rapid gossip sync server)
27029 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
27031 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);
27034 * Marks a channel in the graph as failed if a corresponding HTLC fail was sent.
27035 * If permanent, removes a channel from the local storage.
27036 * May cause the removal of nodes too, if this was their last channel.
27037 * If not permanent, makes channels unavailable for routing.
27039 void NetworkGraph_channel_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
27042 * Marks a node in the graph as failed.
27044 void NetworkGraph_node_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent);
27047 * Removes information about channels that we haven't heard any updates about in some time.
27048 * This can be used regularly to prune the network graph of channels that likely no longer
27051 * While there is no formal requirement that nodes regularly re-broadcast their channel
27052 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
27053 * pruning occur for updates which are at least two weeks old, which we implement here.
27055 * Note that for users of the `lightning-background-processor` crate this method may be
27056 * automatically called regularly for you.
27058 * This method is only available with the `std` feature. See
27059 * [`NetworkGraph::remove_stale_channels_with_time`] for `no-std` use.
27061 void NetworkGraph_remove_stale_channels(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
27064 * Removes information about channels that we haven't heard any updates about in some time.
27065 * This can be used regularly to prune the network graph of channels that likely no longer
27068 * While there is no formal requirement that nodes regularly re-broadcast their channel
27069 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
27070 * pruning occur for updates which are at least two weeks old, which we implement here.
27072 * This function takes the current unix time as an argument. For users with the `std` feature
27073 * enabled, [`NetworkGraph::remove_stale_channels`] may be preferable.
27075 void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
27078 * For an already known (from announcement) channel, update info about one of the directions
27081 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
27082 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
27083 * routing messages from a source using a protocol other than the lightning P2P protocol.
27085 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
27086 * materially in the future will be rejected.
27088 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
27091 * For an already known (from announcement) channel, update info about one of the directions
27092 * of the channel without verifying the associated signatures. Because we aren't given the
27093 * associated signatures here we cannot relay the channel update to any of our peers.
27095 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
27096 * materially in the future will be rejected.
27098 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
27101 * Returns information on a channel with the given id.
27103 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27105 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
27108 * Returns information on a node with the given id.
27110 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27112 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
27115 * Get network addresses by node id.
27116 * Returns None if the requested node is completely unknown,
27117 * or if node announcement for the node was never received.
27119 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
27122 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
27124 void RouteHop_free(struct LDKRouteHop this_obj);
27127 * The node_id of the node at this hop.
27129 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
27132 * The node_id of the node at this hop.
27134 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27137 * The node_announcement features of the node at this hop. For the last hop, these may be
27138 * amended to match the features present in the invoice this node generated.
27140 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
27143 * The node_announcement features of the node at this hop. For the last hop, these may be
27144 * amended to match the features present in the invoice this node generated.
27146 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
27149 * The channel that should be used from the previous hop to reach this node.
27151 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
27154 * The channel that should be used from the previous hop to reach this node.
27156 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
27159 * The channel_announcement features of the channel that should be used from the previous hop
27160 * to reach this node.
27162 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
27165 * The channel_announcement features of the channel that should be used from the previous hop
27166 * to reach this node.
27168 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
27171 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
27172 * For the last hop, this should be the full value of the payment (might be more than
27173 * requested if we had to match htlc_minimum_msat).
27175 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
27178 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
27179 * For the last hop, this should be the full value of the payment (might be more than
27180 * requested if we had to match htlc_minimum_msat).
27182 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
27185 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
27186 * expected at the destination, in excess of the current block height.
27188 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
27191 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
27192 * expected at the destination, in excess of the current block height.
27194 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
27197 * Constructs a new RouteHop given each field
27199 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);
27202 * Creates a copy of the RouteHop
27204 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
27207 * Checks if two RouteHops contain equal inner contents.
27209 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
27212 * Checks if two RouteHops contain equal inner contents.
27213 * This ignores pointers and is_owned flags and looks at the values in fields.
27214 * Two objects with NULL inner values will be considered "equal" here.
27216 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
27219 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
27221 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
27224 * Read a RouteHop from a byte array, created by RouteHop_write
27226 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
27229 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
27231 void Route_free(struct LDKRoute this_obj);
27234 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
27235 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
27236 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
27237 * least length one. While the maximum length of any given path is variable, keeping the length
27238 * of any path less or equal to 19 should currently ensure it is viable.
27240 struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
27243 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
27244 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
27245 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
27246 * least length one. While the maximum length of any given path is variable, keeping the length
27247 * of any path less or equal to 19 should currently ensure it is viable.
27249 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
27252 * The `payment_params` parameter passed to [`find_route`].
27253 * This is used by `ChannelManager` to track information which may be required for retries,
27254 * provided back to you via [`Event::PaymentPathFailed`].
27256 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
27258 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27260 struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr);
27263 * The `payment_params` parameter passed to [`find_route`].
27264 * This is used by `ChannelManager` to track information which may be required for retries,
27265 * provided back to you via [`Event::PaymentPathFailed`].
27267 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
27269 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27271 void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
27274 * Constructs a new Route given each field
27276 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPaymentParameters payment_params_arg);
27279 * Creates a copy of the Route
27281 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
27284 * Checks if two Routes contain equal inner contents.
27286 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
27289 * Checks if two Routes contain equal inner contents.
27290 * This ignores pointers and is_owned flags and looks at the values in fields.
27291 * Two objects with NULL inner values will be considered "equal" here.
27293 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
27296 * Returns the total amount of fees paid on this [`Route`].
27298 * This doesn't include any extra payment made to the recipient, which can happen in excess of
27299 * the amount passed to [`find_route`]'s `params.final_value_msat`.
27301 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
27304 * Returns the total amount paid on this [`Route`], excluding the fees.
27306 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
27309 * Serialize the Route object into a byte array which can be read by Route_read
27311 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
27314 * Read a Route from a byte array, created by Route_write
27316 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
27319 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
27321 void RouteParameters_free(struct LDKRouteParameters this_obj);
27324 * The parameters of the failed payment path.
27326 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
27329 * The parameters of the failed payment path.
27331 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
27334 * The amount in msats sent on the failed payment path.
27336 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
27339 * The amount in msats sent on the failed payment path.
27341 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
27344 * The CLTV on the final hop of the failed payment path.
27346 uint32_t RouteParameters_get_final_cltv_expiry_delta(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
27349 * The CLTV on the final hop of the failed payment path.
27351 void RouteParameters_set_final_cltv_expiry_delta(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint32_t val);
27354 * Constructs a new RouteParameters given each field
27356 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);
27359 * Creates a copy of the RouteParameters
27361 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
27364 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
27366 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
27369 * Read a RouteParameters from a byte array, created by RouteParameters_write
27371 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
27374 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
27376 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
27379 * The node id of the payee.
27381 struct LDKPublicKey PaymentParameters_get_payee_pubkey(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27384 * The node id of the payee.
27386 void PaymentParameters_set_payee_pubkey(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27389 * Features supported by the payee.
27391 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
27392 * does not contain any features.
27394 * [`for_keysend`]: Self::for_keysend
27396 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27398 struct LDKInvoiceFeatures PaymentParameters_get_features(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27401 * Features supported by the payee.
27403 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
27404 * does not contain any features.
27406 * [`for_keysend`]: Self::for_keysend
27408 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27410 void PaymentParameters_set_features(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
27413 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
27415 struct LDKCVec_RouteHintZ PaymentParameters_get_route_hints(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27418 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
27420 void PaymentParameters_set_route_hints(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
27423 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
27425 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27428 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
27430 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27433 * The maximum total CLTV delta we accept for the route.
27434 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
27436 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27439 * The maximum total CLTV delta we accept for the route.
27440 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
27442 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
27445 * The maximum number of paths that may be used by (MPP) payments.
27446 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
27448 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27451 * The maximum number of paths that may be used by (MPP) payments.
27452 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
27454 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
27457 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
27458 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
27459 * a lower value prefers to send larger MPP parts, potentially saturating channels and
27460 * increasing failure probability for those paths.
27462 * Note that this restriction will be relaxed during pathfinding after paths which meet this
27463 * restriction have been found. While paths which meet this criteria will be searched for, it
27464 * is ultimately up to the scorer to select them over other paths.
27466 * A value of 0 will allow payments up to and including a channel's total announced usable
27467 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
27471 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27474 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
27475 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
27476 * a lower value prefers to send larger MPP parts, potentially saturating channels and
27477 * increasing failure probability for those paths.
27479 * Note that this restriction will be relaxed during pathfinding after paths which meet this
27480 * restriction have been found. While paths which meet this criteria will be searched for, it
27481 * is ultimately up to the scorer to select them over other paths.
27483 * A value of 0 will allow payments up to and including a channel's total announced usable
27484 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
27488 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
27491 * A list of SCIDs which this payment was previously attempted over and which caused the
27492 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
27495 * Returns a copy of the field.
27497 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
27500 * A list of SCIDs which this payment was previously attempted over and which caused the
27501 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
27504 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
27507 * Constructs a new PaymentParameters given each field
27509 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPublicKey payee_pubkey_arg, struct LDKInvoiceFeatures features_arg, struct LDKCVec_RouteHintZ route_hints_arg, struct LDKCOption_u64Z expiry_time_arg, uint32_t max_total_cltv_expiry_delta_arg, uint8_t max_path_count_arg, uint8_t max_channel_saturation_power_of_half_arg, struct LDKCVec_u64Z previously_failed_channels_arg);
27512 * Creates a copy of the PaymentParameters
27514 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
27517 * Checks if two PaymentParameterss contain equal inner contents.
27519 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
27522 * Checks if two PaymentParameterss contain equal inner contents.
27523 * This ignores pointers and is_owned flags and looks at the values in fields.
27524 * Two objects with NULL inner values will be considered "equal" here.
27526 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
27529 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
27531 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
27534 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
27536 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser);
27539 * Creates a payee with the node id of the given `pubkey`.
27541 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey);
27544 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
27546 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey);
27549 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
27551 void RouteHint_free(struct LDKRouteHint this_obj);
27553 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
27555 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
27558 * Constructs a new RouteHint given each field
27560 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
27563 * Creates a copy of the RouteHint
27565 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
27568 * Checks if two RouteHints contain equal inner contents.
27570 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
27573 * Checks if two RouteHints contain equal inner contents.
27574 * This ignores pointers and is_owned flags and looks at the values in fields.
27575 * Two objects with NULL inner values will be considered "equal" here.
27577 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
27580 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
27582 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
27585 * Read a RouteHint from a byte array, created by RouteHint_write
27587 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
27590 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
27592 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
27595 * The node_id of the non-target end of the route
27597 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27600 * The node_id of the non-target end of the route
27602 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27605 * The short_channel_id of this channel
27607 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27610 * The short_channel_id of this channel
27612 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
27615 * The fees which must be paid to use this channel
27617 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27620 * The fees which must be paid to use this channel
27622 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
27625 * The difference in CLTV values between this node and the next node.
27627 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27630 * The difference in CLTV values between this node and the next node.
27632 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
27635 * The minimum value, in msat, which must be relayed to the next hop.
27637 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27640 * The minimum value, in msat, which must be relayed to the next hop.
27642 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27645 * The maximum value in msat available for routing with a single HTLC.
27647 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
27650 * The maximum value in msat available for routing with a single HTLC.
27652 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27655 * Constructs a new RouteHintHop given each field
27657 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);
27660 * Creates a copy of the RouteHintHop
27662 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
27665 * Checks if two RouteHintHops contain equal inner contents.
27667 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
27670 * Checks if two RouteHintHops contain equal inner contents.
27671 * This ignores pointers and is_owned flags and looks at the values in fields.
27672 * Two objects with NULL inner values will be considered "equal" here.
27674 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
27677 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
27679 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
27682 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
27684 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
27687 * Finds a route from us (payer) to the given target node (payee).
27689 * If the payee provided features in their invoice, they should be provided via `params.payee`.
27690 * Without this, MPP will only be used if the payee's features are available in the network graph.
27692 * Private routing paths between a public node and the target may be included in `params.payee`.
27694 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
27695 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
27696 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
27698 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
27699 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
27700 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
27704 * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
27705 * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
27710 * Panics if first_hops contains channels without short_channel_ids;
27711 * [`ChannelManager::list_usable_channels`] will never include such channels.
27713 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
27714 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
27715 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
27717 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
27719 struct LDKCResult_RouteLightningErrorZ find_route(struct LDKPublicKey our_node_pubkey, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKLogger logger, const struct LDKScore *NONNULL_PTR scorer, const uint8_t (*random_seed_bytes)[32]);
27722 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
27723 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
27725 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
27727 struct LDKCResult_RouteLightningErrorZ build_route_from_hops(struct LDKPublicKey our_node_pubkey, struct LDKCVec_PublicKeyZ hops, const struct LDKRouteParameters *NONNULL_PTR route_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, const uint8_t (*random_seed_bytes)[32]);
27730 * Calls the free function if one is set
27732 void Score_free(struct LDKScore this_ptr);
27735 * Calls the free function if one is set
27737 void LockableScore_free(struct LDKLockableScore this_ptr);
27740 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
27742 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
27745 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
27747 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
27750 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
27752 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
27755 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
27757 void ChannelUsage_free(struct LDKChannelUsage this_obj);
27760 * The amount to send through the channel, denominated in millisatoshis.
27762 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
27765 * The amount to send through the channel, denominated in millisatoshis.
27767 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
27770 * Total amount, denominated in millisatoshis, already allocated to send through the channel
27771 * as part of a multi-path payment.
27773 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
27776 * Total amount, denominated in millisatoshis, already allocated to send through the channel
27777 * as part of a multi-path payment.
27779 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
27782 * The effective capacity of the channel.
27784 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
27787 * The effective capacity of the channel.
27789 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
27792 * Constructs a new ChannelUsage given each field
27794 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
27797 * Creates a copy of the ChannelUsage
27799 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
27802 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
27804 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
27807 * Creates a copy of the FixedPenaltyScorer
27809 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
27812 * Creates a new scorer using `penalty_msat`.
27814 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
27817 * Constructs a new Score which calls the relevant methods on this_arg.
27818 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
27820 struct LDKScore FixedPenaltyScorer_as_Score(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
27823 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
27825 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
27828 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
27830 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
27833 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
27835 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
27838 * Frees any resources used by the ProbabilisticScoringParameters, if is_owned is set and inner is non-NULL.
27840 void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj);
27843 * A fixed penalty in msats to apply to each channel.
27845 * Default value: 500 msat
27847 uint64_t ProbabilisticScoringParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27850 * A fixed penalty in msats to apply to each channel.
27852 * Default value: 500 msat
27854 void ProbabilisticScoringParameters_set_base_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27857 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
27858 * channel, in excess of the [`base_penalty_msat`].
27860 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27861 * fees plus penalty) for large payments. The penalty is computed as the product of this
27862 * multiplier and `2^30`ths of the payment amount.
27864 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
27866 * Default value: 8,192 msat
27868 * [`base_penalty_msat`]: Self::base_penalty_msat
27870 uint64_t ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27873 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
27874 * channel, in excess of the [`base_penalty_msat`].
27876 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27877 * fees plus penalty) for large payments. The penalty is computed as the product of this
27878 * multiplier and `2^30`ths of the payment amount.
27880 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
27882 * Default value: 8,192 msat
27884 * [`base_penalty_msat`]: Self::base_penalty_msat
27886 void ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27889 * A multiplier used in conjunction with the negative `log10` of the channel's success
27890 * probability for a payment to determine the liquidity penalty.
27892 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
27893 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
27894 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
27895 * lower bounding the success probability to `0.01`) when the amount falls within the
27896 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
27897 * result in a `u64::max_value` penalty, however.
27899 * Default value: 40,000 msat
27901 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
27903 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27906 * A multiplier used in conjunction with the negative `log10` of the channel's success
27907 * probability for a payment to determine the liquidity penalty.
27909 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
27910 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
27911 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
27912 * lower bounding the success probability to `0.01`) when the amount falls within the
27913 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
27914 * result in a `u64::max_value` penalty, however.
27916 * Default value: 40,000 msat
27918 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
27920 void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27923 * The time required to elapse before any knowledge learned about channel liquidity balances is
27926 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
27927 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
27928 * the certainty of the channel liquidity balance.
27930 * Default value: 1 hour
27934 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
27935 * liquidity knowledge will never decay except when the bounds cross.
27937 uint64_t ProbabilisticScoringParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27940 * The time required to elapse before any knowledge learned about channel liquidity balances is
27943 * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
27944 * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
27945 * the certainty of the channel liquidity balance.
27947 * Default value: 1 hour
27951 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
27952 * liquidity knowledge will never decay except when the bounds cross.
27954 void ProbabilisticScoringParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27957 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
27958 * channel's success probability for the payment to determine the amount penalty.
27960 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27961 * fees plus penalty) for large payments. The penalty is computed as the product of this
27962 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
27963 * success probability.
27965 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
27967 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
27968 * the amount will result in a penalty of the multiplier. And, as the success probability
27969 * decreases, the negative `log10` weighting will increase dramatically. For higher success
27970 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
27973 * Default value: 256 msat
27975 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
27978 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
27979 * channel's success probability for the payment to determine the amount penalty.
27981 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
27982 * fees plus penalty) for large payments. The penalty is computed as the product of this
27983 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
27984 * success probability.
27986 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
27988 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
27989 * the amount will result in a penalty of the multiplier. And, as the success probability
27990 * decreases, the negative `log10` weighting will increase dramatically. For higher success
27991 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
27994 * Default value: 256 msat
27996 void ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
27999 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
28000 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
28001 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
28002 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
28004 * Default value: 250 msat
28006 uint64_t ProbabilisticScoringParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
28009 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
28010 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
28011 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
28012 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
28014 * Default value: 250 msat
28016 void ProbabilisticScoringParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
28019 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
28020 * current estimate of the channel's available liquidity.
28022 * Note that in this case all other penalties, including the
28023 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
28024 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
28025 * applicable, are still included in the overall penalty.
28027 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
28028 * `u64::max_value()` will guarantee that.
28030 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
28032 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
28033 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
28034 * [`base_penalty_msat`]: Self::base_penalty_msat
28035 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
28037 uint64_t ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
28040 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
28041 * current estimate of the channel's available liquidity.
28043 * Note that in this case all other penalties, including the
28044 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
28045 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
28046 * applicable, are still included in the overall penalty.
28048 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
28049 * `u64::max_value()` will guarantee that.
28051 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
28053 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
28054 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
28055 * [`base_penalty_msat`]: Self::base_penalty_msat
28056 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
28058 void ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
28061 * Creates a copy of the ProbabilisticScoringParameters
28063 struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig);
28066 * Creates a new scorer using the given scoring parameters for sending payments from a node
28067 * through a network graph.
28069 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
28072 * Dump the contents of this scorer into the configured logger.
28074 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
28075 * which may be a substantial amount of log output.
28077 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
28080 * Query the estimated minimum and maximum liquidity available for sending a payment over the
28081 * channel with `scid` towards the given `target` node.
28083 MUST_USE_RES struct LDKCOption_C2Tuple_u64u64ZZ ProbabilisticScorer_estimated_channel_liquidity_range(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target);
28086 * Marks the node with the given `node_id` as banned, i.e.,
28087 * it will be avoided during path finding.
28089 void ProbabilisticScorer_add_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
28092 * Removes the node with the given `node_id` from the list of nodes to avoid.
28094 void ProbabilisticScorer_remove_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
28097 * Sets a manual penalty for the given node.
28099 void ProbabilisticScorer_set_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
28102 * Removes the node with the given `node_id` from the list of manual penalties.
28104 void ProbabilisticScorer_remove_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
28107 * Clears the list of manual penalties that are applied during path finding.
28109 void ProbabilisticScorer_clear_manual_penalties(struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
28112 * Marks all nodes in the given list as banned, i.e.,
28113 * they will be avoided during path finding.
28115 void ProbabilisticScoringParameters_add_banned_from_list(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
28118 * Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.
28120 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void);
28123 * Constructs a new Score which calls the relevant methods on this_arg.
28124 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
28126 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
28129 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
28131 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
28134 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
28136 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
28139 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
28141 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
28144 * Initialize a new FilesystemPersister and set the path to the individual channels'
28147 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
28150 * Get the directory which was provided when this persister was initialized.
28152 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
28155 * Read `ChannelMonitor`s from disk.
28157 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKKeysInterface keys_manager);
28160 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
28162 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
28165 * Frees any resources used by the GossipSync
28167 void GossipSync_free(struct LDKGossipSync this_ptr);
28170 * Utility method to constructs a new P2P-variant GossipSync
28172 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
28175 * Utility method to constructs a new Rapid-variant GossipSync
28177 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
28180 * Utility method to constructs a new None-variant GossipSync
28182 struct LDKGossipSync GossipSync_none(void);
28185 * Start a background thread that takes care of responsibilities enumerated in the [top-level
28188 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
28189 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
28190 * either [`join`] or [`stop`].
28192 * # Data Persistence
28194 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
28195 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
28196 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
28197 * provided implementation.
28199 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
28200 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
28201 * See the `lightning-persister` crate for LDK's provided implementation.
28203 * Typically, users should either implement [`Persister::persist_manager`] to never return an
28204 * error or call [`join`] and handle any error that may arise. For the latter case,
28205 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
28209 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
28210 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
28211 * functionality implemented by other handlers.
28212 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
28214 * # Rapid Gossip Sync
28216 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
28217 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
28218 * until the [`RapidGossipSync`] instance completes its first sync.
28220 * [top-level documentation]: BackgroundProcessor
28221 * [`join`]: Self::join
28222 * [`stop`]: Self::stop
28223 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
28224 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
28225 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
28226 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
28227 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
28228 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
28230 * Note that scorer (or a relevant inner pointer) may be NULL or all-0s to represent None
28232 MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKGossipSync gossip_sync, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger, struct LDKMultiThreadedLockableScore scorer);
28235 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
28236 * [`ChannelManager`].
28240 * This function panics if the background thread has panicked such as while persisting or
28243 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
28245 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
28248 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
28249 * [`ChannelManager`].
28253 * This function panics if the background thread has panicked such as while persisting or
28256 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
28258 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
28261 * Frees any resources used by the ParseError
28263 void ParseError_free(struct LDKParseError this_ptr);
28266 * Creates a copy of the ParseError
28268 struct LDKParseError ParseError_clone(const struct LDKParseError *NONNULL_PTR orig);
28271 * Utility method to constructs a new Bech32Error-variant ParseError
28273 struct LDKParseError ParseError_bech32_error(struct LDKBech32Error a);
28276 * Utility method to constructs a new ParseAmountError-variant ParseError
28278 struct LDKParseError ParseError_parse_amount_error(struct LDKError a);
28281 * Utility method to constructs a new MalformedSignature-variant ParseError
28283 struct LDKParseError ParseError_malformed_signature(enum LDKSecp256k1Error a);
28286 * Utility method to constructs a new BadPrefix-variant ParseError
28288 struct LDKParseError ParseError_bad_prefix(void);
28291 * Utility method to constructs a new UnknownCurrency-variant ParseError
28293 struct LDKParseError ParseError_unknown_currency(void);
28296 * Utility method to constructs a new UnknownSiPrefix-variant ParseError
28298 struct LDKParseError ParseError_unknown_si_prefix(void);
28301 * Utility method to constructs a new MalformedHRP-variant ParseError
28303 struct LDKParseError ParseError_malformed_hrp(void);
28306 * Utility method to constructs a new TooShortDataPart-variant ParseError
28308 struct LDKParseError ParseError_too_short_data_part(void);
28311 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant ParseError
28313 struct LDKParseError ParseError_unexpected_end_of_tagged_fields(void);
28316 * Utility method to constructs a new DescriptionDecodeError-variant ParseError
28318 struct LDKParseError ParseError_description_decode_error(struct LDKError a);
28321 * Utility method to constructs a new PaddingError-variant ParseError
28323 struct LDKParseError ParseError_padding_error(void);
28326 * Utility method to constructs a new IntegerOverflowError-variant ParseError
28328 struct LDKParseError ParseError_integer_overflow_error(void);
28331 * Utility method to constructs a new InvalidSegWitProgramLength-variant ParseError
28333 struct LDKParseError ParseError_invalid_seg_wit_program_length(void);
28336 * Utility method to constructs a new InvalidPubKeyHashLength-variant ParseError
28338 struct LDKParseError ParseError_invalid_pub_key_hash_length(void);
28341 * Utility method to constructs a new InvalidScriptHashLength-variant ParseError
28343 struct LDKParseError ParseError_invalid_script_hash_length(void);
28346 * Utility method to constructs a new InvalidRecoveryId-variant ParseError
28348 struct LDKParseError ParseError_invalid_recovery_id(void);
28351 * Utility method to constructs a new InvalidSliceLength-variant ParseError
28353 struct LDKParseError ParseError_invalid_slice_length(struct LDKStr a);
28356 * Utility method to constructs a new Skip-variant ParseError
28358 struct LDKParseError ParseError_skip(void);
28361 * Frees any resources used by the ParseOrSemanticError
28363 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
28366 * Creates a copy of the ParseOrSemanticError
28368 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
28371 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
28373 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKParseError a);
28376 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
28378 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKSemanticError a);
28381 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
28383 void Invoice_free(struct LDKInvoice this_obj);
28386 * Checks if two Invoices contain equal inner contents.
28387 * This ignores pointers and is_owned flags and looks at the values in fields.
28388 * Two objects with NULL inner values will be considered "equal" here.
28390 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
28393 * Creates a copy of the Invoice
28395 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
28398 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
28400 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
28403 * Checks if two SignedRawInvoices contain equal inner contents.
28404 * This ignores pointers and is_owned flags and looks at the values in fields.
28405 * Two objects with NULL inner values will be considered "equal" here.
28407 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
28410 * Creates a copy of the SignedRawInvoice
28412 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
28415 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
28417 void RawInvoice_free(struct LDKRawInvoice this_obj);
28422 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
28427 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
28430 * Checks if two RawInvoices contain equal inner contents.
28431 * This ignores pointers and is_owned flags and looks at the values in fields.
28432 * Two objects with NULL inner values will be considered "equal" here.
28434 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
28437 * Creates a copy of the RawInvoice
28439 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
28442 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
28444 void RawDataPart_free(struct LDKRawDataPart this_obj);
28447 * generation time of the invoice
28449 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
28452 * generation time of the invoice
28454 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
28457 * Checks if two RawDataParts contain equal inner contents.
28458 * This ignores pointers and is_owned flags and looks at the values in fields.
28459 * Two objects with NULL inner values will be considered "equal" here.
28461 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
28464 * Creates a copy of the RawDataPart
28466 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
28469 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
28471 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
28474 * Checks if two PositiveTimestamps contain equal inner contents.
28475 * This ignores pointers and is_owned flags and looks at the values in fields.
28476 * Two objects with NULL inner values will be considered "equal" here.
28478 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
28481 * Creates a copy of the PositiveTimestamp
28483 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
28486 * Creates a copy of the SiPrefix
28488 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
28491 * Utility method to constructs a new Milli-variant SiPrefix
28493 enum LDKSiPrefix SiPrefix_milli(void);
28496 * Utility method to constructs a new Micro-variant SiPrefix
28498 enum LDKSiPrefix SiPrefix_micro(void);
28501 * Utility method to constructs a new Nano-variant SiPrefix
28503 enum LDKSiPrefix SiPrefix_nano(void);
28506 * Utility method to constructs a new Pico-variant SiPrefix
28508 enum LDKSiPrefix SiPrefix_pico(void);
28511 * Checks if two SiPrefixs contain equal inner contents.
28512 * This ignores pointers and is_owned flags and looks at the values in fields.
28514 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
28517 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
28518 * This is effectively 10^12 * the prefix multiplier
28520 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
28523 * Creates a copy of the Currency
28525 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
28528 * Utility method to constructs a new Bitcoin-variant Currency
28530 enum LDKCurrency Currency_bitcoin(void);
28533 * Utility method to constructs a new BitcoinTestnet-variant Currency
28535 enum LDKCurrency Currency_bitcoin_testnet(void);
28538 * Utility method to constructs a new Regtest-variant Currency
28540 enum LDKCurrency Currency_regtest(void);
28543 * Utility method to constructs a new Simnet-variant Currency
28545 enum LDKCurrency Currency_simnet(void);
28548 * Utility method to constructs a new Signet-variant Currency
28550 enum LDKCurrency Currency_signet(void);
28553 * Checks if two Currencys contain equal inner contents.
28555 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
28558 * Checks if two Currencys contain equal inner contents.
28559 * This ignores pointers and is_owned flags and looks at the values in fields.
28561 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
28564 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
28566 void Sha256_free(struct LDKSha256 this_obj);
28569 * Creates a copy of the Sha256
28571 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
28574 * Checks if two Sha256s contain equal inner contents.
28576 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
28579 * Checks if two Sha256s contain equal inner contents.
28580 * This ignores pointers and is_owned flags and looks at the values in fields.
28581 * Two objects with NULL inner values will be considered "equal" here.
28583 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
28586 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
28588 void Description_free(struct LDKDescription this_obj);
28591 * Creates a copy of the Description
28593 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
28596 * Checks if two Descriptions contain equal inner contents.
28598 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
28601 * Checks if two Descriptions contain equal inner contents.
28602 * This ignores pointers and is_owned flags and looks at the values in fields.
28603 * Two objects with NULL inner values will be considered "equal" here.
28605 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
28608 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
28610 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
28612 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
28614 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28617 * Constructs a new PayeePubKey given each field
28619 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
28622 * Creates a copy of the PayeePubKey
28624 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
28627 * Checks if two PayeePubKeys contain equal inner contents.
28629 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
28632 * Checks if two PayeePubKeys contain equal inner contents.
28633 * This ignores pointers and is_owned flags and looks at the values in fields.
28634 * Two objects with NULL inner values will be considered "equal" here.
28636 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
28639 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
28641 void ExpiryTime_free(struct LDKExpiryTime this_obj);
28644 * Creates a copy of the ExpiryTime
28646 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
28649 * Checks if two ExpiryTimes contain equal inner contents.
28651 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
28654 * Checks if two ExpiryTimes contain equal inner contents.
28655 * This ignores pointers and is_owned flags and looks at the values in fields.
28656 * Two objects with NULL inner values will be considered "equal" here.
28658 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
28661 * Frees any resources used by the MinFinalCltvExpiry, if is_owned is set and inner is non-NULL.
28663 void MinFinalCltvExpiry_free(struct LDKMinFinalCltvExpiry this_obj);
28665 uint64_t MinFinalCltvExpiry_get_a(const struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr);
28667 void MinFinalCltvExpiry_set_a(struct LDKMinFinalCltvExpiry *NONNULL_PTR this_ptr, uint64_t val);
28670 * Constructs a new MinFinalCltvExpiry given each field
28672 MUST_USE_RES struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_new(uint64_t a_arg);
28675 * Creates a copy of the MinFinalCltvExpiry
28677 struct LDKMinFinalCltvExpiry MinFinalCltvExpiry_clone(const struct LDKMinFinalCltvExpiry *NONNULL_PTR orig);
28680 * Checks if two MinFinalCltvExpirys contain equal inner contents.
28682 uint64_t MinFinalCltvExpiry_hash(const struct LDKMinFinalCltvExpiry *NONNULL_PTR o);
28685 * Checks if two MinFinalCltvExpirys contain equal inner contents.
28686 * This ignores pointers and is_owned flags and looks at the values in fields.
28687 * Two objects with NULL inner values will be considered "equal" here.
28689 bool MinFinalCltvExpiry_eq(const struct LDKMinFinalCltvExpiry *NONNULL_PTR a, const struct LDKMinFinalCltvExpiry *NONNULL_PTR b);
28692 * Frees any resources used by the Fallback
28694 void Fallback_free(struct LDKFallback this_ptr);
28697 * Creates a copy of the Fallback
28699 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
28702 * Utility method to constructs a new SegWitProgram-variant Fallback
28704 struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
28707 * Utility method to constructs a new PubKeyHash-variant Fallback
28709 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
28712 * Utility method to constructs a new ScriptHash-variant Fallback
28714 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
28717 * Checks if two Fallbacks contain equal inner contents.
28719 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
28722 * Checks if two Fallbacks contain equal inner contents.
28723 * This ignores pointers and is_owned flags and looks at the values in fields.
28725 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
28728 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
28730 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
28733 * Creates a copy of the InvoiceSignature
28735 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
28738 * Checks if two InvoiceSignatures contain equal inner contents.
28739 * This ignores pointers and is_owned flags and looks at the values in fields.
28740 * Two objects with NULL inner values will be considered "equal" here.
28742 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
28745 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
28747 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
28750 * Creates a copy of the PrivateRoute
28752 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
28755 * Checks if two PrivateRoutes contain equal inner contents.
28757 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
28760 * Checks if two PrivateRoutes contain equal inner contents.
28761 * This ignores pointers and is_owned flags and looks at the values in fields.
28762 * Two objects with NULL inner values will be considered "equal" here.
28764 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
28767 * Disassembles the `SignedRawInvoice` into its three parts:
28769 * 2. hash of the raw invoice
28772 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
28775 * The `RawInvoice` which was signed.
28777 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
28780 * The hash of the `RawInvoice` that was signed.
28782 MUST_USE_RES const uint8_t (*SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
28785 * InvoiceSignature for the invoice.
28787 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
28790 * Recovers the public key used for signing the invoice from the recoverable signature.
28792 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
28795 * Checks if the signature is valid for the included payee public key or if none exists if it's
28796 * valid for the recovered signature (which should always be true?).
28798 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
28801 * Calculate the hash of the encoded `RawInvoice`
28803 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28807 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28809 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28813 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28815 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28819 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28821 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28825 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28827 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28831 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28833 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28837 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28839 MUST_USE_RES struct LDKMinFinalCltvExpiry RawInvoice_min_final_cltv_expiry(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28843 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28845 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28849 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28851 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28853 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28855 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28857 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
28860 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
28862 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
28864 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
28867 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
28868 * the range `0..=MAX_TIMESTAMP`.
28870 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
28872 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
28875 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
28876 * `0..=MAX_TIMESTAMP`.
28878 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
28880 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
28883 * Returns the Unix timestamp representing the stored time
28885 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
28888 * Returns the duration of the stored time since the Unix epoch
28890 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
28893 * Returns the [`SystemTime`] representing the stored time
28895 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
28898 * Transform the `Invoice` into it's unchecked version
28900 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
28903 * Check that the invoice is signed correctly and that key recovery works
28905 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
28908 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
28910 * use lightning_invoice::*;
28912 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
28913 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
28914 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
28915 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
28916 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
28917 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
28918 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
28919 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
28920 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
28921 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
28922 * j5r6drg6k6zcqj0fcwg\";
28924 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
28926 * assert!(Invoice::from_signed(signed).is_ok());
28929 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
28932 * Returns the `Invoice`'s timestamp (should equal its creation time)
28934 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
28937 * Returns the `Invoice`'s timestamp as a duration since the Unix epoch
28939 MUST_USE_RES uint64_t Invoice_duration_since_epoch(const struct LDKInvoice *NONNULL_PTR this_arg);
28942 * Returns the hash to which we will receive the preimage on completion of the payment
28944 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
28947 * Get the payee's public key if one was included in the invoice
28949 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28951 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
28954 * Get the payment secret if one was included in the invoice
28956 MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
28959 * Get the invoice features if they were included in the invoice
28961 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28963 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
28966 * Recover the payee's public key (only to be used if none was included in the invoice)
28968 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
28971 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
28973 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
28976 * Returns whether the invoice has expired.
28978 MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
28981 * Returns whether the expiry time would pass at the given point in time.
28982 * `at_time` is the timestamp as a duration since the Unix epoch.
28984 MUST_USE_RES bool Invoice_would_expire(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t at_time);
28987 * Returns the invoice's `min_final_cltv_expiry` time, if present, otherwise
28988 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY`].
28990 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
28993 * Returns a list of all routes included in the invoice
28995 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
28998 * Returns a list of all routes included in the invoice as the underlying hints
29000 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
29003 * Returns the currency for which the invoice was issued
29005 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
29008 * Returns the amount if specified in the invoice as millisatoshis.
29010 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
29013 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
29014 * returns `CreationError::DescriptionTooLong` otherwise
29016 * Please note that single characters may use more than one byte due to UTF8 encoding.
29018 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
29021 * Returns the underlying description `String`
29023 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
29026 * Construct an `ExpiryTime` from seconds.
29028 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
29031 * Construct an `ExpiryTime` from a `Duration`.
29033 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
29036 * Returns the expiry time in seconds
29038 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
29041 * Returns a reference to the underlying `Duration` (=expiry time)
29043 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
29046 * Creates a new (partial) route from a list of hops
29048 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
29051 * Returns the underlying list of hops
29053 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
29056 * Creates a copy of the CreationError
29058 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
29061 * Utility method to constructs a new DescriptionTooLong-variant CreationError
29063 enum LDKCreationError CreationError_description_too_long(void);
29066 * Utility method to constructs a new RouteTooLong-variant CreationError
29068 enum LDKCreationError CreationError_route_too_long(void);
29071 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
29073 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
29076 * Utility method to constructs a new InvalidAmount-variant CreationError
29078 enum LDKCreationError CreationError_invalid_amount(void);
29081 * Utility method to constructs a new MissingRouteHints-variant CreationError
29083 enum LDKCreationError CreationError_missing_route_hints(void);
29086 * Checks if two CreationErrors contain equal inner contents.
29087 * This ignores pointers and is_owned flags and looks at the values in fields.
29089 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
29092 * Get the string representation of a CreationError object
29094 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
29097 * Creates a copy of the SemanticError
29099 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
29102 * Utility method to constructs a new NoPaymentHash-variant SemanticError
29104 enum LDKSemanticError SemanticError_no_payment_hash(void);
29107 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
29109 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
29112 * Utility method to constructs a new NoDescription-variant SemanticError
29114 enum LDKSemanticError SemanticError_no_description(void);
29117 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
29119 enum LDKSemanticError SemanticError_multiple_descriptions(void);
29122 * Utility method to constructs a new NoPaymentSecret-variant SemanticError
29124 enum LDKSemanticError SemanticError_no_payment_secret(void);
29127 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
29129 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
29132 * Utility method to constructs a new InvalidFeatures-variant SemanticError
29134 enum LDKSemanticError SemanticError_invalid_features(void);
29137 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
29139 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
29142 * Utility method to constructs a new InvalidSignature-variant SemanticError
29144 enum LDKSemanticError SemanticError_invalid_signature(void);
29147 * Utility method to constructs a new ImpreciseAmount-variant SemanticError
29149 enum LDKSemanticError SemanticError_imprecise_amount(void);
29152 * Checks if two SemanticErrors contain equal inner contents.
29153 * This ignores pointers and is_owned flags and looks at the values in fields.
29155 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
29158 * Get the string representation of a SemanticError object
29160 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
29163 * Frees any resources used by the SignOrCreationError
29165 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
29168 * Creates a copy of the SignOrCreationError
29170 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
29173 * Utility method to constructs a new SignError-variant SignOrCreationError
29175 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
29178 * Utility method to constructs a new CreationError-variant SignOrCreationError
29180 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
29183 * Checks if two SignOrCreationErrors contain equal inner contents.
29184 * This ignores pointers and is_owned flags and looks at the values in fields.
29186 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
29189 * Get the string representation of a SignOrCreationError object
29191 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
29194 * Frees any resources used by the InvoicePayer, if is_owned is set and inner is non-NULL.
29196 void InvoicePayer_free(struct LDKInvoicePayer this_obj);
29199 * Calls the free function if one is set
29201 void Payer_free(struct LDKPayer this_ptr);
29204 * Calls the free function if one is set
29206 void Router_free(struct LDKRouter this_ptr);
29209 * Frees any resources used by the Retry
29211 void Retry_free(struct LDKRetry this_ptr);
29214 * Creates a copy of the Retry
29216 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
29219 * Utility method to constructs a new Attempts-variant Retry
29221 struct LDKRetry Retry_attempts(uintptr_t a);
29224 * Utility method to constructs a new Timeout-variant Retry
29226 struct LDKRetry Retry_timeout(uint64_t a);
29229 * Checks if two Retrys contain equal inner contents.
29230 * This ignores pointers and is_owned flags and looks at the values in fields.
29232 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
29235 * Checks if two Retrys contain equal inner contents.
29237 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
29240 * Frees any resources used by the PaymentError
29242 void PaymentError_free(struct LDKPaymentError this_ptr);
29245 * Creates a copy of the PaymentError
29247 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
29250 * Utility method to constructs a new Invoice-variant PaymentError
29252 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
29255 * Utility method to constructs a new Routing-variant PaymentError
29257 struct LDKPaymentError PaymentError_routing(struct LDKLightningError a);
29260 * Utility method to constructs a new Sending-variant PaymentError
29262 struct LDKPaymentError PaymentError_sending(struct LDKPaymentSendFailure a);
29265 * Creates an invoice payer that retries failed payment paths.
29267 * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once
29268 * `retry` has been exceeded for a given [`Invoice`].
29270 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);
29273 * Pays the given [`Invoice`], caching it for later use in case a retry is needed.
29275 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
29276 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
29279 MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_invoice(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice);
29282 * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in
29283 * case a retry is needed.
29285 * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
29286 * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
29289 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);
29292 * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in
29293 * case a retry is needed.
29295 * You should ensure that `payment_preimage` is unique and that its `payment_hash` has never
29296 * been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so for you.
29298 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);
29301 * Removes the payment cached by the given payment hash.
29303 * Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
29304 * [`EventHandler`]. Otherwise, calling this method is unnecessary.
29306 void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
29309 * Constructs a new EventHandler which calls the relevant methods on this_arg.
29310 * This copies the `inner` pointer in this_arg and thus the returned EventHandler must be freed before this_arg is
29312 struct LDKEventHandler InvoicePayer_as_EventHandler(const struct LDKInvoicePayer *NONNULL_PTR this_arg);
29315 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
29316 * See [`PhantomKeysManager`] for more information on phantom node payments.
29318 * `phantom_route_hints` parameter:
29319 * * Contains channel info for all nodes participating in the phantom invoice
29320 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
29321 * participating node
29322 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
29323 * updated when a channel becomes disabled or closes
29324 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
29325 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
29328 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
29329 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
29330 * If `None` is provided for `payment_hash`, then one will be created.
29332 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
29333 * in excess of the current time.
29335 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
29336 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
29339 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
29340 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
29341 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
29342 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
29343 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
29345 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
29347 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);
29350 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
29351 * See [`PhantomKeysManager`] for more information on phantom node payments.
29353 * `phantom_route_hints` parameter:
29354 * * Contains channel info for all nodes participating in the phantom invoice
29355 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
29356 * participating node
29357 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
29358 * updated when a channel becomes disabled or closes
29359 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
29360 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
29363 * `description_hash` is a SHA-256 hash of the description text
29365 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
29366 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
29367 * If `None` is provided for `payment_hash`, then one will be created.
29369 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
29370 * in excess of the current time.
29372 * Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
29373 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
29376 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
29377 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
29378 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
29379 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
29380 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
29382 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
29384 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);
29387 * Utility to construct an invoice. Generally, unless you want to do something like a custom
29388 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
29389 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
29390 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
29391 * that the payment secret is valid when the invoice is paid.
29393 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
29394 * in excess of the current time.
29396 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);
29399 * Utility to construct an invoice. Generally, unless you want to do something like a custom
29400 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
29401 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
29402 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
29403 * that the payment secret is valid when the invoice is paid.
29404 * Use this variant if you want to pass the `description_hash` to the invoice.
29406 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
29407 * in excess of the current time.
29409 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);
29412 * See [`create_invoice_from_channelmanager_with_description_hash`]
29413 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
29414 * available and the current time is supplied by the caller.
29416 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);
29419 * See [`create_invoice_from_channelmanager`]
29420 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
29421 * available and the current time is supplied by the caller.
29423 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);
29426 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
29428 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
29431 * Creates a new router using the given [`NetworkGraph`], a [`Logger`], and a randomness source
29432 * `random_seed_bytes`.
29434 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes);
29437 * Constructs a new Router which calls the relevant methods on this_arg.
29438 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
29440 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
29443 * Constructs a new Payer which calls the relevant methods on this_arg.
29444 * This copies the `inner` pointer in this_arg and thus the returned Payer must be freed before this_arg is
29446 struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg);
29449 * Read a SiPrefix object from a string
29451 struct LDKCResult_SiPrefixParseErrorZ SiPrefix_from_str(struct LDKStr s);
29454 * Read a Invoice object from a string
29456 struct LDKCResult_InvoiceParseOrSemanticErrorZ Invoice_from_str(struct LDKStr s);
29459 * Read a SignedRawInvoice object from a string
29461 struct LDKCResult_SignedRawInvoiceParseErrorZ SignedRawInvoice_from_str(struct LDKStr s);
29464 * Get the string representation of a ParseError object
29466 struct LDKStr ParseError_to_str(const struct LDKParseError *NONNULL_PTR o);
29469 * Get the string representation of a ParseOrSemanticError object
29471 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
29474 * Get the string representation of a Invoice object
29476 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
29479 * Get the string representation of a SignedRawInvoice object
29481 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
29484 * Get the string representation of a Currency object
29486 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
29489 * Get the string representation of a SiPrefix object
29491 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
29494 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
29496 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
29499 * Instantiate a new [`RapidGossipSync`] instance
29501 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph);
29504 * Sync gossip data from a file
29505 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
29507 * `network_graph`: The network graph to apply the updates to
29509 * `sync_path`: Path to the file where the gossip update data is located
29512 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
29515 * Returns whether a rapid gossip sync has completed at least once
29517 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
29520 * Frees any resources used by the GraphSyncError
29522 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
29525 * Creates a copy of the GraphSyncError
29527 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
29530 * Utility method to constructs a new DecodeError-variant GraphSyncError
29532 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
29535 * Utility method to constructs a new LightningError-variant GraphSyncError
29537 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
29540 * Update network graph from binary data.
29541 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
29543 * `network_graph`: network graph to be updated
29545 * `update_data`: `&[u8]` binary stream that comprises the update data
29547 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
29549 #endif /* LDK_C_BINDINGS_H */
29551 #include "ldk_ver.h"