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 enum which can either contain a or not
16 typedef enum LDKCOption_NoneZ {
18 * When we're in this state, this COption_NoneZ contains a
20 LDKCOption_NoneZ_Some,
22 * When we're in this state, this COption_NoneZ contains nothing
24 LDKCOption_NoneZ_None,
26 * Must be last for serialization purposes
28 LDKCOption_NoneZ_Sentinel,
32 * An enum representing the status of a channel monitor update persistence.
34 typedef enum LDKChannelMonitorUpdateStatus {
36 * The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
39 * This includes performing any `fsync()` calls required to ensure the update is guaranteed to
40 * be available on restart even if the application crashes.
42 LDKChannelMonitorUpdateStatus_Completed,
44 * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
45 * our state failed, but is expected to succeed at some point in the future).
47 * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
48 * submitting new commitment transactions to the counterparty. Once the update(s) which failed
49 * have been successfully applied, a [`MonitorEvent::Completed`] can be used to restore the
50 * channel to an operational state.
52 * Note that a given [`ChannelManager`] will *never* re-generate a [`ChannelMonitorUpdate`].
53 * If you return this error you must ensure that it is written to disk safely before writing
54 * the latest [`ChannelManager`] state, or you should return [`PermanentFailure`] instead.
56 * Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
57 * occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
58 * attempting to claim it on this channel) and those updates must still be persisted.
60 * No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
61 * until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
62 * monitor update for the same channel.
64 * For deployments where a copy of ChannelMonitors and other local state are backed up in a
65 * remote location (with local copies persisted immediately), it is anticipated that all
66 * updates will return [`InProgress`] until the remote copies could be updated.
68 * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
69 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
70 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
72 LDKChannelMonitorUpdateStatus_InProgress,
74 * Used to indicate no further channel monitor updates will be allowed (likely a disk failure
75 * or a remote copy of this [`ChannelMonitor`] is no longer reachable and thus not updatable).
77 * When this is returned, [`ChannelManager`] will force-close the channel but *not* broadcast
78 * our current commitment transaction. This avoids a dangerous case where a local disk failure
79 * (e.g. the Linux-default remounting of the disk as read-only) causes [`PermanentFailure`]s
80 * for all monitor updates. If we were to broadcast our latest commitment transaction and then
81 * restart, we could end up reading a previous [`ChannelMonitor`] and [`ChannelManager`],
82 * revoking our now-broadcasted state before seeing it confirm and losing all our funds.
84 * Note that this is somewhat of a tradeoff - if the disk is really gone and we may have lost
85 * the data permanently, we really should broadcast immediately. If the data can be recovered
86 * with manual intervention, we'd rather close the channel, rejecting future updates to it,
87 * and broadcast the latest state only if we have HTLCs to claim which are timing out (which
88 * we do as long as blocks are connected).
90 * In order to broadcast the latest local commitment transaction, you'll need to call
91 * [`ChannelMonitor::get_latest_holder_commitment_txn`] and broadcast the resulting
92 * transactions once you've safely ensured no further channel updates can be generated by your
95 * Note that at least one final [`ChannelMonitorUpdate`] may still be provided, which must
96 * still be processed by a running [`ChannelMonitor`]. This final update will mark the
97 * [`ChannelMonitor`] as finalized, ensuring no further updates (e.g. revocation of the latest
98 * commitment transaction) are allowed.
100 * Note that even if you return a [`PermanentFailure`] due to unavailability of secondary
101 * [`ChannelMonitor`] copies, you should still make an attempt to store the update where
102 * possible to ensure you can claim HTLC outputs on the latest commitment transaction
105 * In case of distributed watchtowers deployment, the new version must be written to disk, as
106 * state may have been stored but rejected due to a block forcing a commitment broadcast. This
107 * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
108 * lagging behind on block processing.
110 * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
111 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
113 LDKChannelMonitorUpdateStatus_PermanentFailure,
115 * Must be last for serialization purposes
117 LDKChannelMonitorUpdateStatus_Sentinel,
118 } LDKChannelMonitorUpdateStatus;
121 * An enum that represents the speed at which we want a transaction to confirm used for feerate
124 typedef enum LDKConfirmationTarget {
126 * We are happy with this transaction confirming slowly when feerate drops some.
128 LDKConfirmationTarget_Background,
130 * We'd like this transaction to confirm without major delay, but 12-18 blocks is fine.
132 LDKConfirmationTarget_Normal,
134 * We'd like this transaction to confirm in the next few blocks.
136 LDKConfirmationTarget_HighPriority,
138 * Must be last for serialization purposes
140 LDKConfirmationTarget_Sentinel,
141 } LDKConfirmationTarget;
144 * Errors that may occur when constructing a new [`RawInvoice`] or [`Invoice`]
146 typedef enum LDKCreationError {
148 * The supplied description string was longer than 639 __bytes__ (see [`Description::new`])
150 LDKCreationError_DescriptionTooLong,
152 * The specified route has too many hops and can't be encoded
154 LDKCreationError_RouteTooLong,
156 * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
158 LDKCreationError_TimestampOutOfBounds,
160 * The supplied millisatoshi amount was greater than the total bitcoin supply.
162 LDKCreationError_InvalidAmount,
164 * Route hints were required for this invoice and were missing. Applies to
165 * [phantom invoices].
167 * [phantom invoices]: crate::utils::create_phantom_invoice
169 LDKCreationError_MissingRouteHints,
171 * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
173 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
175 LDKCreationError_MinFinalCltvExpiryDeltaTooShort,
177 * Must be last for serialization purposes
179 LDKCreationError_Sentinel,
183 * Enum representing the crypto currencies (or networks) supported by this library
185 typedef enum LDKCurrency {
193 LDKCurrency_BitcoinTestnet,
207 * Must be last for serialization purposes
209 LDKCurrency_Sentinel,
213 * This enum is used to specify which error data to send to peers when failing back an HTLC
214 * using [`ChannelManager::fail_htlc_backwards_with_reason`].
216 * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
218 typedef enum LDKFailureCode {
220 * We had a temporary error processing the payment. Useful if no other error codes fit
221 * and you want to indicate that the payer may want to retry.
223 LDKFailureCode_TemporaryNodeFailure,
225 * We have a required feature which was not in this onion. For example, you may require
226 * some additional metadata that was not provided with this payment.
228 LDKFailureCode_RequiredNodeFeatureMissing,
230 * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
231 * the HTLC is too close to the current block height for safe handling.
232 * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
233 * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
235 LDKFailureCode_IncorrectOrUnknownPaymentDetails,
237 * Must be last for serialization purposes
239 LDKFailureCode_Sentinel,
243 * Describes the type of HTLC claim as determined by analyzing the witness.
245 typedef enum LDKHTLCClaim {
247 * Claims an offered output on a commitment transaction through the timeout path.
249 LDKHTLCClaim_OfferedTimeout,
251 * Claims an offered output on a commitment transaction through the success path.
253 LDKHTLCClaim_OfferedPreimage,
255 * Claims an accepted output on a commitment transaction through the timeout path.
257 LDKHTLCClaim_AcceptedTimeout,
259 * Claims an accepted output on a commitment transaction through the success path.
261 LDKHTLCClaim_AcceptedPreimage,
263 * Claims an offered/accepted output on a commitment transaction through the revocation path.
265 LDKHTLCClaim_Revocation,
267 * Must be last for serialization purposes
269 LDKHTLCClaim_Sentinel,
273 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
275 typedef enum LDKIOError {
277 LDKIOError_PermissionDenied,
278 LDKIOError_ConnectionRefused,
279 LDKIOError_ConnectionReset,
280 LDKIOError_ConnectionAborted,
281 LDKIOError_NotConnected,
282 LDKIOError_AddrInUse,
283 LDKIOError_AddrNotAvailable,
284 LDKIOError_BrokenPipe,
285 LDKIOError_AlreadyExists,
286 LDKIOError_WouldBlock,
287 LDKIOError_InvalidInput,
288 LDKIOError_InvalidData,
290 LDKIOError_WriteZero,
291 LDKIOError_Interrupted,
293 LDKIOError_UnexpectedEof,
295 * Must be last for serialization purposes
301 * An enum representing the available verbosity levels of the logger.
303 typedef enum LDKLevel {
305 * Designates extremely verbose information, including gossip-induced messages
309 * Designates very low priority, often extremely verbose, information
313 * Designates lower priority information
317 * Designates useful information
321 * Designates hazardous situations
325 * Designates very serious errors
329 * Must be last for serialization purposes
335 * An enum representing the possible Bitcoin or test networks which we can run on
337 typedef enum LDKNetwork {
339 * The main Bitcoin blockchain.
343 * The testnet3 blockchain.
347 * A local test blockchain.
351 * A blockchain on which blocks are signed instead of mined.
355 * Must be last for serialization purposes
361 * The reason the payment failed. Used in [`Event::PaymentFailed`].
363 typedef enum LDKPaymentFailureReason {
365 * The intended recipient rejected our payment.
367 LDKPaymentFailureReason_RecipientRejected,
369 * The user chose to abandon this payment by calling [`ChannelManager::abandon_payment`].
371 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
373 LDKPaymentFailureReason_UserAbandoned,
375 * We exhausted all of our retry attempts while trying to send the payment, or we
376 * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry
377 * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will
378 * have come before this.
380 * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout
382 LDKPaymentFailureReason_RetriesExhausted,
384 * The payment expired while retrying, based on the provided
385 * [`PaymentParameters::expiry_time`].
387 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
389 LDKPaymentFailureReason_PaymentExpired,
391 * We failed to find a route while retrying the payment.
393 LDKPaymentFailureReason_RouteNotFound,
395 * This error should generally never happen. This likely means that there is a problem with
398 LDKPaymentFailureReason_UnexpectedError,
400 * Must be last for serialization purposes
402 LDKPaymentFailureReason_Sentinel,
403 } LDKPaymentFailureReason;
406 * Specifies the recipient of an invoice.
408 * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign
411 typedef enum LDKRecipient {
413 * The invoice should be signed with the local node secret key.
417 * The invoice should be signed with the phantom node secret key. This secret key must be the
418 * same for all nodes participating in the [phantom node payment].
420 * [phantom node payment]: PhantomKeysManager
422 LDKRecipient_PhantomNode,
424 * Must be last for serialization purposes
426 LDKRecipient_Sentinel,
430 * Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be
431 * surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
433 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
434 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
435 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
437 typedef enum LDKRetryableSendFailure {
439 * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
440 * that this error is *not* caused by [`Retry::Timeout`].
442 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
444 LDKRetryableSendFailure_PaymentExpired,
446 * We were unable to find a route to the destination.
448 LDKRetryableSendFailure_RouteNotFound,
450 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
451 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
453 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
454 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
455 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
457 LDKRetryableSendFailure_DuplicatePayment,
459 * Must be last for serialization purposes
461 LDKRetryableSendFailure_Sentinel,
462 } LDKRetryableSendFailure;
465 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
467 typedef enum LDKSecp256k1Error {
469 * Signature failed verification
471 LDKSecp256k1Error_IncorrectSignature,
473 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
475 LDKSecp256k1Error_InvalidMessage,
479 LDKSecp256k1Error_InvalidPublicKey,
483 LDKSecp256k1Error_InvalidSignature,
487 LDKSecp256k1Error_InvalidSecretKey,
491 LDKSecp256k1Error_InvalidSharedSecret,
495 LDKSecp256k1Error_InvalidRecoveryId,
497 * Invalid tweak for add_assign or mul_assign
499 LDKSecp256k1Error_InvalidTweak,
501 * Didn't pass enough memory to context creation with preallocated memory
503 LDKSecp256k1Error_NotEnoughMemory,
505 * Bad set of public keys.
507 LDKSecp256k1Error_InvalidPublicKeySum,
509 * The only valid parity values are 0 or 1.
511 LDKSecp256k1Error_InvalidParityValue,
513 * Must be last for serialization purposes
515 LDKSecp256k1Error_Sentinel,
519 * Errors that may occur when converting a [`RawInvoice`] to an [`Invoice`]. They relate to the
520 * requirements sections in BOLT #11
522 typedef enum LDKSemanticError {
524 * The invoice is missing the mandatory payment hash
526 LDKSemanticError_NoPaymentHash,
528 * The invoice has multiple payment hashes which isn't allowed
530 LDKSemanticError_MultiplePaymentHashes,
532 * No description or description hash are part of the invoice
534 LDKSemanticError_NoDescription,
536 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
538 LDKSemanticError_MultipleDescriptions,
540 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
543 LDKSemanticError_NoPaymentSecret,
545 * The invoice contains multiple payment secrets
547 LDKSemanticError_MultiplePaymentSecrets,
549 * The invoice's features are invalid
551 LDKSemanticError_InvalidFeatures,
553 * The recovery id doesn't fit the signature/pub key
555 LDKSemanticError_InvalidRecoveryId,
557 * The invoice's signature is invalid
559 LDKSemanticError_InvalidSignature,
561 * The invoice's amount was not a whole number of millisatoshis
563 LDKSemanticError_ImpreciseAmount,
565 * Must be last for serialization purposes
567 LDKSemanticError_Sentinel,
571 * SI prefixes for the human readable part
573 typedef enum LDKSiPrefix {
591 * Must be last for serialization purposes
593 LDKSiPrefix_Sentinel,
597 * An error when accessing the chain via [`UtxoLookup`].
599 typedef enum LDKUtxoLookupError {
601 * The requested chain is unknown.
603 LDKUtxoLookupError_UnknownChain,
605 * The requested transaction doesn't exist or hasn't confirmed.
607 LDKUtxoLookupError_UnknownTx,
609 * Must be last for serialization purposes
611 LDKUtxoLookupError_Sentinel,
612 } LDKUtxoLookupError;
615 * A Rust str object, ie a reference to a UTF8-valid string.
616 * This is *not* null-terminated so cannot be used directly as a C string!
618 typedef struct LDKStr {
620 * A pointer to the string's bytes, in UTF8 encoding
622 const uint8_t *chars;
624 * The number of bytes (not characters!) pointed to by `chars`
628 * Whether the data pointed to by `chars` should be freed or not.
634 * A 16-byte byte array.
636 typedef struct LDKSixteenBytes {
644 * Unsigned, 128-bit integer.
646 * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
647 * See https://github.com/rust-lang/rust/issues/54341 for more details.
649 typedef struct LDKU128 {
651 * The 128-bit integer, as 16 little-endian bytes
653 uint8_t le_bytes[16];
657 * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
659 typedef struct LDKBigEndianScalar {
661 * The bytes of the scalar value.
663 uint8_t big_endian_bytes[32];
664 } LDKBigEndianScalar;
667 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
668 * look up the corresponding function in rust-lightning's docs.
670 typedef struct LDKThirtyTwoBytes {
672 * The thirty-two bytes
678 * Represents an error returned from the bech32 library during validation of some bech32 data
680 typedef enum LDKBech32Error_Tag {
682 * String does not contain the separator character
684 LDKBech32Error_MissingSeparator,
686 * The checksum does not match the rest of the data
688 LDKBech32Error_InvalidChecksum,
690 * The data or human-readable part is too long or too short
692 LDKBech32Error_InvalidLength,
694 * Some part of the string contains an invalid character
696 LDKBech32Error_InvalidChar,
698 * Some part of the data has an invalid value
700 LDKBech32Error_InvalidData,
702 * The bit conversion failed due to a padding issue
704 LDKBech32Error_InvalidPadding,
706 * The whole string must be of one case
708 LDKBech32Error_MixedCase,
710 * Must be last for serialization purposes
712 LDKBech32Error_Sentinel,
713 } LDKBech32Error_Tag;
715 typedef struct LDKBech32Error {
716 LDKBech32Error_Tag tag;
719 uint32_t invalid_char;
722 uint8_t invalid_data;
728 * A serialized transaction, in (pointer, length) form.
730 * This type optionally owns its own memory, and thus the semantics around access change based on
731 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
732 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
733 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
734 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
735 * you would be invalid.
737 * Note that, while it may change in the future, because transactions on the Rust side are stored
738 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
739 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
740 * `data_is_owned` either set or unset at your discretion.
742 typedef struct LDKTransaction {
744 * The serialized transaction data.
746 * This is non-const for your convenience, an object passed to Rust is never written to.
750 * The length of the serialized transaction
754 * Whether the data pointed to by `data` should be freed or not.
760 * A serialized witness.
762 typedef struct LDKWitness {
764 * The serialized transaction data.
766 * This is non-const for your convenience, an object passed to Rust is never written to.
770 * The length of the serialized transaction
774 * Whether the data pointed to by `data` should be freed or not.
780 * A dynamically-allocated array of u8s of arbitrary size.
781 * This corresponds to std::vector in C++
783 typedef struct LDKCVec_u8Z {
785 * The elements in the array.
786 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
790 * The number of elements pointed to by `data`.
796 * A transaction output including a scriptPubKey and value.
797 * This type *does* own its own memory, so must be free'd appropriately.
799 typedef struct LDKTxOut {
801 * The script_pubkey in this output
803 struct LDKCVec_u8Z script_pubkey;
805 * The value, in satoshis, of this output
811 * An enum which can either contain a u64 or not
813 typedef enum LDKCOption_DurationZ_Tag {
815 * When we're in this state, this COption_DurationZ contains a u64
817 LDKCOption_DurationZ_Some,
819 * When we're in this state, this COption_DurationZ contains nothing
821 LDKCOption_DurationZ_None,
823 * Must be last for serialization purposes
825 LDKCOption_DurationZ_Sentinel,
826 } LDKCOption_DurationZ_Tag;
828 typedef struct LDKCOption_DurationZ {
829 LDKCOption_DurationZ_Tag tag;
835 } LDKCOption_DurationZ;
840 * Onion messages and payments can be sent and received to blinded paths, which serve to hide the
841 * identity of the recipient.
843 typedef struct MUST_USE_STRUCT LDKBlindedPath {
845 * A pointer to the opaque Rust object.
846 * Nearly everywhere, inner must be non-null, however in places where
847 * the Rust equivalent takes an Option, it may be set to null to indicate None.
849 LDKnativeBlindedPath *inner;
851 * Indicates that this is the only struct which contains the same pointer.
852 * Rust functions which take ownership of an object provided via an argument require
853 * this to be true and invalidate the object pointed to by inner.
859 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedPaths of arbitrary size.
860 * This corresponds to std::vector in C++
862 typedef struct LDKCVec_BlindedPathZ {
864 * The elements in the array.
865 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
867 struct LDKBlindedPath *data;
869 * The number of elements pointed to by `data`.
872 } LDKCVec_BlindedPathZ;
875 * An enum which can either contain a u64 or not
877 typedef enum LDKCOption_u64Z_Tag {
879 * When we're in this state, this COption_u64Z contains a u64
881 LDKCOption_u64Z_Some,
883 * When we're in this state, this COption_u64Z contains nothing
885 LDKCOption_u64Z_None,
887 * Must be last for serialization purposes
889 LDKCOption_u64Z_Sentinel,
890 } LDKCOption_u64Z_Tag;
892 typedef struct LDKCOption_u64Z {
893 LDKCOption_u64Z_Tag tag;
904 * A script pubkey for shutting down a channel as defined by [BOLT #2].
906 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
908 typedef struct MUST_USE_STRUCT LDKShutdownScript {
910 * A pointer to the opaque Rust object.
911 * Nearly everywhere, inner must be non-null, however in places where
912 * the Rust equivalent takes an Option, it may be set to null to indicate None.
914 LDKnativeShutdownScript *inner;
916 * Indicates that this is the only struct which contains the same pointer.
917 * Rust functions which take ownership of an object provided via an argument require
918 * this to be true and invalidate the object pointed to by inner.
924 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
927 typedef enum LDKAPIError_Tag {
929 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
930 * are documented, but generally indicates some precondition of a function was violated.
932 LDKAPIError_APIMisuseError,
934 * Due to a high feerate, we were unable to complete the request.
935 * For example, this may be returned if the feerate implies we cannot open a channel at the
936 * requested value, but opening a larger channel would succeed.
938 LDKAPIError_FeeRateTooHigh,
940 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
941 * too-many-hops, etc).
943 LDKAPIError_InvalidRoute,
945 * We were unable to complete the request as the Channel required to do so is unable to
946 * complete the request (or was not found). This can take many forms, including disconnected
947 * peer, channel at capacity, channel shutting down, etc.
949 LDKAPIError_ChannelUnavailable,
951 * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
952 * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
953 * monitor update is awaiting async resolution. Once it resolves the attempted action should
954 * complete automatically.
956 * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
957 * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
958 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
960 LDKAPIError_MonitorUpdateInProgress,
962 * [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
963 * with the channel counterparty as negotiated in [`InitFeatures`].
965 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
966 * a channel or cooperatively close one with this peer (and will have to force-close instead).
968 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::SignerProvider::get_shutdown_scriptpubkey
969 * [`InitFeatures`]: crate::ln::features::InitFeatures
971 LDKAPIError_IncompatibleShutdownScript,
973 * Must be last for serialization purposes
975 LDKAPIError_Sentinel,
978 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
980 * A human-readable error message
983 } LDKAPIError_LDKAPIMisuseError_Body;
985 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
987 * A human-readable error message
991 * The feerate which was too high.
994 } LDKAPIError_LDKFeeRateTooHigh_Body;
996 typedef struct LDKAPIError_LDKInvalidRoute_Body {
998 * A human-readable error message
1001 } LDKAPIError_LDKInvalidRoute_Body;
1003 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
1005 * A human-readable error message
1008 } LDKAPIError_LDKChannelUnavailable_Body;
1010 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
1012 * The incompatible shutdown script.
1014 struct LDKShutdownScript script;
1015 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
1017 typedef struct MUST_USE_STRUCT LDKAPIError {
1018 LDKAPIError_Tag tag;
1020 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
1021 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
1022 LDKAPIError_LDKInvalidRoute_Body invalid_route;
1023 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
1024 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
1029 * The contents of CResult_NoneAPIErrorZ
1031 typedef union LDKCResult_NoneAPIErrorZPtr {
1033 * Note that this value is always NULL, as there are no contents in the OK variant
1037 * A pointer to the contents in the error state.
1038 * Reading from this pointer when `result_ok` is set is undefined.
1040 struct LDKAPIError *err;
1041 } LDKCResult_NoneAPIErrorZPtr;
1044 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
1045 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
1046 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1048 typedef struct LDKCResult_NoneAPIErrorZ {
1050 * The contents of this CResult_NoneAPIErrorZ, accessible via either
1051 * `err` or `result` depending on the state of `result_ok`.
1053 union LDKCResult_NoneAPIErrorZPtr contents;
1055 * Whether this CResult_NoneAPIErrorZ represents a success state.
1058 } LDKCResult_NoneAPIErrorZ;
1061 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
1062 * This corresponds to std::vector in C++
1064 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
1066 * The elements in the array.
1067 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1069 struct LDKCResult_NoneAPIErrorZ *data;
1071 * The number of elements pointed to by `data`.
1074 } LDKCVec_CResult_NoneAPIErrorZZ;
1077 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
1078 * This corresponds to std::vector in C++
1080 typedef struct LDKCVec_APIErrorZ {
1082 * The elements in the array.
1083 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1085 struct LDKAPIError *data;
1087 * The number of elements pointed to by `data`.
1090 } LDKCVec_APIErrorZ;
1093 * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
1095 typedef enum LDKCOption_CVec_u8ZZ_Tag {
1097 * When we're in this state, this COption_CVec_u8ZZ contains a crate::c_types::derived::CVec_u8Z
1099 LDKCOption_CVec_u8ZZ_Some,
1101 * When we're in this state, this COption_CVec_u8ZZ contains nothing
1103 LDKCOption_CVec_u8ZZ_None,
1105 * Must be last for serialization purposes
1107 LDKCOption_CVec_u8ZZ_Sentinel,
1108 } LDKCOption_CVec_u8ZZ_Tag;
1110 typedef struct LDKCOption_CVec_u8ZZ {
1111 LDKCOption_CVec_u8ZZ_Tag tag;
1114 struct LDKCVec_u8Z some;
1117 } LDKCOption_CVec_u8ZZ;
1122 * Information which is provided, encrypted, to the payment recipient when sending HTLCs.
1124 * This should generally be constructed with data communicated to us from the recipient (via a
1125 * BOLT11 or BOLT12 invoice).
1127 typedef struct MUST_USE_STRUCT LDKRecipientOnionFields {
1129 * A pointer to the opaque Rust object.
1130 * Nearly everywhere, inner must be non-null, however in places where
1131 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1133 LDKnativeRecipientOnionFields *inner;
1135 * Indicates that this is the only struct which contains the same pointer.
1136 * Rust functions which take ownership of an object provided via an argument require
1137 * this to be true and invalidate the object pointed to by inner.
1140 } LDKRecipientOnionFields;
1143 * An error in decoding a message or struct.
1145 typedef enum LDKDecodeError_Tag {
1147 * A version byte specified something we don't know how to handle.
1149 * Includes unknown realm byte in an onion hop data packet.
1151 LDKDecodeError_UnknownVersion,
1153 * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
1155 LDKDecodeError_UnknownRequiredFeature,
1157 * Value was invalid.
1159 * For example, a byte which was supposed to be a bool was something other than a 0
1160 * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
1161 * syntactically incorrect, etc.
1163 LDKDecodeError_InvalidValue,
1165 * The buffer to be read was too short.
1167 LDKDecodeError_ShortRead,
1169 * A length descriptor in the packet didn't describe the later data correctly.
1171 LDKDecodeError_BadLengthDescriptor,
1173 * Error from [`std::io`].
1177 * The message included zlib-compressed values, which we don't support.
1179 LDKDecodeError_UnsupportedCompression,
1181 * Must be last for serialization purposes
1183 LDKDecodeError_Sentinel,
1184 } LDKDecodeError_Tag;
1186 typedef struct MUST_USE_STRUCT LDKDecodeError {
1187 LDKDecodeError_Tag tag;
1196 * The contents of CResult_RecipientOnionFieldsDecodeErrorZ
1198 typedef union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr {
1200 * A pointer to the contents in the success state.
1201 * Reading from this pointer when `result_ok` is not set is undefined.
1203 struct LDKRecipientOnionFields *result;
1205 * A pointer to the contents in the error state.
1206 * Reading from this pointer when `result_ok` is set is undefined.
1208 struct LDKDecodeError *err;
1209 } LDKCResult_RecipientOnionFieldsDecodeErrorZPtr;
1212 * A CResult_RecipientOnionFieldsDecodeErrorZ represents the result of a fallible operation,
1213 * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
1214 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1216 typedef struct LDKCResult_RecipientOnionFieldsDecodeErrorZ {
1218 * The contents of this CResult_RecipientOnionFieldsDecodeErrorZ, accessible via either
1219 * `err` or `result` depending on the state of `result_ok`.
1221 union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr contents;
1223 * Whether this CResult_RecipientOnionFieldsDecodeErrorZ represents a success state.
1226 } LDKCResult_RecipientOnionFieldsDecodeErrorZ;
1229 * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
1231 typedef enum LDKCOption_HTLCClaimZ_Tag {
1233 * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
1235 LDKCOption_HTLCClaimZ_Some,
1237 * When we're in this state, this COption_HTLCClaimZ contains nothing
1239 LDKCOption_HTLCClaimZ_None,
1241 * Must be last for serialization purposes
1243 LDKCOption_HTLCClaimZ_Sentinel,
1244 } LDKCOption_HTLCClaimZ_Tag;
1246 typedef struct LDKCOption_HTLCClaimZ {
1247 LDKCOption_HTLCClaimZ_Tag tag;
1250 enum LDKHTLCClaim some;
1253 } LDKCOption_HTLCClaimZ;
1256 * The contents of CResult_NoneNoneZ
1258 typedef union LDKCResult_NoneNoneZPtr {
1260 * Note that this value is always NULL, as there are no contents in the OK variant
1264 * Note that this value is always NULL, as there are no contents in the Err variant
1267 } LDKCResult_NoneNoneZPtr;
1270 * A CResult_NoneNoneZ represents the result of a fallible operation,
1271 * containing a () on success and a () on failure.
1272 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1274 typedef struct LDKCResult_NoneNoneZ {
1276 * The contents of this CResult_NoneNoneZ, accessible via either
1277 * `err` or `result` depending on the state of `result_ok`.
1279 union LDKCResult_NoneNoneZPtr contents;
1281 * Whether this CResult_NoneNoneZ represents a success state.
1284 } LDKCResult_NoneNoneZ;
1289 * Implements the per-commitment secret storage scheme from
1290 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
1292 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
1295 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
1297 * A pointer to the opaque Rust object.
1298 * Nearly everywhere, inner must be non-null, however in places where
1299 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1301 LDKnativeCounterpartyCommitmentSecrets *inner;
1303 * Indicates that this is the only struct which contains the same pointer.
1304 * Rust functions which take ownership of an object provided via an argument require
1305 * this to be true and invalidate the object pointed to by inner.
1308 } LDKCounterpartyCommitmentSecrets;
1311 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
1313 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
1315 * A pointer to the contents in the success state.
1316 * Reading from this pointer when `result_ok` is not set is undefined.
1318 struct LDKCounterpartyCommitmentSecrets *result;
1320 * A pointer to the contents in the error state.
1321 * Reading from this pointer when `result_ok` is set is undefined.
1323 struct LDKDecodeError *err;
1324 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
1327 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
1328 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
1329 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1331 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
1333 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
1334 * `err` or `result` depending on the state of `result_ok`.
1336 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
1338 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
1341 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
1346 * The set of public keys which are used in the creation of one commitment transaction.
1347 * These are derived from the channel base keys and per-commitment data.
1349 * A broadcaster key is provided from potential broadcaster of the computed transaction.
1350 * A countersignatory key is coming from a protocol participant unable to broadcast the
1353 * These keys are assumed to be good, either because the code derived them from
1354 * channel basepoints via the new function, or they were obtained via
1355 * CommitmentTransaction.trust().keys() because we trusted the source of the
1356 * pre-calculated keys.
1358 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
1360 * A pointer to the opaque Rust object.
1361 * Nearly everywhere, inner must be non-null, however in places where
1362 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1364 LDKnativeTxCreationKeys *inner;
1366 * Indicates that this is the only struct which contains the same pointer.
1367 * Rust functions which take ownership of an object provided via an argument require
1368 * this to be true and invalidate the object pointed to by inner.
1371 } LDKTxCreationKeys;
1374 * The contents of CResult_TxCreationKeysDecodeErrorZ
1376 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
1378 * A pointer to the contents in the success state.
1379 * Reading from this pointer when `result_ok` is not set is undefined.
1381 struct LDKTxCreationKeys *result;
1383 * A pointer to the contents in the error state.
1384 * Reading from this pointer when `result_ok` is set is undefined.
1386 struct LDKDecodeError *err;
1387 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
1390 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
1391 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
1392 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1394 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
1396 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
1397 * `err` or `result` depending on the state of `result_ok`.
1399 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
1401 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
1404 } LDKCResult_TxCreationKeysDecodeErrorZ;
1409 * One counterparty's public keys which do not change over the life of a channel.
1411 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
1413 * A pointer to the opaque Rust object.
1414 * Nearly everywhere, inner must be non-null, however in places where
1415 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1417 LDKnativeChannelPublicKeys *inner;
1419 * Indicates that this is the only struct which contains the same pointer.
1420 * Rust functions which take ownership of an object provided via an argument require
1421 * this to be true and invalidate the object pointed to by inner.
1424 } LDKChannelPublicKeys;
1427 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
1429 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
1431 * A pointer to the contents in the success state.
1432 * Reading from this pointer when `result_ok` is not set is undefined.
1434 struct LDKChannelPublicKeys *result;
1436 * A pointer to the contents in the error state.
1437 * Reading from this pointer when `result_ok` is set is undefined.
1439 struct LDKDecodeError *err;
1440 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
1443 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
1444 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
1445 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1447 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
1449 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
1450 * `err` or `result` depending on the state of `result_ok`.
1452 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
1454 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
1457 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
1460 * An enum which can either contain a u32 or not
1462 typedef enum LDKCOption_u32Z_Tag {
1464 * When we're in this state, this COption_u32Z contains a u32
1466 LDKCOption_u32Z_Some,
1468 * When we're in this state, this COption_u32Z contains nothing
1470 LDKCOption_u32Z_None,
1472 * Must be last for serialization purposes
1474 LDKCOption_u32Z_Sentinel,
1475 } LDKCOption_u32Z_Tag;
1477 typedef struct LDKCOption_u32Z {
1478 LDKCOption_u32Z_Tag tag;
1489 * Information about an HTLC as it appears in a commitment transaction
1491 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
1493 * A pointer to the opaque Rust object.
1494 * Nearly everywhere, inner must be non-null, however in places where
1495 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1497 LDKnativeHTLCOutputInCommitment *inner;
1499 * Indicates that this is the only struct which contains the same pointer.
1500 * Rust functions which take ownership of an object provided via an argument require
1501 * this to be true and invalidate the object pointed to by inner.
1504 } LDKHTLCOutputInCommitment;
1507 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
1509 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
1511 * A pointer to the contents in the success state.
1512 * Reading from this pointer when `result_ok` is not set is undefined.
1514 struct LDKHTLCOutputInCommitment *result;
1516 * A pointer to the contents in the error state.
1517 * Reading from this pointer when `result_ok` is set is undefined.
1519 struct LDKDecodeError *err;
1520 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
1523 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
1524 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
1525 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1527 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
1529 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
1530 * `err` or `result` depending on the state of `result_ok`.
1532 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
1534 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
1537 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
1542 * Late-bound per-channel counterparty data used to build transactions.
1544 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
1546 * A pointer to the opaque Rust object.
1547 * Nearly everywhere, inner must be non-null, however in places where
1548 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1550 LDKnativeCounterpartyChannelTransactionParameters *inner;
1552 * Indicates that this is the only struct which contains the same pointer.
1553 * Rust functions which take ownership of an object provided via an argument require
1554 * this to be true and invalidate the object pointed to by inner.
1557 } LDKCounterpartyChannelTransactionParameters;
1560 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
1562 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
1564 * A pointer to the contents in the success state.
1565 * Reading from this pointer when `result_ok` is not set is undefined.
1567 struct LDKCounterpartyChannelTransactionParameters *result;
1569 * A pointer to the contents in the error state.
1570 * Reading from this pointer when `result_ok` is set is undefined.
1572 struct LDKDecodeError *err;
1573 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
1576 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1577 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1578 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1580 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
1582 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
1583 * `err` or `result` depending on the state of `result_ok`.
1585 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
1587 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
1590 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
1595 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
1596 * The fields are organized by holder/counterparty.
1598 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
1599 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
1601 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
1603 * A pointer to the opaque Rust object.
1604 * Nearly everywhere, inner must be non-null, however in places where
1605 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1607 LDKnativeChannelTransactionParameters *inner;
1609 * Indicates that this is the only struct which contains the same pointer.
1610 * Rust functions which take ownership of an object provided via an argument require
1611 * this to be true and invalidate the object pointed to by inner.
1614 } LDKChannelTransactionParameters;
1617 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
1619 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
1621 * A pointer to the contents in the success state.
1622 * Reading from this pointer when `result_ok` is not set is undefined.
1624 struct LDKChannelTransactionParameters *result;
1626 * A pointer to the contents in the error state.
1627 * Reading from this pointer when `result_ok` is set is undefined.
1629 struct LDKDecodeError *err;
1630 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
1633 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1634 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1635 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1637 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
1639 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
1640 * `err` or `result` depending on the state of `result_ok`.
1642 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
1644 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
1647 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
1650 * Represents a secp256k1 signature serialized as two 32-byte numbers
1652 typedef struct LDKSignature {
1654 * The bytes of the signature in "compact" form
1656 uint8_t compact_form[64];
1660 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
1661 * This corresponds to std::vector in C++
1663 typedef struct LDKCVec_SignatureZ {
1665 * The elements in the array.
1666 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1668 struct LDKSignature *data;
1670 * The number of elements pointed to by `data`.
1673 } LDKCVec_SignatureZ;
1678 * Information needed to build and sign a holder's commitment transaction.
1680 * The transaction is only signed once we are ready to broadcast.
1682 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
1684 * A pointer to the opaque Rust object.
1685 * Nearly everywhere, inner must be non-null, however in places where
1686 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1688 LDKnativeHolderCommitmentTransaction *inner;
1690 * Indicates that this is the only struct which contains the same pointer.
1691 * Rust functions which take ownership of an object provided via an argument require
1692 * this to be true and invalidate the object pointed to by inner.
1695 } LDKHolderCommitmentTransaction;
1698 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
1700 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
1702 * A pointer to the contents in the success state.
1703 * Reading from this pointer when `result_ok` is not set is undefined.
1705 struct LDKHolderCommitmentTransaction *result;
1707 * A pointer to the contents in the error state.
1708 * Reading from this pointer when `result_ok` is set is undefined.
1710 struct LDKDecodeError *err;
1711 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
1714 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1715 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1716 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1718 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
1720 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
1721 * `err` or `result` depending on the state of `result_ok`.
1723 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
1725 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
1728 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
1733 * A pre-built Bitcoin commitment transaction and its txid.
1735 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
1737 * A pointer to the opaque Rust object.
1738 * Nearly everywhere, inner must be non-null, however in places where
1739 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1741 LDKnativeBuiltCommitmentTransaction *inner;
1743 * Indicates that this is the only struct which contains the same pointer.
1744 * Rust functions which take ownership of an object provided via an argument require
1745 * this to be true and invalidate the object pointed to by inner.
1748 } LDKBuiltCommitmentTransaction;
1751 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1753 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1755 * A pointer to the contents in the success state.
1756 * Reading from this pointer when `result_ok` is not set is undefined.
1758 struct LDKBuiltCommitmentTransaction *result;
1760 * A pointer to the contents in the error state.
1761 * Reading from this pointer when `result_ok` is set is undefined.
1763 struct LDKDecodeError *err;
1764 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1767 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1768 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1769 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1771 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1773 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1774 * `err` or `result` depending on the state of `result_ok`.
1776 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1778 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1781 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1786 * A wrapper on ClosingTransaction indicating that the built bitcoin
1787 * transaction is trusted.
1789 * See trust() and verify() functions on CommitmentTransaction.
1791 * This structure implements Deref.
1793 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
1795 * A pointer to the opaque Rust object.
1796 * Nearly everywhere, inner must be non-null, however in places where
1797 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1799 LDKnativeTrustedClosingTransaction *inner;
1801 * Indicates that this is the only struct which contains the same pointer.
1802 * Rust functions which take ownership of an object provided via an argument require
1803 * this to be true and invalidate the object pointed to by inner.
1806 } LDKTrustedClosingTransaction;
1809 * The contents of CResult_TrustedClosingTransactionNoneZ
1811 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
1813 * A pointer to the contents in the success state.
1814 * Reading from this pointer when `result_ok` is not set is undefined.
1816 struct LDKTrustedClosingTransaction *result;
1818 * Note that this value is always NULL, as there are no contents in the Err variant
1821 } LDKCResult_TrustedClosingTransactionNoneZPtr;
1824 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
1825 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
1826 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1828 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
1830 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
1831 * `err` or `result` depending on the state of `result_ok`.
1833 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
1835 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
1838 } LDKCResult_TrustedClosingTransactionNoneZ;
1843 * This class tracks the per-transaction information needed to build a commitment transaction and will
1844 * actually build it and sign. It is used for holder transactions that we sign only when needed
1845 * and for transactions we sign for the counterparty.
1847 * This class can be used inside a signer implementation to generate a signature given the relevant
1850 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1852 * A pointer to the opaque Rust object.
1853 * Nearly everywhere, inner must be non-null, however in places where
1854 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1856 LDKnativeCommitmentTransaction *inner;
1858 * Indicates that this is the only struct which contains the same pointer.
1859 * Rust functions which take ownership of an object provided via an argument require
1860 * this to be true and invalidate the object pointed to by inner.
1863 } LDKCommitmentTransaction;
1866 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1868 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1870 * A pointer to the contents in the success state.
1871 * Reading from this pointer when `result_ok` is not set is undefined.
1873 struct LDKCommitmentTransaction *result;
1875 * A pointer to the contents in the error state.
1876 * Reading from this pointer when `result_ok` is set is undefined.
1878 struct LDKDecodeError *err;
1879 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1882 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1883 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1884 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1886 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1888 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1889 * `err` or `result` depending on the state of `result_ok`.
1891 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1893 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1896 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1901 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1902 * transaction and the transaction creation keys) are trusted.
1904 * See trust() and verify() functions on CommitmentTransaction.
1906 * This structure implements Deref.
1908 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1910 * A pointer to the opaque Rust object.
1911 * Nearly everywhere, inner must be non-null, however in places where
1912 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1914 LDKnativeTrustedCommitmentTransaction *inner;
1916 * Indicates that this is the only struct which contains the same pointer.
1917 * Rust functions which take ownership of an object provided via an argument require
1918 * this to be true and invalidate the object pointed to by inner.
1921 } LDKTrustedCommitmentTransaction;
1924 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1926 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1928 * A pointer to the contents in the success state.
1929 * Reading from this pointer when `result_ok` is not set is undefined.
1931 struct LDKTrustedCommitmentTransaction *result;
1933 * Note that this value is always NULL, as there are no contents in the Err variant
1936 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1939 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1940 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1941 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1943 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1945 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1946 * `err` or `result` depending on the state of `result_ok`.
1948 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1950 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1953 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1956 * The contents of CResult_CVec_SignatureZNoneZ
1958 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1960 * A pointer to the contents in the success state.
1961 * Reading from this pointer when `result_ok` is not set is undefined.
1963 struct LDKCVec_SignatureZ *result;
1965 * Note that this value is always NULL, as there are no contents in the Err variant
1968 } LDKCResult_CVec_SignatureZNoneZPtr;
1971 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1972 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1973 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1975 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1977 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1978 * `err` or `result` depending on the state of `result_ok`.
1980 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1982 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1985 } LDKCResult_CVec_SignatureZNoneZ;
1988 * The contents of CResult_ShutdownScriptDecodeErrorZ
1990 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
1992 * A pointer to the contents in the success state.
1993 * Reading from this pointer when `result_ok` is not set is undefined.
1995 struct LDKShutdownScript *result;
1997 * A pointer to the contents in the error state.
1998 * Reading from this pointer when `result_ok` is set is undefined.
2000 struct LDKDecodeError *err;
2001 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
2004 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
2005 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
2006 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2008 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
2010 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
2011 * `err` or `result` depending on the state of `result_ok`.
2013 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
2015 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
2018 } LDKCResult_ShutdownScriptDecodeErrorZ;
2023 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
2025 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
2027 * A pointer to the opaque Rust object.
2028 * Nearly everywhere, inner must be non-null, however in places where
2029 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2031 LDKnativeInvalidShutdownScript *inner;
2033 * Indicates that this is the only struct which contains the same pointer.
2034 * Rust functions which take ownership of an object provided via an argument require
2035 * this to be true and invalidate the object pointed to by inner.
2038 } LDKInvalidShutdownScript;
2041 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
2043 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
2045 * A pointer to the contents in the success state.
2046 * Reading from this pointer when `result_ok` is not set is undefined.
2048 struct LDKShutdownScript *result;
2050 * A pointer to the contents in the error state.
2051 * Reading from this pointer when `result_ok` is set is undefined.
2053 struct LDKInvalidShutdownScript *err;
2054 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
2057 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
2058 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
2059 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2061 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
2063 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
2064 * `err` or `result` depending on the state of `result_ok`.
2066 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
2068 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
2071 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
2076 * Information needed to route a payment across a [`BlindedPath`].
2078 typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
2080 * A pointer to the opaque Rust object.
2081 * Nearly everywhere, inner must be non-null, however in places where
2082 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2084 LDKnativeBlindedPayInfo *inner;
2086 * Indicates that this is the only struct which contains the same pointer.
2087 * Rust functions which take ownership of an object provided via an argument require
2088 * this to be true and invalidate the object pointed to by inner.
2091 } LDKBlindedPayInfo;
2094 * The contents of CResult_BlindedPayInfoDecodeErrorZ
2096 typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
2098 * A pointer to the contents in the success state.
2099 * Reading from this pointer when `result_ok` is not set is undefined.
2101 struct LDKBlindedPayInfo *result;
2103 * A pointer to the contents in the error state.
2104 * Reading from this pointer when `result_ok` is set is undefined.
2106 struct LDKDecodeError *err;
2107 } LDKCResult_BlindedPayInfoDecodeErrorZPtr;
2110 * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
2111 * containing a crate::lightning::offers::invoice::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
2112 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2114 typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
2116 * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
2117 * `err` or `result` depending on the state of `result_ok`.
2119 union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
2121 * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
2124 } LDKCResult_BlindedPayInfoDecodeErrorZ;
2129 * Represents the compressed public key of a node
2131 typedef struct MUST_USE_STRUCT LDKNodeId {
2133 * A pointer to the opaque Rust object.
2134 * Nearly everywhere, inner must be non-null, however in places where
2135 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2137 LDKnativeNodeId *inner;
2139 * Indicates that this is the only struct which contains the same pointer.
2140 * Rust functions which take ownership of an object provided via an argument require
2141 * this to be true and invalidate the object pointed to by inner.
2149 * Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`].
2151 typedef struct MUST_USE_STRUCT LDKChannelUsage {
2153 * A pointer to the opaque Rust object.
2154 * Nearly everywhere, inner must be non-null, however in places where
2155 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2157 LDKnativeChannelUsage *inner;
2159 * Indicates that this is the only struct which contains the same pointer.
2160 * Rust functions which take ownership of an object provided via an argument require
2161 * this to be true and invalidate the object pointed to by inner.
2169 * A path in a [`Route`] to the payment recipient. Must always be at least length one.
2170 * If no [`Path::blinded_tail`] is present, then [`Path::hops`] length may be up to 19.
2172 typedef struct MUST_USE_STRUCT LDKPath {
2174 * A pointer to the opaque Rust object.
2175 * Nearly everywhere, inner must be non-null, however in places where
2176 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2178 LDKnativePath *inner;
2180 * Indicates that this is the only struct which contains the same pointer.
2181 * Rust functions which take ownership of an object provided via an argument require
2182 * this to be true and invalidate the object pointed to by inner.
2188 * An interface used to score payment channels for path finding.
2190 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
2192 typedef struct LDKScore {
2194 * An opaque pointer which is passed to your function implementations as an argument.
2195 * This has no meaning in the LDK, and can be NULL or any other value.
2199 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
2200 * given channel in the direction from `source` to `target`.
2202 * The channel's capacity (less any other MPP parts that are also being considered for use in
2203 * the same payment) is given by `capacity_msat`. It may be determined from various sources
2204 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
2205 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
2206 * Thus, implementations should be overflow-safe.
2208 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);
2210 * Handles updating channel penalties after failing to route through a channel.
2212 void (*payment_path_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id);
2214 * Handles updating channel penalties after successfully routing along a path.
2216 void (*payment_path_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path);
2218 * Handles updating channel penalties after a probe over the given path failed.
2220 void (*probe_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id);
2222 * Handles updating channel penalties after a probe over the given path succeeded.
2224 void (*probe_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path);
2226 * Serialize the object into a byte array
2228 struct LDKCVec_u8Z (*write)(const void *this_arg);
2230 * Frees any resources associated with this object given its this_arg pointer.
2231 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2233 void (*free)(void *this_arg);
2237 * A scorer that is accessed under a lock.
2239 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
2240 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
2241 * implementations. Internal locking would be detrimental to route finding performance and could
2242 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
2244 * [`find_route`]: crate::routing::router::find_route
2246 typedef struct LDKLockableScore {
2248 * An opaque pointer which is passed to your function implementations as an argument.
2249 * This has no meaning in the LDK, and can be NULL or any other value.
2253 * Returns the locked scorer.
2255 struct LDKScore (*lock)(const void *this_arg);
2257 * Frees any resources associated with this object given its this_arg pointer.
2258 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2260 void (*free)(void *this_arg);
2264 * Refers to a scorer that is accessible under lock and also writeable to disk
2266 * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
2267 * use the Persister to persist it.
2269 typedef struct LDKWriteableScore {
2271 * An opaque pointer which is passed to your function implementations as an argument.
2272 * This has no meaning in the LDK, and can be NULL or any other value.
2276 * Implementation of LockableScore for this object.
2278 struct LDKLockableScore LockableScore;
2280 * Serialize the object into a byte array
2282 struct LDKCVec_u8Z (*write)(const void *this_arg);
2284 * Frees any resources associated with this object given its this_arg pointer.
2285 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2287 void (*free)(void *this_arg);
2288 } LDKWriteableScore;
2291 * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
2293 typedef enum LDKCOption_WriteableScoreZ_Tag {
2295 * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
2297 LDKCOption_WriteableScoreZ_Some,
2299 * When we're in this state, this COption_WriteableScoreZ contains nothing
2301 LDKCOption_WriteableScoreZ_None,
2303 * Must be last for serialization purposes
2305 LDKCOption_WriteableScoreZ_Sentinel,
2306 } LDKCOption_WriteableScoreZ_Tag;
2308 typedef struct LDKCOption_WriteableScoreZ {
2309 LDKCOption_WriteableScoreZ_Tag tag;
2312 struct LDKWriteableScore some;
2315 } LDKCOption_WriteableScoreZ;
2318 * The contents of CResult_NoneErrorZ
2320 typedef union LDKCResult_NoneErrorZPtr {
2322 * Note that this value is always NULL, as there are no contents in the OK variant
2326 * A pointer to the contents in the error state.
2327 * Reading from this pointer when `result_ok` is set is undefined.
2329 enum LDKIOError *err;
2330 } LDKCResult_NoneErrorZPtr;
2333 * A CResult_NoneErrorZ represents the result of a fallible operation,
2334 * containing a () on success and a crate::c_types::IOError on failure.
2335 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2337 typedef struct LDKCResult_NoneErrorZ {
2339 * The contents of this CResult_NoneErrorZ, accessible via either
2340 * `err` or `result` depending on the state of `result_ok`.
2342 union LDKCResult_NoneErrorZPtr contents;
2344 * Whether this CResult_NoneErrorZ represents a success state.
2347 } LDKCResult_NoneErrorZ;
2352 * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
2354 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2356 * A pointer to the opaque Rust object.
2357 * Nearly everywhere, inner must be non-null, however in places where
2358 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2360 LDKnativeChannelDetails *inner;
2362 * Indicates that this is the only struct which contains the same pointer.
2363 * Rust functions which take ownership of an object provided via an argument require
2364 * this to be true and invalidate the object pointed to by inner.
2367 } LDKChannelDetails;
2370 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
2371 * This corresponds to std::vector in C++
2373 typedef struct LDKCVec_ChannelDetailsZ {
2375 * The elements in the array.
2376 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2378 struct LDKChannelDetails *data;
2380 * The number of elements pointed to by `data`.
2383 } LDKCVec_ChannelDetailsZ;
2388 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
2389 * it can take multiple paths. Each path is composed of one or more hops through the network.
2391 typedef struct MUST_USE_STRUCT LDKRoute {
2393 * A pointer to the opaque Rust object.
2394 * Nearly everywhere, inner must be non-null, however in places where
2395 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2397 LDKnativeRoute *inner;
2399 * Indicates that this is the only struct which contains the same pointer.
2400 * Rust functions which take ownership of an object provided via an argument require
2401 * this to be true and invalidate the object pointed to by inner.
2409 * An Err type for failure to process messages.
2411 typedef struct MUST_USE_STRUCT LDKLightningError {
2413 * A pointer to the opaque Rust object.
2414 * Nearly everywhere, inner must be non-null, however in places where
2415 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2417 LDKnativeLightningError *inner;
2419 * Indicates that this is the only struct which contains the same pointer.
2420 * Rust functions which take ownership of an object provided via an argument require
2421 * this to be true and invalidate the object pointed to by inner.
2424 } LDKLightningError;
2427 * The contents of CResult_RouteLightningErrorZ
2429 typedef union LDKCResult_RouteLightningErrorZPtr {
2431 * A pointer to the contents in the success state.
2432 * Reading from this pointer when `result_ok` is not set is undefined.
2434 struct LDKRoute *result;
2436 * A pointer to the contents in the error state.
2437 * Reading from this pointer when `result_ok` is set is undefined.
2439 struct LDKLightningError *err;
2440 } LDKCResult_RouteLightningErrorZPtr;
2443 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2444 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2445 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2447 typedef struct LDKCResult_RouteLightningErrorZ {
2449 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2450 * `err` or `result` depending on the state of `result_ok`.
2452 union LDKCResult_RouteLightningErrorZPtr contents;
2454 * Whether this CResult_RouteLightningErrorZ represents a success state.
2457 } LDKCResult_RouteLightningErrorZ;
2462 * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
2463 * in-use channel liquidity.
2465 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
2467 * A pointer to the opaque Rust object.
2468 * Nearly everywhere, inner must be non-null, however in places where
2469 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2471 LDKnativeInFlightHtlcs *inner;
2473 * Indicates that this is the only struct which contains the same pointer.
2474 * Rust functions which take ownership of an object provided via an argument require
2475 * this to be true and invalidate the object pointed to by inner.
2481 * The contents of CResult_InFlightHtlcsDecodeErrorZ
2483 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
2485 * A pointer to the contents in the success state.
2486 * Reading from this pointer when `result_ok` is not set is undefined.
2488 struct LDKInFlightHtlcs *result;
2490 * A pointer to the contents in the error state.
2491 * Reading from this pointer when `result_ok` is set is undefined.
2493 struct LDKDecodeError *err;
2494 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
2497 * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
2498 * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
2499 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2501 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
2503 * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
2504 * `err` or `result` depending on the state of `result_ok`.
2506 union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
2508 * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
2511 } LDKCResult_InFlightHtlcsDecodeErrorZ;
2516 * A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel
2519 typedef struct MUST_USE_STRUCT LDKRouteHop {
2521 * A pointer to the opaque Rust object.
2522 * Nearly everywhere, inner must be non-null, however in places where
2523 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2525 LDKnativeRouteHop *inner;
2527 * Indicates that this is the only struct which contains the same pointer.
2528 * Rust functions which take ownership of an object provided via an argument require
2529 * this to be true and invalidate the object pointed to by inner.
2535 * The contents of CResult_RouteHopDecodeErrorZ
2537 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
2539 * A pointer to the contents in the success state.
2540 * Reading from this pointer when `result_ok` is not set is undefined.
2542 struct LDKRouteHop *result;
2544 * A pointer to the contents in the error state.
2545 * Reading from this pointer when `result_ok` is set is undefined.
2547 struct LDKDecodeError *err;
2548 } LDKCResult_RouteHopDecodeErrorZPtr;
2551 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
2552 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
2553 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2555 typedef struct LDKCResult_RouteHopDecodeErrorZ {
2557 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
2558 * `err` or `result` depending on the state of `result_ok`.
2560 union LDKCResult_RouteHopDecodeErrorZPtr contents;
2562 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
2565 } LDKCResult_RouteHopDecodeErrorZ;
2570 * Used to construct the blinded hops portion of a blinded path. These hops cannot be identified
2571 * by outside observers and thus can be used to hide the identity of the recipient.
2573 typedef struct MUST_USE_STRUCT LDKBlindedHop {
2575 * A pointer to the opaque Rust object.
2576 * Nearly everywhere, inner must be non-null, however in places where
2577 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2579 LDKnativeBlindedHop *inner;
2581 * Indicates that this is the only struct which contains the same pointer.
2582 * Rust functions which take ownership of an object provided via an argument require
2583 * this to be true and invalidate the object pointed to by inner.
2589 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedHops of arbitrary size.
2590 * This corresponds to std::vector in C++
2592 typedef struct LDKCVec_BlindedHopZ {
2594 * The elements in the array.
2595 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2597 struct LDKBlindedHop *data;
2599 * The number of elements pointed to by `data`.
2602 } LDKCVec_BlindedHopZ;
2607 * The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in
2608 * their BOLT12 [`Invoice`].
2610 * [`Invoice`]: crate::offers::invoice::Invoice
2612 typedef struct MUST_USE_STRUCT LDKBlindedTail {
2614 * A pointer to the opaque Rust object.
2615 * Nearly everywhere, inner must be non-null, however in places where
2616 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2618 LDKnativeBlindedTail *inner;
2620 * Indicates that this is the only struct which contains the same pointer.
2621 * Rust functions which take ownership of an object provided via an argument require
2622 * this to be true and invalidate the object pointed to by inner.
2628 * The contents of CResult_BlindedTailDecodeErrorZ
2630 typedef union LDKCResult_BlindedTailDecodeErrorZPtr {
2632 * A pointer to the contents in the success state.
2633 * Reading from this pointer when `result_ok` is not set is undefined.
2635 struct LDKBlindedTail *result;
2637 * A pointer to the contents in the error state.
2638 * Reading from this pointer when `result_ok` is set is undefined.
2640 struct LDKDecodeError *err;
2641 } LDKCResult_BlindedTailDecodeErrorZPtr;
2644 * A CResult_BlindedTailDecodeErrorZ represents the result of a fallible operation,
2645 * containing a crate::lightning::routing::router::BlindedTail on success and a crate::lightning::ln::msgs::DecodeError on failure.
2646 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2648 typedef struct LDKCResult_BlindedTailDecodeErrorZ {
2650 * The contents of this CResult_BlindedTailDecodeErrorZ, accessible via either
2651 * `err` or `result` depending on the state of `result_ok`.
2653 union LDKCResult_BlindedTailDecodeErrorZPtr contents;
2655 * Whether this CResult_BlindedTailDecodeErrorZ represents a success state.
2658 } LDKCResult_BlindedTailDecodeErrorZ;
2661 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
2662 * This corresponds to std::vector in C++
2664 typedef struct LDKCVec_RouteHopZ {
2666 * The elements in the array.
2667 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2669 struct LDKRouteHop *data;
2671 * The number of elements pointed to by `data`.
2674 } LDKCVec_RouteHopZ;
2677 * A dynamically-allocated array of crate::lightning::routing::router::Paths of arbitrary size.
2678 * This corresponds to std::vector in C++
2680 typedef struct LDKCVec_PathZ {
2682 * The elements in the array.
2683 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2685 struct LDKPath *data;
2687 * The number of elements pointed to by `data`.
2693 * The contents of CResult_RouteDecodeErrorZ
2695 typedef union LDKCResult_RouteDecodeErrorZPtr {
2697 * A pointer to the contents in the success state.
2698 * Reading from this pointer when `result_ok` is not set is undefined.
2700 struct LDKRoute *result;
2702 * A pointer to the contents in the error state.
2703 * Reading from this pointer when `result_ok` is set is undefined.
2705 struct LDKDecodeError *err;
2706 } LDKCResult_RouteDecodeErrorZPtr;
2709 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
2710 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
2711 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2713 typedef struct LDKCResult_RouteDecodeErrorZ {
2715 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
2716 * `err` or `result` depending on the state of `result_ok`.
2718 union LDKCResult_RouteDecodeErrorZPtr contents;
2720 * Whether this CResult_RouteDecodeErrorZ represents a success state.
2723 } LDKCResult_RouteDecodeErrorZ;
2728 * Parameters needed to find a [`Route`].
2730 * Passed to [`find_route`] and [`build_route_from_hops`], but also provided in
2731 * [`Event::PaymentPathFailed`].
2733 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
2735 typedef struct MUST_USE_STRUCT LDKRouteParameters {
2737 * A pointer to the opaque Rust object.
2738 * Nearly everywhere, inner must be non-null, however in places where
2739 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2741 LDKnativeRouteParameters *inner;
2743 * Indicates that this is the only struct which contains the same pointer.
2744 * Rust functions which take ownership of an object provided via an argument require
2745 * this to be true and invalidate the object pointed to by inner.
2748 } LDKRouteParameters;
2751 * The contents of CResult_RouteParametersDecodeErrorZ
2753 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
2755 * A pointer to the contents in the success state.
2756 * Reading from this pointer when `result_ok` is not set is undefined.
2758 struct LDKRouteParameters *result;
2760 * A pointer to the contents in the error state.
2761 * Reading from this pointer when `result_ok` is set is undefined.
2763 struct LDKDecodeError *err;
2764 } LDKCResult_RouteParametersDecodeErrorZPtr;
2767 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
2768 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2769 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2771 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
2773 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
2774 * `err` or `result` depending on the state of `result_ok`.
2776 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
2778 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
2781 } LDKCResult_RouteParametersDecodeErrorZ;
2784 * A dynamically-allocated array of u64s of arbitrary size.
2785 * This corresponds to std::vector in C++
2787 typedef struct LDKCVec_u64Z {
2789 * The elements in the array.
2790 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2794 * The number of elements pointed to by `data`.
2802 * The recipient of a payment.
2804 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
2806 * A pointer to the opaque Rust object.
2807 * Nearly everywhere, inner must be non-null, however in places where
2808 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2810 LDKnativePaymentParameters *inner;
2812 * Indicates that this is the only struct which contains the same pointer.
2813 * Rust functions which take ownership of an object provided via an argument require
2814 * this to be true and invalidate the object pointed to by inner.
2817 } LDKPaymentParameters;
2820 * The contents of CResult_PaymentParametersDecodeErrorZ
2822 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
2824 * A pointer to the contents in the success state.
2825 * Reading from this pointer when `result_ok` is not set is undefined.
2827 struct LDKPaymentParameters *result;
2829 * A pointer to the contents in the error state.
2830 * Reading from this pointer when `result_ok` is set is undefined.
2832 struct LDKDecodeError *err;
2833 } LDKCResult_PaymentParametersDecodeErrorZPtr;
2836 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
2837 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2838 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2840 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
2842 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
2843 * `err` or `result` depending on the state of `result_ok`.
2845 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
2847 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
2850 } LDKCResult_PaymentParametersDecodeErrorZ;
2853 * A tuple of 2 elements. See the individual fields for the types contained.
2855 typedef struct LDKC2Tuple_BlindedPayInfoBlindedPathZ {
2857 * The element at position 0
2859 struct LDKBlindedPayInfo a;
2861 * The element at position 1
2863 struct LDKBlindedPath b;
2864 } LDKC2Tuple_BlindedPayInfoBlindedPathZ;
2867 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZs of arbitrary size.
2868 * This corresponds to std::vector in C++
2870 typedef struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ {
2872 * The elements in the array.
2873 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2875 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *data;
2877 * The number of elements pointed to by `data`.
2880 } LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ;
2885 * A list of hops along a payment path terminating with a channel to the recipient.
2887 typedef struct MUST_USE_STRUCT LDKRouteHint {
2889 * A pointer to the opaque Rust object.
2890 * Nearly everywhere, inner must be non-null, however in places where
2891 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2893 LDKnativeRouteHint *inner;
2895 * Indicates that this is the only struct which contains the same pointer.
2896 * Rust functions which take ownership of an object provided via an argument require
2897 * this to be true and invalidate the object pointed to by inner.
2903 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
2904 * This corresponds to std::vector in C++
2906 typedef struct LDKCVec_RouteHintZ {
2908 * The elements in the array.
2909 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2911 struct LDKRouteHint *data;
2913 * The number of elements pointed to by `data`.
2916 } LDKCVec_RouteHintZ;
2921 * A channel descriptor for a hop along a payment path.
2923 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
2925 * A pointer to the opaque Rust object.
2926 * Nearly everywhere, inner must be non-null, however in places where
2927 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2929 LDKnativeRouteHintHop *inner;
2931 * Indicates that this is the only struct which contains the same pointer.
2932 * Rust functions which take ownership of an object provided via an argument require
2933 * this to be true and invalidate the object pointed to by inner.
2939 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
2940 * This corresponds to std::vector in C++
2942 typedef struct LDKCVec_RouteHintHopZ {
2944 * The elements in the array.
2945 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2947 struct LDKRouteHintHop *data;
2949 * The number of elements pointed to by `data`.
2952 } LDKCVec_RouteHintHopZ;
2955 * The contents of CResult_RouteHintDecodeErrorZ
2957 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
2959 * A pointer to the contents in the success state.
2960 * Reading from this pointer when `result_ok` is not set is undefined.
2962 struct LDKRouteHint *result;
2964 * A pointer to the contents in the error state.
2965 * Reading from this pointer when `result_ok` is set is undefined.
2967 struct LDKDecodeError *err;
2968 } LDKCResult_RouteHintDecodeErrorZPtr;
2971 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
2972 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
2973 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2975 typedef struct LDKCResult_RouteHintDecodeErrorZ {
2977 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
2978 * `err` or `result` depending on the state of `result_ok`.
2980 union LDKCResult_RouteHintDecodeErrorZPtr contents;
2982 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
2985 } LDKCResult_RouteHintDecodeErrorZ;
2988 * The contents of CResult_RouteHintHopDecodeErrorZ
2990 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
2992 * A pointer to the contents in the success state.
2993 * Reading from this pointer when `result_ok` is not set is undefined.
2995 struct LDKRouteHintHop *result;
2997 * A pointer to the contents in the error state.
2998 * Reading from this pointer when `result_ok` is set is undefined.
3000 struct LDKDecodeError *err;
3001 } LDKCResult_RouteHintHopDecodeErrorZPtr;
3004 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
3005 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
3006 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3008 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
3010 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
3011 * `err` or `result` depending on the state of `result_ok`.
3013 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
3015 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
3018 } LDKCResult_RouteHintHopDecodeErrorZ;
3021 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
3023 typedef struct LDKPublicKey {
3025 * The bytes of the public key
3027 uint8_t compressed_form[33];
3031 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
3032 * This corresponds to std::vector in C++
3034 typedef struct LDKCVec_PublicKeyZ {
3036 * The elements in the array.
3037 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3039 struct LDKPublicKey *data;
3041 * The number of elements pointed to by `data`.
3044 } LDKCVec_PublicKeyZ;
3047 * A tuple of 2 elements. See the individual fields for the types contained.
3049 typedef struct LDKC2Tuple_usizeTransactionZ {
3051 * The element at position 0
3055 * The element at position 1
3057 struct LDKTransaction b;
3058 } LDKC2Tuple_usizeTransactionZ;
3061 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
3062 * This corresponds to std::vector in C++
3064 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
3066 * The elements in the array.
3067 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3069 struct LDKC2Tuple_usizeTransactionZ *data;
3071 * The number of elements pointed to by `data`.
3074 } LDKCVec_C2Tuple_usizeTransactionZZ;
3077 * A tuple of 2 elements. See the individual fields for the types contained.
3079 typedef struct LDKC2Tuple_TxidBlockHashZ {
3081 * The element at position 0
3083 struct LDKThirtyTwoBytes a;
3085 * The element at position 1
3087 struct LDKThirtyTwoBytes b;
3088 } LDKC2Tuple_TxidBlockHashZ;
3091 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidBlockHashZs of arbitrary size.
3092 * This corresponds to std::vector in C++
3094 typedef struct LDKCVec_C2Tuple_TxidBlockHashZZ {
3096 * The elements in the array.
3097 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3099 struct LDKC2Tuple_TxidBlockHashZ *data;
3101 * The number of elements pointed to by `data`.
3104 } LDKCVec_C2Tuple_TxidBlockHashZZ;
3109 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
3110 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
3111 * preimage claim backward will lead to loss of funds.
3113 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
3115 * A pointer to the opaque Rust object.
3116 * Nearly everywhere, inner must be non-null, however in places where
3117 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3119 LDKnativeHTLCUpdate *inner;
3121 * Indicates that this is the only struct which contains the same pointer.
3122 * Rust functions which take ownership of an object provided via an argument require
3123 * this to be true and invalidate the object pointed to by inner.
3131 * A reference to a transaction output.
3133 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
3134 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
3136 typedef struct MUST_USE_STRUCT LDKOutPoint {
3138 * A pointer to the opaque Rust object.
3139 * Nearly everywhere, inner must be non-null, however in places where
3140 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3142 LDKnativeOutPoint *inner;
3144 * Indicates that this is the only struct which contains the same pointer.
3145 * Rust functions which take ownership of an object provided via an argument require
3146 * this to be true and invalidate the object pointed to by inner.
3152 * An event to be processed by the ChannelManager.
3154 typedef enum LDKMonitorEvent_Tag {
3156 * A monitor event containing an HTLCUpdate.
3158 LDKMonitorEvent_HTLCEvent,
3160 * A monitor event that the Channel's commitment transaction was confirmed.
3162 LDKMonitorEvent_CommitmentTxConfirmed,
3164 * Indicates a [`ChannelMonitor`] update has completed. See
3165 * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
3167 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
3169 LDKMonitorEvent_Completed,
3171 * Indicates a [`ChannelMonitor`] update has failed. See
3172 * [`ChannelMonitorUpdateStatus::PermanentFailure`] for more information on how this is used.
3174 * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
3176 LDKMonitorEvent_UpdateFailed,
3178 * Must be last for serialization purposes
3180 LDKMonitorEvent_Sentinel,
3181 } LDKMonitorEvent_Tag;
3183 typedef struct LDKMonitorEvent_LDKCompleted_Body {
3185 * The funding outpoint of the [`ChannelMonitor`] that was updated
3187 struct LDKOutPoint funding_txo;
3189 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
3190 * [`ChannelMonitor::get_latest_update_id`].
3192 * Note that this should only be set to a given update's ID if all previous updates for the
3193 * same [`ChannelMonitor`] have been applied and persisted.
3195 uint64_t monitor_update_id;
3196 } LDKMonitorEvent_LDKCompleted_Body;
3198 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
3199 LDKMonitorEvent_Tag tag;
3202 struct LDKHTLCUpdate htlc_event;
3205 struct LDKOutPoint commitment_tx_confirmed;
3207 LDKMonitorEvent_LDKCompleted_Body completed;
3209 struct LDKOutPoint update_failed;
3215 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
3216 * This corresponds to std::vector in C++
3218 typedef struct LDKCVec_MonitorEventZ {
3220 * The elements in the array.
3221 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3223 struct LDKMonitorEvent *data;
3225 * The number of elements pointed to by `data`.
3228 } LDKCVec_MonitorEventZ;
3231 * A tuple of 3 elements. See the individual fields for the types contained.
3233 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
3235 * The element at position 0
3237 struct LDKOutPoint a;
3239 * The element at position 1
3241 struct LDKCVec_MonitorEventZ b;
3243 * The element at position 2
3245 struct LDKPublicKey c;
3246 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
3249 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
3250 * This corresponds to std::vector in C++
3252 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
3254 * The elements in the array.
3255 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3257 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
3259 * The number of elements pointed to by `data`.
3262 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
3267 * [`Score`] implementation that uses a fixed penalty.
3269 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
3271 * A pointer to the opaque Rust object.
3272 * Nearly everywhere, inner must be non-null, however in places where
3273 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3275 LDKnativeFixedPenaltyScorer *inner;
3277 * Indicates that this is the only struct which contains the same pointer.
3278 * Rust functions which take ownership of an object provided via an argument require
3279 * this to be true and invalidate the object pointed to by inner.
3282 } LDKFixedPenaltyScorer;
3285 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
3287 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
3289 * A pointer to the contents in the success state.
3290 * Reading from this pointer when `result_ok` is not set is undefined.
3292 struct LDKFixedPenaltyScorer *result;
3294 * A pointer to the contents in the error state.
3295 * Reading from this pointer when `result_ok` is set is undefined.
3297 struct LDKDecodeError *err;
3298 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
3301 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
3302 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
3303 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3305 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
3307 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
3308 * `err` or `result` depending on the state of `result_ok`.
3310 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
3312 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
3315 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
3318 * A tuple of 2 elements. See the individual fields for the types contained.
3320 typedef struct LDKC2Tuple_u64u64Z {
3322 * The element at position 0
3326 * The element at position 1
3329 } LDKC2Tuple_u64u64Z;
3332 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
3334 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
3336 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
3338 LDKCOption_C2Tuple_u64u64ZZ_Some,
3340 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
3342 LDKCOption_C2Tuple_u64u64ZZ_None,
3344 * Must be last for serialization purposes
3346 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
3347 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
3349 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
3350 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
3353 struct LDKC2Tuple_u64u64Z some;
3356 } LDKCOption_C2Tuple_u64u64ZZ;
3361 typedef struct LDKEightU16s {
3363 * The eight 16-bit integers
3369 * A tuple of 2 elements. See the individual fields for the types contained.
3371 typedef struct LDKC2Tuple_Z {
3373 * The element at position 0
3375 struct LDKEightU16s a;
3377 * The element at position 1
3379 struct LDKEightU16s b;
3383 * A tuple of 2 elements. See the individual fields for the types contained.
3385 typedef struct LDKC2Tuple__u168_u168Z {
3387 * The element at position 0
3389 struct LDKEightU16s a;
3391 * The element at position 1
3393 struct LDKEightU16s b;
3394 } LDKC2Tuple__u168_u168Z;
3397 * An enum which can either contain a crate::c_types::derived::C2Tuple__u168_u168Z or not
3399 typedef enum LDKCOption_C2Tuple_EightU16sEightU16sZZ_Tag {
3401 * When we're in this state, this COption_C2Tuple_EightU16sEightU16sZZ contains a crate::c_types::derived::C2Tuple__u168_u168Z
3403 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some,
3405 * When we're in this state, this COption_C2Tuple_EightU16sEightU16sZZ contains nothing
3407 LDKCOption_C2Tuple_EightU16sEightU16sZZ_None,
3409 * Must be last for serialization purposes
3411 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Sentinel,
3412 } LDKCOption_C2Tuple_EightU16sEightU16sZZ_Tag;
3414 typedef struct LDKCOption_C2Tuple_EightU16sEightU16sZZ {
3415 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Tag tag;
3418 struct LDKC2Tuple__u168_u168Z some;
3421 } LDKCOption_C2Tuple_EightU16sEightU16sZZ;
3424 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
3425 * This corresponds to std::vector in C++
3427 typedef struct LDKCVec_NodeIdZ {
3429 * The elements in the array.
3430 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3432 struct LDKNodeId *data;
3434 * The number of elements pointed to by `data`.
3442 * A Record, unit of logging output with Metadata to enable filtering
3443 * Module_path, file, line to inform on log's source
3445 typedef struct MUST_USE_STRUCT LDKRecord {
3447 * A pointer to the opaque Rust object.
3448 * Nearly everywhere, inner must be non-null, however in places where
3449 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3451 LDKnativeRecord *inner;
3453 * Indicates that this is the only struct which contains the same pointer.
3454 * Rust functions which take ownership of an object provided via an argument require
3455 * this to be true and invalidate the object pointed to by inner.
3461 * A trait encapsulating the operations required of a logger
3463 typedef struct LDKLogger {
3465 * An opaque pointer which is passed to your function implementations as an argument.
3466 * This has no meaning in the LDK, and can be NULL or any other value.
3472 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
3474 * Frees any resources associated with this object given its this_arg pointer.
3475 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3477 void (*free)(void *this_arg);
3483 * Represents the network as nodes and channels between them
3485 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
3487 * A pointer to the opaque Rust object.
3488 * Nearly everywhere, inner must be non-null, however in places where
3489 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3491 LDKnativeNetworkGraph *inner;
3493 * Indicates that this is the only struct which contains the same pointer.
3494 * Rust functions which take ownership of an object provided via an argument require
3495 * this to be true and invalidate the object pointed to by inner.
3503 * [`Score`] implementation using channel success probability distributions.
3505 * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
3506 * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
3507 * When a payment is forwarded through a channel (but fails later in the route), we learn the
3508 * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
3510 * These bounds are then used to determine a success probability using the formula from
3511 * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
3512 * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
3514 * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
3515 * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
3516 * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
3517 * terms of the entire path's success probability. This allows the router to directly compare
3518 * penalties for different paths. See the documentation of those parameters for the exact formulas.
3520 * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
3522 * Further, we track the history of our upper and lower liquidity bounds for each channel,
3523 * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
3524 * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
3525 * formula, but using the history of a channel rather than our latest estimates for the liquidity
3530 * Mixing the `no-std` feature between serialization and deserialization results in undefined
3533 * [1]: https://arxiv.org/abs/2107.05322
3534 * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringParameters::liquidity_penalty_multiplier_msat
3535 * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringParameters::liquidity_penalty_amount_multiplier_msat
3536 * [`liquidity_offset_half_life`]: ProbabilisticScoringParameters::liquidity_offset_half_life
3537 * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringParameters::historical_liquidity_penalty_multiplier_msat
3538 * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringParameters::historical_liquidity_penalty_amount_multiplier_msat
3540 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
3542 * A pointer to the opaque Rust object.
3543 * Nearly everywhere, inner must be non-null, however in places where
3544 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3546 LDKnativeProbabilisticScorer *inner;
3548 * Indicates that this is the only struct which contains the same pointer.
3549 * Rust functions which take ownership of an object provided via an argument require
3550 * this to be true and invalidate the object pointed to by inner.
3553 } LDKProbabilisticScorer;
3556 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
3558 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
3560 * A pointer to the contents in the success state.
3561 * Reading from this pointer when `result_ok` is not set is undefined.
3563 struct LDKProbabilisticScorer *result;
3565 * A pointer to the contents in the error state.
3566 * Reading from this pointer when `result_ok` is set is undefined.
3568 struct LDKDecodeError *err;
3569 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
3572 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
3573 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
3574 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3576 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
3578 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
3579 * `err` or `result` depending on the state of `result_ok`.
3581 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
3583 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
3586 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
3591 * Features used within an `init` message.
3593 typedef struct MUST_USE_STRUCT LDKInitFeatures {
3595 * A pointer to the opaque Rust object.
3596 * Nearly everywhere, inner must be non-null, however in places where
3597 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3599 LDKnativeInitFeatures *inner;
3601 * Indicates that this is the only struct which contains the same pointer.
3602 * Rust functions which take ownership of an object provided via an argument require
3603 * this to be true and invalidate the object pointed to by inner.
3609 * The contents of CResult_InitFeaturesDecodeErrorZ
3611 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
3613 * A pointer to the contents in the success state.
3614 * Reading from this pointer when `result_ok` is not set is undefined.
3616 struct LDKInitFeatures *result;
3618 * A pointer to the contents in the error state.
3619 * Reading from this pointer when `result_ok` is set is undefined.
3621 struct LDKDecodeError *err;
3622 } LDKCResult_InitFeaturesDecodeErrorZPtr;
3625 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
3626 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
3627 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3629 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
3631 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
3632 * `err` or `result` depending on the state of `result_ok`.
3634 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
3636 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
3639 } LDKCResult_InitFeaturesDecodeErrorZ;
3644 * Features used within a `channel_announcement` message.
3646 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
3648 * A pointer to the opaque Rust object.
3649 * Nearly everywhere, inner must be non-null, however in places where
3650 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3652 LDKnativeChannelFeatures *inner;
3654 * Indicates that this is the only struct which contains the same pointer.
3655 * Rust functions which take ownership of an object provided via an argument require
3656 * this to be true and invalidate the object pointed to by inner.
3659 } LDKChannelFeatures;
3662 * The contents of CResult_ChannelFeaturesDecodeErrorZ
3664 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
3666 * A pointer to the contents in the success state.
3667 * Reading from this pointer when `result_ok` is not set is undefined.
3669 struct LDKChannelFeatures *result;
3671 * A pointer to the contents in the error state.
3672 * Reading from this pointer when `result_ok` is set is undefined.
3674 struct LDKDecodeError *err;
3675 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
3678 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
3679 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
3680 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3682 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
3684 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
3685 * `err` or `result` depending on the state of `result_ok`.
3687 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
3689 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
3692 } LDKCResult_ChannelFeaturesDecodeErrorZ;
3697 * Features used within a `node_announcement` message.
3699 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
3701 * A pointer to the opaque Rust object.
3702 * Nearly everywhere, inner must be non-null, however in places where
3703 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3705 LDKnativeNodeFeatures *inner;
3707 * Indicates that this is the only struct which contains the same pointer.
3708 * Rust functions which take ownership of an object provided via an argument require
3709 * this to be true and invalidate the object pointed to by inner.
3715 * The contents of CResult_NodeFeaturesDecodeErrorZ
3717 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
3719 * A pointer to the contents in the success state.
3720 * Reading from this pointer when `result_ok` is not set is undefined.
3722 struct LDKNodeFeatures *result;
3724 * A pointer to the contents in the error state.
3725 * Reading from this pointer when `result_ok` is set is undefined.
3727 struct LDKDecodeError *err;
3728 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
3731 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
3732 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
3733 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3735 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
3737 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
3738 * `err` or `result` depending on the state of `result_ok`.
3740 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
3742 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
3745 } LDKCResult_NodeFeaturesDecodeErrorZ;
3750 * Features used within an invoice.
3752 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
3754 * A pointer to the opaque Rust object.
3755 * Nearly everywhere, inner must be non-null, however in places where
3756 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3758 LDKnativeInvoiceFeatures *inner;
3760 * Indicates that this is the only struct which contains the same pointer.
3761 * Rust functions which take ownership of an object provided via an argument require
3762 * this to be true and invalidate the object pointed to by inner.
3765 } LDKInvoiceFeatures;
3768 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
3770 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
3772 * A pointer to the contents in the success state.
3773 * Reading from this pointer when `result_ok` is not set is undefined.
3775 struct LDKInvoiceFeatures *result;
3777 * A pointer to the contents in the error state.
3778 * Reading from this pointer when `result_ok` is set is undefined.
3780 struct LDKDecodeError *err;
3781 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
3784 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
3785 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
3786 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3788 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
3790 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
3791 * `err` or `result` depending on the state of `result_ok`.
3793 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
3795 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
3798 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
3803 * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
3805 typedef struct MUST_USE_STRUCT LDKBlindedHopFeatures {
3807 * A pointer to the opaque Rust object.
3808 * Nearly everywhere, inner must be non-null, however in places where
3809 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3811 LDKnativeBlindedHopFeatures *inner;
3813 * Indicates that this is the only struct which contains the same pointer.
3814 * Rust functions which take ownership of an object provided via an argument require
3815 * this to be true and invalidate the object pointed to by inner.
3818 } LDKBlindedHopFeatures;
3821 * The contents of CResult_BlindedHopFeaturesDecodeErrorZ
3823 typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
3825 * A pointer to the contents in the success state.
3826 * Reading from this pointer when `result_ok` is not set is undefined.
3828 struct LDKBlindedHopFeatures *result;
3830 * A pointer to the contents in the error state.
3831 * Reading from this pointer when `result_ok` is set is undefined.
3833 struct LDKDecodeError *err;
3834 } LDKCResult_BlindedHopFeaturesDecodeErrorZPtr;
3837 * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
3838 * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
3839 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3841 typedef struct LDKCResult_BlindedHopFeaturesDecodeErrorZ {
3843 * The contents of this CResult_BlindedHopFeaturesDecodeErrorZ, accessible via either
3844 * `err` or `result` depending on the state of `result_ok`.
3846 union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr contents;
3848 * Whether this CResult_BlindedHopFeaturesDecodeErrorZ represents a success state.
3851 } LDKCResult_BlindedHopFeaturesDecodeErrorZ;
3856 * Features used within the channel_type field in an OpenChannel message.
3858 * A channel is always of some known \"type\", describing the transaction formats used and the exact
3859 * semantics of our interaction with our peer.
3861 * Note that because a channel is a specific type which is proposed by the opener and accepted by
3862 * the counterparty, only required features are allowed here.
3864 * This is serialized differently from other feature types - it is not prefixed by a length, and
3865 * thus must only appear inside a TLV where its length is known in advance.
3867 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
3869 * A pointer to the opaque Rust object.
3870 * Nearly everywhere, inner must be non-null, however in places where
3871 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3873 LDKnativeChannelTypeFeatures *inner;
3875 * Indicates that this is the only struct which contains the same pointer.
3876 * Rust functions which take ownership of an object provided via an argument require
3877 * this to be true and invalidate the object pointed to by inner.
3880 } LDKChannelTypeFeatures;
3883 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
3885 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
3887 * A pointer to the contents in the success state.
3888 * Reading from this pointer when `result_ok` is not set is undefined.
3890 struct LDKChannelTypeFeatures *result;
3892 * A pointer to the contents in the error state.
3893 * Reading from this pointer when `result_ok` is set is undefined.
3895 struct LDKDecodeError *err;
3896 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
3899 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
3900 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
3901 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3903 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
3905 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
3906 * `err` or `result` depending on the state of `result_ok`.
3908 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
3910 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
3913 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
3916 * Some information provided on receipt of payment depends on whether the payment received is a
3917 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
3919 typedef enum LDKPaymentPurpose_Tag {
3921 * Information for receiving a payment that we generated an invoice for.
3923 LDKPaymentPurpose_InvoicePayment,
3925 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
3926 * (the payee) providing a preimage.
3928 LDKPaymentPurpose_SpontaneousPayment,
3930 * Must be last for serialization purposes
3932 LDKPaymentPurpose_Sentinel,
3933 } LDKPaymentPurpose_Tag;
3935 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
3937 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
3938 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
3939 * [`ChannelManager::claim_funds`].
3941 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
3942 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
3944 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3946 struct LDKThirtyTwoBytes payment_preimage;
3948 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
3949 * number of deanonymization attacks during the routing process.
3950 * It is provided here for your reference, however its accuracy is enforced directly by
3951 * [`ChannelManager`] using the values you previously provided to
3952 * [`ChannelManager::create_inbound_payment`] or
3953 * [`ChannelManager::create_inbound_payment_for_hash`].
3955 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3956 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
3957 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
3959 struct LDKThirtyTwoBytes payment_secret;
3960 } LDKPaymentPurpose_LDKInvoicePayment_Body;
3962 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
3963 LDKPaymentPurpose_Tag tag;
3965 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
3967 struct LDKThirtyTwoBytes spontaneous_payment;
3970 } LDKPaymentPurpose;
3973 * The contents of CResult_PaymentPurposeDecodeErrorZ
3975 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
3977 * A pointer to the contents in the success state.
3978 * Reading from this pointer when `result_ok` is not set is undefined.
3980 struct LDKPaymentPurpose *result;
3982 * A pointer to the contents in the error state.
3983 * Reading from this pointer when `result_ok` is set is undefined.
3985 struct LDKDecodeError *err;
3986 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
3989 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
3990 * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
3991 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3993 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
3995 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
3996 * `err` or `result` depending on the state of `result_ok`.
3998 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
4000 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
4003 } LDKCResult_PaymentPurposeDecodeErrorZ;
4008 * A [`channel_update`] message to be sent to or received from a peer.
4010 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
4012 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
4014 * A pointer to the opaque Rust object.
4015 * Nearly everywhere, inner must be non-null, however in places where
4016 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4018 LDKnativeChannelUpdate *inner;
4020 * Indicates that this is the only struct which contains the same pointer.
4021 * Rust functions which take ownership of an object provided via an argument require
4022 * this to be true and invalidate the object pointed to by inner.
4028 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
4029 * return packet by a node along the route. See [BOLT #4] for details.
4031 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
4033 typedef enum LDKNetworkUpdate_Tag {
4035 * An error indicating a `channel_update` messages should be applied via
4036 * [`NetworkGraph::update_channel`].
4038 LDKNetworkUpdate_ChannelUpdateMessage,
4040 * An error indicating that a channel failed to route a payment, which should be applied via
4041 * [`NetworkGraph::channel_failed_permanent`] if permanent.
4043 LDKNetworkUpdate_ChannelFailure,
4045 * An error indicating that a node failed to route a payment, which should be applied via
4046 * [`NetworkGraph::node_failed_permanent`] if permanent.
4048 LDKNetworkUpdate_NodeFailure,
4050 * Must be last for serialization purposes
4052 LDKNetworkUpdate_Sentinel,
4053 } LDKNetworkUpdate_Tag;
4055 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
4057 * The update to apply via [`NetworkGraph::update_channel`].
4059 struct LDKChannelUpdate msg;
4060 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
4062 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
4064 * The short channel id of the closed channel.
4066 uint64_t short_channel_id;
4068 * Whether the channel should be permanently removed or temporarily disabled until a new
4069 * `channel_update` message is received.
4072 } LDKNetworkUpdate_LDKChannelFailure_Body;
4074 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
4076 * The node id of the failed node.
4078 struct LDKPublicKey node_id;
4080 * Whether the node should be permanently removed from consideration or can be restored
4081 * when a new `channel_update` message is received.
4084 } LDKNetworkUpdate_LDKNodeFailure_Body;
4086 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
4087 LDKNetworkUpdate_Tag tag;
4089 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
4090 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
4091 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
4096 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
4098 typedef enum LDKCOption_NetworkUpdateZ_Tag {
4100 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
4102 LDKCOption_NetworkUpdateZ_Some,
4104 * When we're in this state, this COption_NetworkUpdateZ contains nothing
4106 LDKCOption_NetworkUpdateZ_None,
4108 * Must be last for serialization purposes
4110 LDKCOption_NetworkUpdateZ_Sentinel,
4111 } LDKCOption_NetworkUpdateZ_Tag;
4113 typedef struct LDKCOption_NetworkUpdateZ {
4114 LDKCOption_NetworkUpdateZ_Tag tag;
4117 struct LDKNetworkUpdate some;
4120 } LDKCOption_NetworkUpdateZ;
4123 * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
4124 * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
4126 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
4127 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
4129 typedef enum LDKPathFailure_Tag {
4131 * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
4134 LDKPathFailure_InitialSend,
4136 * A hop on the path failed to forward our payment.
4138 LDKPathFailure_OnPath,
4140 * Must be last for serialization purposes
4142 LDKPathFailure_Sentinel,
4143 } LDKPathFailure_Tag;
4145 typedef struct LDKPathFailure_LDKInitialSend_Body {
4147 * The error surfaced from initial send.
4149 struct LDKAPIError err;
4150 } LDKPathFailure_LDKInitialSend_Body;
4152 typedef struct LDKPathFailure_LDKOnPath_Body {
4154 * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
4155 * decisions can take into account the update.
4157 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
4158 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
4160 struct LDKCOption_NetworkUpdateZ network_update;
4161 } LDKPathFailure_LDKOnPath_Body;
4163 typedef struct MUST_USE_STRUCT LDKPathFailure {
4164 LDKPathFailure_Tag tag;
4166 LDKPathFailure_LDKInitialSend_Body initial_send;
4167 LDKPathFailure_LDKOnPath_Body on_path;
4172 * An enum which can either contain a crate::lightning::events::PathFailure or not
4174 typedef enum LDKCOption_PathFailureZ_Tag {
4176 * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
4178 LDKCOption_PathFailureZ_Some,
4180 * When we're in this state, this COption_PathFailureZ contains nothing
4182 LDKCOption_PathFailureZ_None,
4184 * Must be last for serialization purposes
4186 LDKCOption_PathFailureZ_Sentinel,
4187 } LDKCOption_PathFailureZ_Tag;
4189 typedef struct LDKCOption_PathFailureZ {
4190 LDKCOption_PathFailureZ_Tag tag;
4193 struct LDKPathFailure some;
4196 } LDKCOption_PathFailureZ;
4199 * The contents of CResult_COption_PathFailureZDecodeErrorZ
4201 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
4203 * A pointer to the contents in the success state.
4204 * Reading from this pointer when `result_ok` is not set is undefined.
4206 struct LDKCOption_PathFailureZ *result;
4208 * A pointer to the contents in the error state.
4209 * Reading from this pointer when `result_ok` is set is undefined.
4211 struct LDKDecodeError *err;
4212 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
4215 * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
4216 * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
4217 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4219 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
4221 * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
4222 * `err` or `result` depending on the state of `result_ok`.
4224 union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
4226 * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
4229 } LDKCResult_COption_PathFailureZDecodeErrorZ;
4234 * Struct to `Display` fields in a safe way using `PrintableString`
4236 typedef struct MUST_USE_STRUCT LDKUntrustedString {
4238 * A pointer to the opaque Rust object.
4239 * Nearly everywhere, inner must be non-null, however in places where
4240 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4242 LDKnativeUntrustedString *inner;
4244 * Indicates that this is the only struct which contains the same pointer.
4245 * Rust functions which take ownership of an object provided via an argument require
4246 * this to be true and invalidate the object pointed to by inner.
4249 } LDKUntrustedString;
4252 * The reason the channel was closed. See individual variants more details.
4254 typedef enum LDKClosureReason_Tag {
4256 * Closure generated from receiving a peer error message.
4258 * Our counterparty may have broadcasted their latest commitment state, and we have
4261 LDKClosureReason_CounterpartyForceClosed,
4263 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
4265 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
4267 LDKClosureReason_HolderForceClosed,
4269 * The channel was closed after negotiating a cooperative close and we've now broadcasted
4270 * the cooperative close transaction. Note the shutdown may have been initiated by us.
4272 LDKClosureReason_CooperativeClosure,
4274 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
4275 * commitment transaction came from our counterparty, but it may also have come from
4276 * a copy of our own `ChannelMonitor`.
4278 LDKClosureReason_CommitmentTxConfirmed,
4280 * The funding transaction failed to confirm in a timely manner on an inbound channel.
4282 LDKClosureReason_FundingTimedOut,
4284 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
4286 LDKClosureReason_ProcessingError,
4288 * The peer disconnected prior to funding completing. In this case the spec mandates that we
4289 * forget the channel entirely - we can attempt again if the peer reconnects.
4291 * This includes cases where we restarted prior to funding completion, including prior to the
4292 * initial [`ChannelMonitor`] persistence completing.
4294 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
4295 * peer because of mutual incompatibility between us and our channel counterparty.
4297 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
4299 LDKClosureReason_DisconnectedPeer,
4301 * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
4302 * the [`ChannelManager`] deserialized.
4304 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
4305 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
4307 LDKClosureReason_OutdatedChannelManager,
4309 * Must be last for serialization purposes
4311 LDKClosureReason_Sentinel,
4312 } LDKClosureReason_Tag;
4314 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
4316 * The error which the peer sent us.
4318 * Be careful about printing the peer_msg, a well-crafted message could exploit
4319 * a security vulnerability in the terminal emulator or the logging subsystem.
4320 * To be safe, use `Display` on `UntrustedString`
4322 * [`UntrustedString`]: crate::util::string::UntrustedString
4324 struct LDKUntrustedString peer_msg;
4325 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
4327 typedef struct LDKClosureReason_LDKProcessingError_Body {
4329 * A developer-readable error message which we generated.
4332 } LDKClosureReason_LDKProcessingError_Body;
4334 typedef struct MUST_USE_STRUCT LDKClosureReason {
4335 LDKClosureReason_Tag tag;
4337 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
4338 LDKClosureReason_LDKProcessingError_Body processing_error;
4343 * An enum which can either contain a crate::lightning::events::ClosureReason or not
4345 typedef enum LDKCOption_ClosureReasonZ_Tag {
4347 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
4349 LDKCOption_ClosureReasonZ_Some,
4351 * When we're in this state, this COption_ClosureReasonZ contains nothing
4353 LDKCOption_ClosureReasonZ_None,
4355 * Must be last for serialization purposes
4357 LDKCOption_ClosureReasonZ_Sentinel,
4358 } LDKCOption_ClosureReasonZ_Tag;
4360 typedef struct LDKCOption_ClosureReasonZ {
4361 LDKCOption_ClosureReasonZ_Tag tag;
4364 struct LDKClosureReason some;
4367 } LDKCOption_ClosureReasonZ;
4370 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
4372 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
4374 * A pointer to the contents in the success state.
4375 * Reading from this pointer when `result_ok` is not set is undefined.
4377 struct LDKCOption_ClosureReasonZ *result;
4379 * A pointer to the contents in the error state.
4380 * Reading from this pointer when `result_ok` is set is undefined.
4382 struct LDKDecodeError *err;
4383 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
4386 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
4387 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
4388 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4390 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
4392 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
4393 * `err` or `result` depending on the state of `result_ok`.
4395 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
4397 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
4400 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
4403 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
4405 typedef enum LDKHTLCDestination_Tag {
4407 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
4408 * there is insufficient capacity in our outbound channel.
4410 LDKHTLCDestination_NextHopChannel,
4412 * Scenario where we are unsure of the next node to forward the HTLC to.
4414 LDKHTLCDestination_UnknownNextHop,
4416 * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
4419 LDKHTLCDestination_InvalidForward,
4421 * Failure scenario where an HTLC may have been forwarded to be intended for us,
4422 * but is invalid for some reason, so we reject it.
4424 * Some of the reasons may include:
4426 * * Excess HTLCs for a payment that we have already fully received, over-paying for the
4428 * * The counterparty node modified the HTLC in transit,
4429 * * A probing attack where an intermediary node is trying to detect if we are the ultimate
4430 * recipient for a payment.
4432 LDKHTLCDestination_FailedPayment,
4434 * Must be last for serialization purposes
4436 LDKHTLCDestination_Sentinel,
4437 } LDKHTLCDestination_Tag;
4439 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
4441 * The `node_id` of the next node. For backwards compatibility, this field is
4442 * marked as optional, versions prior to 0.0.110 may not always be able to provide
4443 * counterparty node information.
4445 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
4447 struct LDKPublicKey node_id;
4449 * The outgoing `channel_id` between us and the next node.
4451 struct LDKThirtyTwoBytes channel_id;
4452 } LDKHTLCDestination_LDKNextHopChannel_Body;
4454 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
4456 * Short channel id we are requesting to forward an HTLC to.
4458 uint64_t requested_forward_scid;
4459 } LDKHTLCDestination_LDKUnknownNextHop_Body;
4461 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
4463 * Short channel id we are requesting to forward an HTLC to.
4465 uint64_t requested_forward_scid;
4466 } LDKHTLCDestination_LDKInvalidForward_Body;
4468 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
4470 * The payment hash of the payment we attempted to process.
4472 struct LDKThirtyTwoBytes payment_hash;
4473 } LDKHTLCDestination_LDKFailedPayment_Body;
4475 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
4476 LDKHTLCDestination_Tag tag;
4478 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
4479 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
4480 LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
4481 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
4483 } LDKHTLCDestination;
4486 * An enum which can either contain a crate::lightning::events::HTLCDestination or not
4488 typedef enum LDKCOption_HTLCDestinationZ_Tag {
4490 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
4492 LDKCOption_HTLCDestinationZ_Some,
4494 * When we're in this state, this COption_HTLCDestinationZ contains nothing
4496 LDKCOption_HTLCDestinationZ_None,
4498 * Must be last for serialization purposes
4500 LDKCOption_HTLCDestinationZ_Sentinel,
4501 } LDKCOption_HTLCDestinationZ_Tag;
4503 typedef struct LDKCOption_HTLCDestinationZ {
4504 LDKCOption_HTLCDestinationZ_Tag tag;
4507 struct LDKHTLCDestination some;
4510 } LDKCOption_HTLCDestinationZ;
4513 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
4515 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
4517 * A pointer to the contents in the success state.
4518 * Reading from this pointer when `result_ok` is not set is undefined.
4520 struct LDKCOption_HTLCDestinationZ *result;
4522 * A pointer to the contents in the error state.
4523 * Reading from this pointer when `result_ok` is set is undefined.
4525 struct LDKDecodeError *err;
4526 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
4529 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
4530 * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
4531 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4533 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
4535 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
4536 * `err` or `result` depending on the state of `result_ok`.
4538 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
4540 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
4543 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
4546 * The contents of CResult_PaymentFailureReasonDecodeErrorZ
4548 typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
4550 * A pointer to the contents in the success state.
4551 * Reading from this pointer when `result_ok` is not set is undefined.
4553 enum LDKPaymentFailureReason *result;
4555 * A pointer to the contents in the error state.
4556 * Reading from this pointer when `result_ok` is set is undefined.
4558 struct LDKDecodeError *err;
4559 } LDKCResult_PaymentFailureReasonDecodeErrorZPtr;
4562 * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
4563 * containing a crate::lightning::events::PaymentFailureReason on success and a crate::lightning::ln::msgs::DecodeError on failure.
4564 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4566 typedef struct LDKCResult_PaymentFailureReasonDecodeErrorZ {
4568 * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
4569 * `err` or `result` depending on the state of `result_ok`.
4571 union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
4573 * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
4576 } LDKCResult_PaymentFailureReasonDecodeErrorZ;
4579 * An enum which can either contain a crate::c_types::U128 or not
4581 typedef enum LDKCOption_u128Z_Tag {
4583 * When we're in this state, this COption_u128Z contains a crate::c_types::U128
4585 LDKCOption_u128Z_Some,
4587 * When we're in this state, this COption_u128Z contains nothing
4589 LDKCOption_u128Z_None,
4591 * Must be last for serialization purposes
4593 LDKCOption_u128Z_Sentinel,
4594 } LDKCOption_u128Z_Tag;
4596 typedef struct LDKCOption_u128Z {
4597 LDKCOption_u128Z_Tag tag;
4600 struct LDKU128 some;
4606 * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
4608 typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
4610 * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
4612 LDKCOption_PaymentFailureReasonZ_Some,
4614 * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
4616 LDKCOption_PaymentFailureReasonZ_None,
4618 * Must be last for serialization purposes
4620 LDKCOption_PaymentFailureReasonZ_Sentinel,
4621 } LDKCOption_PaymentFailureReasonZ_Tag;
4623 typedef struct LDKCOption_PaymentFailureReasonZ {
4624 LDKCOption_PaymentFailureReasonZ_Tag tag;
4627 enum LDKPaymentFailureReason some;
4630 } LDKCOption_PaymentFailureReasonZ;
4635 * Information about a spendable output to a P2WSH script.
4637 * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
4639 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
4641 * A pointer to the opaque Rust object.
4642 * Nearly everywhere, inner must be non-null, however in places where
4643 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4645 LDKnativeDelayedPaymentOutputDescriptor *inner;
4647 * Indicates that this is the only struct which contains the same pointer.
4648 * Rust functions which take ownership of an object provided via an argument require
4649 * this to be true and invalidate the object pointed to by inner.
4652 } LDKDelayedPaymentOutputDescriptor;
4657 * Information about a spendable output to our \"payment key\".
4659 * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
4661 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
4663 * A pointer to the opaque Rust object.
4664 * Nearly everywhere, inner must be non-null, however in places where
4665 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4667 LDKnativeStaticPaymentOutputDescriptor *inner;
4669 * Indicates that this is the only struct which contains the same pointer.
4670 * Rust functions which take ownership of an object provided via an argument require
4671 * this to be true and invalidate the object pointed to by inner.
4674 } LDKStaticPaymentOutputDescriptor;
4677 * Describes the necessary information to spend a spendable output.
4679 * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
4680 * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
4681 * to spend on-chain. The information needed to do this is provided in this enum, including the
4682 * outpoint describing which `txid` and output `index` is available, the full output which exists
4683 * at that `txid`/`index`, and any keys or other information required to sign.
4685 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
4687 typedef enum LDKSpendableOutputDescriptor_Tag {
4689 * An output to a script which was provided via [`SignerProvider`] directly, either from
4690 * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
4691 * know how to spend it. No secret keys are provided as LDK was never given any key.
4692 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
4693 * on-chain using the payment preimage or after it has timed out.
4695 * [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
4696 * [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
4698 LDKSpendableOutputDescriptor_StaticOutput,
4700 * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
4703 * The witness in the spending input should be:
4705 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
4708 * Note that the `nSequence` field in the spending input must be set to
4709 * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
4710 * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
4711 * the outpoint confirms, see [BIP
4712 * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
4713 * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
4716 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
4717 * it is an output from an old state which we broadcast (which should never happen).
4719 * To derive the delayed payment key which is used to sign this input, you must pass the
4720 * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
4721 * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
4722 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The public key can be
4723 * generated without the secret key using [`chan_utils::derive_public_key`] and only the
4724 * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
4726 * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
4727 * used in the witness script generation), you must pass the counterparty
4728 * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
4729 * [`ChannelSigner::provide_channel_parameters`]) and the provided
4730 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
4731 * [`chan_utils::derive_public_revocation_key`].
4733 * The witness script which is hashed and included in the output `script_pubkey` may be
4734 * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
4735 * as explained above), our delayed payment pubkey (derived as explained above), and the
4736 * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
4737 * [`chan_utils::get_revokeable_redeemscript`].
4739 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
4741 * An output to a P2WPKH, spendable exclusively by our payment key (i.e., the private key
4742 * which corresponds to the `payment_point` in [`ChannelSigner::pubkeys`]). The witness
4743 * in the spending input is, thus, simply:
4745 * <BIP 143 signature> <payment key>
4748 * These are generally the result of our counterparty having broadcast the current state,
4749 * allowing us to claim the non-HTLC-encumbered outputs immediately.
4751 LDKSpendableOutputDescriptor_StaticPaymentOutput,
4753 * Must be last for serialization purposes
4755 LDKSpendableOutputDescriptor_Sentinel,
4756 } LDKSpendableOutputDescriptor_Tag;
4758 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
4760 * The outpoint which is spendable.
4762 struct LDKOutPoint outpoint;
4764 * The output which is referenced by the given outpoint.
4766 struct LDKTxOut output;
4767 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
4769 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
4770 LDKSpendableOutputDescriptor_Tag tag;
4772 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
4774 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
4777 struct LDKStaticPaymentOutputDescriptor static_payment_output;
4780 } LDKSpendableOutputDescriptor;
4783 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
4784 * This corresponds to std::vector in C++
4786 typedef struct LDKCVec_SpendableOutputDescriptorZ {
4788 * The elements in the array.
4789 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4791 struct LDKSpendableOutputDescriptor *data;
4793 * The number of elements pointed to by `data`.
4796 } LDKCVec_SpendableOutputDescriptorZ;
4799 * An Event which you should probably take some action in response to.
4801 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
4802 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
4803 * written as it makes no sense to respond to it after reconnecting to peers).
4805 typedef enum LDKEvent_Tag {
4807 * Used to indicate that the client should generate a funding transaction with the given
4808 * parameters and then call [`ChannelManager::funding_transaction_generated`].
4809 * Generated in [`ChannelManager`] message handling.
4810 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
4811 * counterparty can steal your funds!
4813 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
4814 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
4816 LDKEvent_FundingGenerationReady,
4818 * Indicates that we've been offered a payment and it needs to be claimed via calling
4819 * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
4821 * Note that if the preimage is not known, you should call
4822 * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
4823 * to free up resources for this HTLC and avoid network congestion.
4824 * If you fail to call either [`ChannelManager::claim_funds`], [`ChannelManager::fail_htlc_backwards`],
4825 * or [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will be
4826 * automatically failed.
4829 * LDK will not stop an inbound payment from being paid multiple times, so multiple
4830 * `PaymentClaimable` events may be generated for the same payment. In such a case it is
4831 * polite (and required in the lightning specification) to fail the payment the second time
4832 * and give the sender their money back rather than accepting double payment.
4835 * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
4837 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
4838 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
4839 * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
4841 LDKEvent_PaymentClaimable,
4843 * Indicates a payment has been claimed and we've received money!
4845 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
4846 * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
4847 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
4848 * [`Event::PaymentClaimable`] event.
4851 * LDK will not stop an inbound payment from being paid multiple times, so multiple
4852 * `PaymentClaimable` events may be generated for the same payment. If you then call
4853 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
4854 * multiple `PaymentClaimed` events.
4856 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
4858 LDKEvent_PaymentClaimed,
4860 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
4861 * and we got back the payment preimage for it).
4863 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
4864 * event. In this situation, you SHOULD treat this payment as having succeeded.
4866 LDKEvent_PaymentSent,
4868 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
4869 * provide failure information for each path attempt in the payment, including retries.
4871 * This event is provided once there are no further pending HTLCs for the payment and the
4872 * payment is no longer retryable, due either to the [`Retry`] provided or
4873 * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
4875 * [`Retry`]: crate::ln::channelmanager::Retry
4876 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
4878 LDKEvent_PaymentFailed,
4880 * Indicates that a path for an outbound payment was successful.
4882 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
4883 * [`Event::PaymentSent`] for obtaining the payment preimage.
4885 LDKEvent_PaymentPathSuccessful,
4887 * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
4890 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
4891 * [`Event::PaymentFailed`].
4893 * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
4896 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
4898 LDKEvent_PaymentPathFailed,
4900 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
4902 LDKEvent_ProbeSuccessful,
4904 * Indicates that a probe payment we sent failed at an intermediary node on the path.
4906 LDKEvent_ProbeFailed,
4908 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
4909 * a time in the future.
4911 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
4913 LDKEvent_PendingHTLCsForwardable,
4915 * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
4916 * you've encoded an intercept scid in the receiver's invoice route hints using
4917 * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
4919 * [`ChannelManager::forward_intercepted_htlc`] or
4920 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
4921 * their docs for more information.
4923 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
4924 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
4925 * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
4926 * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
4928 LDKEvent_HTLCIntercepted,
4930 * Used to indicate that an output which you should know how to spend was confirmed on chain
4931 * and is now spendable.
4932 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
4933 * counterparty spending them due to some kind of timeout. Thus, you need to store them
4934 * somewhere and spend them when you create on-chain transactions.
4936 LDKEvent_SpendableOutputs,
4938 * This event is generated when a payment has been successfully forwarded through us and a
4939 * forwarding fee earned.
4941 LDKEvent_PaymentForwarded,
4943 * Used to indicate that a channel with the given `channel_id` is being opened and pending
4944 * confirmation on-chain.
4946 * This event is emitted when the funding transaction has been signed and is broadcast to the
4947 * network. For 0conf channels it will be immediately followed by the corresponding
4948 * [`Event::ChannelReady`] event.
4950 LDKEvent_ChannelPending,
4952 * Used to indicate that a channel with the given `channel_id` is ready to
4953 * be used. This event is emitted either when the funding transaction has been confirmed
4954 * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
4957 LDKEvent_ChannelReady,
4959 * Used to indicate that a previously opened channel with the given `channel_id` is in the
4960 * process of closure.
4962 LDKEvent_ChannelClosed,
4964 * Used to indicate to the user that they can abandon the funding transaction and recycle the
4965 * inputs for another purpose.
4967 LDKEvent_DiscardFunding,
4969 * Indicates a request to open a new channel by a peer.
4971 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the
4972 * request, call [`ChannelManager::force_close_without_broadcasting_txn`].
4974 * The event is only triggered when a new open channel request is received and the
4975 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
4977 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
4978 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
4979 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
4981 LDKEvent_OpenChannelRequest,
4983 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
4986 * Some scenarios where this event may be sent include:
4987 * * Insufficient capacity in the outbound channel
4988 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
4989 * * When an unknown SCID is requested for forwarding a payment.
4990 * * Expected MPP amount has already been reached
4991 * * The HTLC has timed out
4993 * This event, however, does not get generated if an HTLC fails to meet the forwarding
4994 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
4996 LDKEvent_HTLCHandlingFailed,
4998 * Must be last for serialization purposes
5003 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
5005 * The random channel_id we picked which you'll need to pass into
5006 * [`ChannelManager::funding_transaction_generated`].
5008 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
5010 struct LDKThirtyTwoBytes temporary_channel_id;
5012 * The counterparty's node_id, which you'll need to pass back into
5013 * [`ChannelManager::funding_transaction_generated`].
5015 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
5017 struct LDKPublicKey counterparty_node_id;
5019 * The value, in satoshis, that the output should have.
5021 uint64_t channel_value_satoshis;
5023 * The script which should be used in the transaction output.
5025 struct LDKCVec_u8Z output_script;
5027 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or a
5028 * random value for an inbound channel. This may be zero for objects serialized with LDK
5029 * versions prior to 0.0.113.
5031 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
5033 struct LDKU128 user_channel_id;
5034 } LDKEvent_LDKFundingGenerationReady_Body;
5036 typedef struct LDKEvent_LDKPaymentClaimable_Body {
5038 * The node that will receive the payment after it has been claimed.
5039 * This is useful to identify payments received via [phantom nodes].
5040 * This field will always be filled in when the event was generated by LDK versions
5041 * 0.0.113 and above.
5043 * [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager
5045 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5047 struct LDKPublicKey receiver_node_id;
5049 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
5050 * not stop you from registering duplicate payment hashes for inbound payments.
5052 struct LDKThirtyTwoBytes payment_hash;
5054 * The fields in the onion which were received with each HTLC. Only fields which were
5055 * identical in each HTLC involved in the payment will be included here.
5057 * Payments received on LDK versions prior to 0.0.115 will have this field unset.
5059 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5061 struct LDKRecipientOnionFields onion_fields;
5063 * The value, in thousandths of a satoshi, that this payment is for.
5065 uint64_t amount_msat;
5067 * Information for claiming this received payment, based on whether the purpose of the
5068 * payment is to pay an invoice or to send a spontaneous payment.
5070 struct LDKPaymentPurpose purpose;
5072 * The `channel_id` indicating over which channel we received the payment.
5074 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5076 struct LDKThirtyTwoBytes via_channel_id;
5078 * The `user_channel_id` indicating over which channel we received the payment.
5080 struct LDKCOption_u128Z via_user_channel_id;
5082 * The block height at which this payment will be failed back and will no longer be
5083 * eligible for claiming.
5085 * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
5086 * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
5088 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
5090 struct LDKCOption_u32Z claim_deadline;
5091 } LDKEvent_LDKPaymentClaimable_Body;
5093 typedef struct LDKEvent_LDKPaymentClaimed_Body {
5095 * The node that received the payment.
5096 * This is useful to identify payments which were received via [phantom nodes].
5097 * This field will always be filled in when the event was generated by LDK versions
5098 * 0.0.113 and above.
5100 * [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager
5102 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5104 struct LDKPublicKey receiver_node_id;
5106 * The payment hash of the claimed payment. Note that LDK will not stop you from
5107 * registering duplicate payment hashes for inbound payments.
5109 struct LDKThirtyTwoBytes payment_hash;
5111 * The value, in thousandths of a satoshi, that this payment is for.
5113 uint64_t amount_msat;
5115 * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
5116 * spontaneous payment.
5118 struct LDKPaymentPurpose purpose;
5119 } LDKEvent_LDKPaymentClaimed_Body;
5121 typedef struct LDKEvent_LDKPaymentSent_Body {
5123 * The `payment_id` passed to [`ChannelManager::send_payment`].
5125 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
5127 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5129 struct LDKThirtyTwoBytes payment_id;
5131 * The preimage to the hash given to ChannelManager::send_payment.
5132 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
5135 struct LDKThirtyTwoBytes payment_preimage;
5137 * The hash that was given to [`ChannelManager::send_payment`].
5139 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
5141 struct LDKThirtyTwoBytes payment_hash;
5143 * The total fee which was spent at intermediate hops in this payment, across all paths.
5145 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
5146 * overpayment to the recipient node.
5148 * If the recipient or an intermediate node misbehaves and gives us free money, this may
5149 * overstate the amount paid, though this is unlikely.
5151 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
5153 struct LDKCOption_u64Z fee_paid_msat;
5154 } LDKEvent_LDKPaymentSent_Body;
5156 typedef struct LDKEvent_LDKPaymentFailed_Body {
5158 * The `payment_id` passed to [`ChannelManager::send_payment`].
5160 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
5162 struct LDKThirtyTwoBytes payment_id;
5164 * The hash that was given to [`ChannelManager::send_payment`].
5166 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
5168 struct LDKThirtyTwoBytes payment_hash;
5170 * The reason the payment failed. This is only `None` for events generated or serialized
5171 * by versions prior to 0.0.115.
5173 struct LDKCOption_PaymentFailureReasonZ reason;
5174 } LDKEvent_LDKPaymentFailed_Body;
5176 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
5178 * The `payment_id` passed to [`ChannelManager::send_payment`].
5180 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
5182 struct LDKThirtyTwoBytes payment_id;
5184 * The hash that was given to [`ChannelManager::send_payment`].
5186 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
5188 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5190 struct LDKThirtyTwoBytes payment_hash;
5192 * The payment path that was successful.
5194 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
5196 struct LDKPath path;
5197 } LDKEvent_LDKPaymentPathSuccessful_Body;
5199 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
5201 * The `payment_id` passed to [`ChannelManager::send_payment`].
5203 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
5204 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
5206 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5208 struct LDKThirtyTwoBytes payment_id;
5210 * The hash that was given to [`ChannelManager::send_payment`].
5212 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
5214 struct LDKThirtyTwoBytes payment_hash;
5216 * Indicates the payment was rejected for some reason by the recipient. This implies that
5217 * the payment has failed, not just the route in question. If this is not set, the payment may
5218 * be retried via a different route.
5220 bool payment_failed_permanently;
5222 * Extra error details based on the failure type. May contain an update that needs to be
5223 * applied to the [`NetworkGraph`].
5225 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
5227 struct LDKPathFailure failure;
5229 * The payment path that failed.
5231 struct LDKPath path;
5233 * The channel responsible for the failed payment path.
5235 * Note that for route hints or for the first hop in a path this may be an SCID alias and
5236 * may not refer to a channel in the public network graph. These aliases may also collide
5237 * with channels in the public network graph.
5239 * If this is `Some`, then the corresponding channel should be avoided when the payment is
5240 * retried. May be `None` for older [`Event`] serializations.
5242 struct LDKCOption_u64Z short_channel_id;
5243 } LDKEvent_LDKPaymentPathFailed_Body;
5245 typedef struct LDKEvent_LDKProbeSuccessful_Body {
5247 * The id returned by [`ChannelManager::send_probe`].
5249 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
5251 struct LDKThirtyTwoBytes payment_id;
5253 * The hash generated by [`ChannelManager::send_probe`].
5255 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
5257 struct LDKThirtyTwoBytes payment_hash;
5259 * The payment path that was successful.
5261 struct LDKPath path;
5262 } LDKEvent_LDKProbeSuccessful_Body;
5264 typedef struct LDKEvent_LDKProbeFailed_Body {
5266 * The id returned by [`ChannelManager::send_probe`].
5268 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
5270 struct LDKThirtyTwoBytes payment_id;
5272 * The hash generated by [`ChannelManager::send_probe`].
5274 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
5276 struct LDKThirtyTwoBytes payment_hash;
5278 * The payment path that failed.
5280 struct LDKPath path;
5282 * The channel responsible for the failed probe.
5284 * Note that for route hints or for the first hop in a path this may be an SCID alias and
5285 * may not refer to a channel in the public network graph. These aliases may also collide
5286 * with channels in the public network graph.
5288 struct LDKCOption_u64Z short_channel_id;
5289 } LDKEvent_LDKProbeFailed_Body;
5291 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
5293 * The minimum amount of time that should be waited prior to calling
5294 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
5295 * you should wait a random amount of time in roughly the range (now + time_forwardable,
5296 * now + 5*time_forwardable).
5298 uint64_t time_forwardable;
5299 } LDKEvent_LDKPendingHTLCsForwardable_Body;
5301 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
5303 * An id to help LDK identify which HTLC is being forwarded or failed.
5305 struct LDKThirtyTwoBytes intercept_id;
5307 * The fake scid that was programmed as the next hop's scid, generated using
5308 * [`ChannelManager::get_intercept_scid`].
5310 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
5312 uint64_t requested_next_hop_scid;
5314 * The payment hash used for this HTLC.
5316 struct LDKThirtyTwoBytes payment_hash;
5318 * How many msats were received on the inbound edge of this HTLC.
5320 uint64_t inbound_amount_msat;
5322 * How many msats the payer intended to route to the next node. Depending on the reason you are
5323 * intercepting this payment, you might take a fee by forwarding less than this amount.
5325 * Note that LDK will NOT check that expected fees were factored into this value. You MUST
5326 * check that whatever fee you want has been included here or subtract it as required. Further,
5327 * LDK will not stop you from forwarding more than you received.
5329 uint64_t expected_outbound_amount_msat;
5330 } LDKEvent_LDKHTLCIntercepted_Body;
5332 typedef struct LDKEvent_LDKSpendableOutputs_Body {
5334 * The outputs which you should store as spendable by you.
5336 struct LDKCVec_SpendableOutputDescriptorZ outputs;
5337 } LDKEvent_LDKSpendableOutputs_Body;
5339 typedef struct LDKEvent_LDKPaymentForwarded_Body {
5341 * The incoming channel between the previous node and us. This is only `None` for events
5342 * generated or serialized by versions prior to 0.0.107.
5344 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5346 struct LDKThirtyTwoBytes prev_channel_id;
5348 * The outgoing channel between the next node and us. This is only `None` for events
5349 * generated or serialized by versions prior to 0.0.107.
5351 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5353 struct LDKThirtyTwoBytes next_channel_id;
5355 * The fee, in milli-satoshis, which was earned as a result of the payment.
5357 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
5358 * was pending, the amount the next hop claimed will have been rounded down to the nearest
5359 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
5360 * claimed the full value in millisatoshis from the source. In this case,
5361 * `claim_from_onchain_tx` will be set.
5363 * If the channel which sent us the payment has been force-closed, we will claim the funds
5364 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
5365 * fees which we will spend and will instead set this to `None`. It is possible duplicate
5366 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
5369 struct LDKCOption_u64Z fee_earned_msat;
5371 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
5374 bool claim_from_onchain_tx;
5376 * The final amount forwarded, in milli-satoshis, after the fee is deducted.
5378 * The caveat described above the `fee_earned_msat` field applies here as well.
5380 struct LDKCOption_u64Z outbound_amount_forwarded_msat;
5381 } LDKEvent_LDKPaymentForwarded_Body;
5383 typedef struct LDKEvent_LDKChannelPending_Body {
5385 * The `channel_id` of the channel that is pending confirmation.
5387 struct LDKThirtyTwoBytes channel_id;
5389 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
5390 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
5391 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
5392 * `user_channel_id` will be randomized for an inbound channel.
5394 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
5395 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
5396 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
5398 struct LDKU128 user_channel_id;
5400 * The `temporary_channel_id` this channel used to be known by during channel establishment.
5402 * Will be `None` for channels created prior to LDK version 0.0.115.
5404 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5406 struct LDKThirtyTwoBytes former_temporary_channel_id;
5408 * The `node_id` of the channel counterparty.
5410 struct LDKPublicKey counterparty_node_id;
5412 * The outpoint of the channel's funding transaction.
5414 struct LDKOutPoint funding_txo;
5415 } LDKEvent_LDKChannelPending_Body;
5417 typedef struct LDKEvent_LDKChannelReady_Body {
5419 * The `channel_id` of the channel that is ready.
5421 struct LDKThirtyTwoBytes channel_id;
5423 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
5424 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
5425 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
5426 * `user_channel_id` will be randomized for an inbound channel.
5428 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
5429 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
5430 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
5432 struct LDKU128 user_channel_id;
5434 * The `node_id` of the channel counterparty.
5436 struct LDKPublicKey counterparty_node_id;
5438 * The features that this channel will operate with.
5440 struct LDKChannelTypeFeatures channel_type;
5441 } LDKEvent_LDKChannelReady_Body;
5443 typedef struct LDKEvent_LDKChannelClosed_Body {
5445 * The `channel_id` of the channel which has been closed. Note that on-chain transactions
5446 * resolving the channel are likely still awaiting confirmation.
5448 struct LDKThirtyTwoBytes channel_id;
5450 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
5451 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
5452 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
5453 * `user_channel_id` will be randomized for inbound channels.
5454 * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
5455 * zero for objects serialized with LDK versions prior to 0.0.102.
5457 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
5458 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
5459 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
5461 struct LDKU128 user_channel_id;
5463 * The reason the channel was closed.
5465 struct LDKClosureReason reason;
5466 } LDKEvent_LDKChannelClosed_Body;
5468 typedef struct LDKEvent_LDKDiscardFunding_Body {
5470 * The channel_id of the channel which has been closed.
5472 struct LDKThirtyTwoBytes channel_id;
5474 * The full transaction received from the user
5476 struct LDKTransaction transaction;
5477 } LDKEvent_LDKDiscardFunding_Body;
5479 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
5481 * The temporary channel ID of the channel requested to be opened.
5483 * When responding to the request, the `temporary_channel_id` should be passed
5484 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
5485 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
5487 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
5488 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
5490 struct LDKThirtyTwoBytes temporary_channel_id;
5492 * The node_id of the counterparty requesting to open the channel.
5494 * When responding to the request, the `counterparty_node_id` should be passed
5495 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
5496 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
5499 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
5500 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
5502 struct LDKPublicKey counterparty_node_id;
5504 * The channel value of the requested channel.
5506 uint64_t funding_satoshis;
5508 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
5512 * The features that this channel will operate with. If you reject the channel, a
5513 * well-behaved counterparty may automatically re-attempt the channel with a new set of
5516 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
5517 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
5520 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
5521 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
5522 * 0.0.107. Channels setting this type also need to get manually accepted via
5523 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
5524 * or will be rejected otherwise.
5526 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
5528 struct LDKChannelTypeFeatures channel_type;
5529 } LDKEvent_LDKOpenChannelRequest_Body;
5531 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
5533 * The channel over which the HTLC was received.
5535 struct LDKThirtyTwoBytes prev_channel_id;
5537 * Destination of the HTLC that failed to be processed.
5539 struct LDKHTLCDestination failed_next_destination;
5540 } LDKEvent_LDKHTLCHandlingFailed_Body;
5542 typedef struct MUST_USE_STRUCT LDKEvent {
5545 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
5546 LDKEvent_LDKPaymentClaimable_Body payment_claimable;
5547 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
5548 LDKEvent_LDKPaymentSent_Body payment_sent;
5549 LDKEvent_LDKPaymentFailed_Body payment_failed;
5550 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
5551 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
5552 LDKEvent_LDKProbeSuccessful_Body probe_successful;
5553 LDKEvent_LDKProbeFailed_Body probe_failed;
5554 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
5555 LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
5556 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
5557 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
5558 LDKEvent_LDKChannelPending_Body channel_pending;
5559 LDKEvent_LDKChannelReady_Body channel_ready;
5560 LDKEvent_LDKChannelClosed_Body channel_closed;
5561 LDKEvent_LDKDiscardFunding_Body discard_funding;
5562 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
5563 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
5568 * An enum which can either contain a crate::lightning::events::Event or not
5570 typedef enum LDKCOption_EventZ_Tag {
5572 * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
5574 LDKCOption_EventZ_Some,
5576 * When we're in this state, this COption_EventZ contains nothing
5578 LDKCOption_EventZ_None,
5580 * Must be last for serialization purposes
5582 LDKCOption_EventZ_Sentinel,
5583 } LDKCOption_EventZ_Tag;
5585 typedef struct LDKCOption_EventZ {
5586 LDKCOption_EventZ_Tag tag;
5589 struct LDKEvent some;
5592 } LDKCOption_EventZ;
5595 * The contents of CResult_COption_EventZDecodeErrorZ
5597 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
5599 * A pointer to the contents in the success state.
5600 * Reading from this pointer when `result_ok` is not set is undefined.
5602 struct LDKCOption_EventZ *result;
5604 * A pointer to the contents in the error state.
5605 * Reading from this pointer when `result_ok` is set is undefined.
5607 struct LDKDecodeError *err;
5608 } LDKCResult_COption_EventZDecodeErrorZPtr;
5611 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
5612 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5613 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5615 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
5617 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
5618 * `err` or `result` depending on the state of `result_ok`.
5620 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
5622 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
5625 } LDKCResult_COption_EventZDecodeErrorZ;
5630 * An [`accept_channel`] message to be sent to or received from a peer.
5632 * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
5634 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
5636 * A pointer to the opaque Rust object.
5637 * Nearly everywhere, inner must be non-null, however in places where
5638 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5640 LDKnativeAcceptChannel *inner;
5642 * Indicates that this is the only struct which contains the same pointer.
5643 * Rust functions which take ownership of an object provided via an argument require
5644 * this to be true and invalidate the object pointed to by inner.
5652 * An [`open_channel`] message to be sent to or received from a peer.
5654 * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
5656 typedef struct MUST_USE_STRUCT LDKOpenChannel {
5658 * A pointer to the opaque Rust object.
5659 * Nearly everywhere, inner must be non-null, however in places where
5660 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5662 LDKnativeOpenChannel *inner;
5664 * Indicates that this is the only struct which contains the same pointer.
5665 * Rust functions which take ownership of an object provided via an argument require
5666 * this to be true and invalidate the object pointed to by inner.
5674 * A [`funding_created`] message to be sent to or received from a peer.
5676 * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
5678 typedef struct MUST_USE_STRUCT LDKFundingCreated {
5680 * A pointer to the opaque Rust object.
5681 * Nearly everywhere, inner must be non-null, however in places where
5682 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5684 LDKnativeFundingCreated *inner;
5686 * Indicates that this is the only struct which contains the same pointer.
5687 * Rust functions which take ownership of an object provided via an argument require
5688 * this to be true and invalidate the object pointed to by inner.
5691 } LDKFundingCreated;
5696 * A [`funding_signed`] message to be sent to or received from a peer.
5698 * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
5700 typedef struct MUST_USE_STRUCT LDKFundingSigned {
5702 * A pointer to the opaque Rust object.
5703 * Nearly everywhere, inner must be non-null, however in places where
5704 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5706 LDKnativeFundingSigned *inner;
5708 * Indicates that this is the only struct which contains the same pointer.
5709 * Rust functions which take ownership of an object provided via an argument require
5710 * this to be true and invalidate the object pointed to by inner.
5718 * A [`channel_ready`] message to be sent to or received from a peer.
5720 * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
5722 typedef struct MUST_USE_STRUCT LDKChannelReady {
5724 * A pointer to the opaque Rust object.
5725 * Nearly everywhere, inner must be non-null, however in places where
5726 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5728 LDKnativeChannelReady *inner;
5730 * Indicates that this is the only struct which contains the same pointer.
5731 * Rust functions which take ownership of an object provided via an argument require
5732 * this to be true and invalidate the object pointed to by inner.
5740 * An [`announcement_signatures`] message to be sent to or received from a peer.
5742 * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
5744 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
5746 * A pointer to the opaque Rust object.
5747 * Nearly everywhere, inner must be non-null, however in places where
5748 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5750 LDKnativeAnnouncementSignatures *inner;
5752 * Indicates that this is the only struct which contains the same pointer.
5753 * Rust functions which take ownership of an object provided via an argument require
5754 * this to be true and invalidate the object pointed to by inner.
5757 } LDKAnnouncementSignatures;
5762 * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
5763 * transaction updates if they were pending.
5765 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
5767 * A pointer to the opaque Rust object.
5768 * Nearly everywhere, inner must be non-null, however in places where
5769 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5771 LDKnativeCommitmentUpdate *inner;
5773 * Indicates that this is the only struct which contains the same pointer.
5774 * Rust functions which take ownership of an object provided via an argument require
5775 * this to be true and invalidate the object pointed to by inner.
5778 } LDKCommitmentUpdate;
5783 * A [`revoke_and_ack`] message to be sent to or received from a peer.
5785 * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
5787 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
5789 * A pointer to the opaque Rust object.
5790 * Nearly everywhere, inner must be non-null, however in places where
5791 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5793 LDKnativeRevokeAndACK *inner;
5795 * Indicates that this is the only struct which contains the same pointer.
5796 * Rust functions which take ownership of an object provided via an argument require
5797 * this to be true and invalidate the object pointed to by inner.
5805 * A [`closing_signed`] message to be sent to or received from a peer.
5807 * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
5809 typedef struct MUST_USE_STRUCT LDKClosingSigned {
5811 * A pointer to the opaque Rust object.
5812 * Nearly everywhere, inner must be non-null, however in places where
5813 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5815 LDKnativeClosingSigned *inner;
5817 * Indicates that this is the only struct which contains the same pointer.
5818 * Rust functions which take ownership of an object provided via an argument require
5819 * this to be true and invalidate the object pointed to by inner.
5827 * A [`shutdown`] message to be sent to or received from a peer.
5829 * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
5831 typedef struct MUST_USE_STRUCT LDKShutdown {
5833 * A pointer to the opaque Rust object.
5834 * Nearly everywhere, inner must be non-null, however in places where
5835 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5837 LDKnativeShutdown *inner;
5839 * Indicates that this is the only struct which contains the same pointer.
5840 * Rust functions which take ownership of an object provided via an argument require
5841 * this to be true and invalidate the object pointed to by inner.
5849 * A [`channel_reestablish`] message to be sent to or received from a peer.
5851 * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
5853 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
5855 * A pointer to the opaque Rust object.
5856 * Nearly everywhere, inner must be non-null, however in places where
5857 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5859 LDKnativeChannelReestablish *inner;
5861 * Indicates that this is the only struct which contains the same pointer.
5862 * Rust functions which take ownership of an object provided via an argument require
5863 * this to be true and invalidate the object pointed to by inner.
5866 } LDKChannelReestablish;
5871 * A [`channel_announcement`] message to be sent to or received from a peer.
5873 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
5875 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
5877 * A pointer to the opaque Rust object.
5878 * Nearly everywhere, inner must be non-null, however in places where
5879 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5881 LDKnativeChannelAnnouncement *inner;
5883 * Indicates that this is the only struct which contains the same pointer.
5884 * Rust functions which take ownership of an object provided via an argument require
5885 * this to be true and invalidate the object pointed to by inner.
5888 } LDKChannelAnnouncement;
5893 * A [`node_announcement`] message to be sent to or received from a peer.
5895 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
5897 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
5899 * A pointer to the opaque Rust object.
5900 * Nearly everywhere, inner must be non-null, however in places where
5901 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5903 LDKnativeNodeAnnouncement *inner;
5905 * Indicates that this is the only struct which contains the same pointer.
5906 * Rust functions which take ownership of an object provided via an argument require
5907 * this to be true and invalidate the object pointed to by inner.
5910 } LDKNodeAnnouncement;
5915 * An [`error`] message to be sent to or received from a peer.
5917 * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
5919 typedef struct MUST_USE_STRUCT LDKErrorMessage {
5921 * A pointer to the opaque Rust object.
5922 * Nearly everywhere, inner must be non-null, however in places where
5923 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5925 LDKnativeErrorMessage *inner;
5927 * Indicates that this is the only struct which contains the same pointer.
5928 * Rust functions which take ownership of an object provided via an argument require
5929 * this to be true and invalidate the object pointed to by inner.
5937 * A [`warning`] message to be sent to or received from a peer.
5939 * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
5941 typedef struct MUST_USE_STRUCT LDKWarningMessage {
5943 * A pointer to the opaque Rust object.
5944 * Nearly everywhere, inner must be non-null, however in places where
5945 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5947 LDKnativeWarningMessage *inner;
5949 * Indicates that this is the only struct which contains the same pointer.
5950 * Rust functions which take ownership of an object provided via an argument require
5951 * this to be true and invalidate the object pointed to by inner.
5954 } LDKWarningMessage;
5957 * Used to put an error message in a [`LightningError`].
5959 typedef enum LDKErrorAction_Tag {
5961 * The peer took some action which made us think they were useless. Disconnect them.
5963 LDKErrorAction_DisconnectPeer,
5965 * The peer did something harmless that we weren't able to process, just log and ignore
5967 LDKErrorAction_IgnoreError,
5969 * The peer did something harmless that we weren't able to meaningfully process.
5970 * If the error is logged, log it at the given level.
5972 LDKErrorAction_IgnoreAndLog,
5974 * The peer provided us with a gossip message which we'd already seen. In most cases this
5975 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
5976 * our own channel announcements.
5978 LDKErrorAction_IgnoreDuplicateGossip,
5980 * The peer did something incorrect. Tell them.
5982 LDKErrorAction_SendErrorMessage,
5984 * The peer did something incorrect. Tell them without closing any channels.
5986 LDKErrorAction_SendWarningMessage,
5988 * Must be last for serialization purposes
5990 LDKErrorAction_Sentinel,
5991 } LDKErrorAction_Tag;
5993 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
5995 * An error message which we should make an effort to send before we disconnect.
5997 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5999 struct LDKErrorMessage msg;
6000 } LDKErrorAction_LDKDisconnectPeer_Body;
6002 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
6004 * The message to send.
6006 struct LDKErrorMessage msg;
6007 } LDKErrorAction_LDKSendErrorMessage_Body;
6009 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
6011 * The message to send.
6013 struct LDKWarningMessage msg;
6015 * The peer may have done something harmless that we weren't able to meaningfully process,
6016 * though we should still tell them about it.
6017 * If this event is logged, log it at the given level.
6019 enum LDKLevel log_level;
6020 } LDKErrorAction_LDKSendWarningMessage_Body;
6022 typedef struct MUST_USE_STRUCT LDKErrorAction {
6023 LDKErrorAction_Tag tag;
6025 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
6027 enum LDKLevel ignore_and_log;
6029 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
6030 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
6037 * A [`query_channel_range`] message is used to query a peer for channel
6038 * UTXOs in a range of blocks. The recipient of a query makes a best
6039 * effort to reply to the query using one or more [`ReplyChannelRange`]
6042 * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6044 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
6046 * A pointer to the opaque Rust object.
6047 * Nearly everywhere, inner must be non-null, however in places where
6048 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6050 LDKnativeQueryChannelRange *inner;
6052 * Indicates that this is the only struct which contains the same pointer.
6053 * Rust functions which take ownership of an object provided via an argument require
6054 * this to be true and invalidate the object pointed to by inner.
6057 } LDKQueryChannelRange;
6062 * A [`query_short_channel_ids`] message is used to query a peer for
6063 * routing gossip messages related to one or more `short_channel_id`s.
6065 * The query recipient will reply with the latest, if available,
6066 * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
6067 * it maintains for the requested `short_channel_id`s followed by a
6068 * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
6069 * this query are encoded. We only support `encoding_type=0` uncompressed
6070 * serialization and do not support `encoding_type=1` zlib serialization.
6072 * [`query_short_channel_ids`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_short_channel_idsreply_short_channel_ids_end-messages
6074 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
6076 * A pointer to the opaque Rust object.
6077 * Nearly everywhere, inner must be non-null, however in places where
6078 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6080 LDKnativeQueryShortChannelIds *inner;
6082 * Indicates that this is the only struct which contains the same pointer.
6083 * Rust functions which take ownership of an object provided via an argument require
6084 * this to be true and invalidate the object pointed to by inner.
6087 } LDKQueryShortChannelIds;
6092 * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
6095 * Multiple `reply_channel_range` messages can be sent in reply
6096 * to a single [`QueryChannelRange`] message. The query recipient makes a
6097 * best effort to respond based on their local network view which may
6098 * not be a perfect view of the network. The `short_channel_id`s in the
6099 * reply are encoded. We only support `encoding_type=0` uncompressed
6100 * serialization and do not support `encoding_type=1` zlib serialization.
6102 * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6104 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
6106 * A pointer to the opaque Rust object.
6107 * Nearly everywhere, inner must be non-null, however in places where
6108 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6110 LDKnativeReplyChannelRange *inner;
6112 * Indicates that this is the only struct which contains the same pointer.
6113 * Rust functions which take ownership of an object provided via an argument require
6114 * this to be true and invalidate the object pointed to by inner.
6117 } LDKReplyChannelRange;
6122 * A [`gossip_timestamp_filter`] message is used by a node to request
6123 * gossip relay for messages in the requested time range when the
6124 * `gossip_queries` feature has been negotiated.
6126 * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
6128 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
6130 * A pointer to the opaque Rust object.
6131 * Nearly everywhere, inner must be non-null, however in places where
6132 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6134 LDKnativeGossipTimestampFilter *inner;
6136 * Indicates that this is the only struct which contains the same pointer.
6137 * Rust functions which take ownership of an object provided via an argument require
6138 * this to be true and invalidate the object pointed to by inner.
6141 } LDKGossipTimestampFilter;
6144 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
6145 * broadcast to most peers).
6146 * These events are handled by PeerManager::process_events if you are using a PeerManager.
6148 typedef enum LDKMessageSendEvent_Tag {
6150 * Used to indicate that we've accepted a channel open and should send the accept_channel
6151 * message provided to the given peer.
6153 LDKMessageSendEvent_SendAcceptChannel,
6155 * Used to indicate that we've initiated a channel open and should send the open_channel
6156 * message provided to the given peer.
6158 LDKMessageSendEvent_SendOpenChannel,
6160 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
6162 LDKMessageSendEvent_SendFundingCreated,
6164 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
6166 LDKMessageSendEvent_SendFundingSigned,
6168 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
6170 LDKMessageSendEvent_SendChannelReady,
6172 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
6174 LDKMessageSendEvent_SendAnnouncementSignatures,
6176 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
6177 * message should be sent to the peer with the given node_id.
6179 LDKMessageSendEvent_UpdateHTLCs,
6181 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
6183 LDKMessageSendEvent_SendRevokeAndACK,
6185 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
6187 LDKMessageSendEvent_SendClosingSigned,
6189 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
6191 LDKMessageSendEvent_SendShutdown,
6193 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
6195 LDKMessageSendEvent_SendChannelReestablish,
6197 * Used to send a channel_announcement and channel_update to a specific peer, likely on
6198 * initial connection to ensure our peers know about our channels.
6200 LDKMessageSendEvent_SendChannelAnnouncement,
6202 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
6203 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
6205 * Note that after doing so, you very likely (unless you did so very recently) want to
6206 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
6207 * ensures that any nodes which see our channel_announcement also have a relevant
6208 * node_announcement, including relevant feature flags which may be important for routing
6211 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
6213 LDKMessageSendEvent_BroadcastChannelAnnouncement,
6215 * Used to indicate that a channel_update should be broadcast to all peers.
6217 LDKMessageSendEvent_BroadcastChannelUpdate,
6219 * Used to indicate that a node_announcement should be broadcast to all peers.
6221 LDKMessageSendEvent_BroadcastNodeAnnouncement,
6223 * Used to indicate that a channel_update should be sent to a single peer.
6224 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
6225 * private channel and we shouldn't be informing all of our peers of channel parameters.
6227 LDKMessageSendEvent_SendChannelUpdate,
6229 * Broadcast an error downstream to be handled
6231 LDKMessageSendEvent_HandleError,
6233 * Query a peer for channels with funding transaction UTXOs in a block range.
6235 LDKMessageSendEvent_SendChannelRangeQuery,
6237 * Request routing gossip messages from a peer for a list of channels identified by
6238 * their short_channel_ids.
6240 LDKMessageSendEvent_SendShortIdsQuery,
6242 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
6243 * emitted during processing of the query.
6245 LDKMessageSendEvent_SendReplyChannelRange,
6247 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
6248 * enable receiving gossip messages from the peer.
6250 LDKMessageSendEvent_SendGossipTimestampFilter,
6252 * Must be last for serialization purposes
6254 LDKMessageSendEvent_Sentinel,
6255 } LDKMessageSendEvent_Tag;
6257 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
6259 * The node_id of the node which should receive this message
6261 struct LDKPublicKey node_id;
6263 * The message which should be sent.
6265 struct LDKAcceptChannel msg;
6266 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
6268 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
6270 * The node_id of the node which should receive this message
6272 struct LDKPublicKey node_id;
6274 * The message which should be sent.
6276 struct LDKOpenChannel msg;
6277 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
6279 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
6281 * The node_id of the node which should receive this message
6283 struct LDKPublicKey node_id;
6285 * The message which should be sent.
6287 struct LDKFundingCreated msg;
6288 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
6290 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
6292 * The node_id of the node which should receive this message
6294 struct LDKPublicKey node_id;
6296 * The message which should be sent.
6298 struct LDKFundingSigned msg;
6299 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
6301 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
6303 * The node_id of the node which should receive these message(s)
6305 struct LDKPublicKey node_id;
6307 * The channel_ready message which should be sent.
6309 struct LDKChannelReady msg;
6310 } LDKMessageSendEvent_LDKSendChannelReady_Body;
6312 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
6314 * The node_id of the node which should receive these message(s)
6316 struct LDKPublicKey node_id;
6318 * The announcement_signatures message which should be sent.
6320 struct LDKAnnouncementSignatures msg;
6321 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
6323 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
6325 * The node_id of the node which should receive these message(s)
6327 struct LDKPublicKey node_id;
6329 * The update messages which should be sent. ALL messages in the struct should be sent!
6331 struct LDKCommitmentUpdate updates;
6332 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
6334 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
6336 * The node_id of the node which should receive this message
6338 struct LDKPublicKey node_id;
6340 * The message which should be sent.
6342 struct LDKRevokeAndACK msg;
6343 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
6345 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
6347 * The node_id of the node which should receive this message
6349 struct LDKPublicKey node_id;
6351 * The message which should be sent.
6353 struct LDKClosingSigned msg;
6354 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
6356 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
6358 * The node_id of the node which should receive this message
6360 struct LDKPublicKey node_id;
6362 * The message which should be sent.
6364 struct LDKShutdown msg;
6365 } LDKMessageSendEvent_LDKSendShutdown_Body;
6367 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
6369 * The node_id of the node which should receive this message
6371 struct LDKPublicKey node_id;
6373 * The message which should be sent.
6375 struct LDKChannelReestablish msg;
6376 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
6378 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
6380 * The node_id of the node which should receive this message
6382 struct LDKPublicKey node_id;
6384 * The channel_announcement which should be sent.
6386 struct LDKChannelAnnouncement msg;
6388 * The followup channel_update which should be sent.
6390 struct LDKChannelUpdate update_msg;
6391 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
6393 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
6395 * The channel_announcement which should be sent.
6397 struct LDKChannelAnnouncement msg;
6399 * The followup channel_update which should be sent.
6401 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6403 struct LDKChannelUpdate update_msg;
6404 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
6406 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
6408 * The channel_update which should be sent.
6410 struct LDKChannelUpdate msg;
6411 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
6413 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
6415 * The node_announcement which should be sent.
6417 struct LDKNodeAnnouncement msg;
6418 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
6420 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
6422 * The node_id of the node which should receive this message
6424 struct LDKPublicKey node_id;
6426 * The channel_update which should be sent.
6428 struct LDKChannelUpdate msg;
6429 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
6431 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
6433 * The node_id of the node which should receive this message
6435 struct LDKPublicKey node_id;
6437 * The action which should be taken.
6439 struct LDKErrorAction action;
6440 } LDKMessageSendEvent_LDKHandleError_Body;
6442 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
6444 * The node_id of this message recipient
6446 struct LDKPublicKey node_id;
6448 * The query_channel_range which should be sent.
6450 struct LDKQueryChannelRange msg;
6451 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
6453 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
6455 * The node_id of this message recipient
6457 struct LDKPublicKey node_id;
6459 * The query_short_channel_ids which should be sent.
6461 struct LDKQueryShortChannelIds msg;
6462 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
6464 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
6466 * The node_id of this message recipient
6468 struct LDKPublicKey node_id;
6470 * The reply_channel_range which should be sent.
6472 struct LDKReplyChannelRange msg;
6473 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
6475 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
6477 * The node_id of this message recipient
6479 struct LDKPublicKey node_id;
6481 * The gossip_timestamp_filter which should be sent.
6483 struct LDKGossipTimestampFilter msg;
6484 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
6486 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
6487 LDKMessageSendEvent_Tag tag;
6489 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
6490 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
6491 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
6492 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
6493 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
6494 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
6495 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
6496 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
6497 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
6498 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
6499 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
6500 LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
6501 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
6502 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
6503 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
6504 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
6505 LDKMessageSendEvent_LDKHandleError_Body handle_error;
6506 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
6507 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
6508 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
6509 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
6511 } LDKMessageSendEvent;
6514 * A dynamically-allocated array of crate::lightning::events::MessageSendEvents of arbitrary size.
6515 * This corresponds to std::vector in C++
6517 typedef struct LDKCVec_MessageSendEventZ {
6519 * The elements in the array.
6520 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6522 struct LDKMessageSendEvent *data;
6524 * The number of elements pointed to by `data`.
6527 } LDKCVec_MessageSendEventZ;
6530 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
6531 * This corresponds to std::vector in C++
6533 typedef struct LDKCVec_ChainHashZ {
6535 * The elements in the array.
6536 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6538 struct LDKThirtyTwoBytes *data;
6540 * The number of elements pointed to by `data`.
6543 } LDKCVec_ChainHashZ;
6546 * The contents of CResult_PublicKeyErrorZ
6548 typedef union LDKCResult_PublicKeyErrorZPtr {
6550 * A pointer to the contents in the success state.
6551 * Reading from this pointer when `result_ok` is not set is undefined.
6553 struct LDKPublicKey *result;
6555 * A pointer to the contents in the error state.
6556 * Reading from this pointer when `result_ok` is set is undefined.
6558 enum LDKSecp256k1Error *err;
6559 } LDKCResult_PublicKeyErrorZPtr;
6562 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
6563 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
6564 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6566 typedef struct LDKCResult_PublicKeyErrorZ {
6568 * The contents of this CResult_PublicKeyErrorZ, accessible via either
6569 * `err` or `result` depending on the state of `result_ok`.
6571 union LDKCResult_PublicKeyErrorZPtr contents;
6573 * Whether this CResult_PublicKeyErrorZ represents a success state.
6576 } LDKCResult_PublicKeyErrorZ;
6579 * The contents of CResult_NodeIdDecodeErrorZ
6581 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
6583 * A pointer to the contents in the success state.
6584 * Reading from this pointer when `result_ok` is not set is undefined.
6586 struct LDKNodeId *result;
6588 * A pointer to the contents in the error state.
6589 * Reading from this pointer when `result_ok` is set is undefined.
6591 struct LDKDecodeError *err;
6592 } LDKCResult_NodeIdDecodeErrorZPtr;
6595 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
6596 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
6597 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6599 typedef struct LDKCResult_NodeIdDecodeErrorZ {
6601 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
6602 * `err` or `result` depending on the state of `result_ok`.
6604 union LDKCResult_NodeIdDecodeErrorZPtr contents;
6606 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
6609 } LDKCResult_NodeIdDecodeErrorZ;
6612 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
6614 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
6616 * A pointer to the contents in the success state.
6617 * Reading from this pointer when `result_ok` is not set is undefined.
6619 struct LDKCOption_NetworkUpdateZ *result;
6621 * A pointer to the contents in the error state.
6622 * Reading from this pointer when `result_ok` is set is undefined.
6624 struct LDKDecodeError *err;
6625 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
6628 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
6629 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6630 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6632 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
6634 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
6635 * `err` or `result` depending on the state of `result_ok`.
6637 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
6639 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
6642 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
6645 * The contents of CResult_TxOutUtxoLookupErrorZ
6647 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
6649 * A pointer to the contents in the success state.
6650 * Reading from this pointer when `result_ok` is not set is undefined.
6652 struct LDKTxOut *result;
6654 * A pointer to the contents in the error state.
6655 * Reading from this pointer when `result_ok` is set is undefined.
6657 enum LDKUtxoLookupError *err;
6658 } LDKCResult_TxOutUtxoLookupErrorZPtr;
6661 * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
6662 * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
6663 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6665 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
6667 * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
6668 * `err` or `result` depending on the state of `result_ok`.
6670 union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
6672 * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
6675 } LDKCResult_TxOutUtxoLookupErrorZ;
6680 * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
6682 * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
6684 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
6686 * A pointer to the opaque Rust object.
6687 * Nearly everywhere, inner must be non-null, however in places where
6688 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6690 LDKnativeUtxoFuture *inner;
6692 * Indicates that this is the only struct which contains the same pointer.
6693 * Rust functions which take ownership of an object provided via an argument require
6694 * this to be true and invalidate the object pointed to by inner.
6700 * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
6701 * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
6704 typedef enum LDKUtxoResult_Tag {
6706 * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
6707 * requested or a [`UtxoLookupError`].
6711 * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
6712 * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
6714 * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
6715 * but only fairly loosely. Because a pending checks block all message processing, leaving
6716 * checks pending for an extended time may cause DoS of other functions. It is recommended you
6717 * keep a tight timeout on lookups, on the order of a few seconds.
6719 LDKUtxoResult_Async,
6721 * Must be last for serialization purposes
6723 LDKUtxoResult_Sentinel,
6724 } LDKUtxoResult_Tag;
6726 typedef struct MUST_USE_STRUCT LDKUtxoResult {
6727 LDKUtxoResult_Tag tag;
6730 struct LDKCResult_TxOutUtxoLookupErrorZ sync;
6733 struct LDKUtxoFuture async;
6739 * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
6741 typedef struct LDKUtxoLookup {
6743 * An opaque pointer which is passed to your function implementations as an argument.
6744 * This has no meaning in the LDK, and can be NULL or any other value.
6748 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
6749 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
6752 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
6754 struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
6756 * Frees any resources associated with this object given its this_arg pointer.
6757 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6759 void (*free)(void *this_arg);
6763 * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
6765 typedef enum LDKCOption_UtxoLookupZ_Tag {
6767 * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
6769 LDKCOption_UtxoLookupZ_Some,
6771 * When we're in this state, this COption_UtxoLookupZ contains nothing
6773 LDKCOption_UtxoLookupZ_None,
6775 * Must be last for serialization purposes
6777 LDKCOption_UtxoLookupZ_Sentinel,
6778 } LDKCOption_UtxoLookupZ_Tag;
6780 typedef struct LDKCOption_UtxoLookupZ {
6781 LDKCOption_UtxoLookupZ_Tag tag;
6784 struct LDKUtxoLookup some;
6787 } LDKCOption_UtxoLookupZ;
6790 * The contents of CResult_boolLightningErrorZ
6792 typedef union LDKCResult_boolLightningErrorZPtr {
6794 * A pointer to the contents in the success state.
6795 * Reading from this pointer when `result_ok` is not set is undefined.
6799 * A pointer to the contents in the error state.
6800 * Reading from this pointer when `result_ok` is set is undefined.
6802 struct LDKLightningError *err;
6803 } LDKCResult_boolLightningErrorZPtr;
6806 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
6807 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
6808 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6810 typedef struct LDKCResult_boolLightningErrorZ {
6812 * The contents of this CResult_boolLightningErrorZ, accessible via either
6813 * `err` or `result` depending on the state of `result_ok`.
6815 union LDKCResult_boolLightningErrorZPtr contents;
6817 * Whether this CResult_boolLightningErrorZ represents a success state.
6820 } LDKCResult_boolLightningErrorZ;
6823 * A tuple of 3 elements. See the individual fields for the types contained.
6825 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
6827 * The element at position 0
6829 struct LDKChannelAnnouncement a;
6831 * The element at position 1
6833 struct LDKChannelUpdate b;
6835 * The element at position 2
6837 struct LDKChannelUpdate c;
6838 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
6841 * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
6843 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
6845 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
6847 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
6849 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
6851 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
6853 * Must be last for serialization purposes
6855 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
6856 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
6858 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
6859 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
6862 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
6865 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
6868 * The contents of CResult_NoneLightningErrorZ
6870 typedef union LDKCResult_NoneLightningErrorZPtr {
6872 * Note that this value is always NULL, as there are no contents in the OK variant
6876 * A pointer to the contents in the error state.
6877 * Reading from this pointer when `result_ok` is set is undefined.
6879 struct LDKLightningError *err;
6880 } LDKCResult_NoneLightningErrorZPtr;
6883 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
6884 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
6885 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6887 typedef struct LDKCResult_NoneLightningErrorZ {
6889 * The contents of this CResult_NoneLightningErrorZ, accessible via either
6890 * `err` or `result` depending on the state of `result_ok`.
6892 union LDKCResult_NoneLightningErrorZPtr contents;
6894 * Whether this CResult_NoneLightningErrorZ represents a success state.
6897 } LDKCResult_NoneLightningErrorZ;
6902 * Details about one direction of a channel as received within a [`ChannelUpdate`].
6904 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
6906 * A pointer to the opaque Rust object.
6907 * Nearly everywhere, inner must be non-null, however in places where
6908 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6910 LDKnativeChannelUpdateInfo *inner;
6912 * Indicates that this is the only struct which contains the same pointer.
6913 * Rust functions which take ownership of an object provided via an argument require
6914 * this to be true and invalidate the object pointed to by inner.
6917 } LDKChannelUpdateInfo;
6920 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
6922 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
6924 * A pointer to the contents in the success state.
6925 * Reading from this pointer when `result_ok` is not set is undefined.
6927 struct LDKChannelUpdateInfo *result;
6929 * A pointer to the contents in the error state.
6930 * Reading from this pointer when `result_ok` is set is undefined.
6932 struct LDKDecodeError *err;
6933 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
6936 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
6937 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6938 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6940 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
6942 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
6943 * `err` or `result` depending on the state of `result_ok`.
6945 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
6947 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
6950 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
6955 * Details about a channel (both directions).
6956 * Received within a channel announcement.
6958 typedef struct MUST_USE_STRUCT LDKChannelInfo {
6960 * A pointer to the opaque Rust object.
6961 * Nearly everywhere, inner must be non-null, however in places where
6962 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6964 LDKnativeChannelInfo *inner;
6966 * Indicates that this is the only struct which contains the same pointer.
6967 * Rust functions which take ownership of an object provided via an argument require
6968 * this to be true and invalidate the object pointed to by inner.
6974 * The contents of CResult_ChannelInfoDecodeErrorZ
6976 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
6978 * A pointer to the contents in the success state.
6979 * Reading from this pointer when `result_ok` is not set is undefined.
6981 struct LDKChannelInfo *result;
6983 * A pointer to the contents in the error state.
6984 * Reading from this pointer when `result_ok` is set is undefined.
6986 struct LDKDecodeError *err;
6987 } LDKCResult_ChannelInfoDecodeErrorZPtr;
6990 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
6991 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6992 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6994 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
6996 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
6997 * `err` or `result` depending on the state of `result_ok`.
6999 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
7001 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
7004 } LDKCResult_ChannelInfoDecodeErrorZ;
7009 * Fees for routing via a given channel or a node
7011 typedef struct MUST_USE_STRUCT LDKRoutingFees {
7013 * A pointer to the opaque Rust object.
7014 * Nearly everywhere, inner must be non-null, however in places where
7015 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7017 LDKnativeRoutingFees *inner;
7019 * Indicates that this is the only struct which contains the same pointer.
7020 * Rust functions which take ownership of an object provided via an argument require
7021 * this to be true and invalidate the object pointed to by inner.
7027 * The contents of CResult_RoutingFeesDecodeErrorZ
7029 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
7031 * A pointer to the contents in the success state.
7032 * Reading from this pointer when `result_ok` is not set is undefined.
7034 struct LDKRoutingFees *result;
7036 * A pointer to the contents in the error state.
7037 * Reading from this pointer when `result_ok` is set is undefined.
7039 struct LDKDecodeError *err;
7040 } LDKCResult_RoutingFeesDecodeErrorZPtr;
7043 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
7044 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
7045 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7047 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
7049 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
7050 * `err` or `result` depending on the state of `result_ok`.
7052 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
7054 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
7057 } LDKCResult_RoutingFeesDecodeErrorZ;
7060 * A 4-byte byte array.
7062 typedef struct LDKFourBytes {
7070 * A 12-byte byte array.
7072 typedef struct LDKTwelveBytes {
7082 * Represents a hostname for serialization purposes.
7083 * Only the character set and length will be validated.
7084 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
7085 * Its length is guaranteed to be representable by a single byte.
7086 * This serialization is used by [`BOLT 7`] hostnames.
7088 * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
7090 typedef struct MUST_USE_STRUCT LDKHostname {
7092 * A pointer to the opaque Rust object.
7093 * Nearly everywhere, inner must be non-null, however in places where
7094 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7096 LDKnativeHostname *inner;
7098 * Indicates that this is the only struct which contains the same pointer.
7099 * Rust functions which take ownership of an object provided via an argument require
7100 * this to be true and invalidate the object pointed to by inner.
7106 * An address which can be used to connect to a remote peer.
7108 typedef enum LDKNetAddress_Tag {
7110 * An IPv4 address/port on which the peer is listening.
7114 * An IPv6 address/port on which the peer is listening.
7118 * An old-style Tor onion address/port on which the peer is listening.
7120 * This field is deprecated and the Tor network generally no longer supports V2 Onion
7121 * addresses. Thus, the details are not parsed here.
7123 LDKNetAddress_OnionV2,
7125 * A new-style Tor onion address/port on which the peer is listening.
7127 * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
7128 * wrap as base32 and append \".onion\".
7130 LDKNetAddress_OnionV3,
7132 * A hostname/port on which the peer is listening.
7134 LDKNetAddress_Hostname,
7136 * Must be last for serialization purposes
7138 LDKNetAddress_Sentinel,
7139 } LDKNetAddress_Tag;
7141 typedef struct LDKNetAddress_LDKIPv4_Body {
7143 * The 4-byte IPv4 address
7145 struct LDKFourBytes addr;
7147 * The port on which the node is listening
7150 } LDKNetAddress_LDKIPv4_Body;
7152 typedef struct LDKNetAddress_LDKIPv6_Body {
7154 * The 16-byte IPv6 address
7156 struct LDKSixteenBytes addr;
7158 * The port on which the node is listening
7161 } LDKNetAddress_LDKIPv6_Body;
7163 typedef struct LDKNetAddress_LDKOnionV3_Body {
7165 * The ed25519 long-term public key of the peer
7167 struct LDKThirtyTwoBytes ed25519_pubkey;
7169 * The checksum of the pubkey and version, as included in the onion address
7173 * The version byte, as defined by the Tor Onion v3 spec.
7177 * The port on which the node is listening
7180 } LDKNetAddress_LDKOnionV3_Body;
7182 typedef struct LDKNetAddress_LDKHostname_Body {
7184 * The hostname on which the node is listening.
7186 struct LDKHostname hostname;
7188 * The port on which the node is listening.
7191 } LDKNetAddress_LDKHostname_Body;
7193 typedef struct MUST_USE_STRUCT LDKNetAddress {
7194 LDKNetAddress_Tag tag;
7196 LDKNetAddress_LDKIPv4_Body i_pv4;
7197 LDKNetAddress_LDKIPv6_Body i_pv6;
7199 struct LDKTwelveBytes onion_v2;
7201 LDKNetAddress_LDKOnionV3_Body onion_v3;
7202 LDKNetAddress_LDKHostname_Body hostname;
7207 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
7208 * This corresponds to std::vector in C++
7210 typedef struct LDKCVec_NetAddressZ {
7212 * The elements in the array.
7213 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7215 struct LDKNetAddress *data;
7217 * The number of elements pointed to by `data`.
7220 } LDKCVec_NetAddressZ;
7225 * Information received in the latest node_announcement from this node.
7227 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
7229 * A pointer to the opaque Rust object.
7230 * Nearly everywhere, inner must be non-null, however in places where
7231 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7233 LDKnativeNodeAnnouncementInfo *inner;
7235 * Indicates that this is the only struct which contains the same pointer.
7236 * Rust functions which take ownership of an object provided via an argument require
7237 * this to be true and invalidate the object pointed to by inner.
7240 } LDKNodeAnnouncementInfo;
7243 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
7245 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
7247 * A pointer to the contents in the success state.
7248 * Reading from this pointer when `result_ok` is not set is undefined.
7250 struct LDKNodeAnnouncementInfo *result;
7252 * A pointer to the contents in the error state.
7253 * Reading from this pointer when `result_ok` is set is undefined.
7255 struct LDKDecodeError *err;
7256 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
7259 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
7260 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7261 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7263 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
7265 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
7266 * `err` or `result` depending on the state of `result_ok`.
7268 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
7270 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
7273 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
7278 * A user-defined name for a node, which may be used when displaying the node in a graph.
7280 * Since node aliases are provided by third parties, they are a potential avenue for injection
7281 * attacks. Care must be taken when processing.
7283 typedef struct MUST_USE_STRUCT LDKNodeAlias {
7285 * A pointer to the opaque Rust object.
7286 * Nearly everywhere, inner must be non-null, however in places where
7287 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7289 LDKnativeNodeAlias *inner;
7291 * Indicates that this is the only struct which contains the same pointer.
7292 * Rust functions which take ownership of an object provided via an argument require
7293 * this to be true and invalidate the object pointed to by inner.
7299 * The contents of CResult_NodeAliasDecodeErrorZ
7301 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
7303 * A pointer to the contents in the success state.
7304 * Reading from this pointer when `result_ok` is not set is undefined.
7306 struct LDKNodeAlias *result;
7308 * A pointer to the contents in the error state.
7309 * Reading from this pointer when `result_ok` is set is undefined.
7311 struct LDKDecodeError *err;
7312 } LDKCResult_NodeAliasDecodeErrorZPtr;
7315 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
7316 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
7317 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7319 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
7321 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
7322 * `err` or `result` depending on the state of `result_ok`.
7324 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
7326 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
7329 } LDKCResult_NodeAliasDecodeErrorZ;
7334 * Details about a node in the network, known from the network announcement.
7336 typedef struct MUST_USE_STRUCT LDKNodeInfo {
7338 * A pointer to the opaque Rust object.
7339 * Nearly everywhere, inner must be non-null, however in places where
7340 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7342 LDKnativeNodeInfo *inner;
7344 * Indicates that this is the only struct which contains the same pointer.
7345 * Rust functions which take ownership of an object provided via an argument require
7346 * this to be true and invalidate the object pointed to by inner.
7352 * The contents of CResult_NodeInfoDecodeErrorZ
7354 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
7356 * A pointer to the contents in the success state.
7357 * Reading from this pointer when `result_ok` is not set is undefined.
7359 struct LDKNodeInfo *result;
7361 * A pointer to the contents in the error state.
7362 * Reading from this pointer when `result_ok` is set is undefined.
7364 struct LDKDecodeError *err;
7365 } LDKCResult_NodeInfoDecodeErrorZPtr;
7368 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
7369 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7370 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7372 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
7374 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
7375 * `err` or `result` depending on the state of `result_ok`.
7377 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
7379 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
7382 } LDKCResult_NodeInfoDecodeErrorZ;
7385 * The contents of CResult_NetworkGraphDecodeErrorZ
7387 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
7389 * A pointer to the contents in the success state.
7390 * Reading from this pointer when `result_ok` is not set is undefined.
7392 struct LDKNetworkGraph *result;
7394 * A pointer to the contents in the error state.
7395 * Reading from this pointer when `result_ok` is set is undefined.
7397 struct LDKDecodeError *err;
7398 } LDKCResult_NetworkGraphDecodeErrorZPtr;
7401 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
7402 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
7403 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7405 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
7407 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
7408 * `err` or `result` depending on the state of `result_ok`.
7410 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
7412 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
7415 } LDKCResult_NetworkGraphDecodeErrorZ;
7418 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
7420 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
7422 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
7424 LDKCOption_CVec_NetAddressZZ_Some,
7426 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
7428 LDKCOption_CVec_NetAddressZZ_None,
7430 * Must be last for serialization purposes
7432 LDKCOption_CVec_NetAddressZZ_Sentinel,
7433 } LDKCOption_CVec_NetAddressZZ_Tag;
7435 typedef struct LDKCOption_CVec_NetAddressZZ {
7436 LDKCOption_CVec_NetAddressZZ_Tag tag;
7439 struct LDKCVec_NetAddressZ some;
7442 } LDKCOption_CVec_NetAddressZZ;
7445 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
7447 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
7449 * A pointer to the contents in the success state.
7450 * Reading from this pointer when `result_ok` is not set is undefined.
7452 struct LDKDelayedPaymentOutputDescriptor *result;
7454 * A pointer to the contents in the error state.
7455 * Reading from this pointer when `result_ok` is set is undefined.
7457 struct LDKDecodeError *err;
7458 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
7461 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
7462 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
7463 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7465 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
7467 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
7468 * `err` or `result` depending on the state of `result_ok`.
7470 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
7472 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
7475 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
7478 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
7480 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
7482 * A pointer to the contents in the success state.
7483 * Reading from this pointer when `result_ok` is not set is undefined.
7485 struct LDKStaticPaymentOutputDescriptor *result;
7487 * A pointer to the contents in the error state.
7488 * Reading from this pointer when `result_ok` is set is undefined.
7490 struct LDKDecodeError *err;
7491 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
7494 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
7495 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
7496 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7498 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
7500 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
7501 * `err` or `result` depending on the state of `result_ok`.
7503 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
7505 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
7508 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
7511 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
7513 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
7515 * A pointer to the contents in the success state.
7516 * Reading from this pointer when `result_ok` is not set is undefined.
7518 struct LDKSpendableOutputDescriptor *result;
7520 * A pointer to the contents in the error state.
7521 * Reading from this pointer when `result_ok` is set is undefined.
7523 struct LDKDecodeError *err;
7524 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
7527 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
7528 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
7529 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7531 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
7533 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
7534 * `err` or `result` depending on the state of `result_ok`.
7536 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
7538 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
7541 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
7544 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
7545 * This corresponds to std::vector in C++
7547 typedef struct LDKCVec_PaymentPreimageZ {
7549 * The elements in the array.
7550 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7552 struct LDKThirtyTwoBytes *data;
7554 * The number of elements pointed to by `data`.
7557 } LDKCVec_PaymentPreimageZ;
7560 * A tuple of 2 elements. See the individual fields for the types contained.
7562 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
7564 * The element at position 0
7566 struct LDKSignature a;
7568 * The element at position 1
7570 struct LDKCVec_SignatureZ b;
7571 } LDKC2Tuple_SignatureCVec_SignatureZZ;
7574 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
7576 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
7578 * A pointer to the contents in the success state.
7579 * Reading from this pointer when `result_ok` is not set is undefined.
7581 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
7583 * Note that this value is always NULL, as there are no contents in the Err variant
7586 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
7589 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
7590 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
7591 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7593 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
7595 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
7596 * `err` or `result` depending on the state of `result_ok`.
7598 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
7600 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
7603 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
7606 * The contents of CResult_SignatureNoneZ
7608 typedef union LDKCResult_SignatureNoneZPtr {
7610 * A pointer to the contents in the success state.
7611 * Reading from this pointer when `result_ok` is not set is undefined.
7613 struct LDKSignature *result;
7615 * Note that this value is always NULL, as there are no contents in the Err variant
7618 } LDKCResult_SignatureNoneZPtr;
7621 * A CResult_SignatureNoneZ represents the result of a fallible operation,
7622 * containing a crate::c_types::Signature on success and a () on failure.
7623 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7625 typedef struct LDKCResult_SignatureNoneZ {
7627 * The contents of this CResult_SignatureNoneZ, accessible via either
7628 * `err` or `result` depending on the state of `result_ok`.
7630 union LDKCResult_SignatureNoneZPtr contents;
7632 * Whether this CResult_SignatureNoneZ represents a success state.
7635 } LDKCResult_SignatureNoneZ;
7638 * The contents of CResult_PublicKeyNoneZ
7640 typedef union LDKCResult_PublicKeyNoneZPtr {
7642 * A pointer to the contents in the success state.
7643 * Reading from this pointer when `result_ok` is not set is undefined.
7645 struct LDKPublicKey *result;
7647 * Note that this value is always NULL, as there are no contents in the Err variant
7650 } LDKCResult_PublicKeyNoneZPtr;
7653 * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
7654 * containing a crate::c_types::PublicKey on success and a () on failure.
7655 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7657 typedef struct LDKCResult_PublicKeyNoneZ {
7659 * The contents of this CResult_PublicKeyNoneZ, accessible via either
7660 * `err` or `result` depending on the state of `result_ok`.
7662 union LDKCResult_PublicKeyNoneZPtr contents;
7664 * Whether this CResult_PublicKeyNoneZ represents a success state.
7667 } LDKCResult_PublicKeyNoneZ;
7670 * An enum which can either contain a crate::c_types::BigEndianScalar or not
7672 typedef enum LDKCOption_ScalarZ_Tag {
7674 * When we're in this state, this COption_ScalarZ contains a crate::c_types::BigEndianScalar
7676 LDKCOption_ScalarZ_Some,
7678 * When we're in this state, this COption_ScalarZ contains nothing
7680 LDKCOption_ScalarZ_None,
7682 * Must be last for serialization purposes
7684 LDKCOption_ScalarZ_Sentinel,
7685 } LDKCOption_ScalarZ_Tag;
7687 typedef struct LDKCOption_ScalarZ {
7688 LDKCOption_ScalarZ_Tag tag;
7691 struct LDKBigEndianScalar some;
7694 } LDKCOption_ScalarZ;
7697 * The contents of CResult_SharedSecretNoneZ
7699 typedef union LDKCResult_SharedSecretNoneZPtr {
7701 * A pointer to the contents in the success state.
7702 * Reading from this pointer when `result_ok` is not set is undefined.
7704 struct LDKThirtyTwoBytes *result;
7706 * Note that this value is always NULL, as there are no contents in the Err variant
7709 } LDKCResult_SharedSecretNoneZPtr;
7712 * A CResult_SharedSecretNoneZ represents the result of a fallible operation,
7713 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
7714 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7716 typedef struct LDKCResult_SharedSecretNoneZ {
7718 * The contents of this CResult_SharedSecretNoneZ, accessible via either
7719 * `err` or `result` depending on the state of `result_ok`.
7721 union LDKCResult_SharedSecretNoneZPtr contents;
7723 * Whether this CResult_SharedSecretNoneZ represents a success state.
7726 } LDKCResult_SharedSecretNoneZ;
7729 * Integer in the range `0..32`
7731 typedef struct LDKU5 {
7736 * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
7737 * This corresponds to std::vector in C++
7739 typedef struct LDKCVec_U5Z {
7741 * The elements in the array.
7742 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7746 * The number of elements pointed to by `data`.
7752 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
7753 * allows recovering the exact public key which created the signature given the message.
7755 typedef struct LDKRecoverableSignature {
7757 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
7760 uint8_t serialized_form[68];
7761 } LDKRecoverableSignature;
7764 * The contents of CResult_RecoverableSignatureNoneZ
7766 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
7768 * A pointer to the contents in the success state.
7769 * Reading from this pointer when `result_ok` is not set is undefined.
7771 struct LDKRecoverableSignature *result;
7773 * Note that this value is always NULL, as there are no contents in the Err variant
7776 } LDKCResult_RecoverableSignatureNoneZPtr;
7779 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
7780 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
7781 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7783 typedef struct LDKCResult_RecoverableSignatureNoneZ {
7785 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
7786 * `err` or `result` depending on the state of `result_ok`.
7788 union LDKCResult_RecoverableSignatureNoneZPtr contents;
7790 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
7793 } LDKCResult_RecoverableSignatureNoneZ;
7798 * This class tracks the per-transaction information needed to build a closing transaction and will
7799 * actually build it and sign.
7801 * This class can be used inside a signer implementation to generate a signature given the relevant
7804 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
7806 * A pointer to the opaque Rust object.
7807 * Nearly everywhere, inner must be non-null, however in places where
7808 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7810 LDKnativeClosingTransaction *inner;
7812 * Indicates that this is the only struct which contains the same pointer.
7813 * Rust functions which take ownership of an object provided via an argument require
7814 * this to be true and invalidate the object pointed to by inner.
7817 } LDKClosingTransaction;
7822 * The unsigned part of a [`channel_announcement`] message.
7824 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
7826 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
7828 * A pointer to the opaque Rust object.
7829 * Nearly everywhere, inner must be non-null, however in places where
7830 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7832 LDKnativeUnsignedChannelAnnouncement *inner;
7834 * Indicates that this is the only struct which contains the same pointer.
7835 * Rust functions which take ownership of an object provided via an argument require
7836 * this to be true and invalidate the object pointed to by inner.
7839 } LDKUnsignedChannelAnnouncement;
7842 * A trait to handle Lightning channel key material without concretizing the channel type or
7843 * the signature mechanism.
7845 typedef struct LDKChannelSigner {
7847 * An opaque pointer which is passed to your function implementations as an argument.
7848 * This has no meaning in the LDK, and can be NULL or any other value.
7852 * Gets the per-commitment point for a specific commitment number
7854 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
7856 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
7858 * Gets the commitment secret for a specific commitment number as part of the revocation process
7860 * An external signer implementation should error here if the commitment was already signed
7861 * and should refuse to sign it in the future.
7863 * May be called more than once for the same index.
7865 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
7867 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
7869 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
7871 * This is required in order for the signer to make sure that releasing a commitment
7872 * secret won't leave us without a broadcastable holder transaction.
7873 * Policy checks should be implemented in this function, including checking the amount
7874 * sent to us and checking the HTLCs.
7876 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
7877 * A validating signer should ensure that an HTLC output is removed only when the matching
7878 * preimage is provided, or when the value to holder is restored.
7880 * Note that all the relevant preimages will be provided, but there may also be additional
7881 * irrelevant or duplicate preimages.
7883 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages);
7885 * Returns the holder's channel public keys and basepoints.
7887 LDKChannelPublicKeys pubkeys;
7889 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
7890 * Note that this takes a pointer to this object, not the this_ptr like other methods do
7891 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
7893 void (*set_pubkeys)(const struct LDKChannelSigner*NONNULL_PTR );
7895 * Returns an arbitrary identifier describing the set of keys which are provided back to you in
7896 * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
7897 * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys.
7899 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
7901 * Set the counterparty static channel data, including basepoints,
7902 * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
7904 * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
7905 * instance, LDK will call this method exactly once - either immediately after construction
7906 * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
7907 * information has been generated.
7909 * channel_parameters.is_populated() MUST be true.
7911 void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
7913 * Frees any resources associated with this object given its this_arg pointer.
7914 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7916 void (*free)(void *this_arg);
7920 * A trait to sign Lightning channel transactions as described in
7921 * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
7923 * Signing services could be implemented on a hardware wallet and should implement signing
7924 * policies in order to be secure. Please refer to the [VLS Policy
7925 * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
7926 * for an example of such policies.
7928 typedef struct LDKEcdsaChannelSigner {
7930 * An opaque pointer which is passed to your function implementations as an argument.
7931 * This has no meaning in the LDK, and can be NULL or any other value.
7935 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
7937 * Note that if signing fails or is rejected, the channel will be force-closed.
7939 * Policy checks should be implemented in this function, including checking the amount
7940 * sent to us and checking the HTLCs.
7942 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
7943 * A validating signer should ensure that an HTLC output is removed only when the matching
7944 * preimage is provided, or when the value to holder is restored.
7946 * Note that all the relevant preimages will be provided, but there may also be additional
7947 * irrelevant or duplicate preimages.
7949 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages);
7951 * Validate the counterparty's revocation.
7953 * This is required in order for the signer to make sure that the state has moved
7954 * forward and it is safe to sign the next counterparty commitment.
7956 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
7958 * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions.
7960 * This will be called
7961 * - with a non-revoked `commitment_tx`.
7962 * - with the latest `commitment_tx` when we initiate a force-close.
7963 * - with the previous `commitment_tx`, just to get claiming HTLC
7964 * signatures, if we are reacting to a [`ChannelMonitor`]
7965 * [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
7966 * that decided to broadcast before it had been updated to the latest `commitment_tx`.
7968 * This may be called multiple times for the same transaction.
7970 * An external signer implementation should check that the commitment has not been revoked.
7972 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
7974 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
7976 * Create a signature for the given input in a transaction spending an HTLC transaction output
7977 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
7979 * A justice transaction may claim multiple outputs at the same time if timelocks are
7980 * similar, but only a signature for the input at index `input` should be signed for here.
7981 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
7982 * to an upcoming timelock expiration.
7984 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
7986 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
7987 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
7988 * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
7991 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]);
7993 * Create a signature for the given input in a transaction spending a commitment transaction
7994 * HTLC output when our counterparty broadcasts an old state.
7996 * A justice transaction may claim multiple outputs at the same time if timelocks are
7997 * similar, but only a signature for the input at index `input` should be signed for here.
7998 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
7999 * to an upcoming timelock expiration.
8001 * `amount` is the value of the output spent by this input, committed to in the BIP 143
8004 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
8005 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
8006 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
8009 * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
8010 * (which is committed to in the BIP 143 signatures).
8012 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);
8014 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
8015 * transaction, either offered or received.
8017 * Such a transaction may claim multiples offered outputs at same time if we know the
8018 * preimage for each when we create it, but only the input at index `input` should be
8019 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
8020 * needed with regards to an upcoming timelock expiration.
8022 * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
8025 * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
8027 * `per_commitment_point` is the dynamic point corresponding to the channel state
8028 * detected onchain. It has been generated by our counterparty and is used to derive
8029 * channel state keys, which are then included in the witness script and committed to in the
8030 * BIP 143 signature.
8032 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);
8034 * Create a signature for a (proposed) closing transaction.
8036 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
8037 * chosen to forgo their output as dust.
8039 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
8041 * Computes the signature for a commitment transaction's anchor output used as an
8042 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
8044 struct LDKCResult_SignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
8046 * Signs a channel announcement message with our funding key proving it comes from one of the
8047 * channel participants.
8049 * Channel announcements also require a signature from each node's network key. Our node
8050 * signature is computed through [`NodeSigner::sign_gossip_message`].
8052 * Note that if this fails or is rejected, the channel will not be publicly announced and
8053 * our counterparty may (though likely will not) close the channel on us for violating the
8056 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement_with_funding_key)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
8058 * Implementation of ChannelSigner for this object.
8060 struct LDKChannelSigner ChannelSigner;
8062 * Frees any resources associated with this object given its this_arg pointer.
8063 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8065 void (*free)(void *this_arg);
8066 } LDKEcdsaChannelSigner;
8069 * A writeable signer.
8071 * There will always be two instances of a signer per channel, one occupied by the
8072 * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
8074 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
8075 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
8077 typedef struct LDKWriteableEcdsaChannelSigner {
8079 * An opaque pointer which is passed to your function implementations as an argument.
8080 * This has no meaning in the LDK, and can be NULL or any other value.
8084 * Implementation of EcdsaChannelSigner for this object.
8086 struct LDKEcdsaChannelSigner EcdsaChannelSigner;
8088 * Serialize the object into a byte array
8090 struct LDKCVec_u8Z (*write)(const void *this_arg);
8092 * Frees any resources associated with this object given its this_arg pointer.
8093 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8095 void (*free)(void *this_arg);
8096 } LDKWriteableEcdsaChannelSigner;
8099 * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
8101 typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
8103 * A pointer to the contents in the success state.
8104 * Reading from this pointer when `result_ok` is not set is undefined.
8106 struct LDKWriteableEcdsaChannelSigner *result;
8108 * A pointer to the contents in the error state.
8109 * Reading from this pointer when `result_ok` is set is undefined.
8111 struct LDKDecodeError *err;
8112 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr;
8115 * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
8116 * containing a crate::lightning::chain::keysinterface::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
8117 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8119 typedef struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ {
8121 * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
8122 * `err` or `result` depending on the state of `result_ok`.
8124 union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
8126 * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
8129 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
8132 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
8133 * This corresponds to std::vector in C++
8135 typedef struct LDKCVec_CVec_u8ZZ {
8137 * The elements in the array.
8138 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8140 struct LDKCVec_u8Z *data;
8142 * The number of elements pointed to by `data`.
8145 } LDKCVec_CVec_u8ZZ;
8148 * The contents of CResult_CVec_CVec_u8ZZNoneZ
8150 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
8152 * A pointer to the contents in the success state.
8153 * Reading from this pointer when `result_ok` is not set is undefined.
8155 struct LDKCVec_CVec_u8ZZ *result;
8157 * Note that this value is always NULL, as there are no contents in the Err variant
8160 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
8163 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
8164 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
8165 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8167 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
8169 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
8170 * `err` or `result` depending on the state of `result_ok`.
8172 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
8174 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
8177 } LDKCResult_CVec_CVec_u8ZZNoneZ;
8182 * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
8184 * This implementation performs no policy checks and is insufficient by itself as
8185 * a secure external signer.
8187 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
8189 * A pointer to the opaque Rust object.
8190 * Nearly everywhere, inner must be non-null, however in places where
8191 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8193 LDKnativeInMemorySigner *inner;
8195 * Indicates that this is the only struct which contains the same pointer.
8196 * Rust functions which take ownership of an object provided via an argument require
8197 * this to be true and invalidate the object pointed to by inner.
8200 } LDKInMemorySigner;
8203 * The contents of CResult_InMemorySignerDecodeErrorZ
8205 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
8207 * A pointer to the contents in the success state.
8208 * Reading from this pointer when `result_ok` is not set is undefined.
8210 struct LDKInMemorySigner *result;
8212 * A pointer to the contents in the error state.
8213 * Reading from this pointer when `result_ok` is set is undefined.
8215 struct LDKDecodeError *err;
8216 } LDKCResult_InMemorySignerDecodeErrorZPtr;
8219 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
8220 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
8221 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8223 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
8225 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
8226 * `err` or `result` depending on the state of `result_ok`.
8228 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
8230 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
8233 } LDKCResult_InMemorySignerDecodeErrorZ;
8236 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
8237 * This corresponds to std::vector in C++
8239 typedef struct LDKCVec_TxOutZ {
8241 * The elements in the array.
8242 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8244 struct LDKTxOut *data;
8246 * The number of elements pointed to by `data`.
8252 * The contents of CResult_TransactionNoneZ
8254 typedef union LDKCResult_TransactionNoneZPtr {
8256 * A pointer to the contents in the success state.
8257 * Reading from this pointer when `result_ok` is not set is undefined.
8259 struct LDKTransaction *result;
8261 * Note that this value is always NULL, as there are no contents in the Err variant
8264 } LDKCResult_TransactionNoneZPtr;
8267 * A CResult_TransactionNoneZ represents the result of a fallible operation,
8268 * containing a crate::c_types::Transaction on success and a () on failure.
8269 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8271 typedef struct LDKCResult_TransactionNoneZ {
8273 * The contents of this CResult_TransactionNoneZ, accessible via either
8274 * `err` or `result` depending on the state of `result_ok`.
8276 union LDKCResult_TransactionNoneZPtr contents;
8278 * Whether this CResult_TransactionNoneZ represents a success state.
8281 } LDKCResult_TransactionNoneZ;
8286 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
8287 * on-chain transactions to ensure no loss of funds occurs.
8289 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
8290 * information and are actively monitoring the chain.
8292 * Pending Events or updated HTLCs which have not yet been read out by
8293 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
8294 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
8295 * gotten are fully handled before re-serializing the new state.
8297 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
8298 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
8299 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
8300 * returned block hash and the the current chain and then reconnecting blocks to get to the
8301 * best chain) upon deserializing the object!
8303 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
8305 * A pointer to the opaque Rust object.
8306 * Nearly everywhere, inner must be non-null, however in places where
8307 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8309 LDKnativeChannelMonitor *inner;
8311 * Indicates that this is the only struct which contains the same pointer.
8312 * Rust functions which take ownership of an object provided via an argument require
8313 * this to be true and invalidate the object pointed to by inner.
8316 } LDKChannelMonitor;
8319 * A tuple of 2 elements. See the individual fields for the types contained.
8321 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
8323 * The element at position 0
8325 struct LDKThirtyTwoBytes a;
8327 * The element at position 1
8329 struct LDKChannelMonitor b;
8330 } LDKC2Tuple_BlockHashChannelMonitorZ;
8333 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
8334 * This corresponds to std::vector in C++
8336 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
8338 * The elements in the array.
8339 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8341 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
8343 * The number of elements pointed to by `data`.
8346 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
8349 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
8351 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
8353 * A pointer to the contents in the success state.
8354 * Reading from this pointer when `result_ok` is not set is undefined.
8356 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
8358 * A pointer to the contents in the error state.
8359 * Reading from this pointer when `result_ok` is set is undefined.
8361 enum LDKIOError *err;
8362 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
8365 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
8366 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
8367 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8369 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
8371 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
8372 * `err` or `result` depending on the state of `result_ok`.
8374 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
8376 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
8379 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
8382 * An enum which can either contain a u16 or not
8384 typedef enum LDKCOption_u16Z_Tag {
8386 * When we're in this state, this COption_u16Z contains a u16
8388 LDKCOption_u16Z_Some,
8390 * When we're in this state, this COption_u16Z contains nothing
8392 LDKCOption_u16Z_None,
8394 * Must be last for serialization purposes
8396 LDKCOption_u16Z_Sentinel,
8397 } LDKCOption_u16Z_Tag;
8399 typedef struct LDKCOption_u16Z {
8400 LDKCOption_u16Z_Tag tag;
8409 * The contents of CResult__u832APIErrorZ
8411 typedef union LDKCResult__u832APIErrorZPtr {
8413 * A pointer to the contents in the success state.
8414 * Reading from this pointer when `result_ok` is not set is undefined.
8416 struct LDKThirtyTwoBytes *result;
8418 * A pointer to the contents in the error state.
8419 * Reading from this pointer when `result_ok` is set is undefined.
8421 struct LDKAPIError *err;
8422 } LDKCResult__u832APIErrorZPtr;
8425 * A CResult__u832APIErrorZ represents the result of a fallible operation,
8426 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
8427 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8429 typedef struct LDKCResult__u832APIErrorZ {
8431 * The contents of this CResult__u832APIErrorZ, accessible via either
8432 * `err` or `result` depending on the state of `result_ok`.
8434 union LDKCResult__u832APIErrorZPtr contents;
8436 * Whether this CResult__u832APIErrorZ represents a success state.
8439 } LDKCResult__u832APIErrorZ;
8442 * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
8443 * These include payments that have yet to find a successful path, or have unresolved HTLCs.
8445 typedef enum LDKRecentPaymentDetails_Tag {
8447 * When a payment is still being sent and awaiting successful delivery.
8449 LDKRecentPaymentDetails_Pending,
8451 * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
8452 * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
8453 * payment is removed from tracking.
8455 LDKRecentPaymentDetails_Fulfilled,
8457 * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
8458 * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
8459 * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
8461 LDKRecentPaymentDetails_Abandoned,
8463 * Must be last for serialization purposes
8465 LDKRecentPaymentDetails_Sentinel,
8466 } LDKRecentPaymentDetails_Tag;
8468 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
8470 * Hash of the payment that is currently being sent but has yet to be fulfilled or
8473 struct LDKThirtyTwoBytes payment_hash;
8475 * Total amount (in msat, excluding fees) across all paths for this payment,
8476 * not just the amount currently inflight.
8478 uint64_t total_msat;
8479 } LDKRecentPaymentDetails_LDKPending_Body;
8481 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
8483 * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
8484 * made before LDK version 0.0.104.
8486 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8488 struct LDKThirtyTwoBytes payment_hash;
8489 } LDKRecentPaymentDetails_LDKFulfilled_Body;
8491 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
8493 * Hash of the payment that we have given up trying to send.
8495 struct LDKThirtyTwoBytes payment_hash;
8496 } LDKRecentPaymentDetails_LDKAbandoned_Body;
8498 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
8499 LDKRecentPaymentDetails_Tag tag;
8501 LDKRecentPaymentDetails_LDKPending_Body pending;
8502 LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
8503 LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
8505 } LDKRecentPaymentDetails;
8508 * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
8509 * This corresponds to std::vector in C++
8511 typedef struct LDKCVec_RecentPaymentDetailsZ {
8513 * The elements in the array.
8514 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8516 struct LDKRecentPaymentDetails *data;
8518 * The number of elements pointed to by `data`.
8521 } LDKCVec_RecentPaymentDetailsZ;
8524 * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
8525 * of several states. This enum is returned as the Err() type describing which state the payment
8526 * is in, see the description of individual enum states for more.
8528 * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
8530 typedef enum LDKPaymentSendFailure_Tag {
8532 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
8533 * send the payment at all.
8535 * You can freely resend the payment in full (with the parameter error fixed).
8537 * Because the payment failed outright, no payment tracking is done and no
8538 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8540 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8541 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8543 LDKPaymentSendFailure_ParameterError,
8545 * A parameter in a single path which was passed to send_payment was invalid, preventing us
8546 * from attempting to send the payment at all.
8548 * You can freely resend the payment in full (with the parameter error fixed).
8550 * Because the payment failed outright, no payment tracking is done and no
8551 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8553 * The results here are ordered the same as the paths in the route object which was passed to
8556 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8557 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8559 LDKPaymentSendFailure_PathParameterError,
8561 * All paths which were attempted failed to send, with no channel state change taking place.
8562 * You can freely resend the payment in full (though you probably want to do so over different
8563 * paths than the ones selected).
8565 * Because the payment failed outright, no payment tracking is done and no
8566 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8568 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8569 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8571 LDKPaymentSendFailure_AllFailedResendSafe,
8573 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
8574 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
8576 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
8577 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
8578 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8580 LDKPaymentSendFailure_DuplicatePayment,
8582 * Some paths that were attempted failed to send, though some paths may have succeeded. At least
8583 * some paths have irrevocably committed to the HTLC.
8585 * The results here are ordered the same as the paths in the route object that was passed to
8588 * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
8589 * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
8591 * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
8593 LDKPaymentSendFailure_PartialFailure,
8595 * Must be last for serialization purposes
8597 LDKPaymentSendFailure_Sentinel,
8598 } LDKPaymentSendFailure_Tag;
8600 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
8602 * The errors themselves, in the same order as the paths from the route.
8604 struct LDKCVec_CResult_NoneAPIErrorZZ results;
8606 * If some paths failed without irrevocably committing to the new HTLC(s), this will
8607 * contain a [`RouteParameters`] object for the failing paths.
8609 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8611 struct LDKRouteParameters failed_paths_retry;
8613 * The payment id for the payment, which is now at least partially pending.
8615 struct LDKThirtyTwoBytes payment_id;
8616 } LDKPaymentSendFailure_LDKPartialFailure_Body;
8618 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
8619 LDKPaymentSendFailure_Tag tag;
8622 struct LDKAPIError parameter_error;
8625 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
8628 struct LDKCVec_APIErrorZ all_failed_resend_safe;
8630 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
8632 } LDKPaymentSendFailure;
8635 * The contents of CResult_NonePaymentSendFailureZ
8637 typedef union LDKCResult_NonePaymentSendFailureZPtr {
8639 * Note that this value is always NULL, as there are no contents in the OK variant
8643 * A pointer to the contents in the error state.
8644 * Reading from this pointer when `result_ok` is set is undefined.
8646 struct LDKPaymentSendFailure *err;
8647 } LDKCResult_NonePaymentSendFailureZPtr;
8650 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
8651 * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8652 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8654 typedef struct LDKCResult_NonePaymentSendFailureZ {
8656 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
8657 * `err` or `result` depending on the state of `result_ok`.
8659 union LDKCResult_NonePaymentSendFailureZPtr contents;
8661 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
8664 } LDKCResult_NonePaymentSendFailureZ;
8667 * The contents of CResult_NoneRetryableSendFailureZ
8669 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
8671 * Note that this value is always NULL, as there are no contents in the OK variant
8675 * A pointer to the contents in the error state.
8676 * Reading from this pointer when `result_ok` is set is undefined.
8678 enum LDKRetryableSendFailure *err;
8679 } LDKCResult_NoneRetryableSendFailureZPtr;
8682 * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
8683 * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8684 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8686 typedef struct LDKCResult_NoneRetryableSendFailureZ {
8688 * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
8689 * `err` or `result` depending on the state of `result_ok`.
8691 union LDKCResult_NoneRetryableSendFailureZPtr contents;
8693 * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
8696 } LDKCResult_NoneRetryableSendFailureZ;
8699 * The contents of CResult_PaymentHashPaymentSendFailureZ
8701 typedef union LDKCResult_PaymentHashPaymentSendFailureZPtr {
8703 * A pointer to the contents in the success state.
8704 * Reading from this pointer when `result_ok` is not set is undefined.
8706 struct LDKThirtyTwoBytes *result;
8708 * A pointer to the contents in the error state.
8709 * Reading from this pointer when `result_ok` is set is undefined.
8711 struct LDKPaymentSendFailure *err;
8712 } LDKCResult_PaymentHashPaymentSendFailureZPtr;
8715 * A CResult_PaymentHashPaymentSendFailureZ represents the result of a fallible operation,
8716 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8717 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8719 typedef struct LDKCResult_PaymentHashPaymentSendFailureZ {
8721 * The contents of this CResult_PaymentHashPaymentSendFailureZ, accessible via either
8722 * `err` or `result` depending on the state of `result_ok`.
8724 union LDKCResult_PaymentHashPaymentSendFailureZPtr contents;
8726 * Whether this CResult_PaymentHashPaymentSendFailureZ represents a success state.
8729 } LDKCResult_PaymentHashPaymentSendFailureZ;
8732 * The contents of CResult_PaymentHashRetryableSendFailureZ
8734 typedef union LDKCResult_PaymentHashRetryableSendFailureZPtr {
8736 * A pointer to the contents in the success state.
8737 * Reading from this pointer when `result_ok` is not set is undefined.
8739 struct LDKThirtyTwoBytes *result;
8741 * A pointer to the contents in the error state.
8742 * Reading from this pointer when `result_ok` is set is undefined.
8744 enum LDKRetryableSendFailure *err;
8745 } LDKCResult_PaymentHashRetryableSendFailureZPtr;
8748 * A CResult_PaymentHashRetryableSendFailureZ represents the result of a fallible operation,
8749 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8750 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8752 typedef struct LDKCResult_PaymentHashRetryableSendFailureZ {
8754 * The contents of this CResult_PaymentHashRetryableSendFailureZ, accessible via either
8755 * `err` or `result` depending on the state of `result_ok`.
8757 union LDKCResult_PaymentHashRetryableSendFailureZPtr contents;
8759 * Whether this CResult_PaymentHashRetryableSendFailureZ represents a success state.
8762 } LDKCResult_PaymentHashRetryableSendFailureZ;
8765 * A tuple of 2 elements. See the individual fields for the types contained.
8767 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
8769 * The element at position 0
8771 struct LDKThirtyTwoBytes a;
8773 * The element at position 1
8775 struct LDKThirtyTwoBytes b;
8776 } LDKC2Tuple_PaymentHashPaymentIdZ;
8779 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
8781 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
8783 * A pointer to the contents in the success state.
8784 * Reading from this pointer when `result_ok` is not set is undefined.
8786 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
8788 * A pointer to the contents in the error state.
8789 * Reading from this pointer when `result_ok` is set is undefined.
8791 struct LDKPaymentSendFailure *err;
8792 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
8795 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
8796 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8797 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8799 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
8801 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
8802 * `err` or `result` depending on the state of `result_ok`.
8804 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
8806 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
8809 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
8812 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
8813 * This corresponds to std::vector in C++
8815 typedef struct LDKCVec_ThirtyTwoBytesZ {
8817 * The elements in the array.
8818 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8820 struct LDKThirtyTwoBytes *data;
8822 * The number of elements pointed to by `data`.
8825 } LDKCVec_ThirtyTwoBytesZ;
8828 * A tuple of 2 elements. See the individual fields for the types contained.
8830 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
8832 * The element at position 0
8834 struct LDKThirtyTwoBytes a;
8836 * The element at position 1
8838 struct LDKThirtyTwoBytes b;
8839 } LDKC2Tuple_PaymentHashPaymentSecretZ;
8842 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
8844 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
8846 * A pointer to the contents in the success state.
8847 * Reading from this pointer when `result_ok` is not set is undefined.
8849 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
8851 * Note that this value is always NULL, as there are no contents in the Err variant
8854 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
8857 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
8858 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
8859 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8861 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
8863 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
8864 * `err` or `result` depending on the state of `result_ok`.
8866 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
8868 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
8871 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
8874 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
8876 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
8878 * A pointer to the contents in the success state.
8879 * Reading from this pointer when `result_ok` is not set is undefined.
8881 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
8883 * A pointer to the contents in the error state.
8884 * Reading from this pointer when `result_ok` is set is undefined.
8886 struct LDKAPIError *err;
8887 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
8890 * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
8891 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
8892 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8894 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
8896 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
8897 * `err` or `result` depending on the state of `result_ok`.
8899 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
8901 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
8904 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
8907 * The contents of CResult_PaymentSecretNoneZ
8909 typedef union LDKCResult_PaymentSecretNoneZPtr {
8911 * A pointer to the contents in the success state.
8912 * Reading from this pointer when `result_ok` is not set is undefined.
8914 struct LDKThirtyTwoBytes *result;
8916 * Note that this value is always NULL, as there are no contents in the Err variant
8919 } LDKCResult_PaymentSecretNoneZPtr;
8922 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
8923 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
8924 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8926 typedef struct LDKCResult_PaymentSecretNoneZ {
8928 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
8929 * `err` or `result` depending on the state of `result_ok`.
8931 union LDKCResult_PaymentSecretNoneZPtr contents;
8933 * Whether this CResult_PaymentSecretNoneZ represents a success state.
8936 } LDKCResult_PaymentSecretNoneZ;
8939 * The contents of CResult_PaymentSecretAPIErrorZ
8941 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
8943 * A pointer to the contents in the success state.
8944 * Reading from this pointer when `result_ok` is not set is undefined.
8946 struct LDKThirtyTwoBytes *result;
8948 * A pointer to the contents in the error state.
8949 * Reading from this pointer when `result_ok` is set is undefined.
8951 struct LDKAPIError *err;
8952 } LDKCResult_PaymentSecretAPIErrorZPtr;
8955 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
8956 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
8957 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8959 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
8961 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
8962 * `err` or `result` depending on the state of `result_ok`.
8964 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
8966 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
8969 } LDKCResult_PaymentSecretAPIErrorZ;
8972 * The contents of CResult_PaymentPreimageAPIErrorZ
8974 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
8976 * A pointer to the contents in the success state.
8977 * Reading from this pointer when `result_ok` is not set is undefined.
8979 struct LDKThirtyTwoBytes *result;
8981 * A pointer to the contents in the error state.
8982 * Reading from this pointer when `result_ok` is set is undefined.
8984 struct LDKAPIError *err;
8985 } LDKCResult_PaymentPreimageAPIErrorZPtr;
8988 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
8989 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
8990 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8992 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
8994 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
8995 * `err` or `result` depending on the state of `result_ok`.
8997 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
8999 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
9002 } LDKCResult_PaymentPreimageAPIErrorZ;
9007 * Information needed for constructing an invoice route hint for this channel.
9009 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
9011 * A pointer to the opaque Rust object.
9012 * Nearly everywhere, inner must be non-null, however in places where
9013 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9015 LDKnativeCounterpartyForwardingInfo *inner;
9017 * Indicates that this is the only struct which contains the same pointer.
9018 * Rust functions which take ownership of an object provided via an argument require
9019 * this to be true and invalidate the object pointed to by inner.
9022 } LDKCounterpartyForwardingInfo;
9025 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
9027 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
9029 * A pointer to the contents in the success state.
9030 * Reading from this pointer when `result_ok` is not set is undefined.
9032 struct LDKCounterpartyForwardingInfo *result;
9034 * A pointer to the contents in the error state.
9035 * Reading from this pointer when `result_ok` is set is undefined.
9037 struct LDKDecodeError *err;
9038 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
9041 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
9042 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
9043 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9045 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
9047 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
9048 * `err` or `result` depending on the state of `result_ok`.
9050 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
9052 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
9055 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
9060 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
9061 * to better separate parameters.
9063 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
9065 * A pointer to the opaque Rust object.
9066 * Nearly everywhere, inner must be non-null, however in places where
9067 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9069 LDKnativeChannelCounterparty *inner;
9071 * Indicates that this is the only struct which contains the same pointer.
9072 * Rust functions which take ownership of an object provided via an argument require
9073 * this to be true and invalidate the object pointed to by inner.
9076 } LDKChannelCounterparty;
9079 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
9081 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
9083 * A pointer to the contents in the success state.
9084 * Reading from this pointer when `result_ok` is not set is undefined.
9086 struct LDKChannelCounterparty *result;
9088 * A pointer to the contents in the error state.
9089 * Reading from this pointer when `result_ok` is set is undefined.
9091 struct LDKDecodeError *err;
9092 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
9095 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
9096 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
9097 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9099 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
9101 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
9102 * `err` or `result` depending on the state of `result_ok`.
9104 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
9106 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
9109 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
9112 * The contents of CResult_ChannelDetailsDecodeErrorZ
9114 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
9116 * A pointer to the contents in the success state.
9117 * Reading from this pointer when `result_ok` is not set is undefined.
9119 struct LDKChannelDetails *result;
9121 * A pointer to the contents in the error state.
9122 * Reading from this pointer when `result_ok` is set is undefined.
9124 struct LDKDecodeError *err;
9125 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
9128 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
9129 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
9130 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9132 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
9134 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
9135 * `err` or `result` depending on the state of `result_ok`.
9137 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
9139 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
9142 } LDKCResult_ChannelDetailsDecodeErrorZ;
9147 * Route hints used in constructing invoices for [phantom node payents].
9149 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
9151 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
9153 * A pointer to the opaque Rust object.
9154 * Nearly everywhere, inner must be non-null, however in places where
9155 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9157 LDKnativePhantomRouteHints *inner;
9159 * Indicates that this is the only struct which contains the same pointer.
9160 * Rust functions which take ownership of an object provided via an argument require
9161 * this to be true and invalidate the object pointed to by inner.
9164 } LDKPhantomRouteHints;
9167 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
9169 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
9171 * A pointer to the contents in the success state.
9172 * Reading from this pointer when `result_ok` is not set is undefined.
9174 struct LDKPhantomRouteHints *result;
9176 * A pointer to the contents in the error state.
9177 * Reading from this pointer when `result_ok` is set is undefined.
9179 struct LDKDecodeError *err;
9180 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
9183 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
9184 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
9185 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9187 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
9189 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
9190 * `err` or `result` depending on the state of `result_ok`.
9192 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
9194 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
9197 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
9200 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
9201 * This corresponds to std::vector in C++
9203 typedef struct LDKCVec_ChannelMonitorZ {
9205 * The elements in the array.
9206 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9208 struct LDKChannelMonitor *data;
9210 * The number of elements pointed to by `data`.
9213 } LDKCVec_ChannelMonitorZ;
9218 * An update generated by the underlying channel itself which contains some new information the
9219 * [`ChannelMonitor`] should be made aware of.
9221 * Because this represents only a small number of updates to the underlying state, it is generally
9222 * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
9223 * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
9224 * transaction), a single update may reach upwards of 1 MiB in serialized size.
9226 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
9228 * A pointer to the opaque Rust object.
9229 * Nearly everywhere, inner must be non-null, however in places where
9230 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9232 LDKnativeChannelMonitorUpdate *inner;
9234 * Indicates that this is the only struct which contains the same pointer.
9235 * Rust functions which take ownership of an object provided via an argument require
9236 * this to be true and invalidate the object pointed to by inner.
9239 } LDKChannelMonitorUpdate;
9242 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
9243 * blocks are connected and disconnected.
9245 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
9246 * responsible for maintaining a set of monitors such that they can be updated accordingly as
9247 * channel state changes and HTLCs are resolved. See method documentation for specific
9250 * Implementations **must** ensure that updates are successfully applied and persisted upon method
9251 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
9252 * without taking any further action such as persisting the current state.
9254 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
9255 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
9256 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
9257 * funds in the channel. See [`ChannelMonitorUpdateStatus`] for more details about how to handle
9258 * multiple instances.
9260 * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
9262 typedef struct LDKWatch {
9264 * An opaque pointer which is passed to your function implementations as an argument.
9265 * This has no meaning in the LDK, and can be NULL or any other value.
9269 * Watches a channel identified by `funding_txo` using `monitor`.
9271 * Implementations are responsible for watching the chain for the funding transaction along
9272 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
9273 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
9275 * Note: this interface MUST error with [`ChannelMonitorUpdateStatus::PermanentFailure`] if
9276 * the given `funding_txo` has previously been registered via `watch_channel`.
9278 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
9279 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
9280 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
9282 enum LDKChannelMonitorUpdateStatus (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
9284 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
9286 * Implementations must call [`update_monitor`] with the given update. See
9287 * [`ChannelMonitorUpdateStatus`] for invariants around returning an error.
9289 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
9291 enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
9293 * Returns any monitor events since the last call. Subsequent calls must only return new
9296 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
9297 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
9300 * For details on asynchronous [`ChannelMonitor`] updating and returning
9301 * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
9303 struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
9305 * Frees any resources associated with this object given its this_arg pointer.
9306 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9308 void (*free)(void *this_arg);
9312 * An interface to send a transaction to the Bitcoin network.
9314 typedef struct LDKBroadcasterInterface {
9316 * An opaque pointer which is passed to your function implementations as an argument.
9317 * This has no meaning in the LDK, and can be NULL or any other value.
9321 * Sends a transaction out to (hopefully) be mined.
9323 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
9325 * Frees any resources associated with this object given its this_arg pointer.
9326 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9328 void (*free)(void *this_arg);
9329 } LDKBroadcasterInterface;
9332 * A trait that describes a source of entropy.
9334 typedef struct LDKEntropySource {
9336 * An opaque pointer which is passed to your function implementations as an argument.
9337 * This has no meaning in the LDK, and can be NULL or any other value.
9341 * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
9342 * different value each time it is called.
9344 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
9346 * Frees any resources associated with this object given its this_arg pointer.
9347 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9349 void (*free)(void *this_arg);
9353 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
9354 * own the memory pointed to by data.
9356 typedef struct LDKu8slice {
9358 * A pointer to the byte buffer
9360 const uint8_t *data;
9362 * The number of bytes pointed to by `data`.
9370 * The unsigned part of a [`channel_update`] message.
9372 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
9374 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
9376 * A pointer to the opaque Rust object.
9377 * Nearly everywhere, inner must be non-null, however in places where
9378 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9380 LDKnativeUnsignedChannelUpdate *inner;
9382 * Indicates that this is the only struct which contains the same pointer.
9383 * Rust functions which take ownership of an object provided via an argument require
9384 * this to be true and invalidate the object pointed to by inner.
9387 } LDKUnsignedChannelUpdate;
9392 * The unsigned part of a [`node_announcement`] message.
9394 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
9396 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
9398 * A pointer to the opaque Rust object.
9399 * Nearly everywhere, inner must be non-null, however in places where
9400 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9402 LDKnativeUnsignedNodeAnnouncement *inner;
9404 * Indicates that this is the only struct which contains the same pointer.
9405 * Rust functions which take ownership of an object provided via an argument require
9406 * this to be true and invalidate the object pointed to by inner.
9409 } LDKUnsignedNodeAnnouncement;
9412 * Represents the set of gossip messages that require a signature from a node's identity key.
9414 typedef enum LDKUnsignedGossipMessage_Tag {
9416 * An unsigned channel announcement.
9418 LDKUnsignedGossipMessage_ChannelAnnouncement,
9420 * An unsigned channel update.
9422 LDKUnsignedGossipMessage_ChannelUpdate,
9424 * An unsigned node announcement.
9426 LDKUnsignedGossipMessage_NodeAnnouncement,
9428 * Must be last for serialization purposes
9430 LDKUnsignedGossipMessage_Sentinel,
9431 } LDKUnsignedGossipMessage_Tag;
9433 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
9434 LDKUnsignedGossipMessage_Tag tag;
9437 struct LDKUnsignedChannelAnnouncement channel_announcement;
9440 struct LDKUnsignedChannelUpdate channel_update;
9443 struct LDKUnsignedNodeAnnouncement node_announcement;
9446 } LDKUnsignedGossipMessage;
9449 * A trait that can handle cryptographic operations at the scope level of a node.
9451 typedef struct LDKNodeSigner {
9453 * An opaque pointer which is passed to your function implementations as an argument.
9454 * This has no meaning in the LDK, and can be NULL or any other value.
9458 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
9460 * If the implementor of this trait supports [phantom node payments], then every node that is
9461 * intended to be included in the phantom invoice route hints must return the same value from
9464 * This method must return the same value each time it is called.
9466 * [phantom node payments]: PhantomKeysManager
9468 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
9470 * Get node id based on the provided [`Recipient`].
9472 * This method must return the same value each time it is called with a given [`Recipient`]
9475 * Errors if the [`Recipient`] variant is not supported by the implementation.
9477 struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
9479 * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
9480 * one is provided. Note that this tweak can be applied to `other_key` instead of our node
9481 * secret, though this is less efficient.
9483 * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
9484 * should be resolved to allow LDK to resume forwarding HTLCs.
9486 * Errors if the [`Recipient`] variant is not supported by the implementation.
9488 struct LDKCResult_SharedSecretNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_ScalarZ tweak);
9492 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
9493 * this trait to parse the invoice and make sure they're signing what they expect, rather than
9494 * blindly signing the hash.
9496 * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
9498 * The secret key used to sign the invoice is dependent on the [`Recipient`].
9500 * Errors if the [`Recipient`] variant is not supported by the implementation.
9502 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
9504 * Sign a gossip message.
9506 * Note that if this fails, LDK may panic and the message will not be broadcast to the network
9507 * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
9508 * message to be broadcast, as otherwise it may prevent one from receiving funds over the
9509 * corresponding channel.
9511 struct LDKCResult_SignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
9513 * Frees any resources associated with this object given its this_arg pointer.
9514 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9516 void (*free)(void *this_arg);
9520 * A trait that can return signer instances for individual channels.
9522 typedef struct LDKSignerProvider {
9524 * An opaque pointer which is passed to your function implementations as an argument.
9525 * This has no meaning in the LDK, and can be NULL or any other value.
9529 * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::Signer`] through
9530 * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
9531 * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
9532 * `channel_keys_id`.
9534 * This method must return a different value each time it is called.
9536 struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
9538 * Derives the private key material backing a `Signer`.
9540 * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
9541 * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
9542 * re-derived from its `channel_keys_id`, which can be obtained through its trait method
9543 * [`ChannelSigner::channel_keys_id`].
9545 struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
9547 * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
9548 * This is only called during deserialization of other objects which contain
9549 * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
9550 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
9551 * contain no versioning scheme. You may wish to include your own version prefix and ensure
9552 * you've read all of the provided bytes to ensure no corruption occurred.
9554 * This method is slowly being phased out -- it will only be called when reading objects
9555 * written by LDK versions prior to 0.0.113.
9557 * [`Signer`]: Self::Signer
9558 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
9559 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
9561 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
9563 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
9565 * This method should return a different value each time it is called, to avoid linking
9566 * on-chain funds across channels as controlled to the same user.
9568 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
9570 * Get a script pubkey which we will send funds to when closing a channel.
9572 * This method should return a different value each time it is called, to avoid linking
9573 * on-chain funds across channels as controlled to the same user.
9575 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
9577 * Frees any resources associated with this object given its this_arg pointer.
9578 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9580 void (*free)(void *this_arg);
9581 } LDKSignerProvider;
9584 * A trait which should be implemented to provide feerate information on a number of time
9587 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
9588 * called from inside the library in response to chain events, P2P events, or timer events).
9590 typedef struct LDKFeeEstimator {
9592 * An opaque pointer which is passed to your function implementations as an argument.
9593 * This has no meaning in the LDK, and can be NULL or any other value.
9597 * Gets estimated satoshis of fee required per 1000 Weight-Units.
9599 * LDK will wrap this method and ensure that the value returned is no smaller than 253
9600 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
9602 * The following unit conversions can be used to convert to sats/KW:
9603 * * satoshis-per-byte * 250
9604 * * satoshis-per-kbyte / 4
9606 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
9608 * Frees any resources associated with this object given its this_arg pointer.
9609 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9611 void (*free)(void *this_arg);
9615 * A trait defining behavior for routing a payment.
9617 typedef struct LDKRouter {
9619 * An opaque pointer which is passed to your function implementations as an argument.
9620 * This has no meaning in the LDK, and can be NULL or any other value.
9624 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
9626 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
9628 struct LDKCResult_RouteLightningErrorZ (*find_route)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
9630 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values. Includes
9631 * `PaymentHash` and `PaymentId` to be able to correlate the request with a specific payment.
9633 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
9635 struct LDKCResult_RouteLightningErrorZ (*find_route_with_id)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs, struct LDKThirtyTwoBytes _payment_hash, struct LDKThirtyTwoBytes _payment_id);
9637 * Frees any resources associated with this object given its this_arg pointer.
9638 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9640 void (*free)(void *this_arg);
9646 * Manager which keeps track of a number of channels and sends messages to the appropriate
9647 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
9649 * Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through
9650 * to individual Channels.
9652 * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
9653 * all peers during write/read (though does not modify this instance, only the instance being
9654 * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
9655 * called [`funding_transaction_generated`] for outbound channels) being closed.
9657 * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
9658 * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST write each monitor update out to disk before
9659 * returning from [`chain::Watch::watch_channel`]/[`update_channel`], with ChannelManagers, writing updates
9660 * happens out-of-band (and will prevent any other `ChannelManager` operations from occurring during
9661 * the serialization process). If the deserialized version is out-of-date compared to the
9662 * [`ChannelMonitor`] passed by reference to [`read`], those channels will be force-closed based on the
9663 * `ChannelMonitor` state and no funds will be lost (mod on-chain transaction fees).
9665 * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
9666 * tells you the last block hash which was connected. You should get the best block tip before using the manager.
9667 * See [`chain::Listen`] and [`chain::Confirm`] for more details.
9669 * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
9670 * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
9671 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
9672 * offline for a full minute. In order to track this, you must call
9673 * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
9675 * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
9676 * inbound channels without confirmed funding transactions. This may result in nodes which we do
9677 * not have a channel with being unable to connect to us or open new channels with us if we have
9678 * many peers with unfunded channels.
9680 * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
9681 * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
9682 * never limited. Please ensure you limit the count of such channels yourself.
9684 * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
9685 * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
9686 * essentially you should default to using a [`SimpleRefChannelManager`], and use a
9687 * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
9688 * you're using lightning-net-tokio.
9690 * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
9691 * [`funding_created`]: msgs::FundingCreated
9692 * [`funding_transaction_generated`]: Self::funding_transaction_generated
9693 * [`BlockHash`]: bitcoin::hash_types::BlockHash
9694 * [`update_channel`]: chain::Watch::update_channel
9695 * [`ChannelUpdate`]: msgs::ChannelUpdate
9696 * [`timer_tick_occurred`]: Self::timer_tick_occurred
9697 * [`read`]: ReadableArgs::read
9699 typedef struct MUST_USE_STRUCT LDKChannelManager {
9701 * A pointer to the opaque Rust object.
9702 * Nearly everywhere, inner must be non-null, however in places where
9703 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9705 LDKnativeChannelManager *inner;
9707 * Indicates that this is the only struct which contains the same pointer.
9708 * Rust functions which take ownership of an object provided via an argument require
9709 * this to be true and invalidate the object pointed to by inner.
9712 } LDKChannelManager;
9715 * A tuple of 2 elements. See the individual fields for the types contained.
9717 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
9719 * The element at position 0
9721 struct LDKThirtyTwoBytes a;
9723 * The element at position 1
9725 struct LDKChannelManager b;
9726 } LDKC2Tuple_BlockHashChannelManagerZ;
9729 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
9731 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
9733 * A pointer to the contents in the success state.
9734 * Reading from this pointer when `result_ok` is not set is undefined.
9736 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
9738 * A pointer to the contents in the error state.
9739 * Reading from this pointer when `result_ok` is set is undefined.
9741 struct LDKDecodeError *err;
9742 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
9745 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
9746 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9747 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9749 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
9751 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
9752 * `err` or `result` depending on the state of `result_ok`.
9754 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
9756 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
9759 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
9764 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
9765 * with our counterparty.
9767 typedef struct MUST_USE_STRUCT LDKChannelConfig {
9769 * A pointer to the opaque Rust object.
9770 * Nearly everywhere, inner must be non-null, however in places where
9771 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9773 LDKnativeChannelConfig *inner;
9775 * Indicates that this is the only struct which contains the same pointer.
9776 * Rust functions which take ownership of an object provided via an argument require
9777 * this to be true and invalidate the object pointed to by inner.
9783 * The contents of CResult_ChannelConfigDecodeErrorZ
9785 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
9787 * A pointer to the contents in the success state.
9788 * Reading from this pointer when `result_ok` is not set is undefined.
9790 struct LDKChannelConfig *result;
9792 * A pointer to the contents in the error state.
9793 * Reading from this pointer when `result_ok` is set is undefined.
9795 struct LDKDecodeError *err;
9796 } LDKCResult_ChannelConfigDecodeErrorZPtr;
9799 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
9800 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
9801 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9803 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
9805 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
9806 * `err` or `result` depending on the state of `result_ok`.
9808 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
9810 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
9813 } LDKCResult_ChannelConfigDecodeErrorZ;
9816 * An enum which can either contain a crate::lightning::util::errors::APIError or not
9818 typedef enum LDKCOption_APIErrorZ_Tag {
9820 * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
9822 LDKCOption_APIErrorZ_Some,
9824 * When we're in this state, this COption_APIErrorZ contains nothing
9826 LDKCOption_APIErrorZ_None,
9828 * Must be last for serialization purposes
9830 LDKCOption_APIErrorZ_Sentinel,
9831 } LDKCOption_APIErrorZ_Tag;
9833 typedef struct LDKCOption_APIErrorZ {
9834 LDKCOption_APIErrorZ_Tag tag;
9837 struct LDKAPIError some;
9840 } LDKCOption_APIErrorZ;
9843 * The contents of CResult_COption_APIErrorZDecodeErrorZ
9845 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
9847 * A pointer to the contents in the success state.
9848 * Reading from this pointer when `result_ok` is not set is undefined.
9850 struct LDKCOption_APIErrorZ *result;
9852 * A pointer to the contents in the error state.
9853 * Reading from this pointer when `result_ok` is set is undefined.
9855 struct LDKDecodeError *err;
9856 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
9859 * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
9860 * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9861 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9863 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
9865 * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
9866 * `err` or `result` depending on the state of `result_ok`.
9868 union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
9870 * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
9873 } LDKCResult_COption_APIErrorZDecodeErrorZ;
9876 * The contents of CResult_UntrustedStringDecodeErrorZ
9878 typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
9880 * A pointer to the contents in the success state.
9881 * Reading from this pointer when `result_ok` is not set is undefined.
9883 struct LDKUntrustedString *result;
9885 * A pointer to the contents in the error state.
9886 * Reading from this pointer when `result_ok` is set is undefined.
9888 struct LDKDecodeError *err;
9889 } LDKCResult_UntrustedStringDecodeErrorZPtr;
9892 * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
9893 * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
9894 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9896 typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
9898 * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
9899 * `err` or `result` depending on the state of `result_ok`.
9901 union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
9903 * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
9906 } LDKCResult_UntrustedStringDecodeErrorZ;
9909 * The contents of CResult_OutPointDecodeErrorZ
9911 typedef union LDKCResult_OutPointDecodeErrorZPtr {
9913 * A pointer to the contents in the success state.
9914 * Reading from this pointer when `result_ok` is not set is undefined.
9916 struct LDKOutPoint *result;
9918 * A pointer to the contents in the error state.
9919 * Reading from this pointer when `result_ok` is set is undefined.
9921 struct LDKDecodeError *err;
9922 } LDKCResult_OutPointDecodeErrorZPtr;
9925 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
9926 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
9927 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9929 typedef struct LDKCResult_OutPointDecodeErrorZ {
9931 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
9932 * `err` or `result` depending on the state of `result_ok`.
9934 union LDKCResult_OutPointDecodeErrorZPtr contents;
9936 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
9939 } LDKCResult_OutPointDecodeErrorZ;
9942 * Defines a type identifier for sending messages over the wire.
9944 * Messages implementing this trait specify a type and must be [`Writeable`].
9946 typedef struct LDKType {
9948 * An opaque pointer which is passed to your function implementations as an argument.
9949 * This has no meaning in the LDK, and can be NULL or any other value.
9953 * Returns the type identifying the message payload.
9955 uint16_t (*type_id)(const void *this_arg);
9957 * Return a human-readable "debug" string describing this object
9959 struct LDKStr (*debug_str)(const void *this_arg);
9961 * Serialize the object into a byte array
9963 struct LDKCVec_u8Z (*write)(const void *this_arg);
9965 * Frees any resources associated with this object given its this_arg pointer.
9966 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9968 void (*free)(void *this_arg);
9972 * An enum which can either contain a crate::lightning::ln::wire::Type or not
9974 typedef enum LDKCOption_TypeZ_Tag {
9976 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
9978 LDKCOption_TypeZ_Some,
9980 * When we're in this state, this COption_TypeZ contains nothing
9982 LDKCOption_TypeZ_None,
9984 * Must be last for serialization purposes
9986 LDKCOption_TypeZ_Sentinel,
9987 } LDKCOption_TypeZ_Tag;
9989 typedef struct LDKCOption_TypeZ {
9990 LDKCOption_TypeZ_Tag tag;
9993 struct LDKType some;
9999 * The contents of CResult_COption_TypeZDecodeErrorZ
10001 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
10003 * A pointer to the contents in the success state.
10004 * Reading from this pointer when `result_ok` is not set is undefined.
10006 struct LDKCOption_TypeZ *result;
10008 * A pointer to the contents in the error state.
10009 * Reading from this pointer when `result_ok` is set is undefined.
10011 struct LDKDecodeError *err;
10012 } LDKCResult_COption_TypeZDecodeErrorZPtr;
10015 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
10016 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10017 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10019 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
10021 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
10022 * `err` or `result` depending on the state of `result_ok`.
10024 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
10026 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
10029 } LDKCResult_COption_TypeZDecodeErrorZ;
10032 * An error that may occur when making a payment.
10034 typedef enum LDKPaymentError_Tag {
10036 * An error resulting from the provided [`Invoice`] or payment hash.
10038 LDKPaymentError_Invoice,
10040 * An error occurring when sending a payment.
10042 LDKPaymentError_Sending,
10044 * Must be last for serialization purposes
10046 LDKPaymentError_Sentinel,
10047 } LDKPaymentError_Tag;
10049 typedef struct MUST_USE_STRUCT LDKPaymentError {
10050 LDKPaymentError_Tag tag;
10053 struct LDKStr invoice;
10056 enum LDKRetryableSendFailure sending;
10062 * The contents of CResult_PaymentIdPaymentErrorZ
10064 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
10066 * A pointer to the contents in the success state.
10067 * Reading from this pointer when `result_ok` is not set is undefined.
10069 struct LDKThirtyTwoBytes *result;
10071 * A pointer to the contents in the error state.
10072 * Reading from this pointer when `result_ok` is set is undefined.
10074 struct LDKPaymentError *err;
10075 } LDKCResult_PaymentIdPaymentErrorZPtr;
10078 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
10079 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
10080 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10082 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
10084 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
10085 * `err` or `result` depending on the state of `result_ok`.
10087 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
10089 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
10092 } LDKCResult_PaymentIdPaymentErrorZ;
10095 * The contents of CResult_NonePaymentErrorZ
10097 typedef union LDKCResult_NonePaymentErrorZPtr {
10099 * Note that this value is always NULL, as there are no contents in the OK variant
10103 * A pointer to the contents in the error state.
10104 * Reading from this pointer when `result_ok` is set is undefined.
10106 struct LDKPaymentError *err;
10107 } LDKCResult_NonePaymentErrorZPtr;
10110 * A CResult_NonePaymentErrorZ represents the result of a fallible operation,
10111 * containing a () on success and a crate::lightning_invoice::payment::PaymentError on failure.
10112 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10114 typedef struct LDKCResult_NonePaymentErrorZ {
10116 * The contents of this CResult_NonePaymentErrorZ, accessible via either
10117 * `err` or `result` depending on the state of `result_ok`.
10119 union LDKCResult_NonePaymentErrorZPtr contents;
10121 * Whether this CResult_NonePaymentErrorZ represents a success state.
10124 } LDKCResult_NonePaymentErrorZ;
10127 * The contents of CResult_StringErrorZ
10129 typedef union LDKCResult_StringErrorZPtr {
10131 * A pointer to the contents in the success state.
10132 * Reading from this pointer when `result_ok` is not set is undefined.
10134 struct LDKStr *result;
10136 * A pointer to the contents in the error state.
10137 * Reading from this pointer when `result_ok` is set is undefined.
10139 enum LDKSecp256k1Error *err;
10140 } LDKCResult_StringErrorZPtr;
10143 * A CResult_StringErrorZ represents the result of a fallible operation,
10144 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
10145 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10147 typedef struct LDKCResult_StringErrorZ {
10149 * The contents of this CResult_StringErrorZ, accessible via either
10150 * `err` or `result` depending on the state of `result_ok`.
10152 union LDKCResult_StringErrorZPtr contents;
10154 * Whether this CResult_StringErrorZ represents a success state.
10157 } LDKCResult_StringErrorZ;
10160 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
10162 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
10164 * A pointer to the contents in the success state.
10165 * Reading from this pointer when `result_ok` is not set is undefined.
10167 struct LDKChannelMonitorUpdate *result;
10169 * A pointer to the contents in the error state.
10170 * Reading from this pointer when `result_ok` is set is undefined.
10172 struct LDKDecodeError *err;
10173 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
10176 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
10177 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10178 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10180 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
10182 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
10183 * `err` or `result` depending on the state of `result_ok`.
10185 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
10187 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
10190 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
10193 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
10195 typedef enum LDKCOption_MonitorEventZ_Tag {
10197 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
10199 LDKCOption_MonitorEventZ_Some,
10201 * When we're in this state, this COption_MonitorEventZ contains nothing
10203 LDKCOption_MonitorEventZ_None,
10205 * Must be last for serialization purposes
10207 LDKCOption_MonitorEventZ_Sentinel,
10208 } LDKCOption_MonitorEventZ_Tag;
10210 typedef struct LDKCOption_MonitorEventZ {
10211 LDKCOption_MonitorEventZ_Tag tag;
10214 struct LDKMonitorEvent some;
10217 } LDKCOption_MonitorEventZ;
10220 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
10222 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
10224 * A pointer to the contents in the success state.
10225 * Reading from this pointer when `result_ok` is not set is undefined.
10227 struct LDKCOption_MonitorEventZ *result;
10229 * A pointer to the contents in the error state.
10230 * Reading from this pointer when `result_ok` is set is undefined.
10232 struct LDKDecodeError *err;
10233 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
10236 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
10237 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10238 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10240 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
10242 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
10243 * `err` or `result` depending on the state of `result_ok`.
10245 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
10247 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
10250 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
10253 * The contents of CResult_HTLCUpdateDecodeErrorZ
10255 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
10257 * A pointer to the contents in the success state.
10258 * Reading from this pointer when `result_ok` is not set is undefined.
10260 struct LDKHTLCUpdate *result;
10262 * A pointer to the contents in the error state.
10263 * Reading from this pointer when `result_ok` is set is undefined.
10265 struct LDKDecodeError *err;
10266 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
10269 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
10270 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10271 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10273 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
10275 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
10276 * `err` or `result` depending on the state of `result_ok`.
10278 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
10280 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
10283 } LDKCResult_HTLCUpdateDecodeErrorZ;
10286 * A tuple of 2 elements. See the individual fields for the types contained.
10288 typedef struct LDKC2Tuple_OutPointScriptZ {
10290 * The element at position 0
10292 struct LDKOutPoint a;
10294 * The element at position 1
10296 struct LDKCVec_u8Z b;
10297 } LDKC2Tuple_OutPointScriptZ;
10300 * A tuple of 2 elements. See the individual fields for the types contained.
10302 typedef struct LDKC2Tuple_u32ScriptZ {
10304 * The element at position 0
10308 * The element at position 1
10310 struct LDKCVec_u8Z b;
10311 } LDKC2Tuple_u32ScriptZ;
10314 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
10315 * This corresponds to std::vector in C++
10317 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
10319 * The elements in the array.
10320 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10322 struct LDKC2Tuple_u32ScriptZ *data;
10324 * The number of elements pointed to by `data`.
10327 } LDKCVec_C2Tuple_u32ScriptZZ;
10330 * A tuple of 2 elements. See the individual fields for the types contained.
10332 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
10334 * The element at position 0
10336 struct LDKThirtyTwoBytes a;
10338 * The element at position 1
10340 struct LDKCVec_C2Tuple_u32ScriptZZ b;
10341 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
10344 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
10345 * This corresponds to std::vector in C++
10347 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
10349 * The elements in the array.
10350 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10352 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
10354 * The number of elements pointed to by `data`.
10357 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
10360 * A dynamically-allocated array of crate::lightning::events::Events of arbitrary size.
10361 * This corresponds to std::vector in C++
10363 typedef struct LDKCVec_EventZ {
10365 * The elements in the array.
10366 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10368 struct LDKEvent *data;
10370 * The number of elements pointed to by `data`.
10376 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
10377 * This corresponds to std::vector in C++
10379 typedef struct LDKCVec_TransactionZ {
10381 * The elements in the array.
10382 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10384 struct LDKTransaction *data;
10386 * The number of elements pointed to by `data`.
10389 } LDKCVec_TransactionZ;
10392 * A tuple of 2 elements. See the individual fields for the types contained.
10394 typedef struct LDKC2Tuple_u32TxOutZ {
10396 * The element at position 0
10400 * The element at position 1
10403 } LDKC2Tuple_u32TxOutZ;
10406 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
10407 * This corresponds to std::vector in C++
10409 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
10411 * The elements in the array.
10412 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10414 struct LDKC2Tuple_u32TxOutZ *data;
10416 * The number of elements pointed to by `data`.
10419 } LDKCVec_C2Tuple_u32TxOutZZ;
10422 * A tuple of 2 elements. See the individual fields for the types contained.
10424 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
10426 * The element at position 0
10428 struct LDKThirtyTwoBytes a;
10430 * The element at position 1
10432 struct LDKCVec_C2Tuple_u32TxOutZZ b;
10433 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
10436 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
10437 * This corresponds to std::vector in C++
10439 typedef struct LDKCVec_TransactionOutputsZ {
10441 * The elements in the array.
10442 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10444 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
10446 * The number of elements pointed to by `data`.
10449 } LDKCVec_TransactionOutputsZ;
10452 * Details about the balance(s) available for spending once the channel appears on chain.
10454 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
10457 typedef enum LDKBalance_Tag {
10459 * The channel is not yet closed (or the commitment or closing transaction has not yet
10460 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
10461 * force-closed now.
10463 LDKBalance_ClaimableOnChannelClose,
10465 * The channel has been closed, and the given balance is ours but awaiting confirmations until
10466 * we consider it spendable.
10468 LDKBalance_ClaimableAwaitingConfirmations,
10470 * The channel has been closed, and the given balance should be ours but awaiting spending
10471 * transaction confirmation. If the spending transaction does not confirm in time, it is
10472 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
10474 * Once the spending transaction confirms, before it has reached enough confirmations to be
10475 * considered safe from chain reorganizations, the balance will instead be provided via
10476 * [`Balance::ClaimableAwaitingConfirmations`].
10478 LDKBalance_ContentiousClaimable,
10480 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
10481 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
10482 * likely to be claimed by our counterparty before we do.
10484 LDKBalance_MaybeTimeoutClaimableHTLC,
10486 * HTLCs which we received from our counterparty which are claimable with a preimage which we
10487 * do not currently have. This will only be claimable if we receive the preimage from the node
10488 * to which we forwarded this HTLC before the timeout.
10490 LDKBalance_MaybePreimageClaimableHTLC,
10492 * The channel has been closed, and our counterparty broadcasted a revoked commitment
10495 * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
10496 * following amount.
10498 LDKBalance_CounterpartyRevokedOutputClaimable,
10500 * Must be last for serialization purposes
10502 LDKBalance_Sentinel,
10505 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
10507 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
10508 * required to do so.
10510 uint64_t claimable_amount_satoshis;
10511 } LDKBalance_LDKClaimableOnChannelClose_Body;
10513 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
10515 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
10516 * were spent in broadcasting the transaction.
10518 uint64_t claimable_amount_satoshis;
10520 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
10523 uint32_t confirmation_height;
10524 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
10526 typedef struct LDKBalance_LDKContentiousClaimable_Body {
10528 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
10529 * required to do so.
10531 uint64_t claimable_amount_satoshis;
10533 * The height at which the counterparty may be able to claim the balance if we have not
10536 uint32_t timeout_height;
10537 } LDKBalance_LDKContentiousClaimable_Body;
10539 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
10541 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
10542 * which will be required to do so.
10544 uint64_t claimable_amount_satoshis;
10546 * The height at which we will be able to claim the balance if our counterparty has not
10549 uint32_t claimable_height;
10550 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
10552 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
10554 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
10555 * which will be required to do so.
10557 uint64_t claimable_amount_satoshis;
10559 * The height at which our counterparty will be able to claim the balance if we have not
10560 * yet received the preimage and claimed it ourselves.
10562 uint32_t expiry_height;
10563 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
10565 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
10567 * The amount, in satoshis, of the output which we can claim.
10569 * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
10570 * were already spent.
10572 uint64_t claimable_amount_satoshis;
10573 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
10575 typedef struct MUST_USE_STRUCT LDKBalance {
10576 LDKBalance_Tag tag;
10578 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
10579 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
10580 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
10581 LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
10582 LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
10583 LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
10588 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
10589 * This corresponds to std::vector in C++
10591 typedef struct LDKCVec_BalanceZ {
10593 * The elements in the array.
10594 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10596 struct LDKBalance *data;
10598 * The number of elements pointed to by `data`.
10601 } LDKCVec_BalanceZ;
10604 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
10606 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
10608 * A pointer to the contents in the success state.
10609 * Reading from this pointer when `result_ok` is not set is undefined.
10611 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
10613 * A pointer to the contents in the error state.
10614 * Reading from this pointer when `result_ok` is set is undefined.
10616 struct LDKDecodeError *err;
10617 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
10620 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
10621 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10622 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10624 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
10626 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
10627 * `err` or `result` depending on the state of `result_ok`.
10629 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
10631 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
10634 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
10637 * A tuple of 2 elements. See the individual fields for the types contained.
10639 typedef struct LDKC2Tuple_PublicKeyTypeZ {
10641 * The element at position 0
10643 struct LDKPublicKey a;
10645 * The element at position 1
10648 } LDKC2Tuple_PublicKeyTypeZ;
10651 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
10652 * This corresponds to std::vector in C++
10654 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
10656 * The elements in the array.
10657 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10659 struct LDKC2Tuple_PublicKeyTypeZ *data;
10661 * The number of elements pointed to by `data`.
10664 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
10667 * The contents of a custom onion message.
10669 typedef struct LDKCustomOnionMessageContents {
10671 * An opaque pointer which is passed to your function implementations as an argument.
10672 * This has no meaning in the LDK, and can be NULL or any other value.
10676 * Returns the TLV type identifying the message contents. MUST be >= 64.
10678 uint64_t (*tlv_type)(const void *this_arg);
10680 * Serialize the object into a byte array
10682 struct LDKCVec_u8Z (*write)(const void *this_arg);
10684 * Frees any resources associated with this object given its this_arg pointer.
10685 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10687 void (*free)(void *this_arg);
10688 } LDKCustomOnionMessageContents;
10691 * An enum which can either contain a crate::lightning::onion_message::packet::CustomOnionMessageContents or not
10693 typedef enum LDKCOption_CustomOnionMessageContentsZ_Tag {
10695 * When we're in this state, this COption_CustomOnionMessageContentsZ contains a crate::lightning::onion_message::packet::CustomOnionMessageContents
10697 LDKCOption_CustomOnionMessageContentsZ_Some,
10699 * When we're in this state, this COption_CustomOnionMessageContentsZ contains nothing
10701 LDKCOption_CustomOnionMessageContentsZ_None,
10703 * Must be last for serialization purposes
10705 LDKCOption_CustomOnionMessageContentsZ_Sentinel,
10706 } LDKCOption_CustomOnionMessageContentsZ_Tag;
10708 typedef struct LDKCOption_CustomOnionMessageContentsZ {
10709 LDKCOption_CustomOnionMessageContentsZ_Tag tag;
10712 struct LDKCustomOnionMessageContents some;
10715 } LDKCOption_CustomOnionMessageContentsZ;
10718 * The contents of CResult_COption_CustomOnionMessageContentsZDecodeErrorZ
10720 typedef union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr {
10722 * A pointer to the contents in the success state.
10723 * Reading from this pointer when `result_ok` is not set is undefined.
10725 struct LDKCOption_CustomOnionMessageContentsZ *result;
10727 * A pointer to the contents in the error state.
10728 * Reading from this pointer when `result_ok` is set is undefined.
10730 struct LDKDecodeError *err;
10731 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr;
10734 * A CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
10735 * containing a crate::c_types::derived::COption_CustomOnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10736 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10738 typedef struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ {
10740 * The contents of this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ, accessible via either
10741 * `err` or `result` depending on the state of `result_ok`.
10743 union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr contents;
10745 * Whether this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents a success state.
10748 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ;
10751 * An enum which can either contain a crate::lightning::ln::msgs::NetAddress or not
10753 typedef enum LDKCOption_NetAddressZ_Tag {
10755 * When we're in this state, this COption_NetAddressZ contains a crate::lightning::ln::msgs::NetAddress
10757 LDKCOption_NetAddressZ_Some,
10759 * When we're in this state, this COption_NetAddressZ contains nothing
10761 LDKCOption_NetAddressZ_None,
10763 * Must be last for serialization purposes
10765 LDKCOption_NetAddressZ_Sentinel,
10766 } LDKCOption_NetAddressZ_Tag;
10768 typedef struct LDKCOption_NetAddressZ {
10769 LDKCOption_NetAddressZ_Tag tag;
10772 struct LDKNetAddress some;
10775 } LDKCOption_NetAddressZ;
10778 * A tuple of 2 elements. See the individual fields for the types contained.
10780 typedef struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ {
10782 * The element at position 0
10784 struct LDKPublicKey a;
10786 * The element at position 1
10788 struct LDKCOption_NetAddressZ b;
10789 } LDKC2Tuple_PublicKeyCOption_NetAddressZZ;
10792 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCOption_NetAddressZZs of arbitrary size.
10793 * This corresponds to std::vector in C++
10795 typedef struct LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ {
10797 * The elements in the array.
10798 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10800 struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ *data;
10802 * The number of elements pointed to by `data`.
10805 } LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ;
10810 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
10811 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
10814 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
10816 * A pointer to the opaque Rust object.
10817 * Nearly everywhere, inner must be non-null, however in places where
10818 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10820 LDKnativePeerHandleError *inner;
10822 * Indicates that this is the only struct which contains the same pointer.
10823 * Rust functions which take ownership of an object provided via an argument require
10824 * this to be true and invalidate the object pointed to by inner.
10827 } LDKPeerHandleError;
10830 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
10832 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
10834 * A pointer to the contents in the success state.
10835 * Reading from this pointer when `result_ok` is not set is undefined.
10837 struct LDKCVec_u8Z *result;
10839 * A pointer to the contents in the error state.
10840 * Reading from this pointer when `result_ok` is set is undefined.
10842 struct LDKPeerHandleError *err;
10843 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
10846 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
10847 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10848 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10850 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
10852 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
10853 * `err` or `result` depending on the state of `result_ok`.
10855 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
10857 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
10860 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
10863 * The contents of CResult_NonePeerHandleErrorZ
10865 typedef union LDKCResult_NonePeerHandleErrorZPtr {
10867 * Note that this value is always NULL, as there are no contents in the OK variant
10871 * A pointer to the contents in the error state.
10872 * Reading from this pointer when `result_ok` is set is undefined.
10874 struct LDKPeerHandleError *err;
10875 } LDKCResult_NonePeerHandleErrorZPtr;
10878 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
10879 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10880 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10882 typedef struct LDKCResult_NonePeerHandleErrorZ {
10884 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
10885 * `err` or `result` depending on the state of `result_ok`.
10887 union LDKCResult_NonePeerHandleErrorZPtr contents;
10889 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
10892 } LDKCResult_NonePeerHandleErrorZ;
10895 * The contents of CResult_boolPeerHandleErrorZ
10897 typedef union LDKCResult_boolPeerHandleErrorZPtr {
10899 * A pointer to the contents in the success state.
10900 * Reading from this pointer when `result_ok` is not set is undefined.
10904 * A pointer to the contents in the error state.
10905 * Reading from this pointer when `result_ok` is set is undefined.
10907 struct LDKPeerHandleError *err;
10908 } LDKCResult_boolPeerHandleErrorZPtr;
10911 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
10912 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10913 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10915 typedef struct LDKCResult_boolPeerHandleErrorZ {
10917 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
10918 * `err` or `result` depending on the state of `result_ok`.
10920 union LDKCResult_boolPeerHandleErrorZPtr contents;
10922 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
10925 } LDKCResult_boolPeerHandleErrorZ;
10928 * Errors that may occur when [sending an onion message].
10930 * [sending an onion message]: OnionMessenger::send_onion_message
10932 typedef enum LDKSendError_Tag {
10934 * Errored computing onion message packet keys.
10936 LDKSendError_Secp256k1,
10938 * Because implementations such as Eclair will drop onion messages where the message packet
10939 * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
10941 LDKSendError_TooBigPacket,
10943 * The provided [`Destination`] was an invalid [`BlindedPath`], due to having fewer than two
10946 LDKSendError_TooFewBlindedHops,
10948 * Our next-hop peer was offline or does not support onion message forwarding.
10950 LDKSendError_InvalidFirstHop,
10952 * Onion message contents must have a TLV type >= 64.
10954 LDKSendError_InvalidMessage,
10956 * Our next-hop peer's buffer was full or our total outbound buffer was full.
10958 LDKSendError_BufferFull,
10960 * Failed to retrieve our node id from the provided [`NodeSigner`].
10962 * [`NodeSigner`]: crate::chain::keysinterface::NodeSigner
10964 LDKSendError_GetNodeIdFailed,
10966 * We attempted to send to a blinded path where we are the introduction node, and failed to
10967 * advance the blinded path to make the second hop the new introduction node. Either
10968 * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
10969 * new blinding point, or we were attempting to send to ourselves.
10971 LDKSendError_BlindedPathAdvanceFailed,
10973 * Must be last for serialization purposes
10975 LDKSendError_Sentinel,
10976 } LDKSendError_Tag;
10978 typedef struct MUST_USE_STRUCT LDKSendError {
10979 LDKSendError_Tag tag;
10982 enum LDKSecp256k1Error secp256k1;
10988 * The contents of CResult_NoneSendErrorZ
10990 typedef union LDKCResult_NoneSendErrorZPtr {
10992 * Note that this value is always NULL, as there are no contents in the OK variant
10996 * A pointer to the contents in the error state.
10997 * Reading from this pointer when `result_ok` is set is undefined.
10999 struct LDKSendError *err;
11000 } LDKCResult_NoneSendErrorZPtr;
11003 * A CResult_NoneSendErrorZ represents the result of a fallible operation,
11004 * containing a () on success and a crate::lightning::onion_message::messenger::SendError on failure.
11005 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11007 typedef struct LDKCResult_NoneSendErrorZ {
11009 * The contents of this CResult_NoneSendErrorZ, accessible via either
11010 * `err` or `result` depending on the state of `result_ok`.
11012 union LDKCResult_NoneSendErrorZPtr contents;
11014 * Whether this CResult_NoneSendErrorZ represents a success state.
11017 } LDKCResult_NoneSendErrorZ;
11020 * The contents of CResult_BlindedPathNoneZ
11022 typedef union LDKCResult_BlindedPathNoneZPtr {
11024 * A pointer to the contents in the success state.
11025 * Reading from this pointer when `result_ok` is not set is undefined.
11027 struct LDKBlindedPath *result;
11029 * Note that this value is always NULL, as there are no contents in the Err variant
11032 } LDKCResult_BlindedPathNoneZPtr;
11035 * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
11036 * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
11037 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11039 typedef struct LDKCResult_BlindedPathNoneZ {
11041 * The contents of this CResult_BlindedPathNoneZ, accessible via either
11042 * `err` or `result` depending on the state of `result_ok`.
11044 union LDKCResult_BlindedPathNoneZPtr contents;
11046 * Whether this CResult_BlindedPathNoneZ represents a success state.
11049 } LDKCResult_BlindedPathNoneZ;
11052 * The contents of CResult_BlindedPathDecodeErrorZ
11054 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
11056 * A pointer to the contents in the success state.
11057 * Reading from this pointer when `result_ok` is not set is undefined.
11059 struct LDKBlindedPath *result;
11061 * A pointer to the contents in the error state.
11062 * Reading from this pointer when `result_ok` is set is undefined.
11064 struct LDKDecodeError *err;
11065 } LDKCResult_BlindedPathDecodeErrorZPtr;
11068 * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
11069 * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
11070 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11072 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
11074 * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
11075 * `err` or `result` depending on the state of `result_ok`.
11077 union LDKCResult_BlindedPathDecodeErrorZPtr contents;
11079 * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
11082 } LDKCResult_BlindedPathDecodeErrorZ;
11085 * The contents of CResult_BlindedHopDecodeErrorZ
11087 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
11089 * A pointer to the contents in the success state.
11090 * Reading from this pointer when `result_ok` is not set is undefined.
11092 struct LDKBlindedHop *result;
11094 * A pointer to the contents in the error state.
11095 * Reading from this pointer when `result_ok` is set is undefined.
11097 struct LDKDecodeError *err;
11098 } LDKCResult_BlindedHopDecodeErrorZPtr;
11101 * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
11102 * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
11103 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11105 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
11107 * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
11108 * `err` or `result` depending on the state of `result_ok`.
11110 union LDKCResult_BlindedHopDecodeErrorZPtr contents;
11112 * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
11115 } LDKCResult_BlindedHopDecodeErrorZ;
11118 * Sub-errors which don't have specific information in them use this type.
11120 typedef struct LDKError {
11122 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
11128 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
11129 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
11131 typedef enum LDKParseError_Tag {
11132 LDKParseError_Bech32Error,
11133 LDKParseError_ParseAmountError,
11134 LDKParseError_MalformedSignature,
11135 LDKParseError_BadPrefix,
11136 LDKParseError_UnknownCurrency,
11137 LDKParseError_UnknownSiPrefix,
11138 LDKParseError_MalformedHRP,
11139 LDKParseError_TooShortDataPart,
11140 LDKParseError_UnexpectedEndOfTaggedFields,
11141 LDKParseError_DescriptionDecodeError,
11142 LDKParseError_PaddingError,
11143 LDKParseError_IntegerOverflowError,
11144 LDKParseError_InvalidSegWitProgramLength,
11145 LDKParseError_InvalidPubKeyHashLength,
11146 LDKParseError_InvalidScriptHashLength,
11147 LDKParseError_InvalidRecoveryId,
11148 LDKParseError_InvalidSliceLength,
11150 * Not an error, but used internally to signal that a part of the invoice should be ignored
11151 * according to BOLT11
11153 LDKParseError_Skip,
11155 * Must be last for serialization purposes
11157 LDKParseError_Sentinel,
11158 } LDKParseError_Tag;
11160 typedef struct MUST_USE_STRUCT LDKParseError {
11161 LDKParseError_Tag tag;
11164 struct LDKBech32Error bech32_error;
11167 struct LDKError parse_amount_error;
11170 enum LDKSecp256k1Error malformed_signature;
11173 struct LDKError description_decode_error;
11176 struct LDKStr invalid_slice_length;
11182 * The contents of CResult_SiPrefixParseErrorZ
11184 typedef union LDKCResult_SiPrefixParseErrorZPtr {
11186 * A pointer to the contents in the success state.
11187 * Reading from this pointer when `result_ok` is not set is undefined.
11189 enum LDKSiPrefix *result;
11191 * A pointer to the contents in the error state.
11192 * Reading from this pointer when `result_ok` is set is undefined.
11194 struct LDKParseError *err;
11195 } LDKCResult_SiPrefixParseErrorZPtr;
11198 * A CResult_SiPrefixParseErrorZ represents the result of a fallible operation,
11199 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::ParseError on failure.
11200 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11202 typedef struct LDKCResult_SiPrefixParseErrorZ {
11204 * The contents of this CResult_SiPrefixParseErrorZ, accessible via either
11205 * `err` or `result` depending on the state of `result_ok`.
11207 union LDKCResult_SiPrefixParseErrorZPtr contents;
11209 * Whether this CResult_SiPrefixParseErrorZ represents a success state.
11212 } LDKCResult_SiPrefixParseErrorZ;
11217 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
11219 * There are three ways to construct an `Invoice`:
11220 * 1. using [`InvoiceBuilder`]
11221 * 2. using [`Invoice::from_signed`]
11222 * 3. using `str::parse::<Invoice>(&str)` (see [`Invoice::from_str`])
11224 * [`Invoice::from_str`]: crate::Invoice#impl-FromStr
11226 typedef struct MUST_USE_STRUCT LDKInvoice {
11228 * A pointer to the opaque Rust object.
11229 * Nearly everywhere, inner must be non-null, however in places where
11230 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11232 LDKnativeInvoice *inner;
11234 * Indicates that this is the only struct which contains the same pointer.
11235 * Rust functions which take ownership of an object provided via an argument require
11236 * this to be true and invalidate the object pointed to by inner.
11242 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
11243 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
11244 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
11246 typedef enum LDKParseOrSemanticError_Tag {
11248 * The invoice couldn't be decoded
11250 LDKParseOrSemanticError_ParseError,
11252 * The invoice could be decoded but violates the BOLT11 standard
11254 LDKParseOrSemanticError_SemanticError,
11256 * Must be last for serialization purposes
11258 LDKParseOrSemanticError_Sentinel,
11259 } LDKParseOrSemanticError_Tag;
11261 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
11262 LDKParseOrSemanticError_Tag tag;
11265 struct LDKParseError parse_error;
11268 enum LDKSemanticError semantic_error;
11271 } LDKParseOrSemanticError;
11274 * The contents of CResult_InvoiceParseOrSemanticErrorZ
11276 typedef union LDKCResult_InvoiceParseOrSemanticErrorZPtr {
11278 * A pointer to the contents in the success state.
11279 * Reading from this pointer when `result_ok` is not set is undefined.
11281 struct LDKInvoice *result;
11283 * A pointer to the contents in the error state.
11284 * Reading from this pointer when `result_ok` is set is undefined.
11286 struct LDKParseOrSemanticError *err;
11287 } LDKCResult_InvoiceParseOrSemanticErrorZPtr;
11290 * A CResult_InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
11291 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
11292 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11294 typedef struct LDKCResult_InvoiceParseOrSemanticErrorZ {
11296 * The contents of this CResult_InvoiceParseOrSemanticErrorZ, accessible via either
11297 * `err` or `result` depending on the state of `result_ok`.
11299 union LDKCResult_InvoiceParseOrSemanticErrorZPtr contents;
11301 * Whether this CResult_InvoiceParseOrSemanticErrorZ represents a success state.
11304 } LDKCResult_InvoiceParseOrSemanticErrorZ;
11309 * Represents a signed [`RawInvoice`] with cached hash. The signature is not checked and may be
11313 * The hash has to be either from the deserialized invoice or from the serialized [`RawInvoice`].
11315 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
11317 * A pointer to the opaque Rust object.
11318 * Nearly everywhere, inner must be non-null, however in places where
11319 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11321 LDKnativeSignedRawInvoice *inner;
11323 * Indicates that this is the only struct which contains the same pointer.
11324 * Rust functions which take ownership of an object provided via an argument require
11325 * this to be true and invalidate the object pointed to by inner.
11328 } LDKSignedRawInvoice;
11331 * The contents of CResult_SignedRawInvoiceParseErrorZ
11333 typedef union LDKCResult_SignedRawInvoiceParseErrorZPtr {
11335 * A pointer to the contents in the success state.
11336 * Reading from this pointer when `result_ok` is not set is undefined.
11338 struct LDKSignedRawInvoice *result;
11340 * A pointer to the contents in the error state.
11341 * Reading from this pointer when `result_ok` is set is undefined.
11343 struct LDKParseError *err;
11344 } LDKCResult_SignedRawInvoiceParseErrorZPtr;
11347 * A CResult_SignedRawInvoiceParseErrorZ represents the result of a fallible operation,
11348 * containing a crate::lightning_invoice::SignedRawInvoice on success and a crate::lightning_invoice::ParseError on failure.
11349 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11351 typedef struct LDKCResult_SignedRawInvoiceParseErrorZ {
11353 * The contents of this CResult_SignedRawInvoiceParseErrorZ, accessible via either
11354 * `err` or `result` depending on the state of `result_ok`.
11356 union LDKCResult_SignedRawInvoiceParseErrorZPtr contents;
11358 * Whether this CResult_SignedRawInvoiceParseErrorZ represents a success state.
11361 } LDKCResult_SignedRawInvoiceParseErrorZ;
11366 * Represents an syntactically correct [`Invoice`] for a payment on the lightning network,
11367 * but without the signature information.
11368 * Decoding and encoding should not lead to information loss but may lead to different hashes.
11370 * For methods without docs see the corresponding methods in [`Invoice`].
11372 typedef struct MUST_USE_STRUCT LDKRawInvoice {
11374 * A pointer to the opaque Rust object.
11375 * Nearly everywhere, inner must be non-null, however in places where
11376 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11378 LDKnativeRawInvoice *inner;
11380 * Indicates that this is the only struct which contains the same pointer.
11381 * Rust functions which take ownership of an object provided via an argument require
11382 * this to be true and invalidate the object pointed to by inner.
11390 * Recoverable signature
11392 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
11394 * A pointer to the opaque Rust object.
11395 * Nearly everywhere, inner must be non-null, however in places where
11396 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11398 LDKnativeInvoiceSignature *inner;
11400 * Indicates that this is the only struct which contains the same pointer.
11401 * Rust functions which take ownership of an object provided via an argument require
11402 * this to be true and invalidate the object pointed to by inner.
11405 } LDKInvoiceSignature;
11408 * A tuple of 3 elements. See the individual fields for the types contained.
11410 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
11412 * The element at position 0
11414 struct LDKRawInvoice a;
11416 * The element at position 1
11418 struct LDKThirtyTwoBytes b;
11420 * The element at position 2
11422 struct LDKInvoiceSignature c;
11423 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
11430 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
11432 * A pointer to the opaque Rust object.
11433 * Nearly everywhere, inner must be non-null, however in places where
11434 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11436 LDKnativePayeePubKey *inner;
11438 * Indicates that this is the only struct which contains the same pointer.
11439 * Rust functions which take ownership of an object provided via an argument require
11440 * this to be true and invalidate the object pointed to by inner.
11446 * The contents of CResult_PayeePubKeyErrorZ
11448 typedef union LDKCResult_PayeePubKeyErrorZPtr {
11450 * A pointer to the contents in the success state.
11451 * Reading from this pointer when `result_ok` is not set is undefined.
11453 struct LDKPayeePubKey *result;
11455 * A pointer to the contents in the error state.
11456 * Reading from this pointer when `result_ok` is set is undefined.
11458 enum LDKSecp256k1Error *err;
11459 } LDKCResult_PayeePubKeyErrorZPtr;
11462 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
11463 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
11464 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11466 typedef struct LDKCResult_PayeePubKeyErrorZ {
11468 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
11469 * `err` or `result` depending on the state of `result_ok`.
11471 union LDKCResult_PayeePubKeyErrorZPtr contents;
11473 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
11476 } LDKCResult_PayeePubKeyErrorZ;
11481 * Private routing information
11484 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
11487 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
11489 * A pointer to the opaque Rust object.
11490 * Nearly everywhere, inner must be non-null, however in places where
11491 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11493 LDKnativePrivateRoute *inner;
11495 * Indicates that this is the only struct which contains the same pointer.
11496 * Rust functions which take ownership of an object provided via an argument require
11497 * this to be true and invalidate the object pointed to by inner.
11503 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
11504 * This corresponds to std::vector in C++
11506 typedef struct LDKCVec_PrivateRouteZ {
11508 * The elements in the array.
11509 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11511 struct LDKPrivateRoute *data;
11513 * The number of elements pointed to by `data`.
11516 } LDKCVec_PrivateRouteZ;
11521 * A timestamp that refers to a date after 1 January 1970.
11525 * The Unix timestamp representing the stored time has to be positive and no greater than
11526 * [`MAX_TIMESTAMP`].
11528 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
11530 * A pointer to the opaque Rust object.
11531 * Nearly everywhere, inner must be non-null, however in places where
11532 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11534 LDKnativePositiveTimestamp *inner;
11536 * Indicates that this is the only struct which contains the same pointer.
11537 * Rust functions which take ownership of an object provided via an argument require
11538 * this to be true and invalidate the object pointed to by inner.
11541 } LDKPositiveTimestamp;
11544 * The contents of CResult_PositiveTimestampCreationErrorZ
11546 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
11548 * A pointer to the contents in the success state.
11549 * Reading from this pointer when `result_ok` is not set is undefined.
11551 struct LDKPositiveTimestamp *result;
11553 * A pointer to the contents in the error state.
11554 * Reading from this pointer when `result_ok` is set is undefined.
11556 enum LDKCreationError *err;
11557 } LDKCResult_PositiveTimestampCreationErrorZPtr;
11560 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
11561 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
11562 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11564 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
11566 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
11567 * `err` or `result` depending on the state of `result_ok`.
11569 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
11571 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
11574 } LDKCResult_PositiveTimestampCreationErrorZ;
11577 * The contents of CResult_NoneSemanticErrorZ
11579 typedef union LDKCResult_NoneSemanticErrorZPtr {
11581 * Note that this value is always NULL, as there are no contents in the OK variant
11585 * A pointer to the contents in the error state.
11586 * Reading from this pointer when `result_ok` is set is undefined.
11588 enum LDKSemanticError *err;
11589 } LDKCResult_NoneSemanticErrorZPtr;
11592 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
11593 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
11594 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11596 typedef struct LDKCResult_NoneSemanticErrorZ {
11598 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
11599 * `err` or `result` depending on the state of `result_ok`.
11601 union LDKCResult_NoneSemanticErrorZPtr contents;
11603 * Whether this CResult_NoneSemanticErrorZ represents a success state.
11606 } LDKCResult_NoneSemanticErrorZ;
11609 * The contents of CResult_InvoiceSemanticErrorZ
11611 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
11613 * A pointer to the contents in the success state.
11614 * Reading from this pointer when `result_ok` is not set is undefined.
11616 struct LDKInvoice *result;
11618 * A pointer to the contents in the error state.
11619 * Reading from this pointer when `result_ok` is set is undefined.
11621 enum LDKSemanticError *err;
11622 } LDKCResult_InvoiceSemanticErrorZPtr;
11625 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
11626 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
11627 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11629 typedef struct LDKCResult_InvoiceSemanticErrorZ {
11631 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
11632 * `err` or `result` depending on the state of `result_ok`.
11634 union LDKCResult_InvoiceSemanticErrorZPtr contents;
11636 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
11639 } LDKCResult_InvoiceSemanticErrorZ;
11642 * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
11643 * This corresponds to std::vector in C++
11645 typedef struct LDKCVec_AddressZ {
11647 * The elements in the array.
11648 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11650 struct LDKStr *data;
11652 * The number of elements pointed to by `data`.
11655 } LDKCVec_AddressZ;
11660 * Description string
11663 * The description can be at most 639 __bytes__ long
11665 typedef struct MUST_USE_STRUCT LDKDescription {
11667 * A pointer to the opaque Rust object.
11668 * Nearly everywhere, inner must be non-null, however in places where
11669 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11671 LDKnativeDescription *inner;
11673 * Indicates that this is the only struct which contains the same pointer.
11674 * Rust functions which take ownership of an object provided via an argument require
11675 * this to be true and invalidate the object pointed to by inner.
11681 * The contents of CResult_DescriptionCreationErrorZ
11683 typedef union LDKCResult_DescriptionCreationErrorZPtr {
11685 * A pointer to the contents in the success state.
11686 * Reading from this pointer when `result_ok` is not set is undefined.
11688 struct LDKDescription *result;
11690 * A pointer to the contents in the error state.
11691 * Reading from this pointer when `result_ok` is set is undefined.
11693 enum LDKCreationError *err;
11694 } LDKCResult_DescriptionCreationErrorZPtr;
11697 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
11698 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
11699 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11701 typedef struct LDKCResult_DescriptionCreationErrorZ {
11703 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
11704 * `err` or `result` depending on the state of `result_ok`.
11706 union LDKCResult_DescriptionCreationErrorZPtr contents;
11708 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
11711 } LDKCResult_DescriptionCreationErrorZ;
11714 * The contents of CResult_PrivateRouteCreationErrorZ
11716 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
11718 * A pointer to the contents in the success state.
11719 * Reading from this pointer when `result_ok` is not set is undefined.
11721 struct LDKPrivateRoute *result;
11723 * A pointer to the contents in the error state.
11724 * Reading from this pointer when `result_ok` is set is undefined.
11726 enum LDKCreationError *err;
11727 } LDKCResult_PrivateRouteCreationErrorZPtr;
11730 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
11731 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
11732 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11734 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
11736 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
11737 * `err` or `result` depending on the state of `result_ok`.
11739 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
11741 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
11744 } LDKCResult_PrivateRouteCreationErrorZ;
11747 * The contents of CResult_NetAddressDecodeErrorZ
11749 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
11751 * A pointer to the contents in the success state.
11752 * Reading from this pointer when `result_ok` is not set is undefined.
11754 struct LDKNetAddress *result;
11756 * A pointer to the contents in the error state.
11757 * Reading from this pointer when `result_ok` is set is undefined.
11759 struct LDKDecodeError *err;
11760 } LDKCResult_NetAddressDecodeErrorZPtr;
11763 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
11764 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
11765 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11767 typedef struct LDKCResult_NetAddressDecodeErrorZ {
11769 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
11770 * `err` or `result` depending on the state of `result_ok`.
11772 union LDKCResult_NetAddressDecodeErrorZPtr contents;
11774 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
11777 } LDKCResult_NetAddressDecodeErrorZ;
11782 * An [`update_add_htlc`] message to be sent to or received from a peer.
11784 * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
11786 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
11788 * A pointer to the opaque Rust object.
11789 * Nearly everywhere, inner must be non-null, however in places where
11790 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11792 LDKnativeUpdateAddHTLC *inner;
11794 * Indicates that this is the only struct which contains the same pointer.
11795 * Rust functions which take ownership of an object provided via an argument require
11796 * this to be true and invalidate the object pointed to by inner.
11799 } LDKUpdateAddHTLC;
11802 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
11803 * This corresponds to std::vector in C++
11805 typedef struct LDKCVec_UpdateAddHTLCZ {
11807 * The elements in the array.
11808 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11810 struct LDKUpdateAddHTLC *data;
11812 * The number of elements pointed to by `data`.
11815 } LDKCVec_UpdateAddHTLCZ;
11820 * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
11822 * [`update_fulfill_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
11824 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
11826 * A pointer to the opaque Rust object.
11827 * Nearly everywhere, inner must be non-null, however in places where
11828 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11830 LDKnativeUpdateFulfillHTLC *inner;
11832 * Indicates that this is the only struct which contains the same pointer.
11833 * Rust functions which take ownership of an object provided via an argument require
11834 * this to be true and invalidate the object pointed to by inner.
11837 } LDKUpdateFulfillHTLC;
11840 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
11841 * This corresponds to std::vector in C++
11843 typedef struct LDKCVec_UpdateFulfillHTLCZ {
11845 * The elements in the array.
11846 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11848 struct LDKUpdateFulfillHTLC *data;
11850 * The number of elements pointed to by `data`.
11853 } LDKCVec_UpdateFulfillHTLCZ;
11858 * An [`update_fail_htlc`] message to be sent to or received from a peer.
11860 * [`update_fail_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
11862 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
11864 * A pointer to the opaque Rust object.
11865 * Nearly everywhere, inner must be non-null, however in places where
11866 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11868 LDKnativeUpdateFailHTLC *inner;
11870 * Indicates that this is the only struct which contains the same pointer.
11871 * Rust functions which take ownership of an object provided via an argument require
11872 * this to be true and invalidate the object pointed to by inner.
11875 } LDKUpdateFailHTLC;
11878 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
11879 * This corresponds to std::vector in C++
11881 typedef struct LDKCVec_UpdateFailHTLCZ {
11883 * The elements in the array.
11884 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11886 struct LDKUpdateFailHTLC *data;
11888 * The number of elements pointed to by `data`.
11891 } LDKCVec_UpdateFailHTLCZ;
11896 * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
11898 * [`update_fail_malformed_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#removing-an-htlc-update_fulfill_htlc-update_fail_htlc-and-update_fail_malformed_htlc
11900 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
11902 * A pointer to the opaque Rust object.
11903 * Nearly everywhere, inner must be non-null, however in places where
11904 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11906 LDKnativeUpdateFailMalformedHTLC *inner;
11908 * Indicates that this is the only struct which contains the same pointer.
11909 * Rust functions which take ownership of an object provided via an argument require
11910 * this to be true and invalidate the object pointed to by inner.
11913 } LDKUpdateFailMalformedHTLC;
11916 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
11917 * This corresponds to std::vector in C++
11919 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
11921 * The elements in the array.
11922 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11924 struct LDKUpdateFailMalformedHTLC *data;
11926 * The number of elements pointed to by `data`.
11929 } LDKCVec_UpdateFailMalformedHTLCZ;
11932 * The contents of CResult_AcceptChannelDecodeErrorZ
11934 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
11936 * A pointer to the contents in the success state.
11937 * Reading from this pointer when `result_ok` is not set is undefined.
11939 struct LDKAcceptChannel *result;
11941 * A pointer to the contents in the error state.
11942 * Reading from this pointer when `result_ok` is set is undefined.
11944 struct LDKDecodeError *err;
11945 } LDKCResult_AcceptChannelDecodeErrorZPtr;
11948 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
11949 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
11950 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11952 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
11954 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
11955 * `err` or `result` depending on the state of `result_ok`.
11957 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
11959 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
11962 } LDKCResult_AcceptChannelDecodeErrorZ;
11965 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
11967 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
11969 * A pointer to the contents in the success state.
11970 * Reading from this pointer when `result_ok` is not set is undefined.
11972 struct LDKAnnouncementSignatures *result;
11974 * A pointer to the contents in the error state.
11975 * Reading from this pointer when `result_ok` is set is undefined.
11977 struct LDKDecodeError *err;
11978 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
11981 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
11982 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
11983 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11985 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
11987 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
11988 * `err` or `result` depending on the state of `result_ok`.
11990 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
11992 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
11995 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
11998 * The contents of CResult_ChannelReestablishDecodeErrorZ
12000 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
12002 * A pointer to the contents in the success state.
12003 * Reading from this pointer when `result_ok` is not set is undefined.
12005 struct LDKChannelReestablish *result;
12007 * A pointer to the contents in the error state.
12008 * Reading from this pointer when `result_ok` is set is undefined.
12010 struct LDKDecodeError *err;
12011 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
12014 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
12015 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
12016 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12018 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
12020 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
12021 * `err` or `result` depending on the state of `result_ok`.
12023 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
12025 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
12028 } LDKCResult_ChannelReestablishDecodeErrorZ;
12031 * The contents of CResult_ClosingSignedDecodeErrorZ
12033 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
12035 * A pointer to the contents in the success state.
12036 * Reading from this pointer when `result_ok` is not set is undefined.
12038 struct LDKClosingSigned *result;
12040 * A pointer to the contents in the error state.
12041 * Reading from this pointer when `result_ok` is set is undefined.
12043 struct LDKDecodeError *err;
12044 } LDKCResult_ClosingSignedDecodeErrorZPtr;
12047 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
12048 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
12049 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12051 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
12053 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
12054 * `err` or `result` depending on the state of `result_ok`.
12056 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
12058 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
12061 } LDKCResult_ClosingSignedDecodeErrorZ;
12066 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
12068 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
12071 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
12073 * A pointer to the opaque Rust object.
12074 * Nearly everywhere, inner must be non-null, however in places where
12075 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12077 LDKnativeClosingSignedFeeRange *inner;
12079 * Indicates that this is the only struct which contains the same pointer.
12080 * Rust functions which take ownership of an object provided via an argument require
12081 * this to be true and invalidate the object pointed to by inner.
12084 } LDKClosingSignedFeeRange;
12087 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
12089 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
12091 * A pointer to the contents in the success state.
12092 * Reading from this pointer when `result_ok` is not set is undefined.
12094 struct LDKClosingSignedFeeRange *result;
12096 * A pointer to the contents in the error state.
12097 * Reading from this pointer when `result_ok` is set is undefined.
12099 struct LDKDecodeError *err;
12100 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
12103 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
12104 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
12105 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12107 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
12109 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
12110 * `err` or `result` depending on the state of `result_ok`.
12112 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
12114 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
12117 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
12122 * A [`commitment_signed`] message to be sent to or received from a peer.
12124 * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
12126 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
12128 * A pointer to the opaque Rust object.
12129 * Nearly everywhere, inner must be non-null, however in places where
12130 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12132 LDKnativeCommitmentSigned *inner;
12134 * Indicates that this is the only struct which contains the same pointer.
12135 * Rust functions which take ownership of an object provided via an argument require
12136 * this to be true and invalidate the object pointed to by inner.
12139 } LDKCommitmentSigned;
12142 * The contents of CResult_CommitmentSignedDecodeErrorZ
12144 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
12146 * A pointer to the contents in the success state.
12147 * Reading from this pointer when `result_ok` is not set is undefined.
12149 struct LDKCommitmentSigned *result;
12151 * A pointer to the contents in the error state.
12152 * Reading from this pointer when `result_ok` is set is undefined.
12154 struct LDKDecodeError *err;
12155 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
12158 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
12159 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
12160 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12162 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
12164 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
12165 * `err` or `result` depending on the state of `result_ok`.
12167 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
12169 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
12172 } LDKCResult_CommitmentSignedDecodeErrorZ;
12175 * The contents of CResult_FundingCreatedDecodeErrorZ
12177 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
12179 * A pointer to the contents in the success state.
12180 * Reading from this pointer when `result_ok` is not set is undefined.
12182 struct LDKFundingCreated *result;
12184 * A pointer to the contents in the error state.
12185 * Reading from this pointer when `result_ok` is set is undefined.
12187 struct LDKDecodeError *err;
12188 } LDKCResult_FundingCreatedDecodeErrorZPtr;
12191 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
12192 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
12193 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12195 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
12197 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
12198 * `err` or `result` depending on the state of `result_ok`.
12200 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
12202 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
12205 } LDKCResult_FundingCreatedDecodeErrorZ;
12208 * The contents of CResult_FundingSignedDecodeErrorZ
12210 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
12212 * A pointer to the contents in the success state.
12213 * Reading from this pointer when `result_ok` is not set is undefined.
12215 struct LDKFundingSigned *result;
12217 * A pointer to the contents in the error state.
12218 * Reading from this pointer when `result_ok` is set is undefined.
12220 struct LDKDecodeError *err;
12221 } LDKCResult_FundingSignedDecodeErrorZPtr;
12224 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
12225 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
12226 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12228 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
12230 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
12231 * `err` or `result` depending on the state of `result_ok`.
12233 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
12235 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
12238 } LDKCResult_FundingSignedDecodeErrorZ;
12241 * The contents of CResult_ChannelReadyDecodeErrorZ
12243 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
12245 * A pointer to the contents in the success state.
12246 * Reading from this pointer when `result_ok` is not set is undefined.
12248 struct LDKChannelReady *result;
12250 * A pointer to the contents in the error state.
12251 * Reading from this pointer when `result_ok` is set is undefined.
12253 struct LDKDecodeError *err;
12254 } LDKCResult_ChannelReadyDecodeErrorZPtr;
12257 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
12258 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
12259 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12261 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
12263 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
12264 * `err` or `result` depending on the state of `result_ok`.
12266 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
12268 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
12271 } LDKCResult_ChannelReadyDecodeErrorZ;
12276 * An [`init`] message to be sent to or received from a peer.
12278 * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
12280 typedef struct MUST_USE_STRUCT LDKInit {
12282 * A pointer to the opaque Rust object.
12283 * Nearly everywhere, inner must be non-null, however in places where
12284 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12286 LDKnativeInit *inner;
12288 * Indicates that this is the only struct which contains the same pointer.
12289 * Rust functions which take ownership of an object provided via an argument require
12290 * this to be true and invalidate the object pointed to by inner.
12296 * The contents of CResult_InitDecodeErrorZ
12298 typedef union LDKCResult_InitDecodeErrorZPtr {
12300 * A pointer to the contents in the success state.
12301 * Reading from this pointer when `result_ok` is not set is undefined.
12303 struct LDKInit *result;
12305 * A pointer to the contents in the error state.
12306 * Reading from this pointer when `result_ok` is set is undefined.
12308 struct LDKDecodeError *err;
12309 } LDKCResult_InitDecodeErrorZPtr;
12312 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
12313 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
12314 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12316 typedef struct LDKCResult_InitDecodeErrorZ {
12318 * The contents of this CResult_InitDecodeErrorZ, accessible via either
12319 * `err` or `result` depending on the state of `result_ok`.
12321 union LDKCResult_InitDecodeErrorZPtr contents;
12323 * Whether this CResult_InitDecodeErrorZ represents a success state.
12326 } LDKCResult_InitDecodeErrorZ;
12329 * The contents of CResult_OpenChannelDecodeErrorZ
12331 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
12333 * A pointer to the contents in the success state.
12334 * Reading from this pointer when `result_ok` is not set is undefined.
12336 struct LDKOpenChannel *result;
12338 * A pointer to the contents in the error state.
12339 * Reading from this pointer when `result_ok` is set is undefined.
12341 struct LDKDecodeError *err;
12342 } LDKCResult_OpenChannelDecodeErrorZPtr;
12345 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
12346 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
12347 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12349 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
12351 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
12352 * `err` or `result` depending on the state of `result_ok`.
12354 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
12356 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
12359 } LDKCResult_OpenChannelDecodeErrorZ;
12362 * The contents of CResult_RevokeAndACKDecodeErrorZ
12364 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
12366 * A pointer to the contents in the success state.
12367 * Reading from this pointer when `result_ok` is not set is undefined.
12369 struct LDKRevokeAndACK *result;
12371 * A pointer to the contents in the error state.
12372 * Reading from this pointer when `result_ok` is set is undefined.
12374 struct LDKDecodeError *err;
12375 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
12378 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
12379 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
12380 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12382 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
12384 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
12385 * `err` or `result` depending on the state of `result_ok`.
12387 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
12389 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
12392 } LDKCResult_RevokeAndACKDecodeErrorZ;
12395 * The contents of CResult_ShutdownDecodeErrorZ
12397 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
12399 * A pointer to the contents in the success state.
12400 * Reading from this pointer when `result_ok` is not set is undefined.
12402 struct LDKShutdown *result;
12404 * A pointer to the contents in the error state.
12405 * Reading from this pointer when `result_ok` is set is undefined.
12407 struct LDKDecodeError *err;
12408 } LDKCResult_ShutdownDecodeErrorZPtr;
12411 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
12412 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
12413 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12415 typedef struct LDKCResult_ShutdownDecodeErrorZ {
12417 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
12418 * `err` or `result` depending on the state of `result_ok`.
12420 union LDKCResult_ShutdownDecodeErrorZPtr contents;
12422 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
12425 } LDKCResult_ShutdownDecodeErrorZ;
12428 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
12430 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
12432 * A pointer to the contents in the success state.
12433 * Reading from this pointer when `result_ok` is not set is undefined.
12435 struct LDKUpdateFailHTLC *result;
12437 * A pointer to the contents in the error state.
12438 * Reading from this pointer when `result_ok` is set is undefined.
12440 struct LDKDecodeError *err;
12441 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
12444 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
12445 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12446 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12448 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
12450 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
12451 * `err` or `result` depending on the state of `result_ok`.
12453 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
12455 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
12458 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
12461 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
12463 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
12465 * A pointer to the contents in the success state.
12466 * Reading from this pointer when `result_ok` is not set is undefined.
12468 struct LDKUpdateFailMalformedHTLC *result;
12470 * A pointer to the contents in the error state.
12471 * Reading from this pointer when `result_ok` is set is undefined.
12473 struct LDKDecodeError *err;
12474 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
12477 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
12478 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12479 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12481 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
12483 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
12484 * `err` or `result` depending on the state of `result_ok`.
12486 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
12488 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
12491 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
12496 * An [`update_fee`] message to be sent to or received from a peer
12498 * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
12500 typedef struct MUST_USE_STRUCT LDKUpdateFee {
12502 * A pointer to the opaque Rust object.
12503 * Nearly everywhere, inner must be non-null, however in places where
12504 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12506 LDKnativeUpdateFee *inner;
12508 * Indicates that this is the only struct which contains the same pointer.
12509 * Rust functions which take ownership of an object provided via an argument require
12510 * this to be true and invalidate the object pointed to by inner.
12516 * The contents of CResult_UpdateFeeDecodeErrorZ
12518 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
12520 * A pointer to the contents in the success state.
12521 * Reading from this pointer when `result_ok` is not set is undefined.
12523 struct LDKUpdateFee *result;
12525 * A pointer to the contents in the error state.
12526 * Reading from this pointer when `result_ok` is set is undefined.
12528 struct LDKDecodeError *err;
12529 } LDKCResult_UpdateFeeDecodeErrorZPtr;
12532 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
12533 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
12534 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12536 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
12538 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
12539 * `err` or `result` depending on the state of `result_ok`.
12541 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
12543 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
12546 } LDKCResult_UpdateFeeDecodeErrorZ;
12549 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
12551 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
12553 * A pointer to the contents in the success state.
12554 * Reading from this pointer when `result_ok` is not set is undefined.
12556 struct LDKUpdateFulfillHTLC *result;
12558 * A pointer to the contents in the error state.
12559 * Reading from this pointer when `result_ok` is set is undefined.
12561 struct LDKDecodeError *err;
12562 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
12565 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
12566 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12567 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12569 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
12571 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
12572 * `err` or `result` depending on the state of `result_ok`.
12574 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
12576 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
12579 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
12582 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
12584 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
12586 * A pointer to the contents in the success state.
12587 * Reading from this pointer when `result_ok` is not set is undefined.
12589 struct LDKUpdateAddHTLC *result;
12591 * A pointer to the contents in the error state.
12592 * Reading from this pointer when `result_ok` is set is undefined.
12594 struct LDKDecodeError *err;
12595 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
12598 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
12599 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12600 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12602 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
12604 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
12605 * `err` or `result` depending on the state of `result_ok`.
12607 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
12609 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
12612 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
12617 * An onion message to be sent to or received from a peer.
12620 typedef struct MUST_USE_STRUCT LDKOnionMessage {
12622 * A pointer to the opaque Rust object.
12623 * Nearly everywhere, inner must be non-null, however in places where
12624 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12626 LDKnativeOnionMessage *inner;
12628 * Indicates that this is the only struct which contains the same pointer.
12629 * Rust functions which take ownership of an object provided via an argument require
12630 * this to be true and invalidate the object pointed to by inner.
12636 * The contents of CResult_OnionMessageDecodeErrorZ
12638 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
12640 * A pointer to the contents in the success state.
12641 * Reading from this pointer when `result_ok` is not set is undefined.
12643 struct LDKOnionMessage *result;
12645 * A pointer to the contents in the error state.
12646 * Reading from this pointer when `result_ok` is set is undefined.
12648 struct LDKDecodeError *err;
12649 } LDKCResult_OnionMessageDecodeErrorZPtr;
12652 * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
12653 * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12654 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12656 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
12658 * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
12659 * `err` or `result` depending on the state of `result_ok`.
12661 union LDKCResult_OnionMessageDecodeErrorZPtr contents;
12663 * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
12666 } LDKCResult_OnionMessageDecodeErrorZ;
12671 * A [`ping`] message to be sent to or received from a peer.
12673 * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
12675 typedef struct MUST_USE_STRUCT LDKPing {
12677 * A pointer to the opaque Rust object.
12678 * Nearly everywhere, inner must be non-null, however in places where
12679 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12681 LDKnativePing *inner;
12683 * Indicates that this is the only struct which contains the same pointer.
12684 * Rust functions which take ownership of an object provided via an argument require
12685 * this to be true and invalidate the object pointed to by inner.
12691 * The contents of CResult_PingDecodeErrorZ
12693 typedef union LDKCResult_PingDecodeErrorZPtr {
12695 * A pointer to the contents in the success state.
12696 * Reading from this pointer when `result_ok` is not set is undefined.
12698 struct LDKPing *result;
12700 * A pointer to the contents in the error state.
12701 * Reading from this pointer when `result_ok` is set is undefined.
12703 struct LDKDecodeError *err;
12704 } LDKCResult_PingDecodeErrorZPtr;
12707 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
12708 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
12709 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12711 typedef struct LDKCResult_PingDecodeErrorZ {
12713 * The contents of this CResult_PingDecodeErrorZ, accessible via either
12714 * `err` or `result` depending on the state of `result_ok`.
12716 union LDKCResult_PingDecodeErrorZPtr contents;
12718 * Whether this CResult_PingDecodeErrorZ represents a success state.
12721 } LDKCResult_PingDecodeErrorZ;
12726 * A [`pong`] message to be sent to or received from a peer.
12728 * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
12730 typedef struct MUST_USE_STRUCT LDKPong {
12732 * A pointer to the opaque Rust object.
12733 * Nearly everywhere, inner must be non-null, however in places where
12734 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12736 LDKnativePong *inner;
12738 * Indicates that this is the only struct which contains the same pointer.
12739 * Rust functions which take ownership of an object provided via an argument require
12740 * this to be true and invalidate the object pointed to by inner.
12746 * The contents of CResult_PongDecodeErrorZ
12748 typedef union LDKCResult_PongDecodeErrorZPtr {
12750 * A pointer to the contents in the success state.
12751 * Reading from this pointer when `result_ok` is not set is undefined.
12753 struct LDKPong *result;
12755 * A pointer to the contents in the error state.
12756 * Reading from this pointer when `result_ok` is set is undefined.
12758 struct LDKDecodeError *err;
12759 } LDKCResult_PongDecodeErrorZPtr;
12762 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
12763 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
12764 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12766 typedef struct LDKCResult_PongDecodeErrorZ {
12768 * The contents of this CResult_PongDecodeErrorZ, accessible via either
12769 * `err` or `result` depending on the state of `result_ok`.
12771 union LDKCResult_PongDecodeErrorZPtr contents;
12773 * Whether this CResult_PongDecodeErrorZ represents a success state.
12776 } LDKCResult_PongDecodeErrorZ;
12779 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
12781 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
12783 * A pointer to the contents in the success state.
12784 * Reading from this pointer when `result_ok` is not set is undefined.
12786 struct LDKUnsignedChannelAnnouncement *result;
12788 * A pointer to the contents in the error state.
12789 * Reading from this pointer when `result_ok` is set is undefined.
12791 struct LDKDecodeError *err;
12792 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
12795 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
12796 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12797 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12799 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
12801 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
12802 * `err` or `result` depending on the state of `result_ok`.
12804 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
12806 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
12809 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
12812 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
12814 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
12816 * A pointer to the contents in the success state.
12817 * Reading from this pointer when `result_ok` is not set is undefined.
12819 struct LDKChannelAnnouncement *result;
12821 * A pointer to the contents in the error state.
12822 * Reading from this pointer when `result_ok` is set is undefined.
12824 struct LDKDecodeError *err;
12825 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
12828 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
12829 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12830 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12832 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
12834 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
12835 * `err` or `result` depending on the state of `result_ok`.
12837 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
12839 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
12842 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
12845 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
12847 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
12849 * A pointer to the contents in the success state.
12850 * Reading from this pointer when `result_ok` is not set is undefined.
12852 struct LDKUnsignedChannelUpdate *result;
12854 * A pointer to the contents in the error state.
12855 * Reading from this pointer when `result_ok` is set is undefined.
12857 struct LDKDecodeError *err;
12858 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
12861 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12862 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12863 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12865 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
12867 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
12868 * `err` or `result` depending on the state of `result_ok`.
12870 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
12872 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
12875 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
12878 * The contents of CResult_ChannelUpdateDecodeErrorZ
12880 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
12882 * A pointer to the contents in the success state.
12883 * Reading from this pointer when `result_ok` is not set is undefined.
12885 struct LDKChannelUpdate *result;
12887 * A pointer to the contents in the error state.
12888 * Reading from this pointer when `result_ok` is set is undefined.
12890 struct LDKDecodeError *err;
12891 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
12894 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12895 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12896 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12898 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
12900 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
12901 * `err` or `result` depending on the state of `result_ok`.
12903 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
12905 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
12908 } LDKCResult_ChannelUpdateDecodeErrorZ;
12911 * The contents of CResult_ErrorMessageDecodeErrorZ
12913 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
12915 * A pointer to the contents in the success state.
12916 * Reading from this pointer when `result_ok` is not set is undefined.
12918 struct LDKErrorMessage *result;
12920 * A pointer to the contents in the error state.
12921 * Reading from this pointer when `result_ok` is set is undefined.
12923 struct LDKDecodeError *err;
12924 } LDKCResult_ErrorMessageDecodeErrorZPtr;
12927 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
12928 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12929 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12931 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
12933 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
12934 * `err` or `result` depending on the state of `result_ok`.
12936 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
12938 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
12941 } LDKCResult_ErrorMessageDecodeErrorZ;
12944 * The contents of CResult_WarningMessageDecodeErrorZ
12946 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
12948 * A pointer to the contents in the success state.
12949 * Reading from this pointer when `result_ok` is not set is undefined.
12951 struct LDKWarningMessage *result;
12953 * A pointer to the contents in the error state.
12954 * Reading from this pointer when `result_ok` is set is undefined.
12956 struct LDKDecodeError *err;
12957 } LDKCResult_WarningMessageDecodeErrorZPtr;
12960 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
12961 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12962 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12964 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
12966 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
12967 * `err` or `result` depending on the state of `result_ok`.
12969 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
12971 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
12974 } LDKCResult_WarningMessageDecodeErrorZ;
12977 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
12979 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
12981 * A pointer to the contents in the success state.
12982 * Reading from this pointer when `result_ok` is not set is undefined.
12984 struct LDKUnsignedNodeAnnouncement *result;
12986 * A pointer to the contents in the error state.
12987 * Reading from this pointer when `result_ok` is set is undefined.
12989 struct LDKDecodeError *err;
12990 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
12993 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
12994 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12995 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12997 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
12999 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
13000 * `err` or `result` depending on the state of `result_ok`.
13002 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
13004 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
13007 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
13010 * The contents of CResult_NodeAnnouncementDecodeErrorZ
13012 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
13014 * A pointer to the contents in the success state.
13015 * Reading from this pointer when `result_ok` is not set is undefined.
13017 struct LDKNodeAnnouncement *result;
13019 * A pointer to the contents in the error state.
13020 * Reading from this pointer when `result_ok` is set is undefined.
13022 struct LDKDecodeError *err;
13023 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
13026 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
13027 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
13028 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13030 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
13032 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
13033 * `err` or `result` depending on the state of `result_ok`.
13035 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
13037 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
13040 } LDKCResult_NodeAnnouncementDecodeErrorZ;
13043 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
13045 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
13047 * A pointer to the contents in the success state.
13048 * Reading from this pointer when `result_ok` is not set is undefined.
13050 struct LDKQueryShortChannelIds *result;
13052 * A pointer to the contents in the error state.
13053 * Reading from this pointer when `result_ok` is set is undefined.
13055 struct LDKDecodeError *err;
13056 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
13059 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
13060 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
13061 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13063 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
13065 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
13066 * `err` or `result` depending on the state of `result_ok`.
13068 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
13070 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
13073 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
13078 * A [`reply_short_channel_ids_end`] message is sent as a reply to a
13079 * message. The query recipient makes a best
13080 * effort to respond based on their local network view which may not be
13081 * a perfect view of the network.
13083 * [`reply_short_channel_ids_end`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_short_channel_idsreply_short_channel_ids_end-messages
13085 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
13087 * A pointer to the opaque Rust object.
13088 * Nearly everywhere, inner must be non-null, however in places where
13089 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13091 LDKnativeReplyShortChannelIdsEnd *inner;
13093 * Indicates that this is the only struct which contains the same pointer.
13094 * Rust functions which take ownership of an object provided via an argument require
13095 * this to be true and invalidate the object pointed to by inner.
13098 } LDKReplyShortChannelIdsEnd;
13101 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
13103 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
13105 * A pointer to the contents in the success state.
13106 * Reading from this pointer when `result_ok` is not set is undefined.
13108 struct LDKReplyShortChannelIdsEnd *result;
13110 * A pointer to the contents in the error state.
13111 * Reading from this pointer when `result_ok` is set is undefined.
13113 struct LDKDecodeError *err;
13114 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
13117 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
13118 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
13119 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13121 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
13123 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
13124 * `err` or `result` depending on the state of `result_ok`.
13126 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
13128 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
13131 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
13134 * The contents of CResult_QueryChannelRangeDecodeErrorZ
13136 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
13138 * A pointer to the contents in the success state.
13139 * Reading from this pointer when `result_ok` is not set is undefined.
13141 struct LDKQueryChannelRange *result;
13143 * A pointer to the contents in the error state.
13144 * Reading from this pointer when `result_ok` is set is undefined.
13146 struct LDKDecodeError *err;
13147 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
13150 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
13151 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
13152 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13154 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
13156 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
13157 * `err` or `result` depending on the state of `result_ok`.
13159 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
13161 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
13164 } LDKCResult_QueryChannelRangeDecodeErrorZ;
13167 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
13169 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
13171 * A pointer to the contents in the success state.
13172 * Reading from this pointer when `result_ok` is not set is undefined.
13174 struct LDKReplyChannelRange *result;
13176 * A pointer to the contents in the error state.
13177 * Reading from this pointer when `result_ok` is set is undefined.
13179 struct LDKDecodeError *err;
13180 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
13183 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
13184 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
13185 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13187 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
13189 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
13190 * `err` or `result` depending on the state of `result_ok`.
13192 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
13194 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
13197 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
13200 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
13202 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
13204 * A pointer to the contents in the success state.
13205 * Reading from this pointer when `result_ok` is not set is undefined.
13207 struct LDKGossipTimestampFilter *result;
13209 * A pointer to the contents in the error state.
13210 * Reading from this pointer when `result_ok` is set is undefined.
13212 struct LDKDecodeError *err;
13213 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
13216 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
13217 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
13218 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13220 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
13222 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
13223 * `err` or `result` depending on the state of `result_ok`.
13225 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
13227 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
13230 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
13233 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
13234 * This corresponds to std::vector in C++
13236 typedef struct LDKCVec_PhantomRouteHintsZ {
13238 * The elements in the array.
13239 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13241 struct LDKPhantomRouteHints *data;
13243 * The number of elements pointed to by `data`.
13246 } LDKCVec_PhantomRouteHintsZ;
13249 * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
13252 typedef enum LDKSignOrCreationError_Tag {
13254 * An error occurred during signing
13256 LDKSignOrCreationError_SignError,
13258 * An error occurred while building the transaction
13260 LDKSignOrCreationError_CreationError,
13262 * Must be last for serialization purposes
13264 LDKSignOrCreationError_Sentinel,
13265 } LDKSignOrCreationError_Tag;
13267 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
13268 LDKSignOrCreationError_Tag tag;
13271 enum LDKCreationError creation_error;
13274 } LDKSignOrCreationError;
13277 * The contents of CResult_InvoiceSignOrCreationErrorZ
13279 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
13281 * A pointer to the contents in the success state.
13282 * Reading from this pointer when `result_ok` is not set is undefined.
13284 struct LDKInvoice *result;
13286 * A pointer to the contents in the error state.
13287 * Reading from this pointer when `result_ok` is set is undefined.
13289 struct LDKSignOrCreationError *err;
13290 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
13293 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
13294 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
13295 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13297 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
13299 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
13300 * `err` or `result` depending on the state of `result_ok`.
13302 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
13304 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
13307 } LDKCResult_InvoiceSignOrCreationErrorZ;
13312 * A simple future which can complete once, and calls some callback(s) when it does so.
13314 * Clones can be made and all futures cloned from the same source will complete at the same time.
13316 typedef struct MUST_USE_STRUCT LDKFuture {
13318 * A pointer to the opaque Rust object.
13319 * Nearly everywhere, inner must be non-null, however in places where
13320 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13322 LDKnativeFuture *inner;
13324 * Indicates that this is the only struct which contains the same pointer.
13325 * Rust functions which take ownership of an object provided via an argument require
13326 * this to be true and invalidate the object pointed to by inner.
13332 * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
13333 * This corresponds to std::vector in C++
13335 typedef struct LDKCVec_FutureZ {
13337 * The elements in the array.
13338 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13340 struct LDKFuture *data;
13342 * The number of elements pointed to by `data`.
13350 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
13352 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
13353 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
13354 * [`Confirm::transactions_confirmed`].
13356 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
13357 * may have been spent there. See [`Filter::register_output`] for details.
13359 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
13360 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
13362 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
13364 * A pointer to the opaque Rust object.
13365 * Nearly everywhere, inner must be non-null, however in places where
13366 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13368 LDKnativeWatchedOutput *inner;
13370 * Indicates that this is the only struct which contains the same pointer.
13371 * Rust functions which take ownership of an object provided via an argument require
13372 * this to be true and invalidate the object pointed to by inner.
13375 } LDKWatchedOutput;
13378 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
13381 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
13382 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
13383 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
13384 * receiving full blocks from a chain source, any further filtering is unnecessary.
13386 * After an output has been registered, subsequent block retrievals from the chain source must not
13387 * exclude any transactions matching the new criteria nor any in-block descendants of such
13390 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
13391 * should not block on I/O. Implementations should instead queue the newly monitored data to be
13392 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
13393 * invocation that has called the `Filter` must return [`InProgress`].
13395 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
13396 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
13397 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
13399 typedef struct LDKFilter {
13401 * An opaque pointer which is passed to your function implementations as an argument.
13402 * This has no meaning in the LDK, and can be NULL or any other value.
13406 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
13407 * a spending condition.
13409 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
13411 * Registers interest in spends of a transaction output.
13413 * Note that this method might be called during processing of a new block. You therefore need
13414 * to ensure that also dependent output spents within an already connected block are correctly
13415 * handled, e.g., by re-scanning the block in question whenever new outputs have been
13416 * registered mid-processing.
13418 void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
13420 * Frees any resources associated with this object given its this_arg pointer.
13421 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13423 void (*free)(void *this_arg);
13427 * An enum which can either contain a crate::lightning::chain::Filter or not
13429 typedef enum LDKCOption_FilterZ_Tag {
13431 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
13433 LDKCOption_FilterZ_Some,
13435 * When we're in this state, this COption_FilterZ contains nothing
13437 LDKCOption_FilterZ_None,
13439 * Must be last for serialization purposes
13441 LDKCOption_FilterZ_Sentinel,
13442 } LDKCOption_FilterZ_Tag;
13444 typedef struct LDKCOption_FilterZ {
13445 LDKCOption_FilterZ_Tag tag;
13448 struct LDKFilter some;
13451 } LDKCOption_FilterZ;
13456 * A read-only reference to a current ChannelMonitor.
13458 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
13461 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
13463 * A pointer to the opaque Rust object.
13464 * Nearly everywhere, inner must be non-null, however in places where
13465 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13467 LDKnativeLockedChannelMonitor *inner;
13469 * Indicates that this is the only struct which contains the same pointer.
13470 * Rust functions which take ownership of an object provided via an argument require
13471 * this to be true and invalidate the object pointed to by inner.
13474 } LDKLockedChannelMonitor;
13477 * The contents of CResult_LockedChannelMonitorNoneZ
13479 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
13481 * A pointer to the contents in the success state.
13482 * Reading from this pointer when `result_ok` is not set is undefined.
13484 struct LDKLockedChannelMonitor *result;
13486 * Note that this value is always NULL, as there are no contents in the Err variant
13489 } LDKCResult_LockedChannelMonitorNoneZPtr;
13492 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
13493 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
13494 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13496 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
13498 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
13499 * `err` or `result` depending on the state of `result_ok`.
13501 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
13503 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
13506 } LDKCResult_LockedChannelMonitorNoneZ;
13509 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
13510 * This corresponds to std::vector in C++
13512 typedef struct LDKCVec_OutPointZ {
13514 * The elements in the array.
13515 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13517 struct LDKOutPoint *data;
13519 * The number of elements pointed to by `data`.
13522 } LDKCVec_OutPointZ;
13527 * An opaque identifier describing a specific [`Persist`] method call.
13529 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
13531 * A pointer to the opaque Rust object.
13532 * Nearly everywhere, inner must be non-null, however in places where
13533 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13535 LDKnativeMonitorUpdateId *inner;
13537 * Indicates that this is the only struct which contains the same pointer.
13538 * Rust functions which take ownership of an object provided via an argument require
13539 * this to be true and invalidate the object pointed to by inner.
13542 } LDKMonitorUpdateId;
13545 * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
13546 * This corresponds to std::vector in C++
13548 typedef struct LDKCVec_MonitorUpdateIdZ {
13550 * The elements in the array.
13551 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13553 struct LDKMonitorUpdateId *data;
13555 * The number of elements pointed to by `data`.
13558 } LDKCVec_MonitorUpdateIdZ;
13561 * A tuple of 2 elements. See the individual fields for the types contained.
13563 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
13565 * The element at position 0
13567 struct LDKOutPoint a;
13569 * The element at position 1
13571 struct LDKCVec_MonitorUpdateIdZ b;
13572 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
13575 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
13576 * This corresponds to std::vector in C++
13578 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
13580 * The elements in the array.
13581 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13583 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
13585 * The number of elements pointed to by `data`.
13588 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
13591 * All-encompassing standard error type that processing can return
13593 typedef enum LDKGraphSyncError_Tag {
13595 * Error trying to read the update data, typically due to an erroneous data length indication
13596 * that is greater than the actual amount of data provided
13598 LDKGraphSyncError_DecodeError,
13600 * Error applying the patch to the network graph, usually the result of updates that are too
13601 * old or missing prerequisite data to the application of updates out of order
13603 LDKGraphSyncError_LightningError,
13605 * Must be last for serialization purposes
13607 LDKGraphSyncError_Sentinel,
13608 } LDKGraphSyncError_Tag;
13610 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
13611 LDKGraphSyncError_Tag tag;
13614 struct LDKDecodeError decode_error;
13617 struct LDKLightningError lightning_error;
13620 } LDKGraphSyncError;
13623 * The contents of CResult_u32GraphSyncErrorZ
13625 typedef union LDKCResult_u32GraphSyncErrorZPtr {
13627 * A pointer to the contents in the success state.
13628 * Reading from this pointer when `result_ok` is not set is undefined.
13632 * A pointer to the contents in the error state.
13633 * Reading from this pointer when `result_ok` is set is undefined.
13635 struct LDKGraphSyncError *err;
13636 } LDKCResult_u32GraphSyncErrorZPtr;
13639 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
13640 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
13641 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13643 typedef struct LDKCResult_u32GraphSyncErrorZ {
13645 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
13646 * `err` or `result` depending on the state of `result_ok`.
13648 union LDKCResult_u32GraphSyncErrorZPtr contents;
13650 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
13653 } LDKCResult_u32GraphSyncErrorZ;
13658 * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
13659 * variable-length integers except that it is serialized in big-endian instead of little-endian.
13661 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
13662 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
13663 * you're looking for an example of a variable-length integer to use for your own project, move
13664 * along, this is a rather poor design.
13666 typedef struct MUST_USE_STRUCT LDKBigSize {
13668 * A pointer to the opaque Rust object.
13669 * Nearly everywhere, inner must be non-null, however in places where
13670 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13672 LDKnativeBigSize *inner;
13674 * Indicates that this is the only struct which contains the same pointer.
13675 * Rust functions which take ownership of an object provided via an argument require
13676 * this to be true and invalidate the object pointed to by inner.
13682 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
13684 typedef struct LDKPersister {
13686 * An opaque pointer which is passed to your function implementations as an argument.
13687 * This has no meaning in the LDK, and can be NULL or any other value.
13691 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
13693 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
13695 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
13697 struct LDKCResult_NoneErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
13699 * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
13701 struct LDKCResult_NoneErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
13703 * Frees any resources associated with this object given its this_arg pointer.
13704 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13706 void (*free)(void *this_arg);
13712 * A string that displays only printable characters, replacing control characters with
13713 * [`core::char::REPLACEMENT_CHARACTER`].
13715 typedef struct MUST_USE_STRUCT LDKPrintableString {
13717 * A pointer to the opaque Rust object.
13718 * Nearly everywhere, inner must be non-null, however in places where
13719 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13721 LDKnativePrintableString *inner;
13723 * Indicates that this is the only struct which contains the same pointer.
13724 * Rust functions which take ownership of an object provided via an argument require
13725 * this to be true and invalidate the object pointed to by inner.
13728 } LDKPrintableString;
13731 * A callback which is called when a [`Future`] completes.
13733 * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
13734 * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
13737 * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
13738 * futures when they receive a wake, rather than immediately executing them.
13740 typedef struct LDKFutureCallback {
13742 * An opaque pointer which is passed to your function implementations as an argument.
13743 * This has no meaning in the LDK, and can be NULL or any other value.
13747 * The method which is called.
13749 void (*call)(const void *this_arg);
13751 * Frees any resources associated with this object given its this_arg pointer.
13752 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13754 void (*free)(void *this_arg);
13755 } LDKFutureCallback;
13760 * A struct which can be used to select across many [`Future`]s at once without relying on a full
13763 typedef struct MUST_USE_STRUCT LDKSleeper {
13765 * A pointer to the opaque Rust object.
13766 * Nearly everywhere, inner must be non-null, however in places where
13767 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13769 LDKnativeSleeper *inner;
13771 * Indicates that this is the only struct which contains the same pointer.
13772 * Rust functions which take ownership of an object provided via an argument require
13773 * this to be true and invalidate the object pointed to by inner.
13781 * Configuration we set when applicable.
13783 * Default::default() provides sane defaults.
13785 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
13787 * A pointer to the opaque Rust object.
13788 * Nearly everywhere, inner must be non-null, however in places where
13789 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13791 LDKnativeChannelHandshakeConfig *inner;
13793 * Indicates that this is the only struct which contains the same pointer.
13794 * Rust functions which take ownership of an object provided via an argument require
13795 * this to be true and invalidate the object pointed to by inner.
13798 } LDKChannelHandshakeConfig;
13803 * Optional channel limits which are applied during channel creation.
13805 * These limits are only applied to our counterparty's limits, not our own.
13807 * Use 0/`<type>::max_value()` as appropriate to skip checking.
13809 * Provides sane defaults for most configurations.
13811 * Most additional limits are disabled except those with which specify a default in individual
13812 * field documentation. Note that this may result in barely-usable channels, but since they
13813 * are applied mostly only to incoming channels that's not much of a problem.
13815 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
13817 * A pointer to the opaque Rust object.
13818 * Nearly everywhere, inner must be non-null, however in places where
13819 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13821 LDKnativeChannelHandshakeLimits *inner;
13823 * Indicates that this is the only struct which contains the same pointer.
13824 * Rust functions which take ownership of an object provided via an argument require
13825 * this to be true and invalidate the object pointed to by inner.
13828 } LDKChannelHandshakeLimits;
13833 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
13835 * Default::default() provides sane defaults for most configurations
13836 * (but currently with 0 relay fees!)
13838 typedef struct MUST_USE_STRUCT LDKUserConfig {
13840 * A pointer to the opaque Rust object.
13841 * Nearly everywhere, inner must be non-null, however in places where
13842 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13844 LDKnativeUserConfig *inner;
13846 * Indicates that this is the only struct which contains the same pointer.
13847 * Rust functions which take ownership of an object provided via an argument require
13848 * this to be true and invalidate the object pointed to by inner.
13856 * The best known block as identified by its hash and height.
13858 typedef struct MUST_USE_STRUCT LDKBestBlock {
13860 * A pointer to the opaque Rust object.
13861 * Nearly everywhere, inner must be non-null, however in places where
13862 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13864 LDKnativeBestBlock *inner;
13866 * Indicates that this is the only struct which contains the same pointer.
13867 * Rust functions which take ownership of an object provided via an argument require
13868 * this to be true and invalidate the object pointed to by inner.
13874 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
13877 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
13878 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
13879 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
13882 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
13883 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
13884 * other similar filtering.
13886 typedef struct LDKListen {
13888 * An opaque pointer which is passed to your function implementations as an argument.
13889 * This has no meaning in the LDK, and can be NULL or any other value.
13893 * Notifies the listener that a block was added at the given height, with the transaction data
13894 * possibly filtered.
13896 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
13898 * Notifies the listener that a block was added at the given height.
13900 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
13902 * Notifies the listener that a block was removed at the given height.
13904 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
13906 * Frees any resources associated with this object given its this_arg pointer.
13907 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13909 void (*free)(void *this_arg);
13913 * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
13914 * chain or unconfirmed during a chain reorganization.
13916 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
13917 * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
13918 * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
13919 * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
13920 * with reference to the confirmation status of the monitored objects.
13923 * The intended use is as follows:
13924 * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
13925 * outputs are, respectively, confirmed or spent on chain.
13926 * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
13927 * [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
13928 * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
13932 * Clients must call these methods in chain order. Specifically:
13933 * - Transactions which are confirmed in a particular block must be given before transactions
13934 * confirmed in a later block.
13935 * - Dependent transactions within the same block must be given in topological order, possibly in
13937 * - All unconfirmed transactions must be given after the original confirmations and before *any*
13938 * reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
13939 * never be interleaved, but always conduced *en bloc*.
13940 * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
13941 * in regard to the new block.
13943 * See individual method documentation for further details.
13945 * [`transactions_confirmed`]: Self::transactions_confirmed
13946 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
13947 * [`best_block_updated`]: Self::best_block_updated
13948 * [`get_relevant_txids`]: Self::get_relevant_txids
13950 typedef struct LDKConfirm {
13952 * An opaque pointer which is passed to your function implementations as an argument.
13953 * This has no meaning in the LDK, and can be NULL or any other value.
13957 * Notifies LDK of transactions confirmed in a block with a given header and height.
13959 * Must be called for any transactions registered by [`Filter::register_tx`] or any
13960 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
13961 * appearing in the same block do not need to be included in the same call; instead, multiple
13962 * calls with additional transactions may be made so long as they are made in [chain order].
13964 * May be called before or after [`best_block_updated`] for the corresponding block. However,
13965 * in the event of a chain reorganization, it must not be called with a `header` that is no
13966 * longer in the chain as of the last call to [`best_block_updated`].
13968 * [chain order]: Confirm#order
13969 * [`best_block_updated`]: Self::best_block_updated
13971 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
13973 * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
13975 * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
13976 * reorganized out of the best chain or if it is no longer confirmed in the block with the
13977 * given block hash. Once called, the given transaction will not be returned
13978 * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
13980 * [`get_relevant_txids`]: Self::get_relevant_txids
13981 * [`transactions_confirmed`]: Self::transactions_confirmed
13983 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
13985 * Notifies LDK of an update to the best header connected at the given height.
13987 * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
13990 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
13992 * Returns transactions that must be monitored for reorganization out of the chain along
13993 * with the hash of the block as part of which it had been previously confirmed.
13995 * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
13996 * 0.0.112 and prior, in which case you need to manually track previous confirmations.
13998 * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
13999 * confirmations to be safe from a chain reorganization. Will not include any transactions
14000 * passed to [`transaction_unconfirmed`], unless later reconfirmed.
14002 * Must be called to determine the subset of transactions that must be monitored for
14003 * reorganization. Will be idempotent between calls but may change as a result of calls to the
14004 * other interface methods. Thus, this is useful to determine which transactions must be
14005 * given to [`transaction_unconfirmed`].
14007 * If any of the returned transactions are confirmed in a block other than the one with the
14008 * given hash, they need to be unconfirmed and reconfirmed via [`transaction_unconfirmed`] and
14009 * [`transactions_confirmed`], respectively.
14011 * [`transactions_confirmed`]: Self::transactions_confirmed
14012 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
14014 struct LDKCVec_C2Tuple_TxidBlockHashZZ (*get_relevant_txids)(const void *this_arg);
14016 * Frees any resources associated with this object given its this_arg pointer.
14017 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14019 void (*free)(void *this_arg);
14023 * `Persist` defines behavior for persisting channel monitors: this could mean
14024 * writing once to disk, and/or uploading to one or more backup services.
14026 * Each method can return three possible values:
14027 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
14028 * implementation should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal
14029 * channel operation should continue.
14030 * * If persistence happens asynchronously, implementations should first ensure the
14031 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
14032 * [`ChannelMonitorUpdateStatus::InProgress`] while the update continues in the background.
14033 * Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be called with
14034 * the corresponding [`MonitorUpdateId`].
14036 * Note that unlike the direct [`chain::Watch`] interface,
14037 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
14039 * * If persistence fails for some reason, implementations should return
14040 * [`ChannelMonitorUpdateStatus::PermanentFailure`], in which case the channel will likely be
14041 * closed without broadcasting the latest state. See
14042 * [`ChannelMonitorUpdateStatus::PermanentFailure`] for more details.
14044 typedef struct LDKPersist {
14046 * An opaque pointer which is passed to your function implementations as an argument.
14047 * This has no meaning in the LDK, and can be NULL or any other value.
14051 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
14052 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
14054 * The data can be stored any way you want, but the identifier provided by LDK is the
14055 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
14056 * and the stored channel data). Note that you **must** persist every new monitor to disk.
14058 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
14059 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
14061 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
14062 * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
14064 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14065 * [`Writeable::write`]: crate::util::ser::Writeable::write
14067 enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
14069 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
14072 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
14073 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
14076 * During blockchain synchronization operations, this may be called with no
14077 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
14078 * Note that after the full [`ChannelMonitor`] is persisted any previous
14079 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
14080 * applied to the persisted [`ChannelMonitor`] as they were already applied.
14082 * If an implementer chooses to persist the updates only, they need to make
14083 * sure that all the updates are applied to the `ChannelMonitors` *before*
14084 * the set of channel monitors is given to the `ChannelManager`
14085 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
14086 * applying a monitor update to a monitor. If full `ChannelMonitors` are
14087 * persisted, then there is no need to persist individual updates.
14089 * Note that there could be a performance tradeoff between persisting complete
14090 * channel monitors on every update vs. persisting only updates and applying
14091 * them in batches. The size of each monitor grows `O(number of state updates)`
14092 * whereas updates are small and `O(1)`.
14094 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
14095 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
14097 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
14098 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
14099 * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
14101 * [`Writeable::write`]: crate::util::ser::Writeable::write
14103 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
14105 enum LDKChannelMonitorUpdateStatus (*update_persisted_channel)(const void *this_arg, struct LDKOutPoint channel_id, struct LDKChannelMonitorUpdate update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
14107 * Frees any resources associated with this object given its this_arg pointer.
14108 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14110 void (*free)(void *this_arg);
14116 * An implementation of [`chain::Watch`] for monitoring channels.
14118 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
14119 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
14120 * or used independently to monitor channels remotely. See the [module-level documentation] for
14123 * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
14124 * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
14125 * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
14126 * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
14127 * environment with spotty connections, like on mobile.
14129 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14130 * [module-level documentation]: crate::chain::chainmonitor
14131 * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
14133 typedef struct MUST_USE_STRUCT LDKChainMonitor {
14135 * A pointer to the opaque Rust object.
14136 * Nearly everywhere, inner must be non-null, however in places where
14137 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14139 LDKnativeChainMonitor *inner;
14141 * Indicates that this is the only struct which contains the same pointer.
14142 * Rust functions which take ownership of an object provided via an argument require
14143 * this to be true and invalidate the object pointed to by inner.
14149 * A trait implemented for objects handling events from [`EventsProvider`].
14151 * An async variation also exists for implementations of [`EventsProvider`] that support async
14152 * event handling. The async event handler should satisfy the generic bounds: `F:
14153 * core::future::Future, H: Fn(Event) -> F`.
14155 typedef struct LDKEventHandler {
14157 * An opaque pointer which is passed to your function implementations as an argument.
14158 * This has no meaning in the LDK, and can be NULL or any other value.
14162 * Handles the given [`Event`].
14164 * See [`EventsProvider`] for details that must be considered when implementing this method.
14166 void (*handle_event)(const void *this_arg, struct LDKEvent event);
14168 * Frees any resources associated with this object given its this_arg pointer.
14169 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14171 void (*free)(void *this_arg);
14175 * A trait indicating an object may generate events.
14177 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
14179 * Implementations of this trait may also feature an async version of event handling, as shown with
14180 * [`ChannelManager::process_pending_events_async`] and
14181 * [`ChainMonitor::process_pending_events_async`].
14185 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
14186 * event since the last invocation.
14188 * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
14189 * and replay any unhandled events on startup. An [`Event`] is considered handled when
14190 * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
14191 * relevant changes to disk *before* returning.
14193 * Further, because an application may crash between an [`Event`] being handled and the
14194 * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
14195 * effect, [`Event`]s may be replayed.
14197 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
14198 * consult the provider's documentation on the implication of processing events and how a handler
14199 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
14200 * [`ChainMonitor::process_pending_events`]).
14202 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
14205 * [`process_pending_events`]: Self::process_pending_events
14206 * [`handle_event`]: EventHandler::handle_event
14207 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
14208 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
14209 * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
14210 * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
14212 typedef struct LDKEventsProvider {
14214 * An opaque pointer which is passed to your function implementations as an argument.
14215 * This has no meaning in the LDK, and can be NULL or any other value.
14219 * Processes any events generated since the last call using the given event handler.
14221 * See the trait-level documentation for requirements.
14223 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
14225 * Frees any resources associated with this object given its this_arg pointer.
14226 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14228 void (*free)(void *this_arg);
14229 } LDKEventsProvider;
14232 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
14234 typedef struct LDKSecretKey {
14236 * The bytes of the secret key
14244 * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
14245 * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
14247 * Your `node_id` is seed/0'.
14248 * Unilateral closes may use seed/1'.
14249 * Cooperative closes may use seed/2'.
14250 * The two close keys may be needed to claim on-chain funds!
14252 * This struct cannot be used for nodes that wish to support receiving phantom payments;
14253 * [`PhantomKeysManager`] must be used instead.
14255 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
14256 * previously issued invoices and attempts to pay previous invoices will fail.
14258 typedef struct MUST_USE_STRUCT LDKKeysManager {
14260 * A pointer to the opaque Rust object.
14261 * Nearly everywhere, inner must be non-null, however in places where
14262 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14264 LDKnativeKeysManager *inner;
14266 * Indicates that this is the only struct which contains the same pointer.
14267 * Rust functions which take ownership of an object provided via an argument require
14268 * this to be true and invalidate the object pointed to by inner.
14276 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
14279 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
14280 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
14281 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
14282 * itself without ever needing to forward to this fake node.
14284 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
14285 * provide some fault tolerance, because payers will automatically retry paying other provided
14286 * nodes in the case that one node goes down.
14288 * Note that multi-path payments are not supported in phantom invoices for security reasons.
14289 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
14290 * invoices and attempts to pay previous invoices will fail.
14292 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
14294 * A pointer to the opaque Rust object.
14295 * Nearly everywhere, inner must be non-null, however in places where
14296 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14298 LDKnativePhantomKeysManager *inner;
14300 * Indicates that this is the only struct which contains the same pointer.
14301 * Rust functions which take ownership of an object provided via an argument require
14302 * this to be true and invalidate the object pointed to by inner.
14305 } LDKPhantomKeysManager;
14310 * Chain-related parameters used to construct a new `ChannelManager`.
14312 * Typically, the block-specific parameters are derived from the best block hash for the network,
14313 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
14314 * are not needed when deserializing a previously constructed `ChannelManager`.
14316 typedef struct MUST_USE_STRUCT LDKChainParameters {
14318 * A pointer to the opaque Rust object.
14319 * Nearly everywhere, inner must be non-null, however in places where
14320 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14322 LDKnativeChainParameters *inner;
14324 * Indicates that this is the only struct which contains the same pointer.
14325 * Rust functions which take ownership of an object provided via an argument require
14326 * this to be true and invalidate the object pointed to by inner.
14329 } LDKChainParameters;
14332 * Strategies available to retry payment path failures.
14334 typedef enum LDKRetry_Tag {
14336 * Max number of attempts to retry payment.
14338 * Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
14339 * retry, and may retry multiple failed HTLCs at once if they failed around the same time and
14340 * were retried along a route from a single call to [`Router::find_route_with_id`].
14344 * Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
14345 * see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
14347 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
14351 * Must be last for serialization purposes
14356 typedef struct MUST_USE_STRUCT LDKRetry {
14360 uintptr_t attempts;
14369 * A trait indicating an object may generate message send events
14371 typedef struct LDKMessageSendEventsProvider {
14373 * An opaque pointer which is passed to your function implementations as an argument.
14374 * This has no meaning in the LDK, and can be NULL or any other value.
14378 * Gets the list of pending events which were generated by previous actions, clearing the list
14381 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
14383 * Frees any resources associated with this object given its this_arg pointer.
14384 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14386 void (*free)(void *this_arg);
14387 } LDKMessageSendEventsProvider;
14390 * A trait to describe an object which can receive channel messages.
14392 * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
14393 * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
14395 typedef struct LDKChannelMessageHandler {
14397 * An opaque pointer which is passed to your function implementations as an argument.
14398 * This has no meaning in the LDK, and can be NULL or any other value.
14402 * Handle an incoming `open_channel` message from the given peer.
14404 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
14406 * Handle an incoming `accept_channel` message from the given peer.
14408 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
14410 * Handle an incoming `funding_created` message from the given peer.
14412 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
14414 * Handle an incoming `funding_signed` message from the given peer.
14416 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
14418 * Handle an incoming `channel_ready` message from the given peer.
14420 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
14422 * Handle an incoming `shutdown` message from the given peer.
14424 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
14426 * Handle an incoming `closing_signed` message from the given peer.
14428 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
14430 * Handle an incoming `update_add_htlc` message from the given peer.
14432 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
14434 * Handle an incoming `update_fulfill_htlc` message from the given peer.
14436 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
14438 * Handle an incoming `update_fail_htlc` message from the given peer.
14440 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
14442 * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
14444 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
14446 * Handle an incoming `commitment_signed` message from the given peer.
14448 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
14450 * Handle an incoming `revoke_and_ack` message from the given peer.
14452 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
14454 * Handle an incoming `update_fee` message from the given peer.
14456 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
14458 * Handle an incoming `announcement_signatures` message from the given peer.
14460 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
14462 * Indicates a connection to the peer failed/an existing connection was lost.
14464 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
14466 * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
14468 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
14469 * with us. Implementors should be somewhat conservative about doing so, however, as other
14470 * message handlers may still wish to communicate with this peer.
14472 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
14474 * Handle an incoming `channel_reestablish` message from the given peer.
14476 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
14478 * Handle an incoming `channel_update` message from the given peer.
14480 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
14482 * Handle an incoming `error` message from the given peer.
14484 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
14486 * Gets the node feature flags which this handler itself supports. All available handlers are
14487 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
14488 * which are broadcasted in our [`NodeAnnouncement`] message.
14490 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
14492 * Gets the init feature flags which should be sent to the given peer. All available handlers
14493 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
14494 * which are sent in our [`Init`] message.
14496 * Note that this method is called before [`Self::peer_connected`].
14498 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
14500 * Implementation of MessageSendEventsProvider for this object.
14502 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
14504 * Frees any resources associated with this object given its this_arg pointer.
14505 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14507 void (*free)(void *this_arg);
14508 } LDKChannelMessageHandler;
14513 * Arguments for the creation of a ChannelManager that are not deserialized.
14515 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
14517 * 1) Deserialize all stored [`ChannelMonitor`]s.
14518 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
14519 * `<(BlockHash, ChannelManager)>::read(reader, args)`
14520 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
14521 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
14522 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
14523 * same way you would handle a [`chain::Filter`] call using
14524 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
14525 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
14526 * 5) Disconnect/connect blocks on the [`ChannelManager`].
14527 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
14528 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
14529 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
14531 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
14532 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
14534 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
14535 * call any other methods on the newly-deserialized [`ChannelManager`].
14537 * Note that because some channels may be closed during deserialization, it is critical that you
14538 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
14539 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
14540 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
14541 * not force-close the same channels but consider them live), you may end up revoking a state for
14542 * which you've already broadcasted the transaction.
14544 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
14546 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
14548 * A pointer to the opaque Rust object.
14549 * Nearly everywhere, inner must be non-null, however in places where
14550 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14552 LDKnativeChannelManagerReadArgs *inner;
14554 * Indicates that this is the only struct which contains the same pointer.
14555 * Rust functions which take ownership of an object provided via an argument require
14556 * this to be true and invalidate the object pointed to by inner.
14559 } LDKChannelManagerReadArgs;
14564 * A set of keys that were HKDF-expanded from an initial call to
14565 * [`NodeSigner::get_inbound_payment_key_material`].
14567 * [`NodeSigner::get_inbound_payment_key_material`]: crate::chain::keysinterface::NodeSigner::get_inbound_payment_key_material
14569 typedef struct MUST_USE_STRUCT LDKExpandedKey {
14571 * A pointer to the opaque Rust object.
14572 * Nearly everywhere, inner must be non-null, however in places where
14573 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14575 LDKnativeExpandedKey *inner;
14577 * Indicates that this is the only struct which contains the same pointer.
14578 * Rust functions which take ownership of an object provided via an argument require
14579 * this to be true and invalidate the object pointed to by inner.
14587 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
14589 * This is used to convince the recipient that the channel is at a certain commitment
14590 * number even if they lost that data due to a local failure. Of course, the peer may lie
14591 * and even later commitments may have been revoked.
14593 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
14595 * A pointer to the opaque Rust object.
14596 * Nearly everywhere, inner must be non-null, however in places where
14597 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14599 LDKnativeDataLossProtect *inner;
14601 * Indicates that this is the only struct which contains the same pointer.
14602 * Rust functions which take ownership of an object provided via an argument require
14603 * this to be true and invalidate the object pointed to by inner.
14606 } LDKDataLossProtect;
14609 * A 3-byte byte array.
14611 typedef struct LDKThreeBytes {
14619 * A trait to describe an object which can receive routing messages.
14621 * # Implementor DoS Warnings
14623 * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
14624 * handling inbound queries. Implementors using an on-disk network graph should be aware of
14625 * repeated disk I/O for queries accessing different parts of the network graph.
14627 typedef struct LDKRoutingMessageHandler {
14629 * An opaque pointer which is passed to your function implementations as an argument.
14630 * This has no meaning in the LDK, and can be NULL or any other value.
14634 * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
14635 * `false` or returning an `Err` otherwise.
14637 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
14639 * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
14640 * or returning an `Err` otherwise.
14642 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
14644 * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
14645 * `false` or returning an `Err` otherwise.
14647 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
14649 * Gets channel announcements and updates required to dump our routing table to a remote node,
14650 * starting at the `short_channel_id` indicated by `starting_point` and including announcements
14651 * for a single channel.
14653 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
14655 * Gets a node announcement required to dump our routing table to a remote node, starting at
14656 * the node *after* the provided pubkey and including up to one announcement immediately
14657 * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
14658 * If `None` is provided for `starting_point`, we start at the first node.
14660 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
14661 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
14663 struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
14665 * Called when a connection is established with a peer. This can be used to
14666 * perform routing table synchronization using a strategy defined by the
14669 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
14670 * with us. Implementors should be somewhat conservative about doing so, however, as other
14671 * message handlers may still wish to communicate with this peer.
14673 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
14675 * Handles the reply of a query we initiated to learn about channels
14676 * for a given range of blocks. We can expect to receive one or more
14677 * replies to a single query.
14679 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
14681 * Handles the reply of a query we initiated asking for routing gossip
14682 * messages for a list of channels. We should receive this message when
14683 * a node has completed its best effort to send us the pertaining routing
14686 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
14688 * Handles when a peer asks us to send a list of `short_channel_id`s
14689 * for the requested range of blocks.
14691 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
14693 * Handles when a peer asks us to send routing gossip messages for a
14694 * list of `short_channel_id`s.
14696 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
14698 * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
14699 * pending some async action. While there is no guarantee of the rate of future messages, the
14700 * caller should seek to reduce the rate of new gossip messages handled, especially
14701 * [`ChannelAnnouncement`]s.
14703 bool (*processing_queue_high)(const void *this_arg);
14705 * Gets the node feature flags which this handler itself supports. All available handlers are
14706 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
14707 * which are broadcasted in our [`NodeAnnouncement`] message.
14709 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
14711 * Gets the init feature flags which should be sent to the given peer. All available handlers
14712 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
14713 * which are sent in our [`Init`] message.
14715 * Note that this method is called before [`Self::peer_connected`].
14717 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
14719 * Implementation of MessageSendEventsProvider for this object.
14721 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
14723 * Frees any resources associated with this object given its this_arg pointer.
14724 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14726 void (*free)(void *this_arg);
14727 } LDKRoutingMessageHandler;
14730 * A trait indicating an object may generate onion messages to send
14732 typedef struct LDKOnionMessageProvider {
14734 * An opaque pointer which is passed to your function implementations as an argument.
14735 * This has no meaning in the LDK, and can be NULL or any other value.
14739 * Gets the next pending onion message for the peer with the given node id.
14741 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
14743 struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
14745 * Frees any resources associated with this object given its this_arg pointer.
14746 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14748 void (*free)(void *this_arg);
14749 } LDKOnionMessageProvider;
14752 * A trait to describe an object that can receive onion messages.
14754 typedef struct LDKOnionMessageHandler {
14756 * An opaque pointer which is passed to your function implementations as an argument.
14757 * This has no meaning in the LDK, and can be NULL or any other value.
14761 * Handle an incoming `onion_message` message from the given peer.
14763 void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
14765 * Called when a connection is established with a peer. Can be used to track which peers
14766 * advertise onion message support and are online.
14768 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
14769 * with us. Implementors should be somewhat conservative about doing so, however, as other
14770 * message handlers may still wish to communicate with this peer.
14772 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
14774 * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
14775 * drop and refuse to forward onion messages to this peer.
14777 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
14779 * Gets the node feature flags which this handler itself supports. All available handlers are
14780 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
14781 * which are broadcasted in our [`NodeAnnouncement`] message.
14783 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
14785 * Gets the init feature flags which should be sent to the given peer. All available handlers
14786 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
14787 * which are sent in our [`Init`] message.
14789 * Note that this method is called before [`Self::peer_connected`].
14791 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
14793 * Implementation of OnionMessageProvider for this object.
14795 struct LDKOnionMessageProvider OnionMessageProvider;
14797 * Frees any resources associated with this object given its this_arg pointer.
14798 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14800 void (*free)(void *this_arg);
14801 } LDKOnionMessageHandler;
14804 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
14807 typedef struct LDKCustomMessageReader {
14809 * An opaque pointer which is passed to your function implementations as an argument.
14810 * This has no meaning in the LDK, and can be NULL or any other value.
14814 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
14815 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
14816 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
14817 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
14819 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
14821 * Frees any resources associated with this object given its this_arg pointer.
14822 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14824 void (*free)(void *this_arg);
14825 } LDKCustomMessageReader;
14828 * A handler provided to [`PeerManager`] for reading and handling custom messages.
14830 * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
14831 * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
14832 * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
14834 * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
14835 * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
14837 typedef struct LDKCustomMessageHandler {
14839 * An opaque pointer which is passed to your function implementations as an argument.
14840 * This has no meaning in the LDK, and can be NULL or any other value.
14844 * Handles the given message sent from `sender_node_id`, possibly producing messages for
14845 * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
14848 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
14850 * Returns the list of pending messages that were generated by the handler, clearing the list
14851 * in the process. Each message is paired with the node id of the intended recipient. If no
14852 * connection to the node exists, then the message is simply not sent.
14854 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
14856 * Implementation of CustomMessageReader for this object.
14858 struct LDKCustomMessageReader CustomMessageReader;
14860 * Frees any resources associated with this object given its this_arg pointer.
14861 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14863 void (*free)(void *this_arg);
14864 } LDKCustomMessageHandler;
14869 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
14870 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
14872 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
14874 * A pointer to the opaque Rust object.
14875 * Nearly everywhere, inner must be non-null, however in places where
14876 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14878 LDKnativeIgnoringMessageHandler *inner;
14880 * Indicates that this is the only struct which contains the same pointer.
14881 * Rust functions which take ownership of an object provided via an argument require
14882 * this to be true and invalidate the object pointed to by inner.
14885 } LDKIgnoringMessageHandler;
14888 * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
14889 * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
14890 * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
14891 * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
14894 * See [`OnionMessenger`] for example usage.
14896 * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
14897 * [`CustomMessage`]: Self::CustomMessage
14899 typedef struct LDKCustomOnionMessageHandler {
14901 * An opaque pointer which is passed to your function implementations as an argument.
14902 * This has no meaning in the LDK, and can be NULL or any other value.
14906 * Called with the custom message that was received.
14908 void (*handle_custom_message)(const void *this_arg, struct LDKCustomOnionMessageContents msg);
14910 * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
14911 * message type is unknown.
14913 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
14915 * Frees any resources associated with this object given its this_arg pointer.
14916 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14918 void (*free)(void *this_arg);
14919 } LDKCustomOnionMessageHandler;
14924 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
14925 * You can provide one of these as the route_handler in a MessageHandler.
14927 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
14929 * A pointer to the opaque Rust object.
14930 * Nearly everywhere, inner must be non-null, however in places where
14931 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14933 LDKnativeErroringMessageHandler *inner;
14935 * Indicates that this is the only struct which contains the same pointer.
14936 * Rust functions which take ownership of an object provided via an argument require
14937 * this to be true and invalidate the object pointed to by inner.
14940 } LDKErroringMessageHandler;
14945 * Provides references to trait impls which handle different types of messages.
14947 typedef struct MUST_USE_STRUCT LDKMessageHandler {
14949 * A pointer to the opaque Rust object.
14950 * Nearly everywhere, inner must be non-null, however in places where
14951 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14953 LDKnativeMessageHandler *inner;
14955 * Indicates that this is the only struct which contains the same pointer.
14956 * Rust functions which take ownership of an object provided via an argument require
14957 * this to be true and invalidate the object pointed to by inner.
14960 } LDKMessageHandler;
14963 * Provides an object which can be used to send data to and which uniquely identifies a connection
14964 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
14965 * implement Hash to meet the PeerManager API.
14967 * For efficiency, [`Clone`] should be relatively cheap for this type.
14969 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
14970 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
14971 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
14972 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
14973 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
14974 * to simply use another value which is guaranteed to be globally unique instead.
14976 typedef struct LDKSocketDescriptor {
14978 * An opaque pointer which is passed to your function implementations as an argument.
14979 * This has no meaning in the LDK, and can be NULL or any other value.
14983 * Attempts to send some data from the given slice to the peer.
14985 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
14986 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
14987 * called and further write attempts may occur until that time.
14989 * If the returned size is smaller than `data.len()`, a
14990 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
14991 * written. Additionally, until a `send_data` event completes fully, no further
14992 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
14993 * prevent denial-of-service issues, you should not read or buffer any data from the socket
14996 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
14997 * (indicating that read events should be paused to prevent DoS in the send buffer),
14998 * `resume_read` may be set indicating that read events on this descriptor should resume. A
14999 * `resume_read` of false carries no meaning, and should not cause any action.
15001 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
15003 * Disconnect the socket pointed to by this SocketDescriptor.
15005 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
15006 * call (doing so is a noop).
15008 void (*disconnect_socket)(void *this_arg);
15010 * Checks if two objects are equal given this object's this_arg pointer and another object.
15012 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
15014 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
15015 * This is used, for example, for inclusion of this object in a hash map.
15017 uint64_t (*hash)(const void *this_arg);
15019 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
15020 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
15021 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
15023 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
15025 * Frees any resources associated with this object given its this_arg pointer.
15026 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
15028 void (*free)(void *this_arg);
15029 } LDKSocketDescriptor;
15034 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
15035 * socket events into messages which it passes on to its [`MessageHandler`].
15037 * Locks are taken internally, so you must never assume that reentrancy from a
15038 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
15040 * Calls to [`read_event`] will decode relevant messages and pass them to the
15041 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
15042 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
15043 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
15044 * calls only after previous ones have returned.
15046 * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
15047 * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
15048 * essentially you should default to using a [`SimpleRefPeerManager`], and use a
15049 * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
15050 * you're using lightning-net-tokio.
15052 * [`read_event`]: PeerManager::read_event
15054 typedef struct MUST_USE_STRUCT LDKPeerManager {
15056 * A pointer to the opaque Rust object.
15057 * Nearly everywhere, inner must be non-null, however in places where
15058 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15060 LDKnativePeerManager *inner;
15062 * Indicates that this is the only struct which contains the same pointer.
15063 * Rust functions which take ownership of an object provided via an argument require
15064 * this to be true and invalidate the object pointed to by inner.
15072 * Static channel fields used to build transactions given per-commitment fields, organized by
15073 * broadcaster/countersignatory.
15075 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
15076 * as_holder_broadcastable and as_counterparty_broadcastable functions.
15078 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
15080 * A pointer to the opaque Rust object.
15081 * Nearly everywhere, inner must be non-null, however in places where
15082 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15084 LDKnativeDirectedChannelTransactionParameters *inner;
15086 * Indicates that this is the only struct which contains the same pointer.
15087 * Rust functions which take ownership of an object provided via an argument require
15088 * this to be true and invalidate the object pointed to by inner.
15091 } LDKDirectedChannelTransactionParameters;
15096 * Features used within an `offer`.
15098 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
15100 * A pointer to the opaque Rust object.
15101 * Nearly everywhere, inner must be non-null, however in places where
15102 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15104 LDKnativeOfferFeatures *inner;
15106 * Indicates that this is the only struct which contains the same pointer.
15107 * Rust functions which take ownership of an object provided via an argument require
15108 * this to be true and invalidate the object pointed to by inner.
15111 } LDKOfferFeatures;
15116 * Features used within an `invoice_request`.
15118 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
15120 * A pointer to the opaque Rust object.
15121 * Nearly everywhere, inner must be non-null, however in places where
15122 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15124 LDKnativeInvoiceRequestFeatures *inner;
15126 * Indicates that this is the only struct which contains the same pointer.
15127 * Rust functions which take ownership of an object provided via an argument require
15128 * this to be true and invalidate the object pointed to by inner.
15131 } LDKInvoiceRequestFeatures;
15136 * Features used within an `invoice`.
15138 typedef struct MUST_USE_STRUCT LDKBolt12InvoiceFeatures {
15140 * A pointer to the opaque Rust object.
15141 * Nearly everywhere, inner must be non-null, however in places where
15142 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15144 LDKnativeBolt12InvoiceFeatures *inner;
15146 * Indicates that this is the only struct which contains the same pointer.
15147 * Rust functions which take ownership of an object provided via an argument require
15148 * this to be true and invalidate the object pointed to by inner.
15151 } LDKBolt12InvoiceFeatures;
15154 * Integer in the range `0..=16`
15156 typedef struct LDKWitnessVersion {
15158 } LDKWitnessVersion;
15163 * A semantically valid [`Invoice`] that hasn't been signed.
15165 typedef struct MUST_USE_STRUCT LDKUnsignedInvoice {
15167 * A pointer to the opaque Rust object.
15168 * Nearly everywhere, inner must be non-null, however in places where
15169 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15171 LDKnativeUnsignedInvoice *inner;
15173 * Indicates that this is the only struct which contains the same pointer.
15174 * Rust functions which take ownership of an object provided via an argument require
15175 * this to be true and invalidate the object pointed to by inner.
15178 } LDKUnsignedInvoice;
15183 * A semantically valid [`InvoiceRequest`] that hasn't been signed.
15185 typedef struct MUST_USE_STRUCT LDKUnsignedInvoiceRequest {
15187 * A pointer to the opaque Rust object.
15188 * Nearly everywhere, inner must be non-null, however in places where
15189 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15191 LDKnativeUnsignedInvoiceRequest *inner;
15193 * Indicates that this is the only struct which contains the same pointer.
15194 * Rust functions which take ownership of an object provided via an argument require
15195 * this to be true and invalidate the object pointed to by inner.
15198 } LDKUnsignedInvoiceRequest;
15203 * An `InvoiceRequest` is a request for an [`Invoice`] formulated from an [`Offer`].
15205 * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request
15206 * specifies these such that its recipient can send an invoice for payment.
15208 * [`Invoice`]: crate::offers::invoice::Invoice
15209 * [`Offer`]: crate::offers::offer::Offer
15211 typedef struct MUST_USE_STRUCT LDKInvoiceRequest {
15213 * A pointer to the opaque Rust object.
15214 * Nearly everywhere, inner must be non-null, however in places where
15215 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15217 LDKnativeInvoiceRequest *inner;
15219 * Indicates that this is the only struct which contains the same pointer.
15220 * Rust functions which take ownership of an object provided via an argument require
15221 * this to be true and invalidate the object pointed to by inner.
15224 } LDKInvoiceRequest;
15229 * An `Offer` is a potentially long-lived proposal for payment of a good or service.
15231 * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a
15232 * customer may request an [`Invoice`] for a specific quantity and using an amount sufficient to
15233 * cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`].
15235 * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
15238 * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
15240 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
15241 * [`Invoice`]: crate::offers::invoice::Invoice
15243 typedef struct MUST_USE_STRUCT LDKOffer {
15245 * A pointer to the opaque Rust object.
15246 * Nearly everywhere, inner must be non-null, however in places where
15247 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15249 LDKnativeOffer *inner;
15251 * Indicates that this is the only struct which contains the same pointer.
15252 * Rust functions which take ownership of an object provided via an argument require
15253 * this to be true and invalidate the object pointed to by inner.
15261 * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
15262 * another currency.
15264 typedef struct MUST_USE_STRUCT LDKAmount {
15266 * A pointer to the opaque Rust object.
15267 * Nearly everywhere, inner must be non-null, however in places where
15268 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15270 LDKnativeAmount *inner;
15272 * Indicates that this is the only struct which contains the same pointer.
15273 * Rust functions which take ownership of an object provided via an argument require
15274 * this to be true and invalidate the object pointed to by inner.
15282 * Quantity of items supported by an [`Offer`].
15284 typedef struct MUST_USE_STRUCT LDKQuantity {
15286 * A pointer to the opaque Rust object.
15287 * Nearly everywhere, inner must be non-null, however in places where
15288 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15290 LDKnativeQuantity *inner;
15292 * Indicates that this is the only struct which contains the same pointer.
15293 * Rust functions which take ownership of an object provided via an argument require
15294 * this to be true and invalidate the object pointed to by inner.
15302 * A `Refund` is a request to send an [`Invoice`] without a preceding [`Offer`].
15304 * Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to
15305 * recoup their funds. A refund may be used more generally as an \"offer for money\", such as with a
15308 * [`Invoice`]: crate::offers::invoice::Invoice
15309 * [`Offer`]: crate::offers::offer::Offer
15311 typedef struct MUST_USE_STRUCT LDKRefund {
15313 * A pointer to the opaque Rust object.
15314 * Nearly everywhere, inner must be non-null, however in places where
15315 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15317 LDKnativeRefund *inner;
15319 * Indicates that this is the only struct which contains the same pointer.
15320 * Rust functions which take ownership of an object provided via an argument require
15321 * this to be true and invalidate the object pointed to by inner.
15329 * Receives and validates network updates from peers,
15330 * stores authentic and relevant data as a network graph.
15331 * This network graph is then used for routing payments.
15332 * Provides interface to help with initial routing sync by
15333 * serving historical announcements.
15335 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
15337 * A pointer to the opaque Rust object.
15338 * Nearly everywhere, inner must be non-null, however in places where
15339 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15341 LDKnativeP2PGossipSync *inner;
15343 * Indicates that this is the only struct which contains the same pointer.
15344 * Rust functions which take ownership of an object provided via an argument require
15345 * this to be true and invalidate the object pointed to by inner.
15348 } LDKP2PGossipSync;
15353 * A read-only view of [`NetworkGraph`].
15355 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
15357 * A pointer to the opaque Rust object.
15358 * Nearly everywhere, inner must be non-null, however in places where
15359 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15361 LDKnativeReadOnlyNetworkGraph *inner;
15363 * Indicates that this is the only struct which contains the same pointer.
15364 * Rust functions which take ownership of an object provided via an argument require
15365 * this to be true and invalidate the object pointed to by inner.
15368 } LDKReadOnlyNetworkGraph;
15373 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
15374 * source node to a target node.
15376 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
15378 * A pointer to the opaque Rust object.
15379 * Nearly everywhere, inner must be non-null, however in places where
15380 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15382 LDKnativeDirectedChannelInfo *inner;
15384 * Indicates that this is the only struct which contains the same pointer.
15385 * Rust functions which take ownership of an object provided via an argument require
15386 * this to be true and invalidate the object pointed to by inner.
15389 } LDKDirectedChannelInfo;
15392 * The effective capacity of a channel for routing purposes.
15394 * While this may be smaller than the actual channel capacity, amounts greater than
15395 * [`Self::as_msat`] should not be routed through the channel.
15397 typedef enum LDKEffectiveCapacity_Tag {
15399 * The available liquidity in the channel known from being a channel counterparty, and thus a
15402 LDKEffectiveCapacity_ExactLiquidity,
15404 * The maximum HTLC amount in one direction as advertised on the gossip network.
15406 LDKEffectiveCapacity_MaximumHTLC,
15408 * The total capacity of the channel as determined by the funding transaction.
15410 LDKEffectiveCapacity_Total,
15412 * A capacity sufficient to route any payment, typically used for private channels provided by
15415 LDKEffectiveCapacity_Infinite,
15417 * A capacity that is unknown possibly because either the chain state is unavailable to know
15418 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
15420 LDKEffectiveCapacity_Unknown,
15422 * Must be last for serialization purposes
15424 LDKEffectiveCapacity_Sentinel,
15425 } LDKEffectiveCapacity_Tag;
15427 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
15429 * Either the inbound or outbound liquidity depending on the direction, denominated in
15432 uint64_t liquidity_msat;
15433 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
15435 typedef struct LDKEffectiveCapacity_LDKMaximumHTLC_Body {
15437 * The maximum HTLC amount denominated in millisatoshi.
15439 uint64_t amount_msat;
15440 } LDKEffectiveCapacity_LDKMaximumHTLC_Body;
15442 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
15444 * The funding amount denominated in millisatoshi.
15446 uint64_t capacity_msat;
15448 * The maximum HTLC amount denominated in millisatoshi.
15450 uint64_t htlc_maximum_msat;
15451 } LDKEffectiveCapacity_LDKTotal_Body;
15453 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
15454 LDKEffectiveCapacity_Tag tag;
15456 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
15457 LDKEffectiveCapacity_LDKMaximumHTLC_Body maximum_htlc;
15458 LDKEffectiveCapacity_LDKTotal_Body total;
15460 } LDKEffectiveCapacity;
15465 * A [`Router`] implemented using [`find_route`].
15467 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
15469 * A pointer to the opaque Rust object.
15470 * Nearly everywhere, inner must be non-null, however in places where
15471 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15473 LDKnativeDefaultRouter *inner;
15475 * Indicates that this is the only struct which contains the same pointer.
15476 * Rust functions which take ownership of an object provided via an argument require
15477 * this to be true and invalidate the object pointed to by inner.
15480 } LDKDefaultRouter;
15485 * [`Score`] implementation that factors in in-flight HTLC liquidity.
15487 * Useful for custom [`Router`] implementations to wrap their [`Score`] on-the-fly when calling
15490 * [`Score`]: crate::routing::scoring::Score
15492 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
15494 * A pointer to the opaque Rust object.
15495 * Nearly everywhere, inner must be non-null, however in places where
15496 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15498 LDKnativeScorerAccountingForInFlightHtlcs *inner;
15500 * Indicates that this is the only struct which contains the same pointer.
15501 * Rust functions which take ownership of an object provided via an argument require
15502 * this to be true and invalidate the object pointed to by inner.
15505 } LDKScorerAccountingForInFlightHtlcs;
15508 * Routing hints for the tail of the route.
15510 typedef enum LDKHints_Tag {
15512 * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
15513 * will be included in the final [`Route`].
15517 * The recipient included these route hints in their BOLT11 invoice.
15521 * Must be last for serialization purposes
15526 typedef struct MUST_USE_STRUCT LDKHints {
15530 struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded;
15533 struct LDKCVec_RouteHintZ clear;
15541 * A concrete implementation of [`LockableScore`] which supports multi-threading.
15543 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
15545 * A pointer to the opaque Rust object.
15546 * Nearly everywhere, inner must be non-null, however in places where
15547 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15549 LDKnativeMultiThreadedLockableScore *inner;
15551 * Indicates that this is the only struct which contains the same pointer.
15552 * Rust functions which take ownership of an object provided via an argument require
15553 * this to be true and invalidate the object pointed to by inner.
15556 } LDKMultiThreadedLockableScore;
15561 * A locked `MultiThreadedLockableScore`.
15563 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLock {
15565 * A pointer to the opaque Rust object.
15566 * Nearly everywhere, inner must be non-null, however in places where
15567 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15569 LDKnativeMultiThreadedScoreLock *inner;
15571 * Indicates that this is the only struct which contains the same pointer.
15572 * Rust functions which take ownership of an object provided via an argument require
15573 * this to be true and invalidate the object pointed to by inner.
15576 } LDKMultiThreadedScoreLock;
15581 * Parameters for configuring [`ProbabilisticScorer`].
15583 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
15584 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
15586 * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
15589 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringParameters {
15591 * A pointer to the opaque Rust object.
15592 * Nearly everywhere, inner must be non-null, however in places where
15593 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15595 LDKnativeProbabilisticScoringParameters *inner;
15597 * Indicates that this is the only struct which contains the same pointer.
15598 * Rust functions which take ownership of an object provided via an argument require
15599 * this to be true and invalidate the object pointed to by inner.
15602 } LDKProbabilisticScoringParameters;
15607 * A sender, receiver and forwarder of onion messages. In upcoming releases, this object will be
15608 * used to retrieve invoices and fulfill invoice requests from [offers]. Currently, only sending
15609 * and receiving custom onion messages is supported.
15614 * # extern crate bitcoin;
15615 * # use bitcoin::hashes::_export::_core::time::Duration;
15616 * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
15617 * # use lightning::blinded_path::BlindedPath;
15618 * # use lightning::chain::keysinterface::KeysManager;
15619 * # use lightning::ln::peer_handler::IgnoringMessageHandler;
15620 * # use lightning::onion_message::messenger::{Destination, OnionMessenger};
15621 * # use lightning::onion_message::packet::{CustomOnionMessageContents, OnionMessageContents};
15622 * # use lightning::util::logger::{Logger, Record};
15623 * # use lightning::util::ser::{Writeable, Writer};
15624 * # use lightning::io;
15625 * # use std::sync::Arc;
15626 * # struct FakeLogger;
15627 * # impl Logger for FakeLogger {
15628 * # fn log(&self, record: &Record) { unimplemented!() }
15630 * # let seed = [42u8; 32];
15631 * # let time = Duration::from_secs(123456);
15632 * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
15633 * # let logger = Arc::new(FakeLogger {});
15634 * # let node_secret = SecretKey::from_slice(&hex::decode(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
15635 * # let secp_ctx = Secp256k1::new();
15636 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
15637 * # let (hop_node_id2, hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1, hop_node_id1);
15638 * # let destination_node_id = hop_node_id1;
15639 * # let your_custom_message_handler = IgnoringMessageHandler {};
15640 * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
15641 * // ChannelManager.
15642 * let onion_messenger = OnionMessenger::new(&keys_manager, &keys_manager, logger, &your_custom_message_handler);
15644 * # struct YourCustomMessage {}
15645 * impl Writeable for YourCustomMessage {
15646 * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
15648 * \t\t// Write your custom onion message to `w`
15651 * impl CustomOnionMessageContents for YourCustomMessage {
15652 * \tfn tlv_type(&self) -> u64 {
15653 * \t\t# let your_custom_message_type = 42;
15654 * \t\tyour_custom_message_type
15657 * // Send a custom onion message to a node id.
15658 * let intermediate_hops = [hop_node_id1, hop_node_id2];
15659 * let reply_path = None;
15660 * # let your_custom_message = YourCustomMessage {};
15661 * let message = OnionMessageContents::Custom(your_custom_message);
15662 * onion_messenger.send_onion_message(&intermediate_hops, Destination::Node(destination_node_id), message, reply_path);
15664 * // Create a blinded path to yourself, for someone to send an onion message to.
15665 * # let your_node_id = hop_node_id1;
15666 * let hops = [hop_node_id3, hop_node_id4, your_node_id];
15667 * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
15669 * // Send a custom onion message to a blinded path.
15670 * # let intermediate_hops = [hop_node_id1, hop_node_id2];
15671 * let reply_path = None;
15672 * # let your_custom_message = YourCustomMessage {};
15673 * let message = OnionMessageContents::Custom(your_custom_message);
15674 * onion_messenger.send_onion_message(&intermediate_hops, Destination::BlindedPath(blinded_path), message, reply_path);
15677 * [offers]: <https://github.com/lightning/bolts/pull/798>
15678 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
15680 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
15682 * A pointer to the opaque Rust object.
15683 * Nearly everywhere, inner must be non-null, however in places where
15684 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15686 LDKnativeOnionMessenger *inner;
15688 * Indicates that this is the only struct which contains the same pointer.
15689 * Rust functions which take ownership of an object provided via an argument require
15690 * this to be true and invalidate the object pointed to by inner.
15693 } LDKOnionMessenger;
15696 * The destination of an onion message.
15698 typedef enum LDKDestination_Tag {
15700 * We're sending this onion message to a node.
15702 LDKDestination_Node,
15704 * We're sending this onion message to a blinded path.
15706 LDKDestination_BlindedPath,
15708 * Must be last for serialization purposes
15710 LDKDestination_Sentinel,
15711 } LDKDestination_Tag;
15713 typedef struct MUST_USE_STRUCT LDKDestination {
15714 LDKDestination_Tag tag;
15717 struct LDKPublicKey node;
15720 struct LDKBlindedPath blinded_path;
15726 * The contents of an onion message. In the context of offers, this would be the invoice, invoice
15727 * request, or invoice error.
15729 typedef enum LDKOnionMessageContents_Tag {
15731 * A custom onion message specified by the user.
15733 LDKOnionMessageContents_Custom,
15735 * Must be last for serialization purposes
15737 LDKOnionMessageContents_Sentinel,
15738 } LDKOnionMessageContents_Tag;
15740 typedef struct MUST_USE_STRUCT LDKOnionMessageContents {
15741 LDKOnionMessageContents_Tag tag;
15744 struct LDKCustomOnionMessageContents custom;
15747 } LDKOnionMessageContents;
15752 * FilesystemPersister persists channel data on disk, where each channel's
15753 * data is stored in a file named after its funding outpoint.
15755 * Warning: this module does the best it can with calls to persist data, but it
15756 * can only guarantee that the data is passed to the drive. It is up to the
15757 * drive manufacturers to do the actual persistence properly, which they often
15758 * don't (especially on consumer-grade hardware). Therefore, it is up to the
15759 * user to validate their entire storage stack, to ensure the writes are
15761 * Corollary: especially when dealing with larger amounts of money, it is best
15762 * practice to have multiple channel data backups and not rely only on one
15763 * FilesystemPersister.
15765 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
15767 * A pointer to the opaque Rust object.
15768 * Nearly everywhere, inner must be non-null, however in places where
15769 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15771 LDKnativeFilesystemPersister *inner;
15773 * Indicates that this is the only struct which contains the same pointer.
15774 * Rust functions which take ownership of an object provided via an argument require
15775 * this to be true and invalidate the object pointed to by inner.
15778 } LDKFilesystemPersister;
15783 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
15784 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
15785 * responsibilities are:
15786 * * Processing [`Event`]s with a user-provided [`EventHandler`].
15787 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
15788 * writing it to disk/backups by invoking the callback given to it at startup.
15789 * [`ChannelManager`] persistence should be done in the background.
15790 * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
15791 * and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
15792 * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
15793 * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
15795 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
15796 * upon as doing so may result in high latency.
15800 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
15801 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
15802 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
15803 * unilateral chain closure fees are at risk.
15805 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
15806 * [`Event`]: lightning::events::Event
15807 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
15809 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
15811 * A pointer to the opaque Rust object.
15812 * Nearly everywhere, inner must be non-null, however in places where
15813 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15815 LDKnativeBackgroundProcessor *inner;
15817 * Indicates that this is the only struct which contains the same pointer.
15818 * Rust functions which take ownership of an object provided via an argument require
15819 * this to be true and invalidate the object pointed to by inner.
15822 } LDKBackgroundProcessor;
15827 * The main Rapid Gossip Sync object.
15829 * See [crate-level documentation] for usage.
15831 * [crate-level documentation]: crate
15833 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
15835 * A pointer to the opaque Rust object.
15836 * Nearly everywhere, inner must be non-null, however in places where
15837 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15839 LDKnativeRapidGossipSync *inner;
15841 * Indicates that this is the only struct which contains the same pointer.
15842 * Rust functions which take ownership of an object provided via an argument require
15843 * this to be true and invalidate the object pointed to by inner.
15846 } LDKRapidGossipSync;
15849 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
15851 typedef enum LDKGossipSync_Tag {
15853 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
15857 * Rapid gossip sync from a trusted server.
15859 LDKGossipSync_Rapid,
15863 LDKGossipSync_None,
15865 * Must be last for serialization purposes
15867 LDKGossipSync_Sentinel,
15868 } LDKGossipSync_Tag;
15870 typedef struct MUST_USE_STRUCT LDKGossipSync {
15871 LDKGossipSync_Tag tag;
15875 * Note that this field is expected to be a reference.
15877 struct LDKP2PGossipSync p2p;
15881 * Note that this field is expected to be a reference.
15883 struct LDKRapidGossipSync rapid;
15891 * Data of the [`RawInvoice`] that is encoded in the data part
15893 typedef struct MUST_USE_STRUCT LDKRawDataPart {
15895 * A pointer to the opaque Rust object.
15896 * Nearly everywhere, inner must be non-null, however in places where
15897 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15899 LDKnativeRawDataPart *inner;
15901 * Indicates that this is the only struct which contains the same pointer.
15902 * Rust functions which take ownership of an object provided via an argument require
15903 * this to be true and invalidate the object pointed to by inner.
15913 typedef struct MUST_USE_STRUCT LDKSha256 {
15915 * A pointer to the opaque Rust object.
15916 * Nearly everywhere, inner must be non-null, however in places where
15917 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15919 LDKnativeSha256 *inner;
15921 * Indicates that this is the only struct which contains the same pointer.
15922 * Rust functions which take ownership of an object provided via an argument require
15923 * this to be true and invalidate the object pointed to by inner.
15931 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
15934 typedef struct MUST_USE_STRUCT LDKExpiryTime {
15936 * A pointer to the opaque Rust object.
15937 * Nearly everywhere, inner must be non-null, however in places where
15938 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15940 LDKnativeExpiryTime *inner;
15942 * Indicates that this is the only struct which contains the same pointer.
15943 * Rust functions which take ownership of an object provided via an argument require
15944 * this to be true and invalidate the object pointed to by inner.
15952 * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
15954 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
15956 * A pointer to the opaque Rust object.
15957 * Nearly everywhere, inner must be non-null, however in places where
15958 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15960 LDKnativeMinFinalCltvExpiryDelta *inner;
15962 * Indicates that this is the only struct which contains the same pointer.
15963 * Rust functions which take ownership of an object provided via an argument require
15964 * this to be true and invalidate the object pointed to by inner.
15967 } LDKMinFinalCltvExpiryDelta;
15970 * A 20-byte byte array.
15972 typedef struct LDKTwentyBytes {
15980 * Fallback address in case no LN payment is possible
15982 typedef enum LDKFallback_Tag {
15983 LDKFallback_SegWitProgram,
15984 LDKFallback_PubKeyHash,
15985 LDKFallback_ScriptHash,
15987 * Must be last for serialization purposes
15989 LDKFallback_Sentinel,
15992 typedef struct LDKFallback_LDKSegWitProgram_Body {
15993 struct LDKWitnessVersion version;
15994 struct LDKCVec_u8Z program;
15995 } LDKFallback_LDKSegWitProgram_Body;
15997 typedef struct MUST_USE_STRUCT LDKFallback {
15998 LDKFallback_Tag tag;
16000 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
16002 struct LDKTwentyBytes pub_key_hash;
16005 struct LDKTwentyBytes script_hash;
16010 extern const uintptr_t MAX_BUF_SIZE;
16012 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
16014 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
16016 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
16018 extern const uint32_t ANTI_REORG_DELAY;
16020 extern const uint16_t BREAKDOWN_TIMEOUT;
16022 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
16024 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
16026 extern const uint16_t MAX_HTLCS;
16028 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
16030 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
16032 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
16034 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
16036 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
16038 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
16040 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
16042 extern const uint64_t MAX_TIMESTAMP;
16044 extern const uint64_t DEFAULT_EXPIRY_TIME;
16046 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
16048 extern const uint8_t TAG_PAYMENT_HASH;
16050 extern const uint8_t TAG_DESCRIPTION;
16052 extern const uint8_t TAG_PAYEE_PUB_KEY;
16054 extern const uint8_t TAG_DESCRIPTION_HASH;
16056 extern const uint8_t TAG_EXPIRY_TIME;
16058 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
16060 extern const uint8_t TAG_FALLBACK;
16062 extern const uint8_t TAG_PRIVATE_ROUTE;
16064 extern const uint8_t TAG_PAYMENT_SECRET;
16066 extern const uint8_t TAG_PAYMENT_METADATA;
16068 extern const uint8_t TAG_FEATURES;
16070 struct LDKStr _ldk_get_compiled_version(void);
16072 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
16075 * Gets the 128-bit integer, as 16 little-endian bytes
16077 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
16080 * Constructs a new U128 from 16 little-endian bytes
16082 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
16085 * Convenience function for constructing a new BigEndianScalar
16087 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
16090 * Creates a new Bech32Error which has the same data as `orig`
16092 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
16095 * Releases any memory held by the given `Bech32Error` (which is currently none)
16097 void Bech32Error_free(struct LDKBech32Error o);
16100 * Frees the data buffer, if data_is_owned is set and datalen > 0.
16102 void Transaction_free(struct LDKTransaction _res);
16105 * Frees the data pointed to by data
16107 void Witness_free(struct LDKWitness _res);
16110 * Convenience function for constructing a new TxOut
16112 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
16115 * Frees the data pointed to by script_pubkey.
16117 void TxOut_free(struct LDKTxOut _res);
16120 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
16122 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
16125 * Frees the data buffer, if chars_is_owned is set and len > 0.
16127 void Str_free(struct LDKStr _res);
16129 #if defined(LDK_DEBUG_BUILD)
16131 * This function exists for memory safety testing purposes. It should never be used in production
16134 const void *__unmangle_inner_ptr(const void *ptr);
16138 * Constructs a new COption_DurationZ containing a u64
16140 struct LDKCOption_DurationZ COption_DurationZ_some(uint64_t o);
16143 * Constructs a new COption_DurationZ containing nothing
16145 struct LDKCOption_DurationZ COption_DurationZ_none(void);
16148 * Frees any resources associated with the u64, if we are in the Some state
16150 void COption_DurationZ_free(struct LDKCOption_DurationZ _res);
16153 * Creates a new COption_DurationZ which has the same data as `orig`
16154 * but with all dynamically-allocated buffers duplicated in new buffers.
16156 struct LDKCOption_DurationZ COption_DurationZ_clone(const struct LDKCOption_DurationZ *NONNULL_PTR orig);
16159 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16161 void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
16164 * Constructs a new COption_u64Z containing a u64
16166 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
16169 * Constructs a new COption_u64Z containing nothing
16171 struct LDKCOption_u64Z COption_u64Z_none(void);
16174 * Frees any resources associated with the u64, if we are in the Some state
16176 void COption_u64Z_free(struct LDKCOption_u64Z _res);
16179 * Creates a new COption_u64Z which has the same data as `orig`
16180 * but with all dynamically-allocated buffers duplicated in new buffers.
16182 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
16185 * Creates a new CResult_NoneAPIErrorZ in the success state.
16187 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
16190 * Creates a new CResult_NoneAPIErrorZ in the error state.
16192 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
16195 * Checks if the given object is currently in the success state
16197 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
16200 * Frees any resources used by the CResult_NoneAPIErrorZ.
16202 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
16205 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
16206 * but with all dynamically-allocated buffers duplicated in new buffers.
16208 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
16211 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16213 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
16216 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16218 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
16221 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16223 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
16226 * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
16228 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
16231 * Constructs a new COption_CVec_u8ZZ containing nothing
16233 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
16236 * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
16238 void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
16241 * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
16242 * but with all dynamically-allocated buffers duplicated in new buffers.
16244 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
16247 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
16249 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
16252 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
16254 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
16257 * Checks if the given object is currently in the success state
16259 bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
16262 * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
16264 void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
16267 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
16268 * but with all dynamically-allocated buffers duplicated in new buffers.
16270 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
16273 * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
16275 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
16278 * Constructs a new COption_HTLCClaimZ containing nothing
16280 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
16283 * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
16285 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
16288 * Creates a new CResult_NoneNoneZ in the success state.
16290 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
16293 * Creates a new CResult_NoneNoneZ in the error state.
16295 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
16298 * Checks if the given object is currently in the success state
16300 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
16303 * Frees any resources used by the CResult_NoneNoneZ.
16305 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
16308 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
16309 * but with all dynamically-allocated buffers duplicated in new buffers.
16311 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
16314 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
16316 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
16319 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
16321 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
16324 * Checks if the given object is currently in the success state
16326 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
16329 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
16331 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
16334 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
16335 * but with all dynamically-allocated buffers duplicated in new buffers.
16337 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
16340 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
16342 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
16345 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
16347 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
16350 * Checks if the given object is currently in the success state
16352 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
16355 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
16357 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
16360 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
16361 * but with all dynamically-allocated buffers duplicated in new buffers.
16363 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
16366 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
16368 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
16371 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
16373 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
16376 * Checks if the given object is currently in the success state
16378 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
16381 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
16383 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
16386 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
16387 * but with all dynamically-allocated buffers duplicated in new buffers.
16389 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
16392 * Constructs a new COption_u32Z containing a u32
16394 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
16397 * Constructs a new COption_u32Z containing nothing
16399 struct LDKCOption_u32Z COption_u32Z_none(void);
16402 * Frees any resources associated with the u32, if we are in the Some state
16404 void COption_u32Z_free(struct LDKCOption_u32Z _res);
16407 * Creates a new COption_u32Z which has the same data as `orig`
16408 * but with all dynamically-allocated buffers duplicated in new buffers.
16410 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
16413 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
16415 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
16418 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
16420 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
16423 * Checks if the given object is currently in the success state
16425 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
16428 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
16430 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
16433 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
16434 * but with all dynamically-allocated buffers duplicated in new buffers.
16436 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
16439 * Constructs a new COption_NoneZ containing a
16441 enum LDKCOption_NoneZ COption_NoneZ_some(void);
16444 * Constructs a new COption_NoneZ containing nothing
16446 enum LDKCOption_NoneZ COption_NoneZ_none(void);
16449 * Frees any resources associated with the , if we are in the Some state
16451 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
16454 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
16456 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
16459 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
16461 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
16464 * Checks if the given object is currently in the success state
16466 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
16469 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
16471 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
16474 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
16475 * but with all dynamically-allocated buffers duplicated in new buffers.
16477 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
16480 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
16482 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
16485 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
16487 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
16490 * Checks if the given object is currently in the success state
16492 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
16495 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
16497 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
16500 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
16501 * but with all dynamically-allocated buffers duplicated in new buffers.
16503 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
16506 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16508 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
16511 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
16513 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
16516 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
16518 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
16521 * Checks if the given object is currently in the success state
16523 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
16526 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
16528 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
16531 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
16532 * but with all dynamically-allocated buffers duplicated in new buffers.
16534 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
16537 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
16539 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
16542 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
16544 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
16547 * Checks if the given object is currently in the success state
16549 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
16552 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
16554 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
16557 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
16558 * but with all dynamically-allocated buffers duplicated in new buffers.
16560 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
16563 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
16565 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
16568 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
16570 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
16573 * Checks if the given object is currently in the success state
16575 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
16578 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
16580 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
16583 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
16585 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
16588 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
16590 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
16593 * Checks if the given object is currently in the success state
16595 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
16598 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
16600 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
16603 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
16604 * but with all dynamically-allocated buffers duplicated in new buffers.
16606 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
16609 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
16611 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
16614 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
16616 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
16619 * Checks if the given object is currently in the success state
16621 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
16624 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
16626 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
16629 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
16631 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
16634 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
16636 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
16639 * Checks if the given object is currently in the success state
16641 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
16644 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
16646 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
16649 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
16650 * but with all dynamically-allocated buffers duplicated in new buffers.
16652 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
16655 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
16657 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
16660 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
16662 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
16665 * Checks if the given object is currently in the success state
16667 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
16670 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
16672 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
16675 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
16676 * but with all dynamically-allocated buffers duplicated in new buffers.
16678 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
16681 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
16683 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
16686 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
16688 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
16691 * Checks if the given object is currently in the success state
16693 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
16696 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
16698 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
16701 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
16702 * but with all dynamically-allocated buffers duplicated in new buffers.
16704 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
16707 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
16709 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
16712 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
16714 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
16717 * Checks if the given object is currently in the success state
16719 bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
16722 * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
16724 void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
16727 * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
16728 * but with all dynamically-allocated buffers duplicated in new buffers.
16730 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
16733 * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
16735 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
16738 * Constructs a new COption_WriteableScoreZ containing nothing
16740 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
16743 * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
16745 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
16748 * Creates a new CResult_NoneErrorZ in the success state.
16750 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
16753 * Creates a new CResult_NoneErrorZ in the error state.
16755 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
16758 * Checks if the given object is currently in the success state
16760 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
16763 * Frees any resources used by the CResult_NoneErrorZ.
16765 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
16768 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
16769 * but with all dynamically-allocated buffers duplicated in new buffers.
16771 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
16774 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16776 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
16779 * Creates a new CResult_RouteLightningErrorZ in the success state.
16781 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
16784 * Creates a new CResult_RouteLightningErrorZ in the error state.
16786 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
16789 * Checks if the given object is currently in the success state
16791 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
16794 * Frees any resources used by the CResult_RouteLightningErrorZ.
16796 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
16799 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
16800 * but with all dynamically-allocated buffers duplicated in new buffers.
16802 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
16805 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
16807 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
16810 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
16812 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
16815 * Checks if the given object is currently in the success state
16817 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
16820 * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
16822 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
16825 * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
16826 * but with all dynamically-allocated buffers duplicated in new buffers.
16828 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
16831 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
16833 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
16836 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
16838 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
16841 * Checks if the given object is currently in the success state
16843 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
16846 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
16848 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
16851 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
16852 * but with all dynamically-allocated buffers duplicated in new buffers.
16854 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
16857 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16859 void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
16862 * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
16864 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
16867 * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
16869 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
16872 * Checks if the given object is currently in the success state
16874 bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
16877 * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
16879 void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
16882 * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
16883 * but with all dynamically-allocated buffers duplicated in new buffers.
16885 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
16888 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16890 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
16893 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16895 void CVec_PathZ_free(struct LDKCVec_PathZ _res);
16898 * Creates a new CResult_RouteDecodeErrorZ in the success state.
16900 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
16903 * Creates a new CResult_RouteDecodeErrorZ in the error state.
16905 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
16908 * Checks if the given object is currently in the success state
16910 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
16913 * Frees any resources used by the CResult_RouteDecodeErrorZ.
16915 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
16918 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
16919 * but with all dynamically-allocated buffers duplicated in new buffers.
16921 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
16924 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
16926 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
16929 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
16931 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
16934 * Checks if the given object is currently in the success state
16936 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
16939 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
16941 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
16944 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
16945 * but with all dynamically-allocated buffers duplicated in new buffers.
16947 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
16950 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16952 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
16955 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
16957 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
16960 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
16962 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
16965 * Checks if the given object is currently in the success state
16967 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
16970 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
16972 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
16975 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
16976 * but with all dynamically-allocated buffers duplicated in new buffers.
16978 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
16981 * Creates a new tuple which has the same data as `orig`
16982 * but with all dynamically-allocated buffers duplicated in new buffers.
16984 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
16987 * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
16989 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
16992 * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
16994 void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
16997 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16999 void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
17002 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17004 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
17007 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17009 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
17012 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
17014 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
17017 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
17019 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
17022 * Checks if the given object is currently in the success state
17024 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
17027 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
17029 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
17032 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
17033 * but with all dynamically-allocated buffers duplicated in new buffers.
17035 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
17038 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
17040 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
17043 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
17045 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
17048 * Checks if the given object is currently in the success state
17050 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
17053 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
17055 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
17058 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
17059 * but with all dynamically-allocated buffers duplicated in new buffers.
17061 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
17064 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17066 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
17069 * Creates a new tuple which has the same data as `orig`
17070 * but with all dynamically-allocated buffers duplicated in new buffers.
17072 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
17075 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
17077 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
17080 * Frees any resources used by the C2Tuple_usizeTransactionZ.
17082 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
17085 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17087 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
17090 * Creates a new tuple which has the same data as `orig`
17091 * but with all dynamically-allocated buffers duplicated in new buffers.
17093 struct LDKC2Tuple_TxidBlockHashZ C2Tuple_TxidBlockHashZ_clone(const struct LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR orig);
17096 * Creates a new C2Tuple_TxidBlockHashZ from the contained elements.
17098 struct LDKC2Tuple_TxidBlockHashZ C2Tuple_TxidBlockHashZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
17101 * Frees any resources used by the C2Tuple_TxidBlockHashZ.
17103 void C2Tuple_TxidBlockHashZ_free(struct LDKC2Tuple_TxidBlockHashZ _res);
17106 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17108 void CVec_C2Tuple_TxidBlockHashZZ_free(struct LDKCVec_C2Tuple_TxidBlockHashZZ _res);
17111 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17113 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
17116 * Creates a new tuple which has the same data as `orig`
17117 * but with all dynamically-allocated buffers duplicated in new buffers.
17119 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
17122 * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
17124 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
17127 * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
17129 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
17132 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17134 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
17137 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
17139 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
17142 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
17144 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
17147 * Checks if the given object is currently in the success state
17149 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
17152 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
17154 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
17157 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
17158 * but with all dynamically-allocated buffers duplicated in new buffers.
17160 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
17163 * Creates a new tuple which has the same data as `orig`
17164 * but with all dynamically-allocated buffers duplicated in new buffers.
17166 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
17169 * Creates a new C2Tuple_u64u64Z from the contained elements.
17171 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
17174 * Frees any resources used by the C2Tuple_u64u64Z.
17176 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
17179 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
17181 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
17184 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
17186 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
17189 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
17191 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
17194 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
17195 * but with all dynamically-allocated buffers duplicated in new buffers.
17197 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
17200 * Creates a new tuple which has the same data as `orig`
17201 * but with all dynamically-allocated buffers duplicated in new buffers.
17203 struct LDKC2Tuple_Z C2Tuple_Z_clone(const struct LDKC2Tuple_Z *NONNULL_PTR orig);
17206 * Creates a new C2Tuple_Z from the contained elements.
17208 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKEightU16s a, struct LDKEightU16s b);
17211 * Frees any resources used by the C2Tuple_Z.
17213 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
17216 * Creates a new tuple which has the same data as `orig`
17217 * but with all dynamically-allocated buffers duplicated in new buffers.
17219 struct LDKC2Tuple__u168_u168Z C2Tuple__u168_u168Z_clone(const struct LDKC2Tuple__u168_u168Z *NONNULL_PTR orig);
17222 * Creates a new C2Tuple__u168_u168Z from the contained elements.
17224 struct LDKC2Tuple__u168_u168Z C2Tuple__u168_u168Z_new(struct LDKEightU16s a, struct LDKEightU16s b);
17227 * Frees any resources used by the C2Tuple__u168_u168Z.
17229 void C2Tuple__u168_u168Z_free(struct LDKC2Tuple__u168_u168Z _res);
17232 * Constructs a new COption_C2Tuple_EightU16sEightU16sZZ containing a crate::c_types::derived::C2Tuple__u168_u168Z
17234 struct LDKCOption_C2Tuple_EightU16sEightU16sZZ COption_C2Tuple_EightU16sEightU16sZZ_some(struct LDKC2Tuple__u168_u168Z o);
17237 * Constructs a new COption_C2Tuple_EightU16sEightU16sZZ containing nothing
17239 struct LDKCOption_C2Tuple_EightU16sEightU16sZZ COption_C2Tuple_EightU16sEightU16sZZ_none(void);
17242 * Frees any resources associated with the crate::c_types::derived::C2Tuple__u168_u168Z, if we are in the Some state
17244 void COption_C2Tuple_EightU16sEightU16sZZ_free(struct LDKCOption_C2Tuple_EightU16sEightU16sZZ _res);
17247 * Creates a new COption_C2Tuple_EightU16sEightU16sZZ which has the same data as `orig`
17248 * but with all dynamically-allocated buffers duplicated in new buffers.
17250 struct LDKCOption_C2Tuple_EightU16sEightU16sZZ COption_C2Tuple_EightU16sEightU16sZZ_clone(const struct LDKCOption_C2Tuple_EightU16sEightU16sZZ *NONNULL_PTR orig);
17253 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17255 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
17258 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
17260 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
17263 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
17265 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
17268 * Checks if the given object is currently in the success state
17270 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
17273 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
17275 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
17278 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
17280 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
17283 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
17285 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
17288 * Checks if the given object is currently in the success state
17290 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
17293 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
17295 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
17298 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
17299 * but with all dynamically-allocated buffers duplicated in new buffers.
17301 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
17304 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
17306 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
17309 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
17311 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
17314 * Checks if the given object is currently in the success state
17316 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
17319 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
17321 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
17324 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
17325 * but with all dynamically-allocated buffers duplicated in new buffers.
17327 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
17330 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
17332 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
17335 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
17337 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
17340 * Checks if the given object is currently in the success state
17342 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
17345 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
17347 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
17350 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
17351 * but with all dynamically-allocated buffers duplicated in new buffers.
17353 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
17356 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
17358 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
17361 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
17363 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
17366 * Checks if the given object is currently in the success state
17368 bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
17371 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
17373 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
17376 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
17377 * but with all dynamically-allocated buffers duplicated in new buffers.
17379 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
17382 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
17384 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
17387 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
17389 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
17392 * Checks if the given object is currently in the success state
17394 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
17397 * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
17399 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
17402 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
17403 * but with all dynamically-allocated buffers duplicated in new buffers.
17405 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
17408 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
17410 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
17413 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
17415 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
17418 * Checks if the given object is currently in the success state
17420 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
17423 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
17425 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
17428 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
17429 * but with all dynamically-allocated buffers duplicated in new buffers.
17431 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
17434 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
17436 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
17439 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
17441 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
17444 * Checks if the given object is currently in the success state
17446 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
17449 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
17451 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
17454 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
17455 * but with all dynamically-allocated buffers duplicated in new buffers.
17457 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
17460 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
17462 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
17465 * Constructs a new COption_NetworkUpdateZ containing nothing
17467 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
17470 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
17472 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
17475 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
17476 * but with all dynamically-allocated buffers duplicated in new buffers.
17478 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
17481 * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
17483 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
17486 * Constructs a new COption_PathFailureZ containing nothing
17488 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
17491 * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
17493 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
17496 * Creates a new COption_PathFailureZ which has the same data as `orig`
17497 * but with all dynamically-allocated buffers duplicated in new buffers.
17499 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
17502 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
17504 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
17507 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
17509 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
17512 * Checks if the given object is currently in the success state
17514 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
17517 * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
17519 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
17522 * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
17523 * but with all dynamically-allocated buffers duplicated in new buffers.
17525 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
17528 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
17530 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
17533 * Constructs a new COption_ClosureReasonZ containing nothing
17535 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
17538 * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
17540 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
17543 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
17544 * but with all dynamically-allocated buffers duplicated in new buffers.
17546 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
17549 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
17551 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
17554 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
17556 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
17559 * Checks if the given object is currently in the success state
17561 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
17564 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
17566 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
17569 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
17570 * but with all dynamically-allocated buffers duplicated in new buffers.
17572 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
17575 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
17577 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
17580 * Constructs a new COption_HTLCDestinationZ containing nothing
17582 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
17585 * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
17587 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
17590 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
17591 * but with all dynamically-allocated buffers duplicated in new buffers.
17593 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
17596 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
17598 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
17601 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
17603 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
17606 * Checks if the given object is currently in the success state
17608 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
17611 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
17613 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
17616 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
17617 * but with all dynamically-allocated buffers duplicated in new buffers.
17619 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
17622 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
17624 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
17627 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
17629 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
17632 * Checks if the given object is currently in the success state
17634 bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
17637 * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
17639 void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
17642 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
17643 * but with all dynamically-allocated buffers duplicated in new buffers.
17645 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
17648 * Constructs a new COption_u128Z containing a crate::c_types::U128
17650 struct LDKCOption_u128Z COption_u128Z_some(struct LDKU128 o);
17653 * Constructs a new COption_u128Z containing nothing
17655 struct LDKCOption_u128Z COption_u128Z_none(void);
17658 * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
17660 void COption_u128Z_free(struct LDKCOption_u128Z _res);
17663 * Creates a new COption_u128Z which has the same data as `orig`
17664 * but with all dynamically-allocated buffers duplicated in new buffers.
17666 struct LDKCOption_u128Z COption_u128Z_clone(const struct LDKCOption_u128Z *NONNULL_PTR orig);
17669 * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
17671 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
17674 * Constructs a new COption_PaymentFailureReasonZ containing nothing
17676 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
17679 * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
17681 void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
17684 * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
17685 * but with all dynamically-allocated buffers duplicated in new buffers.
17687 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
17690 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17692 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
17695 * Constructs a new COption_EventZ containing a crate::lightning::events::Event
17697 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
17700 * Constructs a new COption_EventZ containing nothing
17702 struct LDKCOption_EventZ COption_EventZ_none(void);
17705 * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
17707 void COption_EventZ_free(struct LDKCOption_EventZ _res);
17710 * Creates a new COption_EventZ which has the same data as `orig`
17711 * but with all dynamically-allocated buffers duplicated in new buffers.
17713 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
17716 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
17718 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
17721 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
17723 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
17726 * Checks if the given object is currently in the success state
17728 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
17731 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
17733 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
17736 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
17737 * but with all dynamically-allocated buffers duplicated in new buffers.
17739 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
17742 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17744 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
17747 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17749 void CVec_ChainHashZ_free(struct LDKCVec_ChainHashZ _res);
17752 * Creates a new CResult_PublicKeyErrorZ in the success state.
17754 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
17757 * Creates a new CResult_PublicKeyErrorZ in the error state.
17759 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
17762 * Checks if the given object is currently in the success state
17764 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
17767 * Frees any resources used by the CResult_PublicKeyErrorZ.
17769 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
17772 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
17773 * but with all dynamically-allocated buffers duplicated in new buffers.
17775 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
17778 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
17780 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
17783 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
17785 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
17788 * Checks if the given object is currently in the success state
17790 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
17793 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
17795 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
17798 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
17799 * but with all dynamically-allocated buffers duplicated in new buffers.
17801 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
17804 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
17806 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
17809 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
17811 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
17814 * Checks if the given object is currently in the success state
17816 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
17819 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
17821 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
17824 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
17825 * but with all dynamically-allocated buffers duplicated in new buffers.
17827 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
17830 * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
17832 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
17835 * Constructs a new COption_UtxoLookupZ containing nothing
17837 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
17840 * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
17842 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
17845 * Creates a new CResult_boolLightningErrorZ in the success state.
17847 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
17850 * Creates a new CResult_boolLightningErrorZ in the error state.
17852 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
17855 * Checks if the given object is currently in the success state
17857 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
17860 * Frees any resources used by the CResult_boolLightningErrorZ.
17862 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
17865 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
17866 * but with all dynamically-allocated buffers duplicated in new buffers.
17868 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
17871 * Creates a new tuple which has the same data as `orig`
17872 * but with all dynamically-allocated buffers duplicated in new buffers.
17874 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
17877 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
17879 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
17882 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
17884 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
17887 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
17889 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
17892 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
17894 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
17897 * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
17899 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
17902 * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
17903 * but with all dynamically-allocated buffers duplicated in new buffers.
17905 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
17908 * Creates a new CResult_NoneLightningErrorZ in the success state.
17910 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
17913 * Creates a new CResult_NoneLightningErrorZ in the error state.
17915 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
17918 * Checks if the given object is currently in the success state
17920 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
17923 * Frees any resources used by the CResult_NoneLightningErrorZ.
17925 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
17928 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
17929 * but with all dynamically-allocated buffers duplicated in new buffers.
17931 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
17934 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
17936 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
17939 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
17941 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
17944 * Checks if the given object is currently in the success state
17946 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
17949 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
17951 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
17954 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
17955 * but with all dynamically-allocated buffers duplicated in new buffers.
17957 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
17960 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
17962 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
17965 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
17967 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
17970 * Checks if the given object is currently in the success state
17972 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
17975 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
17977 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
17980 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
17981 * but with all dynamically-allocated buffers duplicated in new buffers.
17983 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
17986 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
17988 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
17991 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
17993 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
17996 * Checks if the given object is currently in the success state
17998 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
18001 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
18003 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
18006 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
18007 * but with all dynamically-allocated buffers duplicated in new buffers.
18009 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
18012 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18014 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
18017 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
18019 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
18022 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
18024 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
18027 * Checks if the given object is currently in the success state
18029 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
18032 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
18034 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
18037 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
18038 * but with all dynamically-allocated buffers duplicated in new buffers.
18040 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
18043 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
18045 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
18048 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
18050 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
18053 * Checks if the given object is currently in the success state
18055 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
18058 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
18060 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
18063 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
18064 * but with all dynamically-allocated buffers duplicated in new buffers.
18066 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
18069 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
18071 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
18074 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
18076 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
18079 * Checks if the given object is currently in the success state
18081 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
18084 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
18086 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
18089 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
18090 * but with all dynamically-allocated buffers duplicated in new buffers.
18092 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
18095 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
18097 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
18100 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
18102 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
18105 * Checks if the given object is currently in the success state
18107 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
18110 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
18112 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
18115 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
18117 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
18120 * Constructs a new COption_CVec_NetAddressZZ containing nothing
18122 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
18125 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
18127 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
18130 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
18131 * but with all dynamically-allocated buffers duplicated in new buffers.
18133 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
18136 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
18138 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
18141 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
18143 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
18146 * Checks if the given object is currently in the success state
18148 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
18151 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
18153 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
18156 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
18157 * but with all dynamically-allocated buffers duplicated in new buffers.
18159 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
18162 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
18164 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
18167 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
18169 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
18172 * Checks if the given object is currently in the success state
18174 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
18177 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
18179 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
18182 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
18183 * but with all dynamically-allocated buffers duplicated in new buffers.
18185 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
18188 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
18190 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
18193 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
18195 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
18198 * Checks if the given object is currently in the success state
18200 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
18203 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
18205 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
18208 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
18209 * but with all dynamically-allocated buffers duplicated in new buffers.
18211 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
18214 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18216 void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res);
18219 * Creates a new tuple which has the same data as `orig`
18220 * but with all dynamically-allocated buffers duplicated in new buffers.
18222 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
18225 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
18227 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
18230 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
18232 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
18235 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
18237 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
18240 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
18242 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
18245 * Checks if the given object is currently in the success state
18247 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
18250 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
18252 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
18255 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
18256 * but with all dynamically-allocated buffers duplicated in new buffers.
18258 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
18261 * Creates a new CResult_SignatureNoneZ in the success state.
18263 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
18266 * Creates a new CResult_SignatureNoneZ in the error state.
18268 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
18271 * Checks if the given object is currently in the success state
18273 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
18276 * Frees any resources used by the CResult_SignatureNoneZ.
18278 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
18281 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
18282 * but with all dynamically-allocated buffers duplicated in new buffers.
18284 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
18287 * Creates a new CResult_PublicKeyNoneZ in the success state.
18289 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
18292 * Creates a new CResult_PublicKeyNoneZ in the error state.
18294 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
18297 * Checks if the given object is currently in the success state
18299 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
18302 * Frees any resources used by the CResult_PublicKeyNoneZ.
18304 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
18307 * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
18308 * but with all dynamically-allocated buffers duplicated in new buffers.
18310 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
18313 * Constructs a new COption_ScalarZ containing a crate::c_types::BigEndianScalar
18315 struct LDKCOption_ScalarZ COption_ScalarZ_some(struct LDKBigEndianScalar o);
18318 * Constructs a new COption_ScalarZ containing nothing
18320 struct LDKCOption_ScalarZ COption_ScalarZ_none(void);
18323 * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
18325 void COption_ScalarZ_free(struct LDKCOption_ScalarZ _res);
18328 * Creates a new COption_ScalarZ which has the same data as `orig`
18329 * but with all dynamically-allocated buffers duplicated in new buffers.
18331 struct LDKCOption_ScalarZ COption_ScalarZ_clone(const struct LDKCOption_ScalarZ *NONNULL_PTR orig);
18334 * Creates a new CResult_SharedSecretNoneZ in the success state.
18336 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
18339 * Creates a new CResult_SharedSecretNoneZ in the error state.
18341 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_err(void);
18344 * Checks if the given object is currently in the success state
18346 bool CResult_SharedSecretNoneZ_is_ok(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR o);
18349 * Frees any resources used by the CResult_SharedSecretNoneZ.
18351 void CResult_SharedSecretNoneZ_free(struct LDKCResult_SharedSecretNoneZ _res);
18354 * Creates a new CResult_SharedSecretNoneZ which has the same data as `orig`
18355 * but with all dynamically-allocated buffers duplicated in new buffers.
18357 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_clone(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR orig);
18360 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18362 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
18365 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
18367 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
18370 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
18372 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
18375 * Checks if the given object is currently in the success state
18377 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
18380 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
18382 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
18385 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
18386 * but with all dynamically-allocated buffers duplicated in new buffers.
18388 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
18391 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
18393 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
18396 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
18398 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
18401 * Checks if the given object is currently in the success state
18403 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
18406 * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
18408 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
18411 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18413 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
18416 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
18418 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
18421 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
18423 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
18426 * Checks if the given object is currently in the success state
18428 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
18431 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
18433 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
18436 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
18437 * but with all dynamically-allocated buffers duplicated in new buffers.
18439 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
18442 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
18444 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
18447 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
18449 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
18452 * Checks if the given object is currently in the success state
18454 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
18457 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
18459 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
18462 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
18463 * but with all dynamically-allocated buffers duplicated in new buffers.
18465 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
18468 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18470 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
18473 * Creates a new CResult_TransactionNoneZ in the success state.
18475 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
18478 * Creates a new CResult_TransactionNoneZ in the error state.
18480 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
18483 * Checks if the given object is currently in the success state
18485 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
18488 * Frees any resources used by the CResult_TransactionNoneZ.
18490 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
18493 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
18494 * but with all dynamically-allocated buffers duplicated in new buffers.
18496 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
18499 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
18501 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
18504 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
18506 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
18509 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18511 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
18514 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
18516 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
18519 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
18521 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
18524 * Checks if the given object is currently in the success state
18526 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
18529 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
18531 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
18534 * Constructs a new COption_u16Z containing a u16
18536 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
18539 * Constructs a new COption_u16Z containing nothing
18541 struct LDKCOption_u16Z COption_u16Z_none(void);
18544 * Frees any resources associated with the u16, if we are in the Some state
18546 void COption_u16Z_free(struct LDKCOption_u16Z _res);
18549 * Creates a new COption_u16Z which has the same data as `orig`
18550 * but with all dynamically-allocated buffers duplicated in new buffers.
18552 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
18555 * Creates a new CResult__u832APIErrorZ in the success state.
18557 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
18560 * Creates a new CResult__u832APIErrorZ in the error state.
18562 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
18565 * Checks if the given object is currently in the success state
18567 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
18570 * Frees any resources used by the CResult__u832APIErrorZ.
18572 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
18575 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
18576 * but with all dynamically-allocated buffers duplicated in new buffers.
18578 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
18581 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18583 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
18586 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
18588 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
18591 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
18593 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
18596 * Checks if the given object is currently in the success state
18598 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
18601 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
18603 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
18606 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
18607 * but with all dynamically-allocated buffers duplicated in new buffers.
18609 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
18612 * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
18614 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
18617 * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
18619 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
18622 * Checks if the given object is currently in the success state
18624 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
18627 * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
18629 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
18632 * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
18633 * but with all dynamically-allocated buffers duplicated in new buffers.
18635 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
18638 * Creates a new CResult_PaymentHashPaymentSendFailureZ in the success state.
18640 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
18643 * Creates a new CResult_PaymentHashPaymentSendFailureZ in the error state.
18645 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
18648 * Checks if the given object is currently in the success state
18650 bool CResult_PaymentHashPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR o);
18653 * Frees any resources used by the CResult_PaymentHashPaymentSendFailureZ.
18655 void CResult_PaymentHashPaymentSendFailureZ_free(struct LDKCResult_PaymentHashPaymentSendFailureZ _res);
18658 * Creates a new CResult_PaymentHashPaymentSendFailureZ which has the same data as `orig`
18659 * but with all dynamically-allocated buffers duplicated in new buffers.
18661 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_clone(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR orig);
18664 * Creates a new CResult_PaymentHashRetryableSendFailureZ in the success state.
18666 struct LDKCResult_PaymentHashRetryableSendFailureZ CResult_PaymentHashRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
18669 * Creates a new CResult_PaymentHashRetryableSendFailureZ in the error state.
18671 struct LDKCResult_PaymentHashRetryableSendFailureZ CResult_PaymentHashRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
18674 * Checks if the given object is currently in the success state
18676 bool CResult_PaymentHashRetryableSendFailureZ_is_ok(const struct LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR o);
18679 * Frees any resources used by the CResult_PaymentHashRetryableSendFailureZ.
18681 void CResult_PaymentHashRetryableSendFailureZ_free(struct LDKCResult_PaymentHashRetryableSendFailureZ _res);
18684 * Creates a new CResult_PaymentHashRetryableSendFailureZ which has the same data as `orig`
18685 * but with all dynamically-allocated buffers duplicated in new buffers.
18687 struct LDKCResult_PaymentHashRetryableSendFailureZ CResult_PaymentHashRetryableSendFailureZ_clone(const struct LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR orig);
18690 * Creates a new tuple which has the same data as `orig`
18691 * but with all dynamically-allocated buffers duplicated in new buffers.
18693 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
18696 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
18698 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
18701 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
18703 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
18706 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
18708 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
18711 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
18713 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
18716 * Checks if the given object is currently in the success state
18718 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
18721 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
18723 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
18726 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
18727 * but with all dynamically-allocated buffers duplicated in new buffers.
18729 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
18732 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18734 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
18737 * Creates a new tuple which has the same data as `orig`
18738 * but with all dynamically-allocated buffers duplicated in new buffers.
18740 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
18743 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
18745 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
18748 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
18750 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
18753 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
18755 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
18758 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
18760 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
18763 * Checks if the given object is currently in the success state
18765 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
18768 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
18770 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
18773 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
18774 * but with all dynamically-allocated buffers duplicated in new buffers.
18776 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
18779 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
18781 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
18784 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
18786 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
18789 * Checks if the given object is currently in the success state
18791 bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
18794 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
18796 void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
18799 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
18800 * but with all dynamically-allocated buffers duplicated in new buffers.
18802 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
18805 * Creates a new CResult_PaymentSecretNoneZ in the success state.
18807 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
18810 * Creates a new CResult_PaymentSecretNoneZ in the error state.
18812 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
18815 * Checks if the given object is currently in the success state
18817 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
18820 * Frees any resources used by the CResult_PaymentSecretNoneZ.
18822 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
18825 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
18826 * but with all dynamically-allocated buffers duplicated in new buffers.
18828 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
18831 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
18833 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
18836 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
18838 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
18841 * Checks if the given object is currently in the success state
18843 bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o);
18846 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
18848 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
18851 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
18852 * but with all dynamically-allocated buffers duplicated in new buffers.
18854 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
18857 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
18859 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
18862 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
18864 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
18867 * Checks if the given object is currently in the success state
18869 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
18872 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
18874 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
18877 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
18878 * but with all dynamically-allocated buffers duplicated in new buffers.
18880 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
18883 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
18885 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
18888 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
18890 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
18893 * Checks if the given object is currently in the success state
18895 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
18898 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
18900 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
18903 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
18904 * but with all dynamically-allocated buffers duplicated in new buffers.
18906 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
18909 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
18911 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
18914 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
18916 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
18919 * Checks if the given object is currently in the success state
18921 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
18924 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
18926 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
18929 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
18930 * but with all dynamically-allocated buffers duplicated in new buffers.
18932 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
18935 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
18937 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
18940 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
18942 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
18945 * Checks if the given object is currently in the success state
18947 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
18950 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
18952 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
18955 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
18956 * but with all dynamically-allocated buffers duplicated in new buffers.
18958 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
18961 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
18963 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
18966 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
18968 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
18971 * Checks if the given object is currently in the success state
18973 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
18976 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
18978 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
18981 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
18982 * but with all dynamically-allocated buffers duplicated in new buffers.
18984 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
18987 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18989 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
18992 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
18994 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
18997 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
18999 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
19002 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
19004 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
19007 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
19009 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
19012 * Checks if the given object is currently in the success state
19014 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
19017 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
19019 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
19022 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
19024 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
19027 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
19029 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
19032 * Checks if the given object is currently in the success state
19034 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
19037 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
19039 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
19042 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
19043 * but with all dynamically-allocated buffers duplicated in new buffers.
19045 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
19048 * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
19050 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
19053 * Constructs a new COption_APIErrorZ containing nothing
19055 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
19058 * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
19060 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
19063 * Creates a new COption_APIErrorZ which has the same data as `orig`
19064 * but with all dynamically-allocated buffers duplicated in new buffers.
19066 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
19069 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
19071 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
19074 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
19076 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
19079 * Checks if the given object is currently in the success state
19081 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
19084 * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
19086 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
19089 * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
19090 * but with all dynamically-allocated buffers duplicated in new buffers.
19092 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
19095 * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
19097 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
19100 * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
19102 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
19105 * Checks if the given object is currently in the success state
19107 bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
19110 * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
19112 void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
19115 * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
19116 * but with all dynamically-allocated buffers duplicated in new buffers.
19118 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
19121 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
19123 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
19126 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
19128 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
19131 * Checks if the given object is currently in the success state
19133 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
19136 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
19138 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
19141 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
19142 * but with all dynamically-allocated buffers duplicated in new buffers.
19144 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
19147 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
19149 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
19152 * Constructs a new COption_TypeZ containing nothing
19154 struct LDKCOption_TypeZ COption_TypeZ_none(void);
19157 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
19159 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
19162 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
19164 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
19167 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
19169 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
19172 * Checks if the given object is currently in the success state
19174 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
19177 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
19179 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
19182 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
19184 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
19187 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
19189 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
19192 * Checks if the given object is currently in the success state
19194 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
19197 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
19199 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
19202 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
19203 * but with all dynamically-allocated buffers duplicated in new buffers.
19205 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
19208 * Creates a new CResult_NonePaymentErrorZ in the success state.
19210 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_ok(void);
19213 * Creates a new CResult_NonePaymentErrorZ in the error state.
19215 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_err(struct LDKPaymentError e);
19218 * Checks if the given object is currently in the success state
19220 bool CResult_NonePaymentErrorZ_is_ok(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR o);
19223 * Frees any resources used by the CResult_NonePaymentErrorZ.
19225 void CResult_NonePaymentErrorZ_free(struct LDKCResult_NonePaymentErrorZ _res);
19228 * Creates a new CResult_NonePaymentErrorZ which has the same data as `orig`
19229 * but with all dynamically-allocated buffers duplicated in new buffers.
19231 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_clone(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR orig);
19234 * Creates a new CResult_StringErrorZ in the success state.
19236 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
19239 * Creates a new CResult_StringErrorZ in the error state.
19241 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
19244 * Checks if the given object is currently in the success state
19246 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
19249 * Frees any resources used by the CResult_StringErrorZ.
19251 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
19254 * Creates a new CResult_StringErrorZ which has the same data as `orig`
19255 * but with all dynamically-allocated buffers duplicated in new buffers.
19257 struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig);
19260 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
19262 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
19265 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
19267 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
19270 * Checks if the given object is currently in the success state
19272 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
19275 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
19277 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
19280 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
19281 * but with all dynamically-allocated buffers duplicated in new buffers.
19283 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
19286 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
19288 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
19291 * Constructs a new COption_MonitorEventZ containing nothing
19293 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
19296 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
19298 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
19301 * Creates a new COption_MonitorEventZ which has the same data as `orig`
19302 * but with all dynamically-allocated buffers duplicated in new buffers.
19304 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
19307 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
19309 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
19312 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
19314 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
19317 * Checks if the given object is currently in the success state
19319 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
19322 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
19324 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
19327 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
19328 * but with all dynamically-allocated buffers duplicated in new buffers.
19330 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
19333 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
19335 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
19338 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
19340 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
19343 * Checks if the given object is currently in the success state
19345 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
19348 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
19350 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
19353 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
19354 * but with all dynamically-allocated buffers duplicated in new buffers.
19356 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
19359 * Creates a new tuple which has the same data as `orig`
19360 * but with all dynamically-allocated buffers duplicated in new buffers.
19362 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
19365 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
19367 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
19370 * Frees any resources used by the C2Tuple_OutPointScriptZ.
19372 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
19375 * Creates a new tuple which has the same data as `orig`
19376 * but with all dynamically-allocated buffers duplicated in new buffers.
19378 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
19381 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
19383 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
19386 * Frees any resources used by the C2Tuple_u32ScriptZ.
19388 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
19391 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19393 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
19396 * Creates a new tuple which has the same data as `orig`
19397 * but with all dynamically-allocated buffers duplicated in new buffers.
19399 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
19402 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
19404 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
19407 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
19409 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
19412 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19414 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
19417 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19419 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
19422 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19424 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
19427 * Creates a new tuple which has the same data as `orig`
19428 * but with all dynamically-allocated buffers duplicated in new buffers.
19430 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
19433 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
19435 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
19438 * Frees any resources used by the C2Tuple_u32TxOutZ.
19440 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
19443 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19445 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
19448 * Creates a new tuple which has the same data as `orig`
19449 * but with all dynamically-allocated buffers duplicated in new buffers.
19451 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
19454 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
19456 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
19459 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
19461 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
19464 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19466 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
19469 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19471 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
19474 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
19476 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
19479 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
19481 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
19484 * Checks if the given object is currently in the success state
19486 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
19489 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
19491 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
19494 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
19496 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
19499 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
19501 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
19504 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19506 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
19509 * Constructs a new COption_CustomOnionMessageContentsZ containing a crate::lightning::onion_message::packet::CustomOnionMessageContents
19511 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_some(struct LDKCustomOnionMessageContents o);
19514 * Constructs a new COption_CustomOnionMessageContentsZ containing nothing
19516 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_none(void);
19519 * Frees any resources associated with the crate::lightning::onion_message::packet::CustomOnionMessageContents, if we are in the Some state
19521 void COption_CustomOnionMessageContentsZ_free(struct LDKCOption_CustomOnionMessageContentsZ _res);
19524 * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the success state.
19526 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_CustomOnionMessageContentsZ o);
19529 * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the error state.
19531 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
19534 * Checks if the given object is currently in the success state
19536 bool CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
19539 * Frees any resources used by the CResult_COption_CustomOnionMessageContentsZDecodeErrorZ.
19541 void CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res);
19544 * Constructs a new COption_NetAddressZ containing a crate::lightning::ln::msgs::NetAddress
19546 struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o);
19549 * Constructs a new COption_NetAddressZ containing nothing
19551 struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void);
19554 * Frees any resources associated with the crate::lightning::ln::msgs::NetAddress, if we are in the Some state
19556 void COption_NetAddressZ_free(struct LDKCOption_NetAddressZ _res);
19559 * Creates a new COption_NetAddressZ which has the same data as `orig`
19560 * but with all dynamically-allocated buffers duplicated in new buffers.
19562 struct LDKCOption_NetAddressZ COption_NetAddressZ_clone(const struct LDKCOption_NetAddressZ *NONNULL_PTR orig);
19565 * Creates a new tuple which has the same data as `orig`
19566 * but with all dynamically-allocated buffers duplicated in new buffers.
19568 struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ C2Tuple_PublicKeyCOption_NetAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR orig);
19571 * Creates a new C2Tuple_PublicKeyCOption_NetAddressZZ from the contained elements.
19573 struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ C2Tuple_PublicKeyCOption_NetAddressZZ_new(struct LDKPublicKey a, struct LDKCOption_NetAddressZ b);
19576 * Frees any resources used by the C2Tuple_PublicKeyCOption_NetAddressZZ.
19578 void C2Tuple_PublicKeyCOption_NetAddressZZ_free(struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ _res);
19581 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19583 void CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ _res);
19586 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
19588 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
19591 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
19593 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
19596 * Checks if the given object is currently in the success state
19598 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
19601 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
19603 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
19606 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
19607 * but with all dynamically-allocated buffers duplicated in new buffers.
19609 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
19612 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
19614 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
19617 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
19619 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
19622 * Checks if the given object is currently in the success state
19624 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
19627 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
19629 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
19632 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
19633 * but with all dynamically-allocated buffers duplicated in new buffers.
19635 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
19638 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
19640 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
19643 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
19645 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
19648 * Checks if the given object is currently in the success state
19650 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
19653 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
19655 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
19658 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
19659 * but with all dynamically-allocated buffers duplicated in new buffers.
19661 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
19664 * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
19666 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
19669 * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
19671 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
19674 * Checks if the given object is currently in the success state
19676 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
19679 * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
19681 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
19684 * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
19685 * but with all dynamically-allocated buffers duplicated in new buffers.
19687 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
19690 * Creates a new CResult_NoneSendErrorZ in the success state.
19692 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void);
19695 * Creates a new CResult_NoneSendErrorZ in the error state.
19697 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e);
19700 * Checks if the given object is currently in the success state
19702 bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o);
19705 * Frees any resources used by the CResult_NoneSendErrorZ.
19707 void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res);
19710 * Creates a new CResult_BlindedPathNoneZ in the success state.
19712 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
19715 * Creates a new CResult_BlindedPathNoneZ in the error state.
19717 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
19720 * Checks if the given object is currently in the success state
19722 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
19725 * Frees any resources used by the CResult_BlindedPathNoneZ.
19727 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
19730 * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
19731 * but with all dynamically-allocated buffers duplicated in new buffers.
19733 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
19736 * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
19738 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
19741 * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
19743 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
19746 * Checks if the given object is currently in the success state
19748 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
19751 * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
19753 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
19756 * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
19757 * but with all dynamically-allocated buffers duplicated in new buffers.
19759 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
19762 * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
19764 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
19767 * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
19769 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
19772 * Checks if the given object is currently in the success state
19774 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
19777 * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
19779 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
19782 * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
19783 * but with all dynamically-allocated buffers duplicated in new buffers.
19785 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
19788 * Creates a new CResult_SiPrefixParseErrorZ in the success state.
19790 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o);
19793 * Creates a new CResult_SiPrefixParseErrorZ in the error state.
19795 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e);
19798 * Checks if the given object is currently in the success state
19800 bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o);
19803 * Frees any resources used by the CResult_SiPrefixParseErrorZ.
19805 void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res);
19808 * Creates a new CResult_SiPrefixParseErrorZ which has the same data as `orig`
19809 * but with all dynamically-allocated buffers duplicated in new buffers.
19811 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig);
19814 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the success state.
19816 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o);
19819 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the error state.
19821 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
19824 * Checks if the given object is currently in the success state
19826 bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
19829 * Frees any resources used by the CResult_InvoiceParseOrSemanticErrorZ.
19831 void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res);
19834 * Creates a new CResult_InvoiceParseOrSemanticErrorZ which has the same data as `orig`
19835 * but with all dynamically-allocated buffers duplicated in new buffers.
19837 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
19840 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the success state.
19842 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o);
19845 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the error state.
19847 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e);
19850 * Checks if the given object is currently in the success state
19852 bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o);
19855 * Frees any resources used by the CResult_SignedRawInvoiceParseErrorZ.
19857 void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res);
19860 * Creates a new CResult_SignedRawInvoiceParseErrorZ which has the same data as `orig`
19861 * but with all dynamically-allocated buffers duplicated in new buffers.
19863 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig);
19866 * Creates a new tuple which has the same data as `orig`
19867 * but with all dynamically-allocated buffers duplicated in new buffers.
19869 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
19872 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
19874 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
19877 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
19879 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
19882 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
19884 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
19887 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
19889 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
19892 * Checks if the given object is currently in the success state
19894 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
19897 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
19899 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
19902 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
19903 * but with all dynamically-allocated buffers duplicated in new buffers.
19905 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
19908 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19910 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
19913 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
19915 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
19918 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
19920 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
19923 * Checks if the given object is currently in the success state
19925 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
19928 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
19930 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
19933 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
19934 * but with all dynamically-allocated buffers duplicated in new buffers.
19936 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
19939 * Creates a new CResult_NoneSemanticErrorZ in the success state.
19941 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
19944 * Creates a new CResult_NoneSemanticErrorZ in the error state.
19946 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
19949 * Checks if the given object is currently in the success state
19951 bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o);
19954 * Frees any resources used by the CResult_NoneSemanticErrorZ.
19956 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
19959 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
19960 * but with all dynamically-allocated buffers duplicated in new buffers.
19962 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
19965 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
19967 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
19970 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
19972 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
19975 * Checks if the given object is currently in the success state
19977 bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o);
19980 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
19982 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
19985 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
19986 * but with all dynamically-allocated buffers duplicated in new buffers.
19988 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
19991 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19993 void CVec_AddressZ_free(struct LDKCVec_AddressZ _res);
19996 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
19998 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
20001 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
20003 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
20006 * Checks if the given object is currently in the success state
20008 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
20011 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
20013 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
20016 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
20017 * but with all dynamically-allocated buffers duplicated in new buffers.
20019 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
20022 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
20024 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
20027 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
20029 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
20032 * Checks if the given object is currently in the success state
20034 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
20037 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
20039 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
20042 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
20043 * but with all dynamically-allocated buffers duplicated in new buffers.
20045 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
20048 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
20050 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
20053 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
20055 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
20058 * Checks if the given object is currently in the success state
20060 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
20063 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
20065 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
20068 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
20069 * but with all dynamically-allocated buffers duplicated in new buffers.
20071 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
20074 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20076 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
20079 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20081 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
20084 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20086 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
20089 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20091 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
20094 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
20096 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
20099 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
20101 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
20104 * Checks if the given object is currently in the success state
20106 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
20109 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
20111 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
20114 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
20115 * but with all dynamically-allocated buffers duplicated in new buffers.
20117 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
20120 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
20122 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
20125 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
20127 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
20130 * Checks if the given object is currently in the success state
20132 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
20135 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
20137 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
20140 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
20141 * but with all dynamically-allocated buffers duplicated in new buffers.
20143 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
20146 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
20148 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
20151 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
20153 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
20156 * Checks if the given object is currently in the success state
20158 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
20161 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
20163 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
20166 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
20167 * but with all dynamically-allocated buffers duplicated in new buffers.
20169 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
20172 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
20174 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
20177 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
20179 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
20182 * Checks if the given object is currently in the success state
20184 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
20187 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
20189 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
20192 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
20193 * but with all dynamically-allocated buffers duplicated in new buffers.
20195 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
20198 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
20200 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
20203 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
20205 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
20208 * Checks if the given object is currently in the success state
20210 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
20213 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
20215 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
20218 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
20219 * but with all dynamically-allocated buffers duplicated in new buffers.
20221 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
20224 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
20226 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
20229 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
20231 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
20234 * Checks if the given object is currently in the success state
20236 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
20239 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
20241 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
20244 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
20245 * but with all dynamically-allocated buffers duplicated in new buffers.
20247 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
20250 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
20252 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
20255 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
20257 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
20260 * Checks if the given object is currently in the success state
20262 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
20265 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
20267 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
20270 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
20271 * but with all dynamically-allocated buffers duplicated in new buffers.
20273 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
20276 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
20278 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
20281 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
20283 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
20286 * Checks if the given object is currently in the success state
20288 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
20291 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
20293 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
20296 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
20297 * but with all dynamically-allocated buffers duplicated in new buffers.
20299 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
20302 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
20304 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
20307 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
20309 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
20312 * Checks if the given object is currently in the success state
20314 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
20317 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
20319 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
20322 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
20323 * but with all dynamically-allocated buffers duplicated in new buffers.
20325 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
20328 * Creates a new CResult_InitDecodeErrorZ in the success state.
20330 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
20333 * Creates a new CResult_InitDecodeErrorZ in the error state.
20335 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
20338 * Checks if the given object is currently in the success state
20340 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
20343 * Frees any resources used by the CResult_InitDecodeErrorZ.
20345 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
20348 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
20349 * but with all dynamically-allocated buffers duplicated in new buffers.
20351 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
20354 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
20356 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
20359 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
20361 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
20364 * Checks if the given object is currently in the success state
20366 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
20369 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
20371 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
20374 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
20375 * but with all dynamically-allocated buffers duplicated in new buffers.
20377 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
20380 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
20382 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
20385 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
20387 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
20390 * Checks if the given object is currently in the success state
20392 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
20395 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
20397 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
20400 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
20401 * but with all dynamically-allocated buffers duplicated in new buffers.
20403 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
20406 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
20408 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
20411 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
20413 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
20416 * Checks if the given object is currently in the success state
20418 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
20421 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
20423 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
20426 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
20427 * but with all dynamically-allocated buffers duplicated in new buffers.
20429 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
20432 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
20434 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
20437 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
20439 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
20442 * Checks if the given object is currently in the success state
20444 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
20447 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
20449 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
20452 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
20453 * but with all dynamically-allocated buffers duplicated in new buffers.
20455 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
20458 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
20460 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
20463 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
20465 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
20468 * Checks if the given object is currently in the success state
20470 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
20473 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
20475 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
20478 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
20479 * but with all dynamically-allocated buffers duplicated in new buffers.
20481 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
20484 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
20486 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
20489 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
20491 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
20494 * Checks if the given object is currently in the success state
20496 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
20499 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
20501 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
20504 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
20505 * but with all dynamically-allocated buffers duplicated in new buffers.
20507 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
20510 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
20512 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
20515 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
20517 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
20520 * Checks if the given object is currently in the success state
20522 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
20525 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
20527 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
20530 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
20531 * but with all dynamically-allocated buffers duplicated in new buffers.
20533 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
20536 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
20538 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
20541 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
20543 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
20546 * Checks if the given object is currently in the success state
20548 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
20551 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
20553 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
20556 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
20557 * but with all dynamically-allocated buffers duplicated in new buffers.
20559 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
20562 * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
20564 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
20567 * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
20569 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
20572 * Checks if the given object is currently in the success state
20574 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
20577 * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
20579 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
20582 * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
20583 * but with all dynamically-allocated buffers duplicated in new buffers.
20585 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
20588 * Creates a new CResult_PingDecodeErrorZ in the success state.
20590 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
20593 * Creates a new CResult_PingDecodeErrorZ in the error state.
20595 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
20598 * Checks if the given object is currently in the success state
20600 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
20603 * Frees any resources used by the CResult_PingDecodeErrorZ.
20605 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
20608 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
20609 * but with all dynamically-allocated buffers duplicated in new buffers.
20611 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
20614 * Creates a new CResult_PongDecodeErrorZ in the success state.
20616 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
20619 * Creates a new CResult_PongDecodeErrorZ in the error state.
20621 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
20624 * Checks if the given object is currently in the success state
20626 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
20629 * Frees any resources used by the CResult_PongDecodeErrorZ.
20631 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
20634 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
20635 * but with all dynamically-allocated buffers duplicated in new buffers.
20637 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
20640 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
20642 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
20645 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
20647 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
20650 * Checks if the given object is currently in the success state
20652 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
20655 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
20657 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
20660 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
20661 * but with all dynamically-allocated buffers duplicated in new buffers.
20663 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
20666 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
20668 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
20671 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
20673 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
20676 * Checks if the given object is currently in the success state
20678 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
20681 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
20683 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
20686 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
20687 * but with all dynamically-allocated buffers duplicated in new buffers.
20689 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
20692 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
20694 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
20697 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
20699 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
20702 * Checks if the given object is currently in the success state
20704 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
20707 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
20709 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
20712 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
20713 * but with all dynamically-allocated buffers duplicated in new buffers.
20715 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
20718 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
20720 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
20723 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
20725 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
20728 * Checks if the given object is currently in the success state
20730 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
20733 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
20735 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
20738 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
20739 * but with all dynamically-allocated buffers duplicated in new buffers.
20741 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
20744 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
20746 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
20749 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
20751 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
20754 * Checks if the given object is currently in the success state
20756 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
20759 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
20761 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
20764 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
20765 * but with all dynamically-allocated buffers duplicated in new buffers.
20767 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
20770 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
20772 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
20775 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
20777 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
20780 * Checks if the given object is currently in the success state
20782 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
20785 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
20787 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
20790 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
20791 * but with all dynamically-allocated buffers duplicated in new buffers.
20793 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
20796 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
20798 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
20801 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
20803 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
20806 * Checks if the given object is currently in the success state
20808 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
20811 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
20813 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
20816 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
20817 * but with all dynamically-allocated buffers duplicated in new buffers.
20819 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
20822 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
20824 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
20827 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
20829 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
20832 * Checks if the given object is currently in the success state
20834 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
20837 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
20839 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
20842 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
20843 * but with all dynamically-allocated buffers duplicated in new buffers.
20845 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
20848 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
20850 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
20853 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
20855 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
20858 * Checks if the given object is currently in the success state
20860 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
20863 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
20865 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
20868 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
20869 * but with all dynamically-allocated buffers duplicated in new buffers.
20871 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
20874 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
20876 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
20879 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
20881 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
20884 * Checks if the given object is currently in the success state
20886 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
20889 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
20891 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
20894 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
20895 * but with all dynamically-allocated buffers duplicated in new buffers.
20897 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
20900 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
20902 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
20905 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
20907 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
20910 * Checks if the given object is currently in the success state
20912 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
20915 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
20917 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
20920 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
20921 * but with all dynamically-allocated buffers duplicated in new buffers.
20923 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
20926 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
20928 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
20931 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
20933 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
20936 * Checks if the given object is currently in the success state
20938 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
20941 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
20943 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
20946 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
20947 * but with all dynamically-allocated buffers duplicated in new buffers.
20949 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
20952 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
20954 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
20957 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
20959 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
20962 * Checks if the given object is currently in the success state
20964 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
20967 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
20969 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
20972 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
20973 * but with all dynamically-allocated buffers duplicated in new buffers.
20975 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
20978 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20980 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
20983 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
20985 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
20988 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
20990 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
20993 * Checks if the given object is currently in the success state
20995 bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
20998 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
21000 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
21003 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
21004 * but with all dynamically-allocated buffers duplicated in new buffers.
21006 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
21009 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21011 void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
21014 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
21016 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
21019 * Constructs a new COption_FilterZ containing nothing
21021 struct LDKCOption_FilterZ COption_FilterZ_none(void);
21024 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
21026 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
21029 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
21031 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
21034 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
21036 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
21039 * Checks if the given object is currently in the success state
21041 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
21044 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
21046 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
21049 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21051 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
21054 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21056 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
21059 * Creates a new tuple which has the same data as `orig`
21060 * but with all dynamically-allocated buffers duplicated in new buffers.
21062 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
21065 * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
21067 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
21070 * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
21072 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
21075 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21077 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
21080 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
21082 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
21085 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
21087 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
21090 * Checks if the given object is currently in the success state
21092 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
21095 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
21097 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
21100 * Frees any resources used by the APIError
21102 void APIError_free(struct LDKAPIError this_ptr);
21105 * Creates a copy of the APIError
21107 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
21110 * Utility method to constructs a new APIMisuseError-variant APIError
21112 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
21115 * Utility method to constructs a new FeeRateTooHigh-variant APIError
21117 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
21120 * Utility method to constructs a new InvalidRoute-variant APIError
21122 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
21125 * Utility method to constructs a new ChannelUnavailable-variant APIError
21127 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
21130 * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
21132 struct LDKAPIError APIError_monitor_update_in_progress(void);
21135 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
21137 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
21140 * Checks if two APIErrors contain equal inner contents.
21141 * This ignores pointers and is_owned flags and looks at the values in fields.
21143 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
21146 * Serialize the APIError object into a byte array which can be read by APIError_read
21148 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
21151 * Read a APIError from a byte array, created by APIError_write
21153 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
21156 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
21158 void BigSize_free(struct LDKBigSize this_obj);
21160 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
21162 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
21165 * Constructs a new BigSize given each field
21167 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
21170 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
21172 void Hostname_free(struct LDKHostname this_obj);
21175 * Creates a copy of the Hostname
21177 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
21180 * Checks if two Hostnames contain equal inner contents.
21181 * This ignores pointers and is_owned flags and looks at the values in fields.
21182 * Two objects with NULL inner values will be considered "equal" here.
21184 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
21187 * Returns the length of the hostname.
21189 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
21192 * Creates a digital signature of a message given a SecretKey, like the node's secret.
21193 * 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.
21194 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
21196 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
21199 * Recovers the PublicKey of the signer of the message given the message and the signature.
21201 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
21204 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
21205 * and the PublicKey.
21207 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
21210 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
21212 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
21215 * Calls the free function if one is set
21217 void Persister_free(struct LDKPersister this_ptr);
21220 * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
21222 void UntrustedString_free(struct LDKUntrustedString this_obj);
21224 struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
21226 void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
21229 * Constructs a new UntrustedString given each field
21231 MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
21234 * Creates a copy of the UntrustedString
21236 struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
21239 * Checks if two UntrustedStrings contain equal inner contents.
21240 * This ignores pointers and is_owned flags and looks at the values in fields.
21241 * Two objects with NULL inner values will be considered "equal" here.
21243 bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
21246 * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
21248 struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
21251 * Read a UntrustedString from a byte array, created by UntrustedString_write
21253 struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
21256 * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
21258 void PrintableString_free(struct LDKPrintableString this_obj);
21260 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
21262 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
21265 * Constructs a new PrintableString given each field
21267 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
21270 * Calls the free function if one is set
21272 void FutureCallback_free(struct LDKFutureCallback this_ptr);
21275 * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
21277 void Future_free(struct LDKFuture this_obj);
21280 * Creates a copy of the Future
21282 struct LDKFuture Future_clone(const struct LDKFuture *NONNULL_PTR orig);
21285 * Registers a callback to be called upon completion of this future. If the future has already
21286 * completed, the callback will be called immediately.
21288 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
21291 * Waits until this [`Future`] completes.
21293 void Future_wait(struct LDKFuture this_arg);
21296 * Waits until this [`Future`] completes or the given amount of time has elapsed.
21298 * Returns true if the [`Future`] completed, false if the time elapsed.
21300 MUST_USE_RES bool Future_wait_timeout(struct LDKFuture this_arg, uint64_t max_wait);
21303 * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
21305 void Sleeper_free(struct LDKSleeper this_obj);
21308 * Constructs a new sleeper from one future, allowing blocking on it.
21310 MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(struct LDKFuture future);
21313 * Constructs a new sleeper from two futures, allowing blocking on both at once.
21315 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(struct LDKFuture fut_a, struct LDKFuture fut_b);
21318 * Constructs a new sleeper on many futures, allowing blocking on all at once.
21320 MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
21323 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
21325 void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
21328 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
21329 * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
21332 MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
21335 * Creates a copy of the Level
21337 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
21340 * Utility method to constructs a new Gossip-variant Level
21342 enum LDKLevel Level_gossip(void);
21345 * Utility method to constructs a new Trace-variant Level
21347 enum LDKLevel Level_trace(void);
21350 * Utility method to constructs a new Debug-variant Level
21352 enum LDKLevel Level_debug(void);
21355 * Utility method to constructs a new Info-variant Level
21357 enum LDKLevel Level_info(void);
21360 * Utility method to constructs a new Warn-variant Level
21362 enum LDKLevel Level_warn(void);
21365 * Utility method to constructs a new Error-variant Level
21367 enum LDKLevel Level_error(void);
21370 * Checks if two Levels contain equal inner contents.
21371 * This ignores pointers and is_owned flags and looks at the values in fields.
21373 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
21376 * Generates a non-cryptographic 64-bit hash of the Level.
21378 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
21381 * Returns the most verbose logging level.
21383 MUST_USE_RES enum LDKLevel Level_max(void);
21386 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
21388 void Record_free(struct LDKRecord this_obj);
21391 * The verbosity level of the message.
21393 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
21396 * The verbosity level of the message.
21398 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
21401 * The message body.
21403 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
21406 * The message body.
21408 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
21411 * The module path of the message.
21413 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
21416 * The module path of the message.
21418 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
21421 * The source file containing the message.
21423 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
21426 * The source file containing the message.
21428 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
21431 * The line containing the message.
21433 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
21436 * The line containing the message.
21438 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
21441 * Creates a copy of the Record
21443 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
21446 * Calls the free function if one is set
21448 void Logger_free(struct LDKLogger this_ptr);
21451 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
21453 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
21456 * Confirmations we will wait for before considering the channel locked in.
21457 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
21458 * equivalent limit applied to outbound channels).
21460 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
21461 * transaction before operation. If you wish to accept channels with zero confirmations, see
21462 * [`UserConfig::manually_accept_inbound_channels`] and
21463 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
21465 * Default value: 6.
21467 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
21468 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
21470 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
21473 * Confirmations we will wait for before considering the channel locked in.
21474 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
21475 * equivalent limit applied to outbound channels).
21477 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
21478 * transaction before operation. If you wish to accept channels with zero confirmations, see
21479 * [`UserConfig::manually_accept_inbound_channels`] and
21480 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
21482 * Default value: 6.
21484 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
21485 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
21487 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
21490 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
21491 * the number of blocks we have to punish our counterparty if they broadcast a revoked
21494 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
21495 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
21496 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
21497 * possibly with time in between to RBF the spending transaction).
21499 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
21500 * case of an honest unilateral channel close, which implicitly decrease the economic value of
21503 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
21504 * can tweak config to ask for more security, not less.
21506 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
21509 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
21510 * the number of blocks we have to punish our counterparty if they broadcast a revoked
21513 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
21514 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
21515 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
21516 * possibly with time in between to RBF the spending transaction).
21518 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
21519 * case of an honest unilateral channel close, which implicitly decrease the economic value of
21522 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
21523 * can tweak config to ask for more security, not less.
21525 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
21528 * Set to the smallest value HTLC we will accept to process.
21530 * This value is sent to our counterparty on channel-open and we close the channel any time
21531 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
21533 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
21536 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
21539 * Set to the smallest value HTLC we will accept to process.
21541 * This value is sent to our counterparty on channel-open and we close the channel any time
21542 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
21544 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
21547 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
21550 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
21553 * This can be set to a value between 1-100, where the value corresponds to the percent of the
21554 * channel value in whole percentages.
21557 * * If configured to another value than the default value 10, any new channels created with
21558 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
21559 * `ChannelManager`.
21561 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
21562 * no way to configure the cap for the total value of outbound HTLCs in-flight.
21564 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
21565 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
21566 * restrict exposure to loss due to being offline for too long.
21567 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
21568 * for more information.
21570 * Default value: 10.
21571 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
21572 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
21574 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
21577 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
21580 * This can be set to a value between 1-100, where the value corresponds to the percent of the
21581 * channel value in whole percentages.
21584 * * If configured to another value than the default value 10, any new channels created with
21585 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
21586 * `ChannelManager`.
21588 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
21589 * no way to configure the cap for the total value of outbound HTLCs in-flight.
21591 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
21592 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
21593 * restrict exposure to loss due to being offline for too long.
21594 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
21595 * for more information.
21597 * Default value: 10.
21598 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
21599 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
21601 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
21604 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
21605 * BOLTs) option for outbound private channels. This provides better privacy by not including
21606 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
21607 * relay HTLCs to us using the channel's SCID alias.
21609 * If this option is set, channels may be created that will not be readable by LDK versions
21610 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
21611 * [`DecodeError::InvalidValue`].
21613 * Note that setting this to true does *not* prevent us from opening channels with
21614 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
21615 * private channel without that option.
21617 * Ignored if the channel is negotiated to be announced, see
21618 * [`ChannelHandshakeConfig::announced_channel`] and
21619 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
21621 * Default value: false. This value is likely to change to true in the future.
21623 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
21624 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
21626 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
21629 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
21630 * BOLTs) option for outbound private channels. This provides better privacy by not including
21631 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
21632 * relay HTLCs to us using the channel's SCID alias.
21634 * If this option is set, channels may be created that will not be readable by LDK versions
21635 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
21636 * [`DecodeError::InvalidValue`].
21638 * Note that setting this to true does *not* prevent us from opening channels with
21639 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
21640 * private channel without that option.
21642 * Ignored if the channel is negotiated to be announced, see
21643 * [`ChannelHandshakeConfig::announced_channel`] and
21644 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
21646 * Default value: false. This value is likely to change to true in the future.
21648 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
21649 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
21651 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
21654 * Set to announce the channel publicly and notify all nodes that they can route via this
21657 * This should only be set to true for nodes which expect to be online reliably.
21659 * As the node which funds a channel picks this value this will only apply for new outbound
21660 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
21662 * Default value: false.
21664 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
21667 * Set to announce the channel publicly and notify all nodes that they can route via this
21670 * This should only be set to true for nodes which expect to be online reliably.
21672 * As the node which funds a channel picks this value this will only apply for new outbound
21673 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
21675 * Default value: false.
21677 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
21680 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
21681 * supports it, they will then enforce the mutual-close output to us matches what we provided
21682 * at intialization, preventing us from closing to an alternate pubkey.
21684 * This is set to true by default to provide a slight increase in security, though ultimately
21685 * any attacker who is able to take control of a channel can just as easily send the funds via
21686 * lightning payments, so we never require that our counterparties support this option.
21688 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
21690 * Default value: true.
21692 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::SignerProvider::get_shutdown_scriptpubkey
21694 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
21697 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
21698 * supports it, they will then enforce the mutual-close output to us matches what we provided
21699 * at intialization, preventing us from closing to an alternate pubkey.
21701 * This is set to true by default to provide a slight increase in security, though ultimately
21702 * any attacker who is able to take control of a channel can just as easily send the funds via
21703 * lightning payments, so we never require that our counterparties support this option.
21705 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
21707 * Default value: true.
21709 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::SignerProvider::get_shutdown_scriptpubkey
21711 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
21714 * The Proportion of the channel value to configure as counterparty's channel reserve,
21715 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
21717 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
21718 * on their side, at all times.
21719 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
21720 * claiming at least this value on chain.
21722 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
21723 * amount can never be used for payments.
21724 * Also, if our selected channel reserve for counterparty and counterparty's selected
21725 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
21728 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
21729 * other than the default value.
21731 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
21732 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
21733 * as 1000 sats instead, which is a safe implementation-specific lower bound.
21734 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
21735 * instead, although channel negotiations will fail in that case.
21737 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
21740 * The Proportion of the channel value to configure as counterparty's channel reserve,
21741 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
21743 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
21744 * on their side, at all times.
21745 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
21746 * claiming at least this value on chain.
21748 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
21749 * amount can never be used for payments.
21750 * Also, if our selected channel reserve for counterparty and counterparty's selected
21751 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
21754 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
21755 * other than the default value.
21757 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
21758 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
21759 * as 1000 sats instead, which is a safe implementation-specific lower bound.
21760 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
21761 * instead, although channel negotiations will fail in that case.
21763 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
21766 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
21768 * Increasing the value can help improve liquidity and stability in
21769 * routing at the cost of higher long term disk / DB usage.
21771 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
21772 * other than the default value.
21774 * Default value: 50
21775 * Maximum value: 483, any values larger will be treated as 483.
21776 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
21778 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
21781 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
21783 * Increasing the value can help improve liquidity and stability in
21784 * routing at the cost of higher long term disk / DB usage.
21786 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
21787 * other than the default value.
21789 * Default value: 50
21790 * Maximum value: 483, any values larger will be treated as 483.
21791 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
21793 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
21796 * Constructs a new ChannelHandshakeConfig given each field
21798 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, uint32_t their_channel_reserve_proportional_millionths_arg, uint16_t our_max_accepted_htlcs_arg);
21801 * Creates a copy of the ChannelHandshakeConfig
21803 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
21806 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
21808 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
21811 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
21813 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
21816 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
21817 * only applies to inbound channels.
21819 * Default value: 0.
21821 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21824 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
21825 * only applies to inbound channels.
21827 * Default value: 0.
21829 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
21832 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
21833 * only applies to inbound channels.
21835 * Default value: 2^24 - 1.
21837 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21840 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
21841 * only applies to inbound channels.
21843 * Default value: 2^24 - 1.
21845 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
21848 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
21849 * you to limit the maximum minimum-size they can require.
21851 * Default value: u64::max_value.
21853 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21856 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
21857 * you to limit the maximum minimum-size they can require.
21859 * Default value: u64::max_value.
21861 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
21864 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
21865 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
21867 * Default value: 0.
21869 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21872 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
21873 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
21875 * Default value: 0.
21877 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
21880 * The remote node will require we keep a certain amount in direct payment to ourselves at all
21881 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
21882 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
21884 * Default value: u64::max_value.
21886 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21889 * The remote node will require we keep a certain amount in direct payment to ourselves at all
21890 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
21891 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
21893 * Default value: u64::max_value.
21895 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
21898 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
21899 * time. This allows you to set a minimum such value.
21901 * Default value: 0.
21903 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21906 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
21907 * time. This allows you to set a minimum such value.
21909 * Default value: 0.
21911 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
21914 * Before a channel is usable the funding transaction will need to be confirmed by at least a
21915 * certain number of blocks, specified by the node which is not the funder (as the funder can
21916 * assume they aren't going to double-spend themselves).
21917 * This config allows you to set a limit on the maximum amount of time to wait.
21919 * Default value: 144, or roughly one day and only applies to outbound channels.
21921 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21924 * Before a channel is usable the funding transaction will need to be confirmed by at least a
21925 * certain number of blocks, specified by the node which is not the funder (as the funder can
21926 * assume they aren't going to double-spend themselves).
21927 * This config allows you to set a limit on the maximum amount of time to wait.
21929 * Default value: 144, or roughly one day and only applies to outbound channels.
21931 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
21934 * Whether we implicitly trust funding transactions generated by us for our own outbound
21935 * channels to not be double-spent.
21937 * If this is set, we assume that our own funding transactions are *never* double-spent, and
21938 * thus we can trust them without any confirmations. This is generally a reasonable
21939 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
21940 * control of the signing keys).
21942 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
21943 * double-spend the funding transaction to RBF with an alternative channel open.
21945 * This only applies if our counterparty set their confirmations-required value to 0, and we
21946 * always trust our own funding transaction at 1 confirmation irrespective of this value.
21947 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
21948 * `true` (0) and `false` (1).
21950 * Default value: true
21952 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21955 * Whether we implicitly trust funding transactions generated by us for our own outbound
21956 * channels to not be double-spent.
21958 * If this is set, we assume that our own funding transactions are *never* double-spent, and
21959 * thus we can trust them without any confirmations. This is generally a reasonable
21960 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
21961 * control of the signing keys).
21963 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
21964 * double-spend the funding transaction to RBF with an alternative channel open.
21966 * This only applies if our counterparty set their confirmations-required value to 0, and we
21967 * always trust our own funding transaction at 1 confirmation irrespective of this value.
21968 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
21969 * `true` (0) and `false` (1).
21971 * Default value: true
21973 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
21976 * Set to force an incoming channel to match our announced channel preference in
21977 * [`ChannelHandshakeConfig::announced_channel`].
21979 * For a node which is not online reliably, this should be set to true and
21980 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
21981 * channels will ever be opened.
21983 * Default value: true.
21985 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21988 * Set to force an incoming channel to match our announced channel preference in
21989 * [`ChannelHandshakeConfig::announced_channel`].
21991 * For a node which is not online reliably, this should be set to true and
21992 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
21993 * channels will ever be opened.
21995 * Default value: true.
21997 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
22000 * Set to the amount of time we're willing to wait to claim money back to us.
22002 * Not checking this value would be a security issue, as our peer would be able to set it to
22003 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
22005 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
22006 * reduce the loss of having useless locked funds (if your peer accepts)
22008 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
22011 * Set to the amount of time we're willing to wait to claim money back to us.
22013 * Not checking this value would be a security issue, as our peer would be able to set it to
22014 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
22016 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
22017 * reduce the loss of having useless locked funds (if your peer accepts)
22019 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
22022 * Constructs a new ChannelHandshakeLimits given each field
22024 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);
22027 * Creates a copy of the ChannelHandshakeLimits
22029 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
22032 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
22034 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
22037 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
22039 void ChannelConfig_free(struct LDKChannelConfig this_obj);
22042 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
22043 * over the channel.
22044 * This may be allowed to change at runtime in a later update, however doing so must result in
22045 * update messages sent to notify all nodes of our updated relay fee.
22047 * Default value: 0.
22049 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
22052 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
22053 * over the channel.
22054 * This may be allowed to change at runtime in a later update, however doing so must result in
22055 * update messages sent to notify all nodes of our updated relay fee.
22057 * Default value: 0.
22059 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
22062 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
22063 * excess of [`forwarding_fee_proportional_millionths`].
22064 * This may be allowed to change at runtime in a later update, however doing so must result in
22065 * update messages sent to notify all nodes of our updated relay fee.
22067 * The default value of a single satoshi roughly matches the market rate on many routing nodes
22068 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
22071 * Default value: 1000.
22073 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
22075 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
22078 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
22079 * excess of [`forwarding_fee_proportional_millionths`].
22080 * This may be allowed to change at runtime in a later update, however doing so must result in
22081 * update messages sent to notify all nodes of our updated relay fee.
22083 * The default value of a single satoshi roughly matches the market rate on many routing nodes
22084 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
22087 * Default value: 1000.
22089 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
22091 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
22094 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
22095 * the channel this config applies to.
22097 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
22098 * HTLC balance when a channel appears on-chain whereas
22099 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
22100 * (non-HTLC-encumbered) balance.
22102 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
22103 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
22104 * commitment transaction at least once per this many blocks (minus some margin to allow us
22105 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
22106 * the spending transaction).
22108 * Default value: 72 (12 hours at an average of 6 blocks/hour).
22109 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
22110 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
22112 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
22114 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
22117 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
22118 * the channel this config applies to.
22120 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
22121 * HTLC balance when a channel appears on-chain whereas
22122 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
22123 * (non-HTLC-encumbered) balance.
22125 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
22126 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
22127 * commitment transaction at least once per this many blocks (minus some margin to allow us
22128 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
22129 * the spending transaction).
22131 * Default value: 72 (12 hours at an average of 6 blocks/hour).
22132 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
22133 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
22135 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
22137 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
22140 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
22141 * small to claim on-chain.
22143 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
22144 * not be claimable on-chain, instead being turned into additional miner fees if either
22145 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
22146 * to such payments may be sustantial if there are many dust HTLCs present when the
22147 * channel is force-closed.
22149 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
22150 * channel negotiated throughout the channel open process, along with the fees required to have
22151 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
22152 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
22153 * account the HTLC transaction fee as it is zero.
22155 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
22156 * exposure across all three types per-channel. Setting this too low may prevent the
22157 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
22158 * important to prevent stealing of dust HTLCs by miners.
22160 * Default value: 5_000_000 msat.
22162 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
22165 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
22166 * small to claim on-chain.
22168 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
22169 * not be claimable on-chain, instead being turned into additional miner fees if either
22170 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
22171 * to such payments may be sustantial if there are many dust HTLCs present when the
22172 * channel is force-closed.
22174 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
22175 * channel negotiated throughout the channel open process, along with the fees required to have
22176 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
22177 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
22178 * account the HTLC transaction fee as it is zero.
22180 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
22181 * exposure across all three types per-channel. Setting this too low may prevent the
22182 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
22183 * important to prevent stealing of dust HTLCs by miners.
22185 * Default value: 5_000_000 msat.
22187 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
22190 * The additional fee we're willing to pay to avoid waiting for the counterparty's
22191 * `to_self_delay` to reclaim funds.
22193 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
22194 * closing transaction which both sides find acceptable, ultimately paid by the channel
22195 * funder/initiator.
22197 * When we are the funder, because we have to pay the channel closing fee, we bound the
22198 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
22199 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
22200 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
22201 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
22204 * When we are not the funder, we require the closing transaction fee pay at least our
22205 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
22206 * Thus, this value is ignored when we are not the funder.
22208 * Default value: 1000 satoshis.
22210 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
22211 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
22213 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
22216 * The additional fee we're willing to pay to avoid waiting for the counterparty's
22217 * `to_self_delay` to reclaim funds.
22219 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
22220 * closing transaction which both sides find acceptable, ultimately paid by the channel
22221 * funder/initiator.
22223 * When we are the funder, because we have to pay the channel closing fee, we bound the
22224 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
22225 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
22226 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
22227 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
22230 * When we are not the funder, we require the closing transaction fee pay at least our
22231 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
22232 * Thus, this value is ignored when we are not the funder.
22234 * Default value: 1000 satoshis.
22236 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
22237 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
22239 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
22242 * Constructs a new ChannelConfig given each field
22244 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);
22247 * Creates a copy of the ChannelConfig
22249 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
22252 * Checks if two ChannelConfigs contain equal inner contents.
22253 * This ignores pointers and is_owned flags and looks at the values in fields.
22254 * Two objects with NULL inner values will be considered "equal" here.
22256 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
22259 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
22261 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
22264 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
22266 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
22269 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
22271 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
22274 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
22276 void UserConfig_free(struct LDKUserConfig this_obj);
22279 * Channel handshake config that we propose to our counterparty.
22281 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
22284 * Channel handshake config that we propose to our counterparty.
22286 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
22289 * Limits applied to our counterparty's proposed channel handshake config settings.
22291 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
22294 * Limits applied to our counterparty's proposed channel handshake config settings.
22296 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
22299 * Channel config which affects behavior during channel lifetime.
22301 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
22304 * Channel config which affects behavior during channel lifetime.
22306 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
22309 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
22310 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
22311 * node which is not online reliably.
22313 * For nodes which are not online reliably, you should set all channels to *not* be announced
22314 * (using [`ChannelHandshakeConfig::announced_channel`] and
22315 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
22316 * ensure you are not exposed to any forwarding risk.
22318 * Note that because you cannot change a channel's announced state after creation, there is no
22319 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
22320 * from a publicly-announced forwarding node to a private non-forwarding node you must close
22321 * all your channels and open new ones. For privacy, you should also change your node_id
22322 * (swapping all private and public key material for new ones) at that time.
22324 * Default value: false.
22326 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
22329 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
22330 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
22331 * node which is not online reliably.
22333 * For nodes which are not online reliably, you should set all channels to *not* be announced
22334 * (using [`ChannelHandshakeConfig::announced_channel`] and
22335 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
22336 * ensure you are not exposed to any forwarding risk.
22338 * Note that because you cannot change a channel's announced state after creation, there is no
22339 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
22340 * from a publicly-announced forwarding node to a private non-forwarding node you must close
22341 * all your channels and open new ones. For privacy, you should also change your node_id
22342 * (swapping all private and public key material for new ones) at that time.
22344 * Default value: false.
22346 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
22349 * If this is set to false, we do not accept inbound requests to open a new channel.
22350 * Default value: true.
22352 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
22355 * If this is set to false, we do not accept inbound requests to open a new channel.
22356 * Default value: true.
22358 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
22361 * If this is set to true, the user needs to manually accept inbound requests to open a new
22364 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
22365 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
22366 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
22367 * user explicitly chooses to accept the request.
22369 * Default value: false.
22371 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
22372 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
22373 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
22375 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
22378 * If this is set to true, the user needs to manually accept inbound requests to open a new
22381 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
22382 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
22383 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
22384 * user explicitly chooses to accept the request.
22386 * Default value: false.
22388 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
22389 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
22390 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
22392 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
22395 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
22396 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
22397 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
22399 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
22401 * Default value: false.
22403 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
22404 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
22406 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
22409 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
22410 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
22411 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
22413 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
22415 * Default value: false.
22417 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
22418 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
22420 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
22423 * Constructs a new UserConfig given each field
22425 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, bool accept_intercept_htlcs_arg);
22428 * Creates a copy of the UserConfig
22430 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
22433 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
22435 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
22438 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
22440 void BestBlock_free(struct LDKBestBlock this_obj);
22443 * Creates a copy of the BestBlock
22445 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
22448 * Checks if two BestBlocks contain equal inner contents.
22449 * This ignores pointers and is_owned flags and looks at the values in fields.
22450 * Two objects with NULL inner values will be considered "equal" here.
22452 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
22455 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
22458 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
22461 * Returns a `BestBlock` as identified by the given block hash and height.
22463 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
22466 * Returns the best block hash.
22468 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
22471 * Returns the best block height.
22473 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
22476 * Calls the free function if one is set
22478 void Listen_free(struct LDKListen this_ptr);
22481 * Calls the free function if one is set
22483 void Confirm_free(struct LDKConfirm this_ptr);
22486 * Creates a copy of the ChannelMonitorUpdateStatus
22488 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
22491 * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
22493 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
22496 * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
22498 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
22501 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateStatus
22503 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_permanent_failure(void);
22506 * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
22507 * This ignores pointers and is_owned flags and looks at the values in fields.
22509 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
22512 * Calls the free function if one is set
22514 void Watch_free(struct LDKWatch this_ptr);
22517 * Calls the free function if one is set
22519 void Filter_free(struct LDKFilter this_ptr);
22522 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
22524 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
22527 * First block where the transaction output may have been spent.
22529 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22531 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
22534 * First block where the transaction output may have been spent.
22536 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
22538 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22541 * Outpoint identifying the transaction output.
22543 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
22546 * Outpoint identifying the transaction output.
22548 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
22551 * Spending condition of the transaction output.
22553 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
22556 * Spending condition of the transaction output.
22558 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
22561 * Constructs a new WatchedOutput given each field
22563 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
22566 * Creates a copy of the WatchedOutput
22568 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
22571 * Checks if two WatchedOutputs contain equal inner contents.
22572 * This ignores pointers and is_owned flags and looks at the values in fields.
22573 * Two objects with NULL inner values will be considered "equal" here.
22575 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
22578 * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
22580 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
22583 * Calls the free function if one is set
22585 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
22588 * Creates a copy of the ConfirmationTarget
22590 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
22593 * Utility method to constructs a new Background-variant ConfirmationTarget
22595 enum LDKConfirmationTarget ConfirmationTarget_background(void);
22598 * Utility method to constructs a new Normal-variant ConfirmationTarget
22600 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
22603 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
22605 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
22608 * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
22610 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
22613 * Checks if two ConfirmationTargets contain equal inner contents.
22614 * This ignores pointers and is_owned flags and looks at the values in fields.
22616 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
22619 * Calls the free function if one is set
22621 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
22624 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
22626 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
22629 * Creates a copy of the MonitorUpdateId
22631 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
22634 * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
22636 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
22639 * Checks if two MonitorUpdateIds contain equal inner contents.
22640 * This ignores pointers and is_owned flags and looks at the values in fields.
22641 * Two objects with NULL inner values will be considered "equal" here.
22643 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
22646 * Calls the free function if one is set
22648 void Persist_free(struct LDKPersist this_ptr);
22651 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
22653 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
22656 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
22658 void ChainMonitor_free(struct LDKChainMonitor this_obj);
22661 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
22663 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
22664 * will call back to it indicating transactions and outputs of interest. This allows clients to
22665 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
22666 * always need to fetch full blocks absent another means for determining which blocks contain
22667 * transactions relevant to the watched channels.
22669 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
22672 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
22673 * claims which are awaiting confirmation.
22675 * Includes the balances from each [`ChannelMonitor`] *except* those included in
22676 * `ignored_channels`, allowing you to filter out balances from channels which are still open
22677 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
22679 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
22680 * inclusion in the return value.
22682 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
22685 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
22686 * such [`ChannelMonitor`] is currently being monitored for.
22688 * Note that the result holds a mutex over our monitor set, and should not be held
22691 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
22694 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
22696 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
22697 * monitoring for on-chain state resolutions.
22699 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
22702 * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
22704 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
22707 * Indicates the persistence of a [`ChannelMonitor`] has completed after
22708 * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
22710 * Thus, the anticipated use is, at a high level:
22711 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
22712 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
22713 * returning [`ChannelMonitorUpdateStatus::InProgress`],
22714 * 2) once all remote copies are updated, you call this function with the
22715 * `completed_update_id` that completed, and once all pending updates have completed the
22716 * channel will be re-enabled.
22718 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
22719 * registered [`ChannelMonitor`]s.
22721 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);
22724 * Gets a [`Future`] that completes when an event is available either via
22725 * [`chain::Watch::release_pending_monitor_events`] or
22726 * [`EventsProvider::process_pending_events`].
22728 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
22729 * [`ChainMonitor`] and should instead register actions to be taken later.
22731 * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
22733 MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
22736 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
22737 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
22738 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
22739 * invoking this every 30 seconds, or lower if running in an environment with spotty
22740 * connections, like on mobile.
22742 void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
22745 * Constructs a new Listen which calls the relevant methods on this_arg.
22746 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
22748 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
22751 * Constructs a new Confirm which calls the relevant methods on this_arg.
22752 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
22754 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
22757 * Constructs a new Watch which calls the relevant methods on this_arg.
22758 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
22760 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
22763 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
22764 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
22766 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
22769 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
22771 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
22774 * The sequence number of this update. Updates *must* be replayed in-order according to this
22775 * sequence number (and updates may panic if they are not). The update_id values are strictly
22776 * increasing and increase by one for each new update, with two exceptions specified below.
22778 * This sequence number is also used to track up to which points updates which returned
22779 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
22780 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
22782 * The only instances we allow where update_id values are not strictly increasing have a
22783 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
22784 * will force close the channel by broadcasting the latest commitment transaction or
22785 * special post-force-close updates, like providing preimages necessary to claim outputs on the
22786 * broadcast commitment transaction. See its docs for more details.
22788 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
22790 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
22793 * The sequence number of this update. Updates *must* be replayed in-order according to this
22794 * sequence number (and updates may panic if they are not). The update_id values are strictly
22795 * increasing and increase by one for each new update, with two exceptions specified below.
22797 * This sequence number is also used to track up to which points updates which returned
22798 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
22799 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
22801 * The only instances we allow where update_id values are not strictly increasing have a
22802 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
22803 * will force close the channel by broadcasting the latest commitment transaction or
22804 * special post-force-close updates, like providing preimages necessary to claim outputs on the
22805 * broadcast commitment transaction. See its docs for more details.
22807 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
22809 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
22812 * Creates a copy of the ChannelMonitorUpdate
22814 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
22817 * Checks if two ChannelMonitorUpdates contain equal inner contents.
22818 * This ignores pointers and is_owned flags and looks at the values in fields.
22819 * Two objects with NULL inner values will be considered "equal" here.
22821 bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
22824 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
22826 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
22829 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
22831 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
22834 * Frees any resources used by the MonitorEvent
22836 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
22839 * Creates a copy of the MonitorEvent
22841 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
22844 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
22846 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
22849 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
22851 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
22854 * Utility method to constructs a new Completed-variant MonitorEvent
22856 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
22859 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
22861 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
22864 * Checks if two MonitorEvents contain equal inner contents.
22865 * This ignores pointers and is_owned flags and looks at the values in fields.
22867 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
22870 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
22872 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
22875 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
22877 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
22880 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
22882 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
22885 * Creates a copy of the HTLCUpdate
22887 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
22890 * Checks if two HTLCUpdates contain equal inner contents.
22891 * This ignores pointers and is_owned flags and looks at the values in fields.
22892 * Two objects with NULL inner values will be considered "equal" here.
22894 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
22897 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
22899 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
22902 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
22904 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
22907 * Frees any resources used by the Balance
22909 void Balance_free(struct LDKBalance this_ptr);
22912 * Creates a copy of the Balance
22914 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
22917 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
22919 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
22922 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
22924 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
22927 * Utility method to constructs a new ContentiousClaimable-variant Balance
22929 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
22932 * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
22934 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
22937 * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
22939 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t expiry_height);
22942 * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
22944 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t claimable_amount_satoshis);
22947 * Checks if two Balances contain equal inner contents.
22948 * This ignores pointers and is_owned flags and looks at the values in fields.
22950 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
22953 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
22955 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
22958 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
22960 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
22963 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
22966 * panics if the given update is not the next update by update_id.
22968 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);
22971 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
22974 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
22977 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
22979 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
22982 * Gets a list of txids, with their output scripts (in the order they appear in the
22983 * transaction), which we must learn about spends of via block_connected().
22985 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
22988 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
22989 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
22990 * have been registered.
22992 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
22995 * Get the list of HTLCs who's status has been updated on chain. This should be called by
22996 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
22998 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
23001 * Gets the list of pending events which were generated by previous actions, clearing the list
23004 * This is called by the [`EventsProvider::process_pending_events`] implementation for
23005 * [`ChainMonitor`].
23007 * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
23008 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
23010 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
23013 * Gets the `node_id` of the counterparty for this channel.
23015 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
23018 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23020 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
23023 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
23024 * the Channel was out-of-date.
23026 * You may also use this to broadcast the latest local commitment transaction, either because
23027 * a monitor update failed with [`ChannelMonitorUpdateStatus::PermanentFailure`] or because we've
23028 * fallen behind (i.e. we've received proof that our counterparty side knows a revocation
23029 * secret we gave them that they shouldn't know).
23031 * Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty
23032 * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
23033 * close channel with their commitment transaction after a substantial amount of time. Best
23034 * may be to contact the other node operator out-of-band to coordinate other options available
23035 * to you. In any-case, the choice is up to you.
23037 * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
23039 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);
23042 * Processes transactions in a newly connected block, which may result in any of the following:
23043 * - update the monitor's state against resolved HTLCs
23044 * - punish the counterparty in the case of seeing a revoked commitment transaction
23045 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
23046 * - detect settled outputs for later spending
23047 * - schedule and bump any in-flight claims
23049 * Returns any new outputs to watch from `txdata`; after called, these are also included in
23050 * [`get_outputs_to_watch`].
23052 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
23054 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);
23057 * Determines if the disconnected block contained any transactions of interest and updates
23060 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);
23063 * Processes transactions confirmed in a block with the given header and height, returning new
23064 * outputs to watch. See [`block_connected`] for details.
23066 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
23067 * blocks. See [`chain::Confirm`] for calling expectations.
23069 * [`block_connected`]: Self::block_connected
23071 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);
23074 * Processes a transaction that was reorganized out of the chain.
23076 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
23077 * than blocks. See [`chain::Confirm`] for calling expectations.
23079 * [`block_disconnected`]: Self::block_disconnected
23081 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);
23084 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
23085 * [`block_connected`] for details.
23087 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
23088 * blocks. See [`chain::Confirm`] for calling expectations.
23090 * [`block_connected`]: Self::block_connected
23092 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);
23095 * Returns the set of txids that should be monitored for re-organization out of the chain.
23097 MUST_USE_RES struct LDKCVec_C2Tuple_TxidBlockHashZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
23100 * Gets the latest best block which was connected either via the [`chain::Listen`] or
23101 * [`chain::Confirm`] interfaces.
23103 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
23106 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
23107 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
23108 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
23109 * invoking this every 30 seconds, or lower if running in an environment with spotty
23110 * connections, like on mobile.
23112 void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
23115 * Gets the balances in this channel which are either claimable by us if we were to
23116 * force-close the channel now or which are claimable on-chain (possibly awaiting
23119 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
23120 * included here until an [`Event::SpendableOutputs`] event has been generated for the
23121 * balance, or until our counterparty has claimed the balance and accrued several
23122 * confirmations on the claim transaction.
23124 * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
23125 * LDK prior to 0.0.111, balances may not be fully captured if our counterparty broadcasted
23128 * See [`Balance`] for additional details on the types of claimable balances which
23129 * may be returned here and their meanings.
23131 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
23134 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
23136 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
23139 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
23141 void OutPoint_free(struct LDKOutPoint this_obj);
23144 * The referenced transaction's txid.
23146 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
23149 * The referenced transaction's txid.
23151 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23154 * The index of the referenced output in its transaction's vout.
23156 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
23159 * The index of the referenced output in its transaction's vout.
23161 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
23164 * Constructs a new OutPoint given each field
23166 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
23169 * Creates a copy of the OutPoint
23171 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
23174 * Checks if two OutPoints contain equal inner contents.
23175 * This ignores pointers and is_owned flags and looks at the values in fields.
23176 * Two objects with NULL inner values will be considered "equal" here.
23178 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
23181 * Generates a non-cryptographic 64-bit hash of the OutPoint.
23183 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
23186 * Convert an `OutPoint` to a lightning channel id.
23188 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
23191 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
23193 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
23196 * Read a OutPoint from a byte array, created by OutPoint_write
23198 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
23201 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
23203 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
23206 * The outpoint which is spendable.
23208 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
23211 * The outpoint which is spendable.
23213 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
23216 * Per commitment point to derive the delayed payment key by key holder.
23218 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
23221 * Per commitment point to derive the delayed payment key by key holder.
23223 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23226 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
23227 * the witness_script.
23229 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
23232 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
23233 * the witness_script.
23235 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
23238 * The output which is referenced by the given outpoint.
23240 * Returns a copy of the field.
23242 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
23245 * The output which is referenced by the given outpoint.
23247 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
23250 * The revocation point specific to the commitment transaction which was broadcast. Used to
23251 * derive the witnessScript for this output.
23253 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
23256 * The revocation point specific to the commitment transaction which was broadcast. Used to
23257 * derive the witnessScript for this output.
23259 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23262 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
23263 * This may be useful in re-deriving keys used in the channel to spend the output.
23265 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
23268 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
23269 * This may be useful in re-deriving keys used in the channel to spend the output.
23271 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23274 * The value of the channel which this output originated from, possibly indirectly.
23276 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
23279 * The value of the channel which this output originated from, possibly indirectly.
23281 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
23284 * Constructs a new DelayedPaymentOutputDescriptor given each field
23286 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);
23289 * Creates a copy of the DelayedPaymentOutputDescriptor
23291 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
23294 * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
23295 * This ignores pointers and is_owned flags and looks at the values in fields.
23296 * Two objects with NULL inner values will be considered "equal" here.
23298 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
23301 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
23303 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
23306 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
23308 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
23311 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
23313 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
23316 * The outpoint which is spendable.
23318 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
23321 * The outpoint which is spendable.
23323 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
23326 * The output which is referenced by the given outpoint.
23328 * Returns a copy of the field.
23330 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
23333 * The output which is referenced by the given outpoint.
23335 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
23338 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
23339 * This may be useful in re-deriving keys used in the channel to spend the output.
23341 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
23344 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
23345 * This may be useful in re-deriving keys used in the channel to spend the output.
23347 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23350 * The value of the channel which this transactions spends.
23352 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
23355 * The value of the channel which this transactions spends.
23357 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
23360 * Constructs a new StaticPaymentOutputDescriptor given each field
23362 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);
23365 * Creates a copy of the StaticPaymentOutputDescriptor
23367 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
23370 * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
23371 * This ignores pointers and is_owned flags and looks at the values in fields.
23372 * Two objects with NULL inner values will be considered "equal" here.
23374 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
23377 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
23379 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
23382 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
23384 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
23387 * Frees any resources used by the SpendableOutputDescriptor
23389 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
23392 * Creates a copy of the SpendableOutputDescriptor
23394 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
23397 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
23399 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
23402 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
23404 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
23407 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
23409 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
23412 * Checks if two SpendableOutputDescriptors contain equal inner contents.
23413 * This ignores pointers and is_owned flags and looks at the values in fields.
23415 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
23418 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
23420 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
23423 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
23425 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
23428 * Calls the free function if one is set
23430 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
23433 * Calls the free function if one is set
23435 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
23438 * Calls the free function if one is set
23440 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
23443 * Creates a copy of the Recipient
23445 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
23448 * Utility method to constructs a new Node-variant Recipient
23450 enum LDKRecipient Recipient_node(void);
23453 * Utility method to constructs a new PhantomNode-variant Recipient
23455 enum LDKRecipient Recipient_phantom_node(void);
23458 * Calls the free function if one is set
23460 void EntropySource_free(struct LDKEntropySource this_ptr);
23463 * Calls the free function if one is set
23465 void NodeSigner_free(struct LDKNodeSigner this_ptr);
23468 * Calls the free function if one is set
23470 void SignerProvider_free(struct LDKSignerProvider this_ptr);
23473 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
23475 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
23478 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
23479 * holder's anchor output in a commitment transaction, if one is present.
23481 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
23484 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
23485 * holder's anchor output in a commitment transaction, if one is present.
23487 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
23490 * Holder secret key for blinded revocation pubkey.
23492 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
23495 * Holder secret key for blinded revocation pubkey.
23497 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
23500 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
23502 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
23505 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
23507 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
23510 * Holder secret key used in an HTLC transaction.
23512 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
23515 * Holder secret key used in an HTLC transaction.
23517 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
23520 * Holder HTLC secret key used in commitment transaction HTLC outputs.
23522 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
23525 * Holder HTLC secret key used in commitment transaction HTLC outputs.
23527 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
23532 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
23537 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23540 * Creates a copy of the InMemorySigner
23542 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
23545 * Creates a new [`InMemorySigner`].
23547 MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(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, struct LDKThirtyTwoBytes rand_bytes_unique_start);
23550 * Returns the counterparty's pubkeys.
23552 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
23554 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
23557 * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
23558 * transactions, i.e., the amount of time that we have to wait to recover our funds if we
23559 * broadcast a transaction.
23561 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
23563 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
23566 * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
23567 * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
23568 * if they broadcast a transaction.
23570 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
23572 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
23575 * Returns whether the holder is the initiator.
23577 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
23579 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
23584 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
23586 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
23589 * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
23590 * building transactions.
23592 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
23594 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
23597 * Returns whether anchors should be used.
23599 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
23601 MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
23604 * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
23605 * by `descriptor`, returning the witness stack for the input.
23607 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
23608 * is not spending the outpoint described by [`descriptor.outpoint`],
23609 * or if an output descriptor `script_pubkey` does not match the one we can spend.
23611 * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
23613 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);
23616 * Sign the single input of `spend_tx` at index `input_idx` which spends the output
23617 * described by `descriptor`, returning the witness stack for the input.
23619 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
23620 * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
23621 * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
23622 * `script_pubkey` does not match the one we can spend.
23624 * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
23625 * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
23627 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);
23630 * Constructs a new EntropySource which calls the relevant methods on this_arg.
23631 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
23633 struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
23636 * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
23637 * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
23639 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
23642 * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
23643 * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
23645 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
23648 * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
23649 * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
23651 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
23654 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
23656 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
23659 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
23661 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
23664 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
23666 void KeysManager_free(struct LDKKeysManager this_obj);
23669 * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
23670 * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
23671 * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
23672 * without a doubt, be unique to this instance. ie if you start multiple times with the same
23673 * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
23674 * is to simply use the current time (with very high precision).
23676 * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
23677 * obviously, `starting_time` should be unique every time you reload the library - it is only
23678 * used to generate new ephemeral key data (which will be stored by the individual channel if
23681 * Note that the seed is required to recover certain on-chain funds independent of
23682 * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
23683 * for any channel, and some on-chain during-closing funds.
23685 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
23687 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
23690 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
23692 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
23695 * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
23697 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]);
23700 * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
23701 * output to the given change destination (if sufficient change value remains). The
23702 * transaction will have a feerate, at least, of the given value.
23704 * Returns `Err(())` if the output value is greater than the input value minus required fee,
23705 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
23706 * does not match the one we can spend.
23708 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
23710 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
23711 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
23713 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);
23716 * Constructs a new EntropySource which calls the relevant methods on this_arg.
23717 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
23719 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
23722 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
23723 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
23725 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
23728 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
23729 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
23731 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
23734 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
23736 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
23739 * Constructs a new EntropySource which calls the relevant methods on this_arg.
23740 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
23742 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
23745 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
23746 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
23748 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
23751 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
23752 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
23754 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
23757 * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
23758 * that is shared across all nodes that intend to participate in [phantom node payments]
23761 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
23762 * `starting_time_nanos`.
23764 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
23765 * same across restarts, or else inbound payments may fail.
23767 * [phantom node payments]: PhantomKeysManager
23769 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]);
23772 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
23774 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);
23777 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
23779 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]);
23782 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
23784 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
23787 * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
23788 * last-hop onion data, etc.
23790 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
23793 * Creates a copy of the FailureCode
23795 enum LDKFailureCode FailureCode_clone(const enum LDKFailureCode *NONNULL_PTR orig);
23798 * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
23800 enum LDKFailureCode FailureCode_temporary_node_failure(void);
23803 * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
23805 enum LDKFailureCode FailureCode_required_node_feature_missing(void);
23808 * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
23810 enum LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
23813 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
23815 void ChannelManager_free(struct LDKChannelManager this_obj);
23818 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
23820 void ChainParameters_free(struct LDKChainParameters this_obj);
23823 * The network for determining the `chain_hash` in Lightning messages.
23825 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
23828 * The network for determining the `chain_hash` in Lightning messages.
23830 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
23833 * The hash and height of the latest block successfully connected.
23835 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
23837 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
23840 * The hash and height of the latest block successfully connected.
23842 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
23844 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
23847 * Constructs a new ChainParameters given each field
23849 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
23852 * Creates a copy of the ChainParameters
23854 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
23857 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
23859 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
23862 * Base routing fee in millisatoshis.
23864 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
23867 * Base routing fee in millisatoshis.
23869 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
23872 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
23874 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
23877 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
23879 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
23882 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
23883 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
23884 * `cltv_expiry_delta` for more details.
23886 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
23889 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
23890 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
23891 * `cltv_expiry_delta` for more details.
23893 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
23896 * Constructs a new CounterpartyForwardingInfo given each field
23898 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);
23901 * Creates a copy of the CounterpartyForwardingInfo
23903 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
23906 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
23908 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
23911 * The node_id of our counterparty
23913 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
23916 * The node_id of our counterparty
23918 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23921 * The Features the channel counterparty provided upon last connection.
23922 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
23923 * many routing-relevant features are present in the init context.
23925 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
23928 * The Features the channel counterparty provided upon last connection.
23929 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
23930 * many routing-relevant features are present in the init context.
23932 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
23935 * The value, in satoshis, that must always be held in the channel for our counterparty. This
23936 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
23937 * claiming at least this value on chain.
23939 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
23941 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
23943 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
23946 * The value, in satoshis, that must always be held in the channel for our counterparty. This
23947 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
23948 * claiming at least this value on chain.
23950 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
23952 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
23954 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
23957 * Information on the fees and requirements that the counterparty requires when forwarding
23958 * payments to us through this channel.
23960 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23962 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
23965 * Information on the fees and requirements that the counterparty requires when forwarding
23966 * payments to us through this channel.
23968 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23970 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
23973 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
23974 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
23975 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
23977 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
23980 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
23981 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
23982 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
23984 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23987 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
23989 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
23992 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
23994 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23997 * Constructs a new ChannelCounterparty given each field
23999 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);
24002 * Creates a copy of the ChannelCounterparty
24004 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
24007 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
24009 void ChannelDetails_free(struct LDKChannelDetails this_obj);
24012 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
24013 * thereafter this is the txid of the funding transaction xor the funding transaction output).
24014 * Note that this means this value is *not* persistent - it can change once during the
24015 * lifetime of the channel.
24017 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
24020 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
24021 * thereafter this is the txid of the funding transaction xor the funding transaction output).
24022 * Note that this means this value is *not* persistent - it can change once during the
24023 * lifetime of the channel.
24025 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24028 * Parameters which apply to our counterparty. See individual fields for more information.
24030 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24033 * Parameters which apply to our counterparty. See individual fields for more information.
24035 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
24038 * The Channel's funding transaction output, if we've negotiated the funding transaction with
24039 * our counterparty already.
24041 * Note that, if this has been set, `channel_id` will be equivalent to
24042 * `funding_txo.unwrap().to_channel_id()`.
24044 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24046 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24049 * The Channel's funding transaction output, if we've negotiated the funding transaction with
24050 * our counterparty already.
24052 * Note that, if this has been set, `channel_id` will be equivalent to
24053 * `funding_txo.unwrap().to_channel_id()`.
24055 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24057 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
24060 * The features which this channel operates with. See individual features for more info.
24062 * `None` until negotiation completes and the channel type is finalized.
24064 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24066 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24069 * The features which this channel operates with. See individual features for more info.
24071 * `None` until negotiation completes and the channel type is finalized.
24073 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24075 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
24078 * The position of the funding transaction in the chain. None if the funding transaction has
24079 * not yet been confirmed and the channel fully opened.
24081 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
24082 * payments instead of this. See [`get_inbound_payment_scid`].
24084 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
24085 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
24087 * [`inbound_scid_alias`]: Self::inbound_scid_alias
24088 * [`outbound_scid_alias`]: Self::outbound_scid_alias
24089 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
24090 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
24091 * [`confirmations_required`]: Self::confirmations_required
24093 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24096 * The position of the funding transaction in the chain. None if the funding transaction has
24097 * not yet been confirmed and the channel fully opened.
24099 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
24100 * payments instead of this. See [`get_inbound_payment_scid`].
24102 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
24103 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
24105 * [`inbound_scid_alias`]: Self::inbound_scid_alias
24106 * [`outbound_scid_alias`]: Self::outbound_scid_alias
24107 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
24108 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
24109 * [`confirmations_required`]: Self::confirmations_required
24111 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
24114 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
24115 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
24116 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
24119 * This will be `None` as long as the channel is not available for routing outbound payments.
24121 * [`short_channel_id`]: Self::short_channel_id
24122 * [`confirmations_required`]: Self::confirmations_required
24124 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24127 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
24128 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
24129 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
24132 * This will be `None` as long as the channel is not available for routing outbound payments.
24134 * [`short_channel_id`]: Self::short_channel_id
24135 * [`confirmations_required`]: Self::confirmations_required
24137 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
24140 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
24141 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
24142 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
24143 * when they see a payment to be routed to us.
24145 * Our counterparty may choose to rotate this value at any time, though will always recognize
24146 * previous values for inbound payment forwarding.
24148 * [`short_channel_id`]: Self::short_channel_id
24150 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24153 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
24154 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
24155 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
24156 * when they see a payment to be routed to us.
24158 * Our counterparty may choose to rotate this value at any time, though will always recognize
24159 * previous values for inbound payment forwarding.
24161 * [`short_channel_id`]: Self::short_channel_id
24163 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
24166 * The value, in satoshis, of this channel as appears in the funding output
24168 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24171 * The value, in satoshis, of this channel as appears in the funding output
24173 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
24176 * The value, in satoshis, that must always be held in the channel for us. This value ensures
24177 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
24178 * this value on chain.
24180 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
24182 * This value will be `None` for outbound channels until the counterparty accepts the channel.
24184 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
24186 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24189 * The value, in satoshis, that must always be held in the channel for us. This value ensures
24190 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
24191 * this value on chain.
24193 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
24195 * This value will be `None` for outbound channels until the counterparty accepts the channel.
24197 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
24199 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
24202 * The `user_channel_id` passed in to create_channel, or a random value if the channel was
24203 * inbound. This may be zero for inbound channels serialized with LDK versions prior to
24206 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24209 * The `user_channel_id` passed in to create_channel, or a random value if the channel was
24210 * inbound. This may be zero for inbound channels serialized with LDK versions prior to
24213 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
24216 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
24217 * which is applied to commitment and HTLC transactions.
24219 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
24221 struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24224 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
24225 * which is applied to commitment and HTLC transactions.
24227 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
24229 void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
24232 * Our total balance. This is the amount we would get if we close the channel.
24233 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
24234 * amount is not likely to be recoverable on close.
24236 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
24237 * balance is not available for inclusion in new outbound HTLCs). This further does not include
24238 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
24239 * This does not consider any on-chain fees.
24241 * See also [`ChannelDetails::outbound_capacity_msat`]
24243 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24246 * Our total balance. This is the amount we would get if we close the channel.
24247 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
24248 * amount is not likely to be recoverable on close.
24250 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
24251 * balance is not available for inclusion in new outbound HTLCs). This further does not include
24252 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
24253 * This does not consider any on-chain fees.
24255 * See also [`ChannelDetails::outbound_capacity_msat`]
24257 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
24260 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
24261 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
24262 * available for inclusion in new outbound HTLCs). This further does not include any pending
24263 * outgoing HTLCs which are awaiting some other resolution to be sent.
24265 * See also [`ChannelDetails::balance_msat`]
24267 * This value is not exact. Due to various in-flight changes, feerate changes, and our
24268 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
24269 * should be able to spend nearly this amount.
24271 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24274 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
24275 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
24276 * available for inclusion in new outbound HTLCs). This further does not include any pending
24277 * outgoing HTLCs which are awaiting some other resolution to be sent.
24279 * See also [`ChannelDetails::balance_msat`]
24281 * This value is not exact. Due to various in-flight changes, feerate changes, and our
24282 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
24283 * should be able to spend nearly this amount.
24285 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
24288 * The available outbound capacity for sending a single HTLC to the remote peer. This is
24289 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
24290 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
24291 * to use a limit as close as possible to the HTLC limit we can currently send.
24293 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
24295 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24298 * The available outbound capacity for sending a single HTLC to the remote peer. This is
24299 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
24300 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
24301 * to use a limit as close as possible to the HTLC limit we can currently send.
24303 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
24305 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
24308 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
24309 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
24310 * available for inclusion in new inbound HTLCs).
24311 * Note that there are some corner cases not fully handled here, so the actual available
24312 * inbound capacity may be slightly higher than this.
24314 * This value is not exact. Due to various in-flight changes, feerate changes, and our
24315 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
24316 * However, our counterparty should be able to spend nearly this amount.
24318 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24321 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
24322 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
24323 * available for inclusion in new inbound HTLCs).
24324 * Note that there are some corner cases not fully handled here, so the actual available
24325 * inbound capacity may be slightly higher than this.
24327 * This value is not exact. Due to various in-flight changes, feerate changes, and our
24328 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
24329 * However, our counterparty should be able to spend nearly this amount.
24331 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
24334 * The number of required confirmations on the funding transaction before the funding will be
24335 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
24336 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
24337 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
24338 * [`ChannelHandshakeLimits::max_minimum_depth`].
24340 * This value will be `None` for outbound channels until the counterparty accepts the channel.
24342 * [`is_outbound`]: ChannelDetails::is_outbound
24343 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
24344 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
24346 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24349 * The number of required confirmations on the funding transaction before the funding will be
24350 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
24351 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
24352 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
24353 * [`ChannelHandshakeLimits::max_minimum_depth`].
24355 * This value will be `None` for outbound channels until the counterparty accepts the channel.
24357 * [`is_outbound`]: ChannelDetails::is_outbound
24358 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
24359 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
24361 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
24364 * The current number of confirmations on the funding transaction.
24366 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
24368 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24371 * The current number of confirmations on the funding transaction.
24373 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
24375 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
24378 * The number of blocks (after our commitment transaction confirms) that we will need to wait
24379 * until we can claim our funds after we force-close the channel. During this time our
24380 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
24381 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
24382 * time to claim our non-HTLC-encumbered funds.
24384 * This value will be `None` for outbound channels until the counterparty accepts the channel.
24386 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24389 * The number of blocks (after our commitment transaction confirms) that we will need to wait
24390 * until we can claim our funds after we force-close the channel. During this time our
24391 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
24392 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
24393 * time to claim our non-HTLC-encumbered funds.
24395 * This value will be `None` for outbound channels until the counterparty accepts the channel.
24397 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
24400 * True if the channel was initiated (and thus funded) by us.
24402 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24405 * True if the channel was initiated (and thus funded) by us.
24407 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
24410 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
24411 * channel is not currently being shut down. `channel_ready` message exchange implies the
24412 * required confirmation count has been reached (and we were connected to the peer at some
24413 * point after the funding transaction received enough confirmations). The required
24414 * confirmation count is provided in [`confirmations_required`].
24416 * [`confirmations_required`]: ChannelDetails::confirmations_required
24418 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24421 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
24422 * channel is not currently being shut down. `channel_ready` message exchange implies the
24423 * required confirmation count has been reached (and we were connected to the peer at some
24424 * point after the funding transaction received enough confirmations). The required
24425 * confirmation count is provided in [`confirmations_required`].
24427 * [`confirmations_required`]: ChannelDetails::confirmations_required
24429 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
24432 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
24433 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
24435 * This is a strict superset of `is_channel_ready`.
24437 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24440 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
24441 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
24443 * This is a strict superset of `is_channel_ready`.
24445 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
24448 * True if this channel is (or will be) publicly-announced.
24450 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24453 * True if this channel is (or will be) publicly-announced.
24455 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
24458 * The smallest value HTLC (in msat) we will accept, for this channel. This field
24459 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
24461 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24464 * The smallest value HTLC (in msat) we will accept, for this channel. This field
24465 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
24467 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
24470 * The largest value HTLC (in msat) we currently will accept, for this channel.
24472 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24475 * The largest value HTLC (in msat) we currently will accept, for this channel.
24477 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
24480 * Set of configurable parameters that affect channel operation.
24482 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
24484 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
24486 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
24489 * Set of configurable parameters that affect channel operation.
24491 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
24493 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
24495 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
24498 * Constructs a new ChannelDetails given each field
24500 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, struct LDKU128 user_channel_id_arg, struct LDKCOption_u32Z feerate_sat_per_1000_weight_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_u32Z confirmations_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);
24503 * Creates a copy of the ChannelDetails
24505 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
24508 * Gets the current SCID which should be used to identify this channel for inbound payments.
24509 * This should be used for providing invoice hints or in any other context where our
24510 * counterparty will forward a payment to us.
24512 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
24513 * [`ChannelDetails::short_channel_id`]. See those for more information.
24515 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
24518 * Gets the current SCID which should be used to identify this channel for outbound payments.
24519 * This should be used in [`Route`]s to describe the first hop or in other contexts where
24520 * we're sending or forwarding a payment outbound over this channel.
24522 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
24523 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
24525 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
24528 * Frees any resources used by the RecentPaymentDetails
24530 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
24533 * Creates a copy of the RecentPaymentDetails
24535 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
24538 * Utility method to constructs a new Pending-variant RecentPaymentDetails
24540 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
24543 * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
24545 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_hash);
24548 * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
24550 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_hash);
24553 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
24555 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
24558 * The list of channels to be included in the invoice route hints.
24560 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
24563 * The list of channels to be included in the invoice route hints.
24565 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
24568 * A fake scid used for representing the phantom node's fake channel in generating the invoice
24571 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
24574 * A fake scid used for representing the phantom node's fake channel in generating the invoice
24577 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
24580 * The pubkey of the real backing node that would ultimately receive the payment.
24582 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
24585 * The pubkey of the real backing node that would ultimately receive the payment.
24587 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
24590 * Constructs a new PhantomRouteHints given each field
24592 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
24595 * Creates a copy of the PhantomRouteHints
24597 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
24600 * Constructs a new `ChannelManager` to hold several channels and route between them.
24602 * This is the main \"logic hub\" for all channel-related actions, and implements
24603 * [`ChannelMessageHandler`].
24605 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
24607 * Users need to notify the new `ChannelManager` when a new block is connected or
24608 * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
24609 * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
24612 * [`block_connected`]: chain::Listen::block_connected
24613 * [`block_disconnected`]: chain::Listen::block_disconnected
24614 * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
24616 MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKUserConfig config, struct LDKChainParameters params);
24619 * Gets the current configuration applied to all new channels.
24621 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
24624 * Creates a new outbound channel to the given remote node and with the given value.
24626 * `user_channel_id` will be provided back as in
24627 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
24628 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
24629 * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
24630 * is simply copied to events and otherwise ignored.
24632 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
24633 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
24635 * Note that we do not check if you are currently connected to the given peer. If no
24636 * connection is available, the outbound `open_channel` message may fail to send, resulting in
24637 * the channel eventually being silently forgotten (dropped on reload).
24639 * Returns the new Channel's temporary `channel_id`. This ID will appear as
24640 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
24641 * [`ChannelDetails::channel_id`] until after
24642 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
24643 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
24644 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
24646 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
24647 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
24648 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
24650 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
24652 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, struct LDKU128 user_channel_id, struct LDKUserConfig override_config);
24655 * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
24656 * more information.
24658 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
24661 * Gets the list of usable channels, in random order. Useful as an argument to
24662 * [`Router::find_route`] to ensure non-announced channels are used.
24664 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
24665 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
24668 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
24671 * Gets the list of channels we have with a given counterparty, in random order.
24673 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
24676 * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
24677 * successful path, or have unresolved HTLCs.
24679 * This can be useful for payments that may have been prepared, but ultimately not sent, as a
24680 * result of a crash. If such a payment exists, is not listed here, and an
24681 * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
24683 * [`Event::PaymentSent`]: events::Event::PaymentSent
24685 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
24688 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
24689 * will be accepted on the given channel, and after additional timeout/the closing of all
24690 * pending HTLCs, the channel will be closed on chain.
24692 * * If we are the channel initiator, we will pay between our [`Background`] and
24693 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
24695 * * If our counterparty is the channel initiator, we will require a channel closing
24696 * transaction feerate of at least our [`Background`] feerate or the feerate which
24697 * would appear on a force-closure transaction, whichever is lower. We will allow our
24698 * counterparty to pay as much fee as they'd like, however.
24700 * May generate a [`SendShutdown`] message event on success, which should be relayed.
24702 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
24703 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
24704 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
24705 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
24707 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);
24710 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
24711 * will be accepted on the given channel, and after additional timeout/the closing of all
24712 * pending HTLCs, the channel will be closed on chain.
24714 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
24715 * the channel being closed or not:
24716 * * If we are the channel initiator, we will pay at least this feerate on the closing
24717 * transaction. The upper-bound is set by
24718 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
24719 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
24720 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
24721 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
24722 * will appear on a force-closure transaction, whichever is lower).
24724 * May generate a [`SendShutdown`] message event on success, which should be relayed.
24726 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
24727 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
24728 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
24729 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
24731 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);
24734 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
24735 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
24736 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
24739 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);
24742 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
24743 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
24744 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
24746 * You can always get the latest local transaction(s) to broadcast from
24747 * [`ChannelMonitor::get_latest_holder_commitment_txn`].
24749 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);
24752 * Force close all channels, immediately broadcasting the latest local commitment transaction
24753 * for each to the chain and rejecting new HTLCs on each.
24755 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
24758 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
24759 * local transaction(s).
24761 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
24764 * Sends a payment along a given route.
24766 * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
24767 * fields for more info.
24769 * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
24770 * [`PeerManager::process_events`]).
24772 * # Avoiding Duplicate Payments
24774 * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
24775 * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
24776 * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
24777 * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
24778 * second payment with the same [`PaymentId`].
24780 * Thus, in order to ensure duplicate payments are not sent, you should implement your own
24781 * tracking of payments, including state to indicate once a payment has completed. Because you
24782 * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
24783 * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
24784 * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
24786 * Additionally, in the scenario where we begin the process of sending a payment, but crash
24787 * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
24788 * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
24789 * [`ChannelManager::list_recent_payments`] for more information.
24791 * # Possible Error States on [`PaymentSendFailure`]
24793 * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
24794 * each entry matching the corresponding-index entry in the route paths, see
24795 * [`PaymentSendFailure`] for more info.
24797 * In general, a path may raise:
24798 * * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
24799 * node public key) is specified.
24800 * * [`APIError::ChannelUnavailable`] if the next-hop channel is not available for updates
24801 * (including due to previous monitor update failure or new permanent monitor update
24803 * * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
24804 * relevant updates.
24806 * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
24807 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
24808 * different route unless you intend to pay twice!
24810 * [`Event::PaymentSent`]: events::Event::PaymentSent
24811 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
24812 * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
24813 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
24814 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
24816 MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment_with_route(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
24819 * Similar to [`ChannelManager::send_payment`], but will automatically find a route based on
24820 * `route_params` and retry failed payment paths based on `retry_strategy`.
24822 MUST_USE_RES struct LDKCResult_NoneRetryableSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
24825 * Signals that no further retries for the given payment should occur. Useful if you have a
24826 * pending outbound payment with retries remaining, but wish to stop retrying the payment before
24827 * retries are exhausted.
24829 * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
24830 * as there are no remaining pending HTLCs for this payment.
24832 * Note that calling this method does *not* prevent a payment from succeeding. You must still
24833 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
24834 * determine the ultimate status of a payment.
24836 * If an [`Event::PaymentFailed`] event is generated and we restart without this
24837 * [`ChannelManager`] having been persisted, another [`Event::PaymentFailed`] may be generated.
24839 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
24840 * [`Event::PaymentSent`]: events::Event::PaymentSent
24842 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
24845 * Send a spontaneous payment, which is a payment that does not require the recipient to have
24846 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
24847 * the preimage, it must be a cryptographically secure random value that no intermediate node
24848 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
24849 * never reach the recipient.
24851 * See [`send_payment`] documentation for more details on the return value of this function
24852 * and idempotency guarantees provided by the [`PaymentId`] key.
24854 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
24855 * [`send_payment`] for more information about the risks of duplicate preimage usage.
24857 * Note that `route` must have exactly one path.
24859 * [`send_payment`]: Self::send_payment
24861 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
24863 MUST_USE_RES struct LDKCResult_PaymentHashPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
24866 * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
24867 * based on `route_params` and retry failed payment paths based on `retry_strategy`.
24869 * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
24872 * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
24874 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
24876 MUST_USE_RES struct LDKCResult_PaymentHashRetryableSendFailureZ ChannelManager_send_spontaneous_payment_with_retry(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
24879 * Send a payment that is probing the given route for liquidity. We calculate the
24880 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
24881 * us to easily discern them from real payments.
24883 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
24886 * Call this upon creation of a funding transaction for the given channel.
24888 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
24889 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
24891 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
24892 * across the p2p network.
24894 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
24895 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
24897 * May panic if the output found in the funding transaction is duplicative with some other
24898 * channel (note that this should be trivially prevented by using unique funding transaction
24899 * keys per-channel).
24901 * Do NOT broadcast the funding transaction yourself. When we have safely received our
24902 * counterparty's signature the funding transaction will automatically be broadcast via the
24903 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
24905 * Note that this includes RBF or similar transaction replacement strategies - lightning does
24906 * not currently support replacing a funding transaction on an existing channel. Instead,
24907 * create a new channel with a conflicting funding transaction.
24909 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
24910 * the wallet software generating the funding transaction to apply anti-fee sniping as
24911 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
24912 * for more details.
24914 * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
24915 * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
24917 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);
24920 * Atomically updates the [`ChannelConfig`] for the given channels.
24922 * Once the updates are applied, each eligible channel (advertised with a known short channel
24923 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
24924 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
24925 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
24927 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
24928 * `counterparty_node_id` is provided.
24930 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
24931 * below [`MIN_CLTV_EXPIRY_DELTA`].
24933 * If an error is returned, none of the updates should be considered applied.
24935 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
24936 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
24937 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
24938 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
24939 * [`ChannelUpdate`]: msgs::ChannelUpdate
24940 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
24941 * [`APIMisuseError`]: APIError::APIMisuseError
24943 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);
24946 * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
24947 * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
24949 * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
24950 * channel to a receiving node if the node lacks sufficient inbound liquidity.
24952 * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
24953 * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
24954 * receiver's invoice route hints. These route hints will signal to LDK to generate an
24955 * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
24956 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
24958 * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
24959 * you from forwarding more than you received.
24961 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
24964 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
24965 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
24967 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const uint8_t (*next_hop_channel_id)[32], struct LDKPublicKey next_node_id, uint64_t amt_to_forward_msat);
24970 * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
24971 * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
24973 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
24976 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
24978 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
24981 * Processes HTLCs which are pending waiting on random forward delay.
24983 * Should only really ever be called in response to a PendingHTLCsForwardable event.
24984 * Will likely generate further events.
24986 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
24989 * Performs actions which should happen on startup and roughly once per minute thereafter.
24991 * This currently includes:
24992 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
24993 * * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
24994 * than a minute, informing the network that they should no longer attempt to route over
24996 * * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
24997 * with the current [`ChannelConfig`].
24998 * * Removing peers which have disconnected but and no longer have any channels.
25000 * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
25001 * estimate fetches.
25003 * [`ChannelUpdate`]: msgs::ChannelUpdate
25004 * [`ChannelConfig`]: crate::util::config::ChannelConfig
25006 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
25009 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
25010 * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
25011 * along the path (including in our own channel on which we received it).
25013 * Note that in some cases around unclean shutdown, it is possible the payment may have
25014 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
25015 * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
25016 * may have already been failed automatically by LDK if it was nearing its expiration time.
25018 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
25019 * [`ChannelManager::claim_funds`]), you should still monitor for
25020 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
25021 * startup during which time claims that were in-progress at shutdown may be replayed.
25023 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
25026 * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
25027 * reason for the failure.
25029 * See [`FailureCode`] for valid failure codes.
25031 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], enum LDKFailureCode failure_code);
25034 * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
25035 * [`MessageSendEvent`]s needed to claim the payment.
25037 * This method is guaranteed to ensure the payment has been claimed but only if the current
25038 * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
25039 * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
25040 * successful. It will generally be available in the next [`process_pending_events`] call.
25042 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
25043 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
25044 * event matches your expectation. If you fail to do so and call this method, you may provide
25045 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
25047 * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
25048 * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
25049 * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
25050 * [`process_pending_events`]: EventsProvider::process_pending_events
25051 * [`create_inbound_payment`]: Self::create_inbound_payment
25052 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
25054 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
25057 * Gets the node_id held by this ChannelManager
25059 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
25062 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
25064 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
25065 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
25068 * The `user_channel_id` parameter will be provided back in
25069 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
25070 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
25072 * Note that this method will return an error and reject the channel, if it requires support
25073 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
25074 * used to accept such channels.
25076 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
25077 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
25079 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, struct LDKU128 user_channel_id);
25082 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
25083 * it as confirmed immediately.
25085 * The `user_channel_id` parameter will be provided back in
25086 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
25087 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
25089 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
25090 * and (if the counterparty agrees), enables forwarding of payments immediately.
25092 * This fully trusts that the counterparty has honestly and correctly constructed the funding
25093 * transaction and blindly assumes that it will eventually confirm.
25095 * If it does not confirm before we decide to close the channel, or if the funding transaction
25096 * does not pay to the correct script the correct amount, *you will lose funds*.
25098 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
25099 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
25101 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, struct LDKU128 user_channel_id);
25104 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
25107 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
25108 * [`PaymentHash`] and [`PaymentPreimage`] for you.
25110 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which
25111 * will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with
25112 * its [`PaymentPurpose::InvoicePayment::payment_preimage`] field filled in. That should then be
25113 * passed directly to [`claim_funds`].
25115 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
25117 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
25118 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
25122 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
25123 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
25125 * Errors if `min_value_msat` is greater than total bitcoin supply.
25127 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
25128 * on versions of LDK prior to 0.0.114.
25130 * [`claim_funds`]: Self::claim_funds
25131 * [`PaymentClaimable`]: events::Event::PaymentClaimable
25132 * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
25133 * [`PaymentPurpose::InvoicePayment`]: events::PaymentPurpose::InvoicePayment
25134 * [`PaymentPurpose::InvoicePayment::payment_preimage`]: events::PaymentPurpose::InvoicePayment::payment_preimage
25135 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
25137 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, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
25140 * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
25141 * serialized state with LDK node(s) running 0.0.103 and earlier.
25143 * May panic if `invoice_expiry_delta_secs` is greater than one year.
25146 * This method is deprecated and will be removed soon.
25148 * [`create_inbound_payment`]: Self::create_inbound_payment
25150 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);
25153 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
25154 * stored external to LDK.
25156 * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
25157 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
25158 * the `min_value_msat` provided here, if one is provided.
25160 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
25161 * note that LDK will not stop you from registering duplicate payment hashes for inbound
25164 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
25165 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
25166 * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
25167 * sender \"proof-of-payment\" unless they have paid the required amount.
25169 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
25170 * in excess of the current time. This should roughly match the expiry time set in the invoice.
25171 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
25172 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
25173 * invoices when no timeout is set.
25175 * Note that we use block header time to time-out pending inbound payments (with some margin
25176 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
25177 * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
25178 * If you need exact expiry semantics, you should enforce them upon receipt of
25179 * [`PaymentClaimable`].
25181 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
25182 * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
25184 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
25185 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
25189 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
25190 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
25192 * Errors if `min_value_msat` is greater than total bitcoin supply.
25194 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
25195 * on versions of LDK prior to 0.0.114.
25197 * [`create_inbound_payment`]: Self::create_inbound_payment
25198 * [`PaymentClaimable`]: events::Event::PaymentClaimable
25200 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, struct LDKCOption_u16Z min_final_cltv_expiry);
25203 * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
25204 * serialized state with LDK node(s) running 0.0.103 and earlier.
25206 * May panic if `invoice_expiry_delta_secs` is greater than one year.
25209 * This method is deprecated and will be removed soon.
25211 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
25213 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);
25216 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
25217 * previously returned from [`create_inbound_payment`].
25219 * [`create_inbound_payment`]: Self::create_inbound_payment
25221 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);
25224 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
25225 * are used when constructing the phantom invoice's route hints.
25227 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
25229 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
25232 * Gets route hints for use in receiving [phantom node payments].
25234 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
25236 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
25239 * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
25240 * used when constructing the route hints for HTLCs intended to be intercepted. See
25241 * [`ChannelManager::forward_intercepted_htlc`].
25243 * Note that this method is not guaranteed to return unique values, you may need to call it a few
25244 * times to get a unique scid.
25246 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
25249 * Gets inflight HTLC information by processing pending outbound payments that are in
25250 * our channels. May be used during pathfinding to account for in-use channel liquidity.
25252 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
25255 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
25256 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
25258 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
25261 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
25262 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
25264 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
25267 * Constructs a new Listen which calls the relevant methods on this_arg.
25268 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
25270 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
25273 * Constructs a new Confirm which calls the relevant methods on this_arg.
25274 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
25276 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
25279 * Gets a [`Future`] that completes when this [`ChannelManager`] needs to be persisted.
25281 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
25282 * [`ChannelManager`] and should instead register actions to be taken later.
25285 MUST_USE_RES struct LDKFuture ChannelManager_get_persistable_update_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
25288 * Gets the latest best block which was connected either via the [`chain::Listen`] or
25289 * [`chain::Confirm`] interfaces.
25291 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
25294 * Fetches the set of [`NodeFeatures`] flags which are provided by or required by
25295 * [`ChannelManager`].
25297 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
25300 * Fetches the set of [`ChannelFeatures`] flags which are provided by or required by
25301 * [`ChannelManager`].
25303 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
25306 * Fetches the set of [`ChannelTypeFeatures`] flags which are provided by or required by
25307 * [`ChannelManager`].
25309 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
25312 * Fetches the set of [`InitFeatures`] flags which are provided by or required by
25313 * [`ChannelManager`].
25315 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
25318 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
25319 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
25321 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
25324 * Fetches the set of [`InitFeatures`] flags which are provided by or required by
25325 * [`ChannelManager`].
25327 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR _config);
25330 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
25332 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
25335 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
25337 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
25340 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
25342 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
25345 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
25347 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
25350 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
25352 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
25355 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
25357 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
25360 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
25362 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
25365 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
25367 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
25370 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
25372 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
25375 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
25377 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
25380 * A cryptographically secure source of entropy.
25382 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
25385 * A cryptographically secure source of entropy.
25387 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
25390 * A signer that is able to perform node-scoped cryptographic operations.
25392 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
25395 * A signer that is able to perform node-scoped cryptographic operations.
25397 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
25400 * The keys provider which will give us relevant keys. Some keys will be loaded during
25401 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
25404 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
25407 * The keys provider which will give us relevant keys. Some keys will be loaded during
25408 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
25411 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
25414 * The fee_estimator for use in the ChannelManager in the future.
25416 * No calls to the FeeEstimator will be made during deserialization.
25418 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
25421 * The fee_estimator for use in the ChannelManager in the future.
25423 * No calls to the FeeEstimator will be made during deserialization.
25425 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
25428 * The chain::Watch for use in the ChannelManager in the future.
25430 * No calls to the chain::Watch will be made during deserialization. It is assumed that
25431 * you have deserialized ChannelMonitors separately and will add them to your
25432 * chain::Watch after deserializing this ChannelManager.
25434 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
25437 * The chain::Watch for use in the ChannelManager in the future.
25439 * No calls to the chain::Watch will be made during deserialization. It is assumed that
25440 * you have deserialized ChannelMonitors separately and will add them to your
25441 * chain::Watch after deserializing this ChannelManager.
25443 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
25446 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
25447 * used to broadcast the latest local commitment transactions of channels which must be
25448 * force-closed during deserialization.
25450 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
25453 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
25454 * used to broadcast the latest local commitment transactions of channels which must be
25455 * force-closed during deserialization.
25457 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
25460 * The router which will be used in the ChannelManager in the future for finding routes
25461 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
25463 * No calls to the router will be made during deserialization.
25465 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
25468 * The router which will be used in the ChannelManager in the future for finding routes
25469 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
25471 * No calls to the router will be made during deserialization.
25473 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
25476 * The Logger for use in the ChannelManager and which may be used to log information during
25479 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
25482 * The Logger for use in the ChannelManager and which may be used to log information during
25485 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
25488 * Default settings used for new channels. Any existing channels will continue to use the
25489 * runtime settings which were stored when the ChannelManager was serialized.
25491 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
25494 * Default settings used for new channels. Any existing channels will continue to use the
25495 * runtime settings which were stored when the ChannelManager was serialized.
25497 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
25500 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
25501 * HashMap for you. This is primarily useful for C bindings where it is not practical to
25502 * populate a HashMap directly from C.
25504 MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKSignerProvider signer_provider, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKRouter router, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors);
25507 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
25509 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
25512 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
25514 void ExpandedKey_free(struct LDKExpandedKey this_obj);
25517 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
25519 * It is recommended to cache this value and not regenerate it for each new inbound payment.
25521 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
25524 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
25525 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
25526 * a `ChannelManager`.
25528 * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
25529 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
25530 * regenerate it for each new inbound payment.
25532 * `current_time` is a Unix timestamp representing the current time.
25534 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
25535 * on versions of LDK prior to 0.0.114.
25537 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
25538 * [`NodeSigner::get_inbound_payment_key_material`]: crate::chain::keysinterface::NodeSigner::get_inbound_payment_key_material
25540 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 LDKEntropySource *NONNULL_PTR entropy_source, uint64_t current_time, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
25543 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
25544 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
25545 * without a `ChannelManager`.
25547 * See [`create`] for information on the `keys` and `current_time` parameters.
25549 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
25550 * on versions of LDK prior to 0.0.114.
25552 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
25554 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, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
25557 * Frees any resources used by the DecodeError
25559 void DecodeError_free(struct LDKDecodeError this_ptr);
25562 * Creates a copy of the DecodeError
25564 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
25567 * Utility method to constructs a new UnknownVersion-variant DecodeError
25569 struct LDKDecodeError DecodeError_unknown_version(void);
25572 * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
25574 struct LDKDecodeError DecodeError_unknown_required_feature(void);
25577 * Utility method to constructs a new InvalidValue-variant DecodeError
25579 struct LDKDecodeError DecodeError_invalid_value(void);
25582 * Utility method to constructs a new ShortRead-variant DecodeError
25584 struct LDKDecodeError DecodeError_short_read(void);
25587 * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
25589 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
25592 * Utility method to constructs a new Io-variant DecodeError
25594 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
25597 * Utility method to constructs a new UnsupportedCompression-variant DecodeError
25599 struct LDKDecodeError DecodeError_unsupported_compression(void);
25602 * Checks if two DecodeErrors contain equal inner contents.
25603 * This ignores pointers and is_owned flags and looks at the values in fields.
25605 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
25608 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
25610 void Init_free(struct LDKInit this_obj);
25613 * The relevant features which the sender supports.
25615 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
25618 * The relevant features which the sender supports.
25620 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
25623 * The receipient's network address.
25625 * This adds the option to report a remote IP address back to a connecting peer using the init
25626 * message. A node can decide to use that information to discover a potential update to its
25627 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
25630 struct LDKCOption_NetAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
25633 * The receipient's network address.
25635 * This adds the option to report a remote IP address back to a connecting peer using the init
25636 * message. A node can decide to use that information to discover a potential update to its
25637 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
25640 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_NetAddressZ val);
25643 * Constructs a new Init given each field
25645 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_NetAddressZ remote_network_address_arg);
25648 * Creates a copy of the Init
25650 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
25653 * Checks if two Inits contain equal inner contents.
25654 * This ignores pointers and is_owned flags and looks at the values in fields.
25655 * Two objects with NULL inner values will be considered "equal" here.
25657 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
25660 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
25662 void ErrorMessage_free(struct LDKErrorMessage this_obj);
25665 * The channel ID involved in the error.
25667 * All-0s indicates a general error unrelated to a specific channel, after which all channels
25668 * with the sending peer should be closed.
25670 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
25673 * The channel ID involved in the error.
25675 * All-0s indicates a general error unrelated to a specific channel, after which all channels
25676 * with the sending peer should be closed.
25678 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25681 * A possibly human-readable error description.
25683 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
25684 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
25685 * the terminal emulator or the logging subsystem.
25687 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
25690 * A possibly human-readable error description.
25692 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
25693 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
25694 * the terminal emulator or the logging subsystem.
25696 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
25699 * Constructs a new ErrorMessage given each field
25701 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
25704 * Creates a copy of the ErrorMessage
25706 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
25709 * Checks if two ErrorMessages contain equal inner contents.
25710 * This ignores pointers and is_owned flags and looks at the values in fields.
25711 * Two objects with NULL inner values will be considered "equal" here.
25713 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
25716 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
25718 void WarningMessage_free(struct LDKWarningMessage this_obj);
25721 * The channel ID involved in the warning.
25723 * All-0s indicates a warning unrelated to a specific channel.
25725 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
25728 * The channel ID involved in the warning.
25730 * All-0s indicates a warning unrelated to a specific channel.
25732 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25735 * A possibly human-readable warning description.
25737 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
25738 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
25739 * the terminal emulator or the logging subsystem.
25741 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
25744 * A possibly human-readable warning description.
25746 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
25747 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
25748 * the terminal emulator or the logging subsystem.
25750 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
25753 * Constructs a new WarningMessage given each field
25755 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
25758 * Creates a copy of the WarningMessage
25760 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
25763 * Checks if two WarningMessages contain equal inner contents.
25764 * This ignores pointers and is_owned flags and looks at the values in fields.
25765 * Two objects with NULL inner values will be considered "equal" here.
25767 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
25770 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
25772 void Ping_free(struct LDKPing this_obj);
25775 * The desired response length.
25777 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
25780 * The desired response length.
25782 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
25785 * The ping packet size.
25787 * This field is not sent on the wire. byteslen zeros are sent.
25789 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
25792 * The ping packet size.
25794 * This field is not sent on the wire. byteslen zeros are sent.
25796 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
25799 * Constructs a new Ping given each field
25801 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
25804 * Creates a copy of the Ping
25806 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
25809 * Checks if two Pings contain equal inner contents.
25810 * This ignores pointers and is_owned flags and looks at the values in fields.
25811 * Two objects with NULL inner values will be considered "equal" here.
25813 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
25816 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
25818 void Pong_free(struct LDKPong this_obj);
25821 * The pong packet size.
25823 * This field is not sent on the wire. byteslen zeros are sent.
25825 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
25828 * The pong packet size.
25830 * This field is not sent on the wire. byteslen zeros are sent.
25832 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
25835 * Constructs a new Pong given each field
25837 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
25840 * Creates a copy of the Pong
25842 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
25845 * Checks if two Pongs contain equal inner contents.
25846 * This ignores pointers and is_owned flags and looks at the values in fields.
25847 * Two objects with NULL inner values will be considered "equal" here.
25849 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
25852 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
25854 void OpenChannel_free(struct LDKOpenChannel this_obj);
25857 * The genesis hash of the blockchain where the channel is to be opened
25859 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
25862 * The genesis hash of the blockchain where the channel is to be opened
25864 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25867 * A temporary channel ID, until the funding outpoint is announced
25869 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
25872 * A temporary channel ID, until the funding outpoint is announced
25874 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25877 * The channel value
25879 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25882 * The channel value
25884 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
25887 * The amount to push to the counterparty as part of the open, in milli-satoshi
25889 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25892 * The amount to push to the counterparty as part of the open, in milli-satoshi
25894 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
25897 * The threshold below which outputs on transactions broadcast by sender will be omitted
25899 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25902 * The threshold below which outputs on transactions broadcast by sender will be omitted
25904 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
25907 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
25909 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25912 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
25914 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
25917 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
25919 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25922 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
25924 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
25927 * The minimum HTLC size incoming to sender, in milli-satoshi
25929 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25932 * The minimum HTLC size incoming to sender, in milli-satoshi
25934 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
25937 * The feerate per 1000-weight of sender generated transactions, until updated by
25940 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25943 * The feerate per 1000-weight of sender generated transactions, until updated by
25946 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
25949 * The number of blocks which the counterparty will have to wait to claim on-chain funds if
25950 * they broadcast a commitment transaction
25952 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25955 * The number of blocks which the counterparty will have to wait to claim on-chain funds if
25956 * they broadcast a commitment transaction
25958 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
25961 * The maximum number of inbound HTLCs towards sender
25963 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25966 * The maximum number of inbound HTLCs towards sender
25968 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
25971 * The sender's key controlling the funding transaction
25973 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25976 * The sender's key controlling the funding transaction
25978 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25981 * Used to derive a revocation key for transactions broadcast by counterparty
25983 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25986 * Used to derive a revocation key for transactions broadcast by counterparty
25988 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25991 * A payment key to sender for transactions broadcast by counterparty
25993 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25996 * A payment key to sender for transactions broadcast by counterparty
25998 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26001 * Used to derive a payment key to sender for transactions broadcast by sender
26003 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
26006 * Used to derive a payment key to sender for transactions broadcast by sender
26008 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26011 * Used to derive an HTLC payment key to sender
26013 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
26016 * Used to derive an HTLC payment key to sender
26018 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26021 * The first to-be-broadcast-by-sender transaction's per commitment point
26023 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
26026 * The first to-be-broadcast-by-sender transaction's per commitment point
26028 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26031 * The channel flags to be used
26033 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
26036 * The channel flags to be used
26038 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
26041 * The channel type that this channel will represent
26043 * If this is `None`, we derive the channel type from the intersection of our
26044 * feature bits with our counterparty's feature bits from the [`Init`] message.
26046 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26048 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
26051 * The channel type that this channel will represent
26053 * If this is `None`, we derive the channel type from the intersection of our
26054 * feature bits with our counterparty's feature bits from the [`Init`] message.
26056 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26058 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
26061 * Creates a copy of the OpenChannel
26063 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
26066 * Checks if two OpenChannels contain equal inner contents.
26067 * This ignores pointers and is_owned flags and looks at the values in fields.
26068 * Two objects with NULL inner values will be considered "equal" here.
26070 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
26073 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
26075 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
26078 * A temporary channel ID, until the funding outpoint is announced
26080 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
26083 * A temporary channel ID, until the funding outpoint is announced
26085 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26088 * The threshold below which outputs on transactions broadcast by sender will be omitted
26090 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26093 * The threshold below which outputs on transactions broadcast by sender will be omitted
26095 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
26098 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
26100 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26103 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
26105 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
26108 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
26110 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26113 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
26115 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
26118 * The minimum HTLC size incoming to sender, in milli-satoshi
26120 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26123 * The minimum HTLC size incoming to sender, in milli-satoshi
26125 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
26128 * Minimum depth of the funding transaction before the channel is considered open
26130 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26133 * Minimum depth of the funding transaction before the channel is considered open
26135 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
26138 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
26140 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26143 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
26145 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
26148 * The maximum number of inbound HTLCs towards sender
26150 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26153 * The maximum number of inbound HTLCs towards sender
26155 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
26158 * The sender's key controlling the funding transaction
26160 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26163 * The sender's key controlling the funding transaction
26165 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26168 * Used to derive a revocation key for transactions broadcast by counterparty
26170 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26173 * Used to derive a revocation key for transactions broadcast by counterparty
26175 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26178 * A payment key to sender for transactions broadcast by counterparty
26180 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26183 * A payment key to sender for transactions broadcast by counterparty
26185 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26188 * Used to derive a payment key to sender for transactions broadcast by sender
26190 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26193 * Used to derive a payment key to sender for transactions broadcast by sender
26195 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26198 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
26200 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26203 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
26205 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26208 * The first to-be-broadcast-by-sender transaction's per commitment point
26210 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26213 * The first to-be-broadcast-by-sender transaction's per commitment point
26215 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26218 * The channel type that this channel will represent.
26220 * If this is `None`, we derive the channel type from the intersection of
26221 * our feature bits with our counterparty's feature bits from the [`Init`] message.
26222 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
26224 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26226 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
26229 * The channel type that this channel will represent.
26231 * If this is `None`, we derive the channel type from the intersection of
26232 * our feature bits with our counterparty's feature bits from the [`Init`] message.
26233 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
26235 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26237 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
26240 * Creates a copy of the AcceptChannel
26242 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
26245 * Checks if two AcceptChannels contain equal inner contents.
26246 * This ignores pointers and is_owned flags and looks at the values in fields.
26247 * Two objects with NULL inner values will be considered "equal" here.
26249 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
26252 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
26254 void FundingCreated_free(struct LDKFundingCreated this_obj);
26257 * A temporary channel ID, until the funding is established
26259 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
26262 * A temporary channel ID, until the funding is established
26264 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26267 * The funding transaction ID
26269 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
26272 * The funding transaction ID
26274 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26277 * The specific output index funding this channel
26279 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
26282 * The specific output index funding this channel
26284 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
26287 * The signature of the channel initiator (funder) on the initial commitment transaction
26289 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
26292 * The signature of the channel initiator (funder) on the initial commitment transaction
26294 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
26297 * Constructs a new FundingCreated given each field
26299 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);
26302 * Creates a copy of the FundingCreated
26304 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
26307 * Checks if two FundingCreateds contain equal inner contents.
26308 * This ignores pointers and is_owned flags and looks at the values in fields.
26309 * Two objects with NULL inner values will be considered "equal" here.
26311 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
26314 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
26316 void FundingSigned_free(struct LDKFundingSigned this_obj);
26321 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
26326 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26329 * The signature of the channel acceptor (fundee) on the initial commitment transaction
26331 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
26334 * The signature of the channel acceptor (fundee) on the initial commitment transaction
26336 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
26339 * Constructs a new FundingSigned given each field
26341 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
26344 * Creates a copy of the FundingSigned
26346 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
26349 * Checks if two FundingSigneds contain equal inner contents.
26350 * This ignores pointers and is_owned flags and looks at the values in fields.
26351 * Two objects with NULL inner values will be considered "equal" here.
26353 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
26356 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
26358 void ChannelReady_free(struct LDKChannelReady this_obj);
26363 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
26368 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26371 * The per-commitment point of the second commitment transaction
26373 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
26376 * The per-commitment point of the second commitment transaction
26378 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26381 * If set, provides a `short_channel_id` alias for this channel.
26383 * The sender will accept payments to be forwarded over this SCID and forward them to this
26384 * messages' recipient.
26386 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
26389 * If set, provides a `short_channel_id` alias for this channel.
26391 * The sender will accept payments to be forwarded over this SCID and forward them to this
26392 * messages' recipient.
26394 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
26397 * Constructs a new ChannelReady given each field
26399 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);
26402 * Creates a copy of the ChannelReady
26404 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
26407 * Checks if two ChannelReadys contain equal inner contents.
26408 * This ignores pointers and is_owned flags and looks at the values in fields.
26409 * Two objects with NULL inner values will be considered "equal" here.
26411 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
26414 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
26416 void Shutdown_free(struct LDKShutdown this_obj);
26421 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
26426 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26429 * The destination of this peer's funds on closing.
26431 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
26433 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
26436 * The destination of this peer's funds on closing.
26438 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
26440 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
26443 * Constructs a new Shutdown given each field
26445 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
26448 * Creates a copy of the Shutdown
26450 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
26453 * Checks if two Shutdowns contain equal inner contents.
26454 * This ignores pointers and is_owned flags and looks at the values in fields.
26455 * Two objects with NULL inner values will be considered "equal" here.
26457 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
26460 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
26462 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
26465 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
26468 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
26471 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
26474 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
26477 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
26480 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
26483 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
26486 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
26489 * Constructs a new ClosingSignedFeeRange given each field
26491 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
26494 * Creates a copy of the ClosingSignedFeeRange
26496 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
26499 * Checks if two ClosingSignedFeeRanges contain equal inner contents.
26500 * This ignores pointers and is_owned flags and looks at the values in fields.
26501 * Two objects with NULL inner values will be considered "equal" here.
26503 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
26506 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
26508 void ClosingSigned_free(struct LDKClosingSigned this_obj);
26513 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
26518 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26521 * The proposed total fee for the closing transaction
26523 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
26526 * The proposed total fee for the closing transaction
26528 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
26531 * A signature on the closing transaction
26533 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
26536 * A signature on the closing transaction
26538 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
26541 * The minimum and maximum fees which the sender is willing to accept, provided only by new
26544 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
26546 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
26549 * The minimum and maximum fees which the sender is willing to accept, provided only by new
26552 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
26554 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
26557 * Constructs a new ClosingSigned given each field
26559 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);
26562 * Creates a copy of the ClosingSigned
26564 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
26567 * Checks if two ClosingSigneds contain equal inner contents.
26568 * This ignores pointers and is_owned flags and looks at the values in fields.
26569 * Two objects with NULL inner values will be considered "equal" here.
26571 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
26574 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
26576 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
26581 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
26586 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26591 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
26596 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
26599 * The HTLC value in milli-satoshi
26601 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
26604 * The HTLC value in milli-satoshi
26606 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
26609 * The payment hash, the pre-image of which controls HTLC redemption
26611 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
26614 * The payment hash, the pre-image of which controls HTLC redemption
26616 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26619 * The expiry height of the HTLC
26621 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
26624 * The expiry height of the HTLC
26626 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
26629 * Creates a copy of the UpdateAddHTLC
26631 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
26634 * Checks if two UpdateAddHTLCs contain equal inner contents.
26635 * This ignores pointers and is_owned flags and looks at the values in fields.
26636 * Two objects with NULL inner values will be considered "equal" here.
26638 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
26641 * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
26643 void OnionMessage_free(struct LDKOnionMessage this_obj);
26646 * Used in decrypting the onion packet's payload.
26648 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
26651 * Used in decrypting the onion packet's payload.
26653 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26656 * Creates a copy of the OnionMessage
26658 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
26661 * Checks if two OnionMessages contain equal inner contents.
26662 * This ignores pointers and is_owned flags and looks at the values in fields.
26663 * Two objects with NULL inner values will be considered "equal" here.
26665 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
26668 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
26670 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
26675 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
26680 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26685 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
26690 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
26693 * The pre-image of the payment hash, allowing HTLC redemption
26695 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
26698 * The pre-image of the payment hash, allowing HTLC redemption
26700 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26703 * Constructs a new UpdateFulfillHTLC given each field
26705 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
26708 * Creates a copy of the UpdateFulfillHTLC
26710 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
26713 * Checks if two UpdateFulfillHTLCs contain equal inner contents.
26714 * This ignores pointers and is_owned flags and looks at the values in fields.
26715 * Two objects with NULL inner values will be considered "equal" here.
26717 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
26720 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
26722 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
26727 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
26732 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26737 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
26742 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
26745 * Creates a copy of the UpdateFailHTLC
26747 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
26750 * Checks if two UpdateFailHTLCs contain equal inner contents.
26751 * This ignores pointers and is_owned flags and looks at the values in fields.
26752 * Two objects with NULL inner values will be considered "equal" here.
26754 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
26757 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
26759 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
26764 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
26769 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26774 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
26779 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
26784 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
26789 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
26792 * Creates a copy of the UpdateFailMalformedHTLC
26794 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
26797 * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
26798 * This ignores pointers and is_owned flags and looks at the values in fields.
26799 * Two objects with NULL inner values will be considered "equal" here.
26801 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
26804 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
26806 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
26811 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
26816 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26819 * A signature on the commitment transaction
26821 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
26824 * A signature on the commitment transaction
26826 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
26829 * Signatures on the HTLC transactions
26831 * Returns a copy of the field.
26833 struct LDKCVec_SignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
26836 * Signatures on the HTLC transactions
26838 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
26841 * Constructs a new CommitmentSigned given each field
26843 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
26846 * Creates a copy of the CommitmentSigned
26848 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
26851 * Checks if two CommitmentSigneds contain equal inner contents.
26852 * This ignores pointers and is_owned flags and looks at the values in fields.
26853 * Two objects with NULL inner values will be considered "equal" here.
26855 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
26858 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
26860 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
26865 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
26870 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26873 * The secret corresponding to the per-commitment point
26875 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
26878 * The secret corresponding to the per-commitment point
26880 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26883 * The next sender-broadcast commitment transaction's per-commitment point
26885 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
26888 * The next sender-broadcast commitment transaction's per-commitment point
26890 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26893 * Constructs a new RevokeAndACK given each field
26895 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);
26898 * Creates a copy of the RevokeAndACK
26900 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
26903 * Checks if two RevokeAndACKs contain equal inner contents.
26904 * This ignores pointers and is_owned flags and looks at the values in fields.
26905 * Two objects with NULL inner values will be considered "equal" here.
26907 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
26910 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
26912 void UpdateFee_free(struct LDKUpdateFee this_obj);
26917 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
26922 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26925 * Fee rate per 1000-weight of the transaction
26927 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
26930 * Fee rate per 1000-weight of the transaction
26932 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
26935 * Constructs a new UpdateFee given each field
26937 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
26940 * Creates a copy of the UpdateFee
26942 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
26945 * Checks if two UpdateFees contain equal inner contents.
26946 * This ignores pointers and is_owned flags and looks at the values in fields.
26947 * Two objects with NULL inner values will be considered "equal" here.
26949 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
26952 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
26954 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
26957 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
26958 * belonging to the recipient
26960 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
26963 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
26964 * belonging to the recipient
26966 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26969 * The sender's per-commitment point for their current commitment transaction
26971 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
26974 * The sender's per-commitment point for their current commitment transaction
26976 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26979 * Constructs a new DataLossProtect given each field
26981 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
26984 * Creates a copy of the DataLossProtect
26986 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
26989 * Checks if two DataLossProtects contain equal inner contents.
26990 * This ignores pointers and is_owned flags and looks at the values in fields.
26991 * Two objects with NULL inner values will be considered "equal" here.
26993 bool DataLossProtect_eq(const struct LDKDataLossProtect *NONNULL_PTR a, const struct LDKDataLossProtect *NONNULL_PTR b);
26996 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
26998 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
27003 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
27008 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27011 * The next commitment number for the sender
27013 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
27016 * The next commitment number for the sender
27018 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
27021 * The next commitment number for the recipient
27023 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
27026 * The next commitment number for the recipient
27028 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
27031 * Creates a copy of the ChannelReestablish
27033 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
27036 * Checks if two ChannelReestablishs contain equal inner contents.
27037 * This ignores pointers and is_owned flags and looks at the values in fields.
27038 * Two objects with NULL inner values will be considered "equal" here.
27040 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
27043 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
27045 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
27050 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
27055 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27058 * The short channel ID
27060 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
27063 * The short channel ID
27065 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
27068 * A signature by the node key
27070 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
27073 * A signature by the node key
27075 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
27078 * A signature by the funding key
27080 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
27083 * A signature by the funding key
27085 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
27088 * Constructs a new AnnouncementSignatures given each field
27090 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);
27093 * Creates a copy of the AnnouncementSignatures
27095 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
27098 * Checks if two AnnouncementSignaturess contain equal inner contents.
27099 * This ignores pointers and is_owned flags and looks at the values in fields.
27100 * Two objects with NULL inner values will be considered "equal" here.
27102 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
27105 * Frees any resources used by the NetAddress
27107 void NetAddress_free(struct LDKNetAddress this_ptr);
27110 * Creates a copy of the NetAddress
27112 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
27115 * Utility method to constructs a new IPv4-variant NetAddress
27117 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
27120 * Utility method to constructs a new IPv6-variant NetAddress
27122 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
27125 * Utility method to constructs a new OnionV2-variant NetAddress
27127 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
27130 * Utility method to constructs a new OnionV3-variant NetAddress
27132 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
27135 * Utility method to constructs a new Hostname-variant NetAddress
27137 struct LDKNetAddress NetAddress_hostname(struct LDKHostname hostname, uint16_t port);
27140 * Checks if two NetAddresss contain equal inner contents.
27141 * This ignores pointers and is_owned flags and looks at the values in fields.
27143 bool NetAddress_eq(const struct LDKNetAddress *NONNULL_PTR a, const struct LDKNetAddress *NONNULL_PTR b);
27146 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
27148 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
27151 * Read a NetAddress from a byte array, created by NetAddress_write
27153 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
27156 * Frees any resources used by the UnsignedGossipMessage
27158 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
27161 * Creates a copy of the UnsignedGossipMessage
27163 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
27166 * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
27168 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
27171 * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
27173 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
27176 * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
27178 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
27181 * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
27183 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
27186 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
27188 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
27191 * The advertised features
27193 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
27196 * The advertised features
27198 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
27201 * A strictly monotonic announcement counter, with gaps allowed
27203 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
27206 * A strictly monotonic announcement counter, with gaps allowed
27208 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
27211 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
27214 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
27217 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
27220 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
27223 * An RGB color for UI purposes
27225 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
27228 * An RGB color for UI purposes
27230 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
27233 * An alias, for UI purposes.
27235 * This should be sanitized before use. There is no guarantee of uniqueness.
27237 struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
27240 * An alias, for UI purposes.
27242 * This should be sanitized before use. There is no guarantee of uniqueness.
27244 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
27247 * List of addresses on which this node is reachable
27249 * Returns a copy of the field.
27251 struct LDKCVec_NetAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
27254 * List of addresses on which this node is reachable
27256 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
27259 * Creates a copy of the UnsignedNodeAnnouncement
27261 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
27264 * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
27265 * This ignores pointers and is_owned flags and looks at the values in fields.
27266 * Two objects with NULL inner values will be considered "equal" here.
27268 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
27271 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
27273 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
27276 * The signature by the node key
27278 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
27281 * The signature by the node key
27283 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
27286 * The actual content of the announcement
27288 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
27291 * The actual content of the announcement
27293 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
27296 * Constructs a new NodeAnnouncement given each field
27298 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
27301 * Creates a copy of the NodeAnnouncement
27303 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
27306 * Checks if two NodeAnnouncements contain equal inner contents.
27307 * This ignores pointers and is_owned flags and looks at the values in fields.
27308 * Two objects with NULL inner values will be considered "equal" here.
27310 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
27313 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
27315 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
27318 * The advertised channel features
27320 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
27323 * The advertised channel features
27325 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
27328 * The genesis hash of the blockchain where the channel is to be opened
27330 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
27333 * The genesis hash of the blockchain where the channel is to be opened
27335 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27338 * The short channel ID
27340 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
27343 * The short channel ID
27345 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
27348 * One of the two `node_id`s which are endpoints of this channel
27350 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
27353 * One of the two `node_id`s which are endpoints of this channel
27355 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
27358 * The other of the two `node_id`s which are endpoints of this channel
27360 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
27363 * The other of the two `node_id`s which are endpoints of this channel
27365 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
27368 * The funding key for the first node
27370 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
27373 * The funding key for the first node
27375 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
27378 * The funding key for the second node
27380 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
27383 * The funding key for the second node
27385 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
27388 * Creates a copy of the UnsignedChannelAnnouncement
27390 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
27393 * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
27394 * This ignores pointers and is_owned flags and looks at the values in fields.
27395 * Two objects with NULL inner values will be considered "equal" here.
27397 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
27400 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
27402 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
27405 * Authentication of the announcement by the first public node
27407 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
27410 * Authentication of the announcement by the first public node
27412 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
27415 * Authentication of the announcement by the second public node
27417 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
27420 * Authentication of the announcement by the second public node
27422 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
27425 * Proof of funding UTXO ownership by the first public node
27427 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
27430 * Proof of funding UTXO ownership by the first public node
27432 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
27435 * Proof of funding UTXO ownership by the second public node
27437 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
27440 * Proof of funding UTXO ownership by the second public node
27442 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
27445 * The actual announcement
27447 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
27450 * The actual announcement
27452 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
27455 * Constructs a new ChannelAnnouncement given each field
27457 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);
27460 * Creates a copy of the ChannelAnnouncement
27462 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
27465 * Checks if two ChannelAnnouncements contain equal inner contents.
27466 * This ignores pointers and is_owned flags and looks at the values in fields.
27467 * Two objects with NULL inner values will be considered "equal" here.
27469 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
27472 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
27474 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
27477 * The genesis hash of the blockchain where the channel is to be opened
27479 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
27482 * The genesis hash of the blockchain where the channel is to be opened
27484 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27487 * The short channel ID
27489 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
27492 * The short channel ID
27494 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
27497 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
27499 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
27502 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
27504 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
27509 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
27514 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
27517 * The number of blocks such that if:
27518 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
27519 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
27520 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
27521 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
27522 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
27523 * forwarding. Note that the HTLC sender is the one who originally sets this value when
27524 * constructing the route.
27526 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
27529 * The number of blocks such that if:
27530 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
27531 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
27532 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
27533 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
27534 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
27535 * forwarding. Note that the HTLC sender is the one who originally sets this value when
27536 * constructing the route.
27538 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
27541 * The minimum HTLC size incoming to sender, in milli-satoshi
27543 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
27546 * The minimum HTLC size incoming to sender, in milli-satoshi
27548 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
27551 * The maximum HTLC value incoming to sender, in milli-satoshi.
27553 * This used to be optional.
27555 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
27558 * The maximum HTLC value incoming to sender, in milli-satoshi.
27560 * This used to be optional.
27562 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
27565 * The base HTLC fee charged by sender, in milli-satoshi
27567 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
27570 * The base HTLC fee charged by sender, in milli-satoshi
27572 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
27575 * The amount to fee multiplier, in micro-satoshi
27577 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
27580 * The amount to fee multiplier, in micro-satoshi
27582 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
27585 * Excess data which was signed as a part of the message which we do not (yet) understand how
27588 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
27590 * Returns a copy of the field.
27592 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
27595 * Excess data which was signed as a part of the message which we do not (yet) understand how
27598 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
27600 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
27603 * Constructs a new UnsignedChannelUpdate given each field
27605 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);
27608 * Creates a copy of the UnsignedChannelUpdate
27610 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
27613 * Checks if two UnsignedChannelUpdates contain equal inner contents.
27614 * This ignores pointers and is_owned flags and looks at the values in fields.
27615 * Two objects with NULL inner values will be considered "equal" here.
27617 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
27620 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
27622 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
27625 * A signature of the channel update
27627 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
27630 * A signature of the channel update
27632 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
27635 * The actual channel update
27637 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
27640 * The actual channel update
27642 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
27645 * Constructs a new ChannelUpdate given each field
27647 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
27650 * Creates a copy of the ChannelUpdate
27652 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
27655 * Checks if two ChannelUpdates contain equal inner contents.
27656 * This ignores pointers and is_owned flags and looks at the values in fields.
27657 * Two objects with NULL inner values will be considered "equal" here.
27659 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
27662 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
27664 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
27667 * The genesis hash of the blockchain being queried
27669 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
27672 * The genesis hash of the blockchain being queried
27674 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27677 * The height of the first block for the channel UTXOs being queried
27679 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
27682 * The height of the first block for the channel UTXOs being queried
27684 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
27687 * The number of blocks to include in the query results
27689 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
27692 * The number of blocks to include in the query results
27694 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
27697 * Constructs a new QueryChannelRange given each field
27699 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
27702 * Creates a copy of the QueryChannelRange
27704 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
27707 * Checks if two QueryChannelRanges contain equal inner contents.
27708 * This ignores pointers and is_owned flags and looks at the values in fields.
27709 * Two objects with NULL inner values will be considered "equal" here.
27711 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
27714 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
27716 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
27719 * The genesis hash of the blockchain being queried
27721 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
27724 * The genesis hash of the blockchain being queried
27726 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27729 * The height of the first block in the range of the reply
27731 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
27734 * The height of the first block in the range of the reply
27736 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
27739 * The number of blocks included in the range of the reply
27741 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
27744 * The number of blocks included in the range of the reply
27746 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
27749 * True when this is the final reply for a query
27751 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
27754 * True when this is the final reply for a query
27756 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
27759 * The `short_channel_id`s in the channel range
27761 * Returns a copy of the field.
27763 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
27766 * The `short_channel_id`s in the channel range
27768 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
27771 * Constructs a new ReplyChannelRange given each field
27773 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);
27776 * Creates a copy of the ReplyChannelRange
27778 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
27781 * Checks if two ReplyChannelRanges contain equal inner contents.
27782 * This ignores pointers and is_owned flags and looks at the values in fields.
27783 * Two objects with NULL inner values will be considered "equal" here.
27785 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
27788 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
27790 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
27793 * The genesis hash of the blockchain being queried
27795 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
27798 * The genesis hash of the blockchain being queried
27800 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27803 * The short_channel_ids that are being queried
27805 * Returns a copy of the field.
27807 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
27810 * The short_channel_ids that are being queried
27812 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
27815 * Constructs a new QueryShortChannelIds given each field
27817 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
27820 * Creates a copy of the QueryShortChannelIds
27822 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
27825 * Checks if two QueryShortChannelIdss contain equal inner contents.
27826 * This ignores pointers and is_owned flags and looks at the values in fields.
27827 * Two objects with NULL inner values will be considered "equal" here.
27829 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
27832 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
27834 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
27837 * The genesis hash of the blockchain that was queried
27839 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
27842 * The genesis hash of the blockchain that was queried
27844 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27847 * Indicates if the query recipient maintains up-to-date channel
27848 * information for the `chain_hash`
27850 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
27853 * Indicates if the query recipient maintains up-to-date channel
27854 * information for the `chain_hash`
27856 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
27859 * Constructs a new ReplyShortChannelIdsEnd given each field
27861 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
27864 * Creates a copy of the ReplyShortChannelIdsEnd
27866 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
27869 * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
27870 * This ignores pointers and is_owned flags and looks at the values in fields.
27871 * Two objects with NULL inner values will be considered "equal" here.
27873 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
27876 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
27878 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
27881 * The genesis hash of the blockchain for channel and node information
27883 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
27886 * The genesis hash of the blockchain for channel and node information
27888 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27891 * The starting unix timestamp
27893 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
27896 * The starting unix timestamp
27898 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
27901 * The range of information in seconds
27903 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
27906 * The range of information in seconds
27908 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
27911 * Constructs a new GossipTimestampFilter given each field
27913 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
27916 * Creates a copy of the GossipTimestampFilter
27918 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
27921 * Checks if two GossipTimestampFilters contain equal inner contents.
27922 * This ignores pointers and is_owned flags and looks at the values in fields.
27923 * Two objects with NULL inner values will be considered "equal" here.
27925 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
27928 * Frees any resources used by the ErrorAction
27930 void ErrorAction_free(struct LDKErrorAction this_ptr);
27933 * Creates a copy of the ErrorAction
27935 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
27938 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
27940 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
27943 * Utility method to constructs a new IgnoreError-variant ErrorAction
27945 struct LDKErrorAction ErrorAction_ignore_error(void);
27948 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
27950 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
27953 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
27955 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
27958 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
27960 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
27963 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
27965 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
27968 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
27970 void LightningError_free(struct LDKLightningError this_obj);
27973 * A human-readable message describing the error
27975 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
27978 * A human-readable message describing the error
27980 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
27983 * The action which should be taken against the offending peer.
27985 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
27988 * The action which should be taken against the offending peer.
27990 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
27993 * Constructs a new LightningError given each field
27995 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
27998 * Creates a copy of the LightningError
28000 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
28003 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
28005 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
28008 * `update_add_htlc` messages which should be sent
28010 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
28013 * `update_add_htlc` messages which should be sent
28015 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
28018 * `update_fulfill_htlc` messages which should be sent
28020 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
28023 * `update_fulfill_htlc` messages which should be sent
28025 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
28028 * `update_fail_htlc` messages which should be sent
28030 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
28033 * `update_fail_htlc` messages which should be sent
28035 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
28038 * `update_fail_malformed_htlc` messages which should be sent
28040 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
28043 * `update_fail_malformed_htlc` messages which should be sent
28045 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
28048 * An `update_fee` message which should be sent
28050 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28052 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
28055 * An `update_fee` message which should be sent
28057 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28059 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
28062 * A `commitment_signed` message which should be sent
28064 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
28067 * A `commitment_signed` message which should be sent
28069 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
28072 * Constructs a new CommitmentUpdate given each field
28074 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);
28077 * Creates a copy of the CommitmentUpdate
28079 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
28082 * Checks if two CommitmentUpdates contain equal inner contents.
28083 * This ignores pointers and is_owned flags and looks at the values in fields.
28084 * Two objects with NULL inner values will be considered "equal" here.
28086 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
28089 * Calls the free function if one is set
28091 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
28094 * Calls the free function if one is set
28096 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
28099 * Calls the free function if one is set
28101 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
28104 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
28106 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
28109 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
28111 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
28114 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
28116 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
28119 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
28121 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
28124 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
28126 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
28129 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
28131 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
28134 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
28136 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
28139 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
28141 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
28144 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
28146 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
28149 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
28151 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
28154 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
28156 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
28159 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
28161 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
28164 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
28166 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
28169 * Read a FundingCreated from a byte array, created by FundingCreated_write
28171 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
28174 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
28176 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
28179 * Read a FundingSigned from a byte array, created by FundingSigned_write
28181 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
28184 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
28186 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
28189 * Read a ChannelReady from a byte array, created by ChannelReady_write
28191 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
28194 * Serialize the Init object into a byte array which can be read by Init_read
28196 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
28199 * Read a Init from a byte array, created by Init_write
28201 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
28204 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
28206 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
28209 * Read a OpenChannel from a byte array, created by OpenChannel_write
28211 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
28214 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
28216 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
28219 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
28221 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
28224 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
28226 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
28229 * Read a Shutdown from a byte array, created by Shutdown_write
28231 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
28234 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
28236 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
28239 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
28241 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
28244 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
28246 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
28249 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
28251 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
28254 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
28256 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
28259 * Read a UpdateFee from a byte array, created by UpdateFee_write
28261 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
28264 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
28266 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
28269 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
28271 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
28274 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
28276 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
28279 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
28281 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
28284 * Read a OnionMessage from a byte array, created by OnionMessage_write
28286 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
28289 * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
28291 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
28294 * Serialize the Ping object into a byte array which can be read by Ping_read
28296 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
28299 * Read a Ping from a byte array, created by Ping_write
28301 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
28304 * Serialize the Pong object into a byte array which can be read by Pong_read
28306 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
28309 * Read a Pong from a byte array, created by Pong_write
28311 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
28314 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
28316 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
28319 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
28321 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
28324 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
28326 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
28329 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
28331 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
28334 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
28336 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
28339 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
28341 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
28344 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
28346 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
28349 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
28351 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
28354 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
28356 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
28359 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
28361 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
28364 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
28366 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
28369 * Read a WarningMessage from a byte array, created by WarningMessage_write
28371 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
28374 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
28376 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
28379 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
28381 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
28384 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
28386 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
28389 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
28391 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
28394 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
28396 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
28399 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
28401 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
28404 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
28406 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
28409 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
28411 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
28414 * Calculates the overflow safe ending block height for the query.
28416 * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
28418 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
28421 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
28423 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
28426 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
28428 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
28431 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
28433 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
28436 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
28438 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
28441 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
28443 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
28446 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
28448 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
28451 * Calls the free function if one is set
28453 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
28456 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
28458 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
28461 * Constructs a new IgnoringMessageHandler given each field
28463 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
28466 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
28467 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
28469 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
28472 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
28473 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
28475 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
28478 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
28479 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
28481 struct LDKOnionMessageProvider IgnoringMessageHandler_as_OnionMessageProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
28484 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
28485 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
28487 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
28490 * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
28491 * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
28493 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
28496 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
28497 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
28499 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
28502 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
28503 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
28505 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
28508 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
28510 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
28513 * Constructs a new ErroringMessageHandler
28515 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
28518 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
28519 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
28521 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
28524 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
28525 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
28527 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
28530 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
28532 void MessageHandler_free(struct LDKMessageHandler this_obj);
28535 * A message handler which handles messages specific to channels. Usually this is just a
28536 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
28538 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28540 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
28543 * A message handler which handles messages specific to channels. Usually this is just a
28544 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
28546 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
28548 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
28551 * A message handler which handles messages updating our knowledge of the network channel
28552 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
28554 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
28556 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
28559 * A message handler which handles messages updating our knowledge of the network channel
28560 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
28562 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
28564 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
28567 * A message handler which handles onion messages. For now, this can only be an
28568 * [`IgnoringMessageHandler`].
28570 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
28573 * A message handler which handles onion messages. For now, this can only be an
28574 * [`IgnoringMessageHandler`].
28576 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
28579 * Constructs a new MessageHandler given each field
28581 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg, struct LDKOnionMessageHandler onion_message_handler_arg);
28584 * Creates a copy of a SocketDescriptor
28586 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
28589 * Calls the free function if one is set
28591 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
28594 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
28596 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
28599 * Constructs a new PeerHandleError given each field
28601 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
28604 * Creates a copy of the PeerHandleError
28606 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
28609 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
28611 void PeerManager_free(struct LDKPeerManager this_obj);
28614 * Constructs a new `PeerManager` with the given message handlers.
28616 * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
28617 * cryptographically secure random bytes.
28619 * `current_time` is used as an always-increasing counter that survives across restarts and is
28620 * incremented irregularly internally. In general it is best to simply use the current UNIX
28621 * timestamp, however if it is not available a persistent counter that increases once per
28622 * minute should suffice.
28624 MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, uint32_t current_time, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKCustomMessageHandler custom_message_handler, struct LDKNodeSigner node_signer);
28627 * Get a list of tuples mapping from node id to network addresses for peers which have
28628 * completed the initial handshake.
28630 * For outbound connections, the [`PublicKey`] will be the same as the `their_node_id` parameter
28631 * passed in to [`Self::new_outbound_connection`], however entries will only appear once the initial
28632 * handshake has completed and we are sure the remote peer has the private key for the given
28635 * The returned `Option`s will only be `Some` if an address had been previously given via
28636 * [`Self::new_outbound_connection`] or [`Self::new_inbound_connection`].
28638 MUST_USE_RES struct LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
28641 * Indicates a new outbound connection has been established to a node with the given `node_id`
28642 * and an optional remote network address.
28644 * The remote network address adds the option to report a remote IP address back to a connecting
28645 * peer using the init message.
28646 * The user should pass the remote network address of the host they are connected to.
28648 * If an `Err` is returned here you must disconnect the connection immediately.
28650 * Returns a small number of bytes to send to the remote node (currently always 50).
28652 * Panics if descriptor is duplicative with some other descriptor which has not yet been
28653 * [`socket_disconnected`].
28655 * [`socket_disconnected`]: PeerManager::socket_disconnected
28657 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);
28660 * Indicates a new inbound connection has been established to a node with an optional remote
28663 * The remote network address adds the option to report a remote IP address back to a connecting
28664 * peer using the init message.
28665 * The user should pass the remote network address of the host they are connected to.
28667 * May refuse the connection by returning an Err, but will never write bytes to the remote end
28668 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
28669 * the connection immediately.
28671 * Panics if descriptor is duplicative with some other descriptor which has not yet been
28672 * [`socket_disconnected`].
28674 * [`socket_disconnected`]: PeerManager::socket_disconnected
28676 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);
28679 * Indicates that there is room to write data to the given socket descriptor.
28681 * May return an Err to indicate that the connection should be closed.
28683 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
28684 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
28685 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
28686 * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't
28689 * [`send_data`]: SocketDescriptor::send_data
28690 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
28692 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
28695 * Indicates that data was read from the given socket descriptor.
28697 * May return an Err to indicate that the connection should be closed.
28699 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
28700 * Thus, however, you should call [`process_events`] after any `read_event` to generate
28701 * [`send_data`] calls to handle responses.
28703 * If `Ok(true)` is returned, further read_events should not be triggered until a
28704 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
28707 * In order to avoid processing too many messages at once per peer, `data` should be on the
28710 * [`send_data`]: SocketDescriptor::send_data
28711 * [`process_events`]: PeerManager::process_events
28713 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);
28716 * Checks for any events generated by our handlers and processes them. Includes sending most
28717 * response messages as well as messages generated by calls to handler functions directly (eg
28718 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
28720 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
28723 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
28724 * or one of the other clients provided in our language bindings.
28726 * Note that if there are any other calls to this function waiting on lock(s) this may return
28727 * without doing any work. All available events that need handling will be handled before the
28728 * other calls return.
28730 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
28731 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
28732 * [`send_data`]: SocketDescriptor::send_data
28734 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
28737 * Indicates that the given socket descriptor's connection is now closed.
28739 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
28742 * Disconnect a peer given its node id.
28744 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
28745 * peer. Thus, be very careful about reentrancy issues.
28747 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
28749 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
28752 * Disconnects all currently-connected peers. This is useful on platforms where there may be
28753 * an indication that TCP sockets have stalled even if we weren't around to time them out
28754 * using regular ping/pongs.
28756 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
28759 * Send pings to each peer and disconnect those which did not respond to the last round of
28762 * This may be called on any timescale you want, however, roughly once every ten seconds is
28763 * preferred. The call rate determines both how often we send a ping to our peers and how much
28764 * time they have to respond before we disconnect them.
28766 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
28769 * [`send_data`]: SocketDescriptor::send_data
28771 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
28774 * Generates a signed node_announcement from the given arguments, sending it to all connected
28775 * peers. Note that peers will likely ignore this message unless we have at least one public
28776 * channel which has at least six confirmations on-chain.
28778 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
28779 * node to humans. They carry no in-protocol meaning.
28781 * `addresses` represent the set (possibly empty) of socket addresses on which this node
28782 * accepts incoming connections. These will be included in the node_announcement, publicly
28783 * tying these addresses together and to this node. If you wish to preserve user privacy,
28784 * addresses should likely contain only Tor Onion addresses.
28786 * Panics if `addresses` is absurdly large (more than 100).
28788 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
28790 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
28793 * Gets the weight for an HTLC-Success transaction.
28795 uint64_t htlc_success_tx_weight(bool opt_anchors);
28798 * Gets the weight for an HTLC-Timeout transaction.
28800 uint64_t htlc_timeout_tx_weight(bool opt_anchors);
28803 * Creates a copy of the HTLCClaim
28805 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
28808 * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
28810 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
28813 * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
28815 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
28818 * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
28820 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
28823 * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
28825 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
28828 * Utility method to constructs a new Revocation-variant HTLCClaim
28830 enum LDKHTLCClaim HTLCClaim_revocation(void);
28833 * Checks if two HTLCClaims contain equal inner contents.
28834 * This ignores pointers and is_owned flags and looks at the values in fields.
28836 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
28839 * Check if a given input witness attempts to claim a HTLC.
28841 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
28844 * Build the commitment secret from the seed and the commitment number
28846 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
28849 * Build a closing transaction
28851 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);
28854 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
28856 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
28859 * Creates a copy of the CounterpartyCommitmentSecrets
28861 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
28864 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
28866 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
28869 * Returns the minimum index of all stored secrets. Note that indexes start
28870 * at 1 << 48 and get decremented by one for each new secret.
28872 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
28875 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
28876 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
28878 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
28881 * Returns the secret at `idx`.
28882 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
28884 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28886 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
28889 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
28891 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
28894 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
28896 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
28899 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
28900 * from the base secret and the per_commitment_point.
28902 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
28905 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
28906 * from the base point and the per_commitment_key. This is the public equivalent of
28907 * derive_private_key - using only public keys to derive a public key instead of private keys.
28909 struct LDKPublicKey derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
28912 * Derives a per-commitment-transaction revocation key from its constituent parts.
28914 * Only the cheating participant owns a valid witness to propagate a revoked
28915 * commitment transaction, thus per_commitment_secret always come from cheater
28916 * and revocation_base_secret always come from punisher, which is the broadcaster
28917 * of the transaction spending with this key knowledge.
28919 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
28922 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
28923 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
28924 * public key instead of private keys.
28926 * Only the cheating participant owns a valid witness to propagate a revoked
28927 * commitment transaction, thus per_commitment_point always come from cheater
28928 * and revocation_base_point always come from punisher, which is the broadcaster
28929 * of the transaction spending with this key knowledge.
28931 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
28932 * generated (ie our own).
28934 struct LDKPublicKey derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
28937 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
28939 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
28942 * The broadcaster's per-commitment public key which was used to derive the other keys.
28944 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
28947 * The broadcaster's per-commitment public key which was used to derive the other keys.
28949 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28952 * The revocation key which is used to allow the broadcaster of the commitment
28953 * transaction to provide their counterparty the ability to punish them if they broadcast
28956 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
28959 * The revocation key which is used to allow the broadcaster of the commitment
28960 * transaction to provide their counterparty the ability to punish them if they broadcast
28963 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28966 * Broadcaster's HTLC Key
28968 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
28971 * Broadcaster's HTLC Key
28973 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28976 * Countersignatory's HTLC Key
28978 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
28981 * Countersignatory's HTLC Key
28983 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28986 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
28988 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
28991 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
28993 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28996 * Constructs a new TxCreationKeys given each field
28998 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);
29001 * Checks if two TxCreationKeyss contain equal inner contents.
29002 * This ignores pointers and is_owned flags and looks at the values in fields.
29003 * Two objects with NULL inner values will be considered "equal" here.
29005 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
29008 * Creates a copy of the TxCreationKeys
29010 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
29013 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
29015 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
29018 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
29020 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
29023 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
29025 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
29028 * The public key which is used to sign all commitment transactions, as it appears in the
29029 * on-chain channel lock-in 2-of-2 multisig output.
29031 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
29034 * The public key which is used to sign all commitment transactions, as it appears in the
29035 * on-chain channel lock-in 2-of-2 multisig output.
29037 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29040 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
29041 * revocation keys. This is combined with the per-commitment-secret generated by the
29042 * counterparty to create a secret which the counterparty can reveal to revoke previous
29045 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
29048 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
29049 * revocation keys. This is combined with the per-commitment-secret generated by the
29050 * counterparty to create a secret which the counterparty can reveal to revoke previous
29053 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29056 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
29057 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
29058 * static across every commitment transaction.
29060 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
29063 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
29064 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
29065 * static across every commitment transaction.
29067 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29070 * The base point which is used (with derive_public_key) to derive a per-commitment payment
29071 * public key which receives non-HTLC-encumbered funds which are only available for spending
29072 * after some delay (or can be claimed via the revocation path).
29074 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
29077 * The base point which is used (with derive_public_key) to derive a per-commitment payment
29078 * public key which receives non-HTLC-encumbered funds which are only available for spending
29079 * after some delay (or can be claimed via the revocation path).
29081 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29084 * The base point which is used (with derive_public_key) to derive a per-commitment public key
29085 * which is used to encumber HTLC-in-flight outputs.
29087 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
29090 * The base point which is used (with derive_public_key) to derive a per-commitment public key
29091 * which is used to encumber HTLC-in-flight outputs.
29093 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29096 * Constructs a new ChannelPublicKeys given each field
29098 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);
29101 * Creates a copy of the ChannelPublicKeys
29103 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
29106 * Checks if two ChannelPublicKeyss contain equal inner contents.
29107 * This ignores pointers and is_owned flags and looks at the values in fields.
29108 * Two objects with NULL inner values will be considered "equal" here.
29110 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
29113 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
29115 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
29118 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
29120 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
29123 * Create per-state keys from channel base points and the per-commitment point.
29124 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
29126 MUST_USE_RES struct LDKTxCreationKeys 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);
29129 * Generate per-state keys from channel static keys.
29130 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
29132 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys);
29135 * A script either spendable by the revocation
29136 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
29137 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
29139 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
29142 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
29144 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
29147 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
29148 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
29149 * need to compare this value to whether the commitment transaction in question is that of
29150 * the counterparty or our own.
29152 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
29155 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
29156 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
29157 * need to compare this value to whether the commitment transaction in question is that of
29158 * the counterparty or our own.
29160 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
29163 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
29164 * this divided by 1000.
29166 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
29169 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
29170 * this divided by 1000.
29172 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
29175 * The CLTV lock-time at which this HTLC expires.
29177 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
29180 * The CLTV lock-time at which this HTLC expires.
29182 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
29185 * The hash of the preimage which unlocks this HTLC.
29187 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
29190 * The hash of the preimage which unlocks this HTLC.
29192 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
29195 * The position within the commitment transactions' outputs. This may be None if the value is
29196 * below the dust limit (in which case no output appears in the commitment transaction and the
29197 * value is spent to additional transaction fees).
29199 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
29202 * The position within the commitment transactions' outputs. This may be None if the value is
29203 * below the dust limit (in which case no output appears in the commitment transaction and the
29204 * value is spent to additional transaction fees).
29206 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
29209 * Constructs a new HTLCOutputInCommitment given each field
29211 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);
29214 * Creates a copy of the HTLCOutputInCommitment
29216 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
29219 * Checks if two HTLCOutputInCommitments contain equal inner contents.
29220 * This ignores pointers and is_owned flags and looks at the values in fields.
29221 * Two objects with NULL inner values will be considered "equal" here.
29223 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
29226 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
29228 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
29231 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
29233 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
29236 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
29237 * does not need to have its previous_output_index filled.
29239 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
29242 * Gets the redeemscript for a funding output from the two funding public keys.
29243 * Note that the order of funding public keys does not matter.
29245 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
29248 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
29249 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
29250 * transaction which needs signing, and can be used to construct an HTLC transaction which is
29251 * broadcastable given a counterparty HTLC signature.
29253 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
29254 * commitment transaction).
29256 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, bool use_non_zero_fee_anchors, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
29259 * Returns the witness required to satisfy and spend a HTLC input.
29261 * Note that preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
29263 struct LDKWitness build_htlc_input_witness(struct LDKSignature local_sig, struct LDKSignature remote_sig, struct LDKThirtyTwoBytes preimage, struct LDKu8slice redeem_script, bool opt_anchors);
29266 * Gets the witnessScript for the to_remote output when anchors are enabled.
29268 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
29271 * Gets the witnessScript for an anchor output from the funding public key.
29272 * The witness in the spending input must be:
29273 * <BIP 143 funding_signature>
29274 * After 16 blocks of confirmation, an alternative satisfying witness could be:
29276 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
29278 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
29281 * Returns the witness required to satisfy and spend an anchor input.
29283 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKSignature funding_sig);
29286 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
29288 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
29291 * Holder public keys
29293 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
29296 * Holder public keys
29298 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
29301 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
29303 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
29306 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
29308 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
29311 * Whether the holder is the initiator of this channel.
29312 * This is an input to the commitment number obscure factor computation.
29314 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
29317 * Whether the holder is the initiator of this channel.
29318 * This is an input to the commitment number obscure factor computation.
29320 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
29323 * The late-bound counterparty channel transaction parameters.
29324 * These parameters are populated at the point in the protocol where the counterparty provides them.
29326 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29328 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
29331 * The late-bound counterparty channel transaction parameters.
29332 * These parameters are populated at the point in the protocol where the counterparty provides them.
29334 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29336 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
29339 * The late-bound funding outpoint
29341 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29343 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
29346 * The late-bound funding outpoint
29348 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29350 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
29353 * Are anchors (zero fee HTLC transaction variant) used for this channel. Boolean is
29354 * serialization backwards-compatible.
29356 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
29359 * Are anchors (zero fee HTLC transaction variant) used for this channel. Boolean is
29360 * serialization backwards-compatible.
29362 void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
29365 * Are non-zero-fee anchors are enabled (used in conjuction with opt_anchors)
29366 * It is intended merely for backwards compatibility with signers that need it.
29367 * There is no support for this feature in LDK channel negotiation.
29369 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_non_zero_fee_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
29372 * Are non-zero-fee anchors are enabled (used in conjuction with opt_anchors)
29373 * It is intended merely for backwards compatibility with signers that need it.
29374 * There is no support for this feature in LDK channel negotiation.
29376 void ChannelTransactionParameters_set_opt_non_zero_fee_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
29379 * Constructs a new ChannelTransactionParameters given each field
29381 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, enum LDKCOption_NoneZ opt_non_zero_fee_anchors_arg);
29384 * Creates a copy of the ChannelTransactionParameters
29386 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
29389 * Checks if two ChannelTransactionParameterss contain equal inner contents.
29390 * This ignores pointers and is_owned flags and looks at the values in fields.
29391 * Two objects with NULL inner values will be considered "equal" here.
29393 bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
29396 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
29398 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
29401 * Counter-party public keys
29403 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
29406 * Counter-party public keys
29408 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
29411 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
29413 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
29416 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
29418 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
29421 * Constructs a new CounterpartyChannelTransactionParameters given each field
29423 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
29426 * Creates a copy of the CounterpartyChannelTransactionParameters
29428 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
29431 * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents.
29432 * This ignores pointers and is_owned flags and looks at the values in fields.
29433 * Two objects with NULL inner values will be considered "equal" here.
29435 bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
29438 * Whether the late bound parameters are populated.
29440 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
29443 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
29444 * given that the holder is the broadcaster.
29446 * self.is_populated() must be true before calling this function.
29448 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
29451 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
29452 * given that the counterparty is the broadcaster.
29454 * self.is_populated() must be true before calling this function.
29456 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
29459 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
29461 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
29464 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
29466 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
29469 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
29471 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
29474 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
29476 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
29479 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
29481 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
29484 * Get the channel pubkeys for the broadcaster
29486 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
29489 * Get the channel pubkeys for the countersignatory
29491 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
29494 * Get the contest delay applicable to the transactions.
29495 * Note that the contest delay was selected by the countersignatory.
29497 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
29500 * Whether the channel is outbound from the broadcaster.
29502 * The boolean representing the side that initiated the channel is
29503 * an input to the commitment number obscure factor computation.
29505 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
29508 * The funding outpoint
29510 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
29513 * Whether to use anchors for this channel
29515 MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
29518 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
29520 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
29523 * Our counterparty's signature for the transaction
29525 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
29528 * Our counterparty's signature for the transaction
29530 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
29533 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
29535 * Returns a copy of the field.
29537 struct LDKCVec_SignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
29540 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
29542 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
29545 * Creates a copy of the HolderCommitmentTransaction
29547 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
29550 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
29552 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
29555 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
29557 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
29560 * Create a new holder transaction with the given counterparty signatures.
29561 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
29563 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);
29566 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
29568 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
29571 * The commitment transaction
29573 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
29576 * The commitment transaction
29578 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
29581 * The txid for the commitment transaction.
29583 * This is provided as a performance optimization, instead of calling transaction.txid()
29586 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
29589 * The txid for the commitment transaction.
29591 * This is provided as a performance optimization, instead of calling transaction.txid()
29594 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
29597 * Constructs a new BuiltCommitmentTransaction given each field
29599 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
29602 * Creates a copy of the BuiltCommitmentTransaction
29604 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
29607 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
29609 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
29612 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
29614 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
29617 * Get the SIGHASH_ALL sighash value of the transaction.
29619 * This can be used to verify a signature.
29621 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);
29624 * Signs the counterparty's commitment transaction.
29626 MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign_counterparty_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
29629 * Signs the holder commitment transaction because we are about to broadcast it.
29631 MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign_holder_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis, const struct LDKEntropySource *NONNULL_PTR entropy_source);
29634 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
29636 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
29639 * Creates a copy of the ClosingTransaction
29641 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
29644 * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
29646 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
29649 * Checks if two ClosingTransactions contain equal inner contents.
29650 * This ignores pointers and is_owned flags and looks at the values in fields.
29651 * Two objects with NULL inner values will be considered "equal" here.
29653 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
29656 * Construct an object of the class
29658 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);
29661 * Trust our pre-built transaction.
29663 * Applies a wrapper which allows access to the transaction.
29665 * This should only be used if you fully trust the builder of this object. It should not
29666 * be used by an external signer - instead use the verify function.
29668 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
29671 * Verify our pre-built transaction.
29673 * Applies a wrapper which allows access to the transaction.
29675 * An external validating signer must call this method before signing
29676 * or using the built transaction.
29678 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
29681 * The value to be sent to the holder, or zero if the output will be omitted
29683 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
29686 * The value to be sent to the counterparty, or zero if the output will be omitted
29688 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
29691 * The destination of the holder's output
29693 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
29696 * The destination of the counterparty's output
29698 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
29701 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
29703 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
29706 * The pre-built Bitcoin commitment transaction
29708 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
29711 * Get the SIGHASH_ALL sighash value of the transaction.
29713 * This can be used to verify a signature.
29715 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);
29718 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
29719 * because we are about to broadcast a holder transaction.
29721 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);
29724 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
29726 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
29729 * Creates a copy of the CommitmentTransaction
29731 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
29734 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
29736 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
29739 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
29741 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
29744 * The backwards-counting commitment number
29746 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
29749 * The value to be sent to the broadcaster
29751 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
29754 * The value to be sent to the counterparty
29756 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
29759 * The feerate paid per 1000-weight-unit in this commitment transaction.
29761 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
29764 * Trust our pre-built transaction and derived transaction creation public keys.
29766 * Applies a wrapper which allows access to these fields.
29768 * This should only be used if you fully trust the builder of this object. It should not
29769 * be used by an external signer - instead use the verify function.
29771 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
29774 * Verify our pre-built transaction and derived transaction creation public keys.
29776 * Applies a wrapper which allows access to these fields.
29778 * An external validating signer must call this method before signing
29779 * or using the built transaction.
29781 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);
29784 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
29786 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
29789 * The transaction ID of the built Bitcoin transaction
29791 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
29794 * The pre-built Bitcoin commitment transaction
29796 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
29799 * The pre-calculated transaction creation public keys.
29801 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
29804 * Should anchors be used.
29806 MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
29809 * Get a signature for each HTLC which was included in the commitment transaction (ie for
29810 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
29812 * The returned Vec has one entry for each HTLC, and in the same order.
29814 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
29816 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, const struct LDKEntropySource *NONNULL_PTR entropy_source);
29819 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
29820 * shared secret first. This prevents on-chain observers from discovering how many commitment
29821 * transactions occurred in a channel before it was closed.
29823 * This function gets the shared secret from relevant channel public keys and can be used to
29824 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
29826 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
29829 * Checks if two InitFeaturess contain equal inner contents.
29830 * This ignores pointers and is_owned flags and looks at the values in fields.
29831 * Two objects with NULL inner values will be considered "equal" here.
29833 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
29836 * Checks if two NodeFeaturess contain equal inner contents.
29837 * This ignores pointers and is_owned flags and looks at the values in fields.
29838 * Two objects with NULL inner values will be considered "equal" here.
29840 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
29843 * Checks if two ChannelFeaturess contain equal inner contents.
29844 * This ignores pointers and is_owned flags and looks at the values in fields.
29845 * Two objects with NULL inner values will be considered "equal" here.
29847 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
29850 * Checks if two InvoiceFeaturess contain equal inner contents.
29851 * This ignores pointers and is_owned flags and looks at the values in fields.
29852 * Two objects with NULL inner values will be considered "equal" here.
29854 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
29857 * Checks if two OfferFeaturess contain equal inner contents.
29858 * This ignores pointers and is_owned flags and looks at the values in fields.
29859 * Two objects with NULL inner values will be considered "equal" here.
29861 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
29864 * Checks if two InvoiceRequestFeaturess contain equal inner contents.
29865 * This ignores pointers and is_owned flags and looks at the values in fields.
29866 * Two objects with NULL inner values will be considered "equal" here.
29868 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
29871 * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
29872 * This ignores pointers and is_owned flags and looks at the values in fields.
29873 * Two objects with NULL inner values will be considered "equal" here.
29875 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
29878 * Checks if two BlindedHopFeaturess contain equal inner contents.
29879 * This ignores pointers and is_owned flags and looks at the values in fields.
29880 * Two objects with NULL inner values will be considered "equal" here.
29882 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
29885 * Checks if two ChannelTypeFeaturess contain equal inner contents.
29886 * This ignores pointers and is_owned flags and looks at the values in fields.
29887 * Two objects with NULL inner values will be considered "equal" here.
29889 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
29892 * Creates a copy of the InitFeatures
29894 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
29897 * Creates a copy of the NodeFeatures
29899 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
29902 * Creates a copy of the ChannelFeatures
29904 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
29907 * Creates a copy of the InvoiceFeatures
29909 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
29912 * Creates a copy of the OfferFeatures
29914 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
29917 * Creates a copy of the InvoiceRequestFeatures
29919 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
29922 * Creates a copy of the Bolt12InvoiceFeatures
29924 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
29927 * Creates a copy of the BlindedHopFeatures
29929 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
29932 * Creates a copy of the ChannelTypeFeatures
29934 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
29937 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
29939 void InitFeatures_free(struct LDKInitFeatures this_obj);
29942 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
29944 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
29947 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
29949 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
29952 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
29954 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
29957 * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
29959 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
29962 * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
29964 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
29967 * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
29969 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
29972 * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
29974 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
29977 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
29979 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
29982 * Create a blank Features with no features set
29984 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
29987 * Returns true if this `Features` object contains unknown feature flags which are set as
29990 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29993 * Create a blank Features with no features set
29995 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
29998 * Returns true if this `Features` object contains unknown feature flags which are set as
30001 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30004 * Create a blank Features with no features set
30006 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
30009 * Returns true if this `Features` object contains unknown feature flags which are set as
30012 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
30015 * Create a blank Features with no features set
30017 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
30020 * Returns true if this `Features` object contains unknown feature flags which are set as
30023 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30026 * Create a blank Features with no features set
30028 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
30031 * Returns true if this `Features` object contains unknown feature flags which are set as
30034 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
30037 * Create a blank Features with no features set
30039 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
30042 * Returns true if this `Features` object contains unknown feature flags which are set as
30045 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
30048 * Create a blank Features with no features set
30050 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
30053 * Returns true if this `Features` object contains unknown feature flags which are set as
30056 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
30059 * Create a blank Features with no features set
30061 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
30064 * Returns true if this `Features` object contains unknown feature flags which are set as
30067 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
30070 * Create a blank Features with no features set
30072 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
30075 * Returns true if this `Features` object contains unknown feature flags which are set as
30078 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30081 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
30083 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
30086 * Read a InitFeatures from a byte array, created by InitFeatures_write
30088 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
30091 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
30093 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
30096 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
30098 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
30101 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
30103 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
30106 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
30108 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
30111 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
30113 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
30116 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
30118 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
30121 * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
30123 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
30126 * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
30128 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
30131 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
30133 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
30136 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
30138 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
30141 * Set this feature as optional.
30143 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30146 * Set this feature as required.
30148 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30151 * Checks if this feature is supported.
30153 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30156 * Set this feature as optional.
30158 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30161 * Set this feature as required.
30163 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30166 * Checks if this feature is supported.
30168 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30171 * Checks if this feature is required.
30173 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30176 * Checks if this feature is required.
30178 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30181 * Set this feature as optional.
30183 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30186 * Set this feature as required.
30188 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30191 * Checks if this feature is supported.
30193 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30196 * Set this feature as optional.
30198 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30201 * Set this feature as required.
30203 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30206 * Checks if this feature is supported.
30208 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30211 * Set this feature as optional.
30213 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30216 * Set this feature as required.
30218 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30221 * Checks if this feature is supported.
30223 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30226 * Checks if this feature is required.
30228 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30231 * Checks if this feature is required.
30233 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30236 * Set this feature as optional.
30238 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30241 * Set this feature as required.
30243 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30246 * Checks if this feature is supported.
30248 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30251 * Set this feature as optional.
30253 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30256 * Set this feature as required.
30258 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30261 * Checks if this feature is supported.
30263 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30266 * Checks if this feature is required.
30268 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30271 * Checks if this feature is required.
30273 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30276 * Set this feature as optional.
30278 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30281 * Set this feature as required.
30283 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30286 * Checks if this feature is supported.
30288 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30291 * Set this feature as optional.
30293 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30296 * Set this feature as required.
30298 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30301 * Checks if this feature is supported.
30303 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30306 * Set this feature as optional.
30308 void InvoiceFeatures_set_variable_length_onion_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30311 * Set this feature as required.
30313 void InvoiceFeatures_set_variable_length_onion_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30316 * Checks if this feature is supported.
30318 MUST_USE_RES bool InvoiceFeatures_supports_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30321 * Checks if this feature is required.
30323 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30326 * Checks if this feature is required.
30328 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30331 * Checks if this feature is required.
30333 MUST_USE_RES bool InvoiceFeatures_requires_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30336 * Set this feature as optional.
30338 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30341 * Set this feature as required.
30343 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30346 * Checks if this feature is supported.
30348 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30351 * Set this feature as optional.
30353 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30356 * Set this feature as required.
30358 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30361 * Checks if this feature is supported.
30363 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30366 * Set this feature as optional.
30368 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30371 * Set this feature as required.
30373 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30376 * Checks if this feature is supported.
30378 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30381 * Checks if this feature is required.
30383 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30386 * Checks if this feature is required.
30388 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30391 * Checks if this feature is required.
30393 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30396 * Set this feature as optional.
30398 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30401 * Set this feature as required.
30403 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30406 * Checks if this feature is supported.
30408 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30411 * Set this feature as optional.
30413 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30416 * Set this feature as required.
30418 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30421 * Checks if this feature is supported.
30423 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30426 * Set this feature as optional.
30428 void InvoiceFeatures_set_payment_secret_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30431 * Set this feature as required.
30433 void InvoiceFeatures_set_payment_secret_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30436 * Checks if this feature is supported.
30438 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30441 * Checks if this feature is required.
30443 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30446 * Checks if this feature is required.
30448 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30451 * Checks if this feature is required.
30453 MUST_USE_RES bool InvoiceFeatures_requires_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30456 * Set this feature as optional.
30458 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30461 * Set this feature as required.
30463 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30466 * Checks if this feature is supported.
30468 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30471 * Set this feature as optional.
30473 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30476 * Set this feature as required.
30478 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30481 * Checks if this feature is supported.
30483 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30486 * Set this feature as optional.
30488 void InvoiceFeatures_set_basic_mpp_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30491 * Set this feature as required.
30493 void InvoiceFeatures_set_basic_mpp_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30496 * Checks if this feature is supported.
30498 MUST_USE_RES bool InvoiceFeatures_supports_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30501 * Set this feature as optional.
30503 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
30506 * Set this feature as required.
30508 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
30511 * Checks if this feature is supported.
30513 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
30516 * Checks if this feature is required.
30518 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30521 * Checks if this feature is required.
30523 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30526 * Checks if this feature is required.
30528 MUST_USE_RES bool InvoiceFeatures_requires_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30531 * Checks if this feature is required.
30533 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
30536 * Set this feature as optional.
30538 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30541 * Set this feature as required.
30543 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30546 * Checks if this feature is supported.
30548 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30551 * Set this feature as optional.
30553 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30556 * Set this feature as required.
30558 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30561 * Checks if this feature is supported.
30563 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30566 * Checks if this feature is required.
30568 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30571 * Checks if this feature is required.
30573 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30576 * Set this feature as optional.
30578 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30581 * Set this feature as required.
30583 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30586 * Checks if this feature is supported.
30588 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30591 * Set this feature as optional.
30593 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30596 * Set this feature as required.
30598 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30601 * Checks if this feature is supported.
30603 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30606 * Set this feature as optional.
30608 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30611 * Set this feature as required.
30613 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30616 * Checks if this feature is supported.
30618 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30621 * Checks if this feature is required.
30623 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30626 * Checks if this feature is required.
30628 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30631 * Checks if this feature is required.
30633 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30636 * Set this feature as optional.
30638 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30641 * Set this feature as required.
30643 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30646 * Checks if this feature is supported.
30648 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30651 * Set this feature as optional.
30653 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30656 * Set this feature as required.
30658 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30661 * Checks if this feature is supported.
30663 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30666 * Checks if this feature is required.
30668 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30671 * Checks if this feature is required.
30673 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30676 * Set this feature as optional.
30678 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30681 * Set this feature as required.
30683 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30686 * Checks if this feature is supported.
30688 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30691 * Set this feature as optional.
30693 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30696 * Set this feature as required.
30698 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30701 * Checks if this feature is supported.
30703 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30706 * Checks if this feature is required.
30708 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30711 * Checks if this feature is required.
30713 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30716 * Set this feature as optional.
30718 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30721 * Set this feature as required.
30723 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30726 * Checks if this feature is supported.
30728 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30731 * Set this feature as optional.
30733 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30736 * Set this feature as required.
30738 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30741 * Checks if this feature is supported.
30743 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30746 * Checks if this feature is required.
30748 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30751 * Checks if this feature is required.
30753 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30756 * Set this feature as optional.
30758 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30761 * Set this feature as required.
30763 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30766 * Checks if this feature is supported.
30768 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30771 * Set this feature as optional.
30773 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30776 * Set this feature as required.
30778 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30781 * Checks if this feature is supported.
30783 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30786 * Set this feature as optional.
30788 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30791 * Set this feature as required.
30793 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30796 * Checks if this feature is supported.
30798 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30801 * Checks if this feature is required.
30803 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30806 * Checks if this feature is required.
30808 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30811 * Checks if this feature is required.
30813 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30816 * Set this feature as optional.
30818 void InvoiceFeatures_set_payment_metadata_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30821 * Set this feature as required.
30823 void InvoiceFeatures_set_payment_metadata_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30826 * Checks if this feature is supported.
30828 MUST_USE_RES bool InvoiceFeatures_supports_payment_metadata(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30831 * Checks if this feature is required.
30833 MUST_USE_RES bool InvoiceFeatures_requires_payment_metadata(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
30836 * Set this feature as optional.
30838 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30841 * Set this feature as required.
30843 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30846 * Checks if this feature is supported.
30848 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30851 * Set this feature as optional.
30853 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30856 * Set this feature as required.
30858 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30861 * Checks if this feature is supported.
30863 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30866 * Set this feature as optional.
30868 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30871 * Set this feature as required.
30873 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30876 * Checks if this feature is supported.
30878 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30881 * Checks if this feature is required.
30883 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30886 * Checks if this feature is required.
30888 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30891 * Checks if this feature is required.
30893 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30896 * Set this feature as optional.
30898 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30901 * Set this feature as required.
30903 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30906 * Checks if this feature is supported.
30908 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30911 * Checks if this feature is required.
30913 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30916 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
30918 void ShutdownScript_free(struct LDKShutdownScript this_obj);
30921 * Creates a copy of the ShutdownScript
30923 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
30926 * Checks if two ShutdownScripts contain equal inner contents.
30927 * This ignores pointers and is_owned flags and looks at the values in fields.
30928 * Two objects with NULL inner values will be considered "equal" here.
30930 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
30933 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
30935 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
30938 * The script that did not meet the requirements from [BOLT #2].
30940 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
30942 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
30945 * The script that did not meet the requirements from [BOLT #2].
30947 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
30949 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
30952 * Constructs a new InvalidShutdownScript given each field
30954 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
30957 * Creates a copy of the InvalidShutdownScript
30959 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
30962 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
30964 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
30967 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
30969 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
30972 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
30974 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
30977 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
30979 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
30982 * Generates a witness script pubkey from the given segwit version and program.
30984 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
30985 * [`ShutdownScript::new_p2wsh`] instead.
30989 * This function may return an error if `program` is invalid for the segwit `version`.
30991 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
30994 * Converts the shutdown script into the underlying [`Script`].
30996 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
30999 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
31001 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31003 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
31006 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
31008 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
31010 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
31013 * Frees any resources used by the Retry
31015 void Retry_free(struct LDKRetry this_ptr);
31018 * Creates a copy of the Retry
31020 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
31023 * Utility method to constructs a new Attempts-variant Retry
31025 struct LDKRetry Retry_attempts(uintptr_t a);
31028 * Utility method to constructs a new Timeout-variant Retry
31030 struct LDKRetry Retry_timeout(uint64_t a);
31033 * Checks if two Retrys contain equal inner contents.
31034 * This ignores pointers and is_owned flags and looks at the values in fields.
31036 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
31039 * Generates a non-cryptographic 64-bit hash of the Retry.
31041 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
31044 * Creates a copy of the RetryableSendFailure
31046 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
31049 * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
31051 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
31054 * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
31056 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
31059 * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
31061 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
31064 * Frees any resources used by the PaymentSendFailure
31066 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
31069 * Creates a copy of the PaymentSendFailure
31071 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
31074 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
31076 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
31079 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
31081 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
31084 * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
31086 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
31089 * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
31091 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
31094 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
31096 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
31099 * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
31101 void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
31104 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
31105 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
31106 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
31109 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
31110 * multi-path payments require a recipient-provided secret.
31112 * Note that for spontaneous payments most lightning nodes do not currently support MPP
31113 * receives, thus you should generally never be providing a secret here for spontaneous
31116 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31118 struct LDKThirtyTwoBytes RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
31121 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
31122 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
31123 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
31126 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
31127 * multi-path payments require a recipient-provided secret.
31129 * Note that for spontaneous payments most lightning nodes do not currently support MPP
31130 * receives, thus you should generally never be providing a secret here for spontaneous
31133 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
31135 void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31138 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
31139 * arbitrary length. This gives recipients substantially more flexibility to receive
31142 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
31143 * scheme to authenticate received payments against expected payments and invoices, this field
31144 * is not used in LDK for received payments, and can be used to store arbitrary data in
31145 * invoices which will be received with the payment.
31147 * Note that this field was added to the lightning specification more recently than
31148 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
31149 * may not be supported as universally.
31151 * Returns a copy of the field.
31153 struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
31156 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
31157 * arbitrary length. This gives recipients substantially more flexibility to receive
31160 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
31161 * scheme to authenticate received payments against expected payments and invoices, this field
31162 * is not used in LDK for received payments, and can be used to store arbitrary data in
31163 * invoices which will be received with the payment.
31165 * Note that this field was added to the lightning specification more recently than
31166 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
31167 * may not be supported as universally.
31169 void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
31172 * Constructs a new RecipientOnionFields given each field
31174 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKCOption_CVec_u8ZZ payment_metadata_arg);
31177 * Creates a copy of the RecipientOnionFields
31179 struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
31182 * Checks if two RecipientOnionFieldss contain equal inner contents.
31183 * This ignores pointers and is_owned flags and looks at the values in fields.
31184 * Two objects with NULL inner values will be considered "equal" here.
31186 bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
31189 * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
31191 struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
31194 * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
31196 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
31199 * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
31200 * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
31201 * but do not require or provide any further data.
31203 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
31206 * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
31207 * payable HTLCs except for spontaneous payments, i.e. this should generally only be used for
31208 * calls to [`ChannelManager::send_spontaneous_payment`].
31210 * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
31212 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
31215 * Calls the free function if one is set
31217 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
31220 * Calls the free function if one is set
31222 void Type_free(struct LDKType this_ptr);
31225 * Frees any resources used by the UnsignedInvoice, if is_owned is set and inner is non-NULL.
31227 void UnsignedInvoice_free(struct LDKUnsignedInvoice this_obj);
31230 * The public key corresponding to the key needed to sign the invoice.
31232 MUST_USE_RES struct LDKPublicKey UnsignedInvoice_signing_pubkey(const struct LDKUnsignedInvoice *NONNULL_PTR this_arg);
31235 * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
31237 void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
31240 * Base fee charged (in millisatoshi) for the entire blinded path.
31242 uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
31245 * Base fee charged (in millisatoshi) for the entire blinded path.
31247 void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
31250 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
31251 * (i.e., 10,000 is 1%).
31253 uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
31256 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
31257 * (i.e., 10,000 is 1%).
31259 void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
31262 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
31265 uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
31268 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
31271 void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
31274 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
31275 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
31276 * seen by the recipient.
31278 uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
31281 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
31282 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
31283 * seen by the recipient.
31285 void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
31288 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
31289 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
31290 * seen by the recipient.
31292 uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
31295 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
31296 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
31297 * seen by the recipient.
31299 void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
31302 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
31305 struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
31308 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
31311 void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
31314 * Constructs a new BlindedPayInfo given each field
31316 MUST_USE_RES struct LDKBlindedPayInfo BlindedPayInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKBlindedHopFeatures features_arg);
31319 * Creates a copy of the BlindedPayInfo
31321 struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
31324 * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
31326 uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
31329 * Checks if two BlindedPayInfos contain equal inner contents.
31330 * This ignores pointers and is_owned flags and looks at the values in fields.
31331 * Two objects with NULL inner values will be considered "equal" here.
31333 bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
31336 * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
31338 struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
31341 * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
31343 struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
31346 * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
31348 void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
31351 * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
31353 void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
31356 * Creates a copy of the InvoiceRequest
31358 struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
31361 * An unpredictable series of bytes, typically containing information about the derivation of
31364 * [`payer_id`]: Self::payer_id
31366 MUST_USE_RES struct LDKu8slice InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
31369 * A chain from [`Offer::chains`] that the offer is valid for.
31371 MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
31374 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
31375 * must be greater than or equal to [`Offer::amount`], converted if necessary.
31377 * [`chain`]: Self::chain
31379 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
31382 * Features pertaining to requesting an invoice.
31384 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
31387 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
31389 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
31392 * A possibly transient pubkey used to sign the invoice request.
31394 MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
31397 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
31400 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31402 MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
31405 * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
31407 struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
31410 * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
31412 void Offer_free(struct LDKOffer this_obj);
31415 * Creates a copy of the Offer
31417 struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
31420 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
31421 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
31422 * for the selected chain.
31424 MUST_USE_RES struct LDKCVec_ChainHashZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
31427 * Returns whether the given chain is supported by the offer.
31429 MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
31432 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
31433 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
31435 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
31438 * The minimum amount required for a successful payment of a single item.
31440 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31442 MUST_USE_RES struct LDKAmount Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
31445 * A complete description of the purpose of the payment. Intended to be displayed to the user
31446 * but with the caveat that it has not been verified in any way.
31448 MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
31451 * Features pertaining to the offer.
31453 MUST_USE_RES struct LDKOfferFeatures Offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
31456 * Duration since the Unix epoch when an invoice should no longer be requested.
31458 * If `None`, the offer does not expire.
31460 MUST_USE_RES struct LDKCOption_DurationZ Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
31463 * Whether the offer has expired.
31465 MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
31468 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
31469 * displayed to the user but with the caveat that it has not been verified in any way.
31471 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31473 MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
31476 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
31477 * recipient privacy by obfuscating its node id.
31479 MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
31482 * The quantity of items supported.
31484 MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
31487 * Returns whether the given quantity is valid for the offer.
31489 MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
31492 * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
31494 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
31496 MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
31499 * The public key used by the recipient to sign invoices.
31501 MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
31504 * Serialize the Offer object into a byte array which can be read by Offer_read
31506 struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
31509 * Frees any resources used by the Amount, if is_owned is set and inner is non-NULL.
31511 void Amount_free(struct LDKAmount this_obj);
31514 * Creates a copy of the Amount
31516 struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
31519 * Frees any resources used by the Quantity, if is_owned is set and inner is non-NULL.
31521 void Quantity_free(struct LDKQuantity this_obj);
31524 * Creates a copy of the Quantity
31526 struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
31529 * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
31531 void Refund_free(struct LDKRefund this_obj);
31534 * Creates a copy of the Refund
31536 struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
31539 * A complete description of the purpose of the refund. Intended to be displayed to the user
31540 * but with the caveat that it has not been verified in any way.
31542 MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
31545 * Duration since the Unix epoch when an invoice should no longer be sent.
31547 * If `None`, the refund does not expire.
31549 MUST_USE_RES struct LDKCOption_DurationZ Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
31552 * Whether the refund has expired.
31554 MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
31557 * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
31558 * displayed to the user but with the caveat that it has not been verified in any way.
31560 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31562 MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
31565 * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
31566 * privacy by obfuscating its node id.
31568 MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
31571 * An unpredictable series of bytes, typically containing information about the derivation of
31574 * [`payer_id`]: Self::payer_id
31576 MUST_USE_RES struct LDKu8slice Refund_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
31579 * A chain that the refund is valid for.
31581 MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
31584 * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
31586 * [`chain`]: Self::chain
31588 MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
31591 * Features pertaining to requesting an invoice.
31593 MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
31596 * The quantity of an item that refund is for.
31598 MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
31601 * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
31602 * transient pubkey.
31604 * [`paths`]: Self::paths
31606 MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
31609 * Payer provided note to include in the invoice.
31611 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31613 MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
31616 * Serialize the Refund object into a byte array which can be read by Refund_read
31618 struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
31621 * Creates a copy of the UtxoLookupError
31623 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
31626 * Utility method to constructs a new UnknownChain-variant UtxoLookupError
31628 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
31631 * Utility method to constructs a new UnknownTx-variant UtxoLookupError
31633 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
31636 * Frees any resources used by the UtxoResult
31638 void UtxoResult_free(struct LDKUtxoResult this_ptr);
31641 * Creates a copy of the UtxoResult
31643 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
31646 * Utility method to constructs a new Sync-variant UtxoResult
31648 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
31651 * Utility method to constructs a new Async-variant UtxoResult
31653 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
31656 * Calls the free function if one is set
31658 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
31661 * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
31663 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
31666 * Creates a copy of the UtxoFuture
31668 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
31671 * Builds a new future for later resolution.
31673 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
31676 * Resolves this future against the given `graph` and with the given `result`.
31678 * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
31679 * forwarding the validated gossip message onwards to peers.
31681 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
31682 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
31685 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
31686 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
31688 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
31691 * Resolves this future against the given `graph` and with the given `result`.
31693 * The given `gossip` is used to broadcast any validated messages onwards to all peers which
31694 * have available buffer space.
31696 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
31697 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
31700 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
31701 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
31703 void UtxoFuture_resolve(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, const struct LDKP2PGossipSync *NONNULL_PTR gossip, struct LDKCResult_TxOutUtxoLookupErrorZ result);
31706 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
31708 void NodeId_free(struct LDKNodeId this_obj);
31711 * Creates a copy of the NodeId
31713 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
31716 * Create a new NodeId from a public key
31718 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
31721 * Get the public key slice from this NodeId
31723 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
31726 * Get the public key from this NodeId
31728 MUST_USE_RES struct LDKCResult_PublicKeyErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
31731 * Generates a non-cryptographic 64-bit hash of the NodeId.
31733 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
31736 * Serialize the NodeId object into a byte array which can be read by NodeId_read
31738 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
31741 * Read a NodeId from a byte array, created by NodeId_write
31743 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
31746 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
31748 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
31751 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
31753 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
31756 * Frees any resources used by the NetworkUpdate
31758 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
31761 * Creates a copy of the NetworkUpdate
31763 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
31766 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
31768 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
31771 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
31773 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
31776 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
31778 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
31781 * Checks if two NetworkUpdates contain equal inner contents.
31782 * This ignores pointers and is_owned flags and looks at the values in fields.
31784 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
31787 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
31789 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
31792 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
31794 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
31797 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
31799 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
31802 * Creates a new tracker of the actual state of the network of channels and nodes,
31803 * assuming an existing [`NetworkGraph`].
31804 * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
31805 * correct, and the announcement is signed with channel owners' keys.
31807 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
31810 * Adds a provider used to check new announcements. Does not affect
31811 * existing announcements unless they are updated.
31812 * Add, update or remove the provider would replace the current one.
31814 void P2PGossipSync_add_utxo_lookup(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
31817 * Handles any network updates originating from [`Event`]s.
31819 * [`Event`]: crate::events::Event
31821 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
31824 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
31825 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
31827 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
31830 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
31831 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
31833 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
31836 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
31838 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
31841 * When the last update to the channel direction was issued.
31842 * Value is opaque, as set in the announcement.
31844 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
31847 * When the last update to the channel direction was issued.
31848 * Value is opaque, as set in the announcement.
31850 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
31853 * Whether the channel can be currently used for payments (in this one direction).
31855 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
31858 * Whether the channel can be currently used for payments (in this one direction).
31860 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
31863 * The difference in CLTV values that you must have when routing through this channel.
31865 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
31868 * The difference in CLTV values that you must have when routing through this channel.
31870 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
31873 * The minimum value, which must be relayed to the next hop via the channel
31875 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
31878 * The minimum value, which must be relayed to the next hop via the channel
31880 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
31883 * The maximum value which may be relayed to the next hop via the channel.
31885 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
31888 * The maximum value which may be relayed to the next hop via the channel.
31890 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
31893 * Fees charged when the channel is used for routing
31895 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
31898 * Fees charged when the channel is used for routing
31900 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
31903 * Most recent update for the channel received from the network
31904 * Mostly redundant with the data we store in fields explicitly.
31905 * Everything else is useful only for sending out for initial routing sync.
31906 * Not stored if contains excess data to prevent DoS.
31908 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31910 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
31913 * Most recent update for the channel received from the network
31914 * Mostly redundant with the data we store in fields explicitly.
31915 * Everything else is useful only for sending out for initial routing sync.
31916 * Not stored if contains excess data to prevent DoS.
31918 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
31920 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
31923 * Constructs a new ChannelUpdateInfo given each field
31925 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);
31928 * Creates a copy of the ChannelUpdateInfo
31930 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
31933 * Checks if two ChannelUpdateInfos contain equal inner contents.
31934 * This ignores pointers and is_owned flags and looks at the values in fields.
31935 * Two objects with NULL inner values will be considered "equal" here.
31937 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
31940 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
31942 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
31945 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
31947 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
31950 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
31952 void ChannelInfo_free(struct LDKChannelInfo this_obj);
31955 * Protocol features of a channel communicated during its announcement
31957 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
31960 * Protocol features of a channel communicated during its announcement
31962 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
31965 * Source node of the first direction of a channel
31967 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
31970 * Source node of the first direction of a channel
31972 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
31975 * Details about the first direction of a channel
31977 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31979 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
31982 * Details about the first direction of a channel
31984 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
31986 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
31989 * Source node of the second direction of a channel
31991 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
31994 * Source node of the second direction of a channel
31996 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
31999 * Details about the second direction of a channel
32001 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32003 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
32006 * Details about the second direction of a channel
32008 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32010 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
32013 * The channel capacity as seen on-chain, if chain lookup is available.
32015 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
32018 * The channel capacity as seen on-chain, if chain lookup is available.
32020 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32023 * An initial announcement of the channel
32024 * Mostly redundant with the data we store in fields explicitly.
32025 * Everything else is useful only for sending out for initial routing sync.
32026 * Not stored if contains excess data to prevent DoS.
32028 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32030 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
32033 * An initial announcement of the channel
32034 * Mostly redundant with the data we store in fields explicitly.
32035 * Everything else is useful only for sending out for initial routing sync.
32036 * Not stored if contains excess data to prevent DoS.
32038 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32040 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
32043 * Creates a copy of the ChannelInfo
32045 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
32048 * Checks if two ChannelInfos contain equal inner contents.
32049 * This ignores pointers and is_owned flags and looks at the values in fields.
32050 * Two objects with NULL inner values will be considered "equal" here.
32052 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
32055 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
32057 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32059 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
32062 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
32064 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
32067 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
32069 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
32072 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
32074 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
32077 * Creates a copy of the DirectedChannelInfo
32079 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
32082 * Returns information for the channel.
32084 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
32087 * Returns the maximum HTLC amount allowed over the channel in the direction.
32089 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
32092 * Returns the [`EffectiveCapacity`] of the channel in the direction.
32094 * This is either the total capacity from the funding transaction, if known, or the
32095 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
32098 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
32101 * Frees any resources used by the EffectiveCapacity
32103 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
32106 * Creates a copy of the EffectiveCapacity
32108 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
32111 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
32113 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
32116 * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity
32118 struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat);
32121 * Utility method to constructs a new Total-variant EffectiveCapacity
32123 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
32126 * Utility method to constructs a new Infinite-variant EffectiveCapacity
32128 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
32131 * Utility method to constructs a new Unknown-variant EffectiveCapacity
32133 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
32136 * Returns the effective capacity denominated in millisatoshi.
32138 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
32141 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
32143 void RoutingFees_free(struct LDKRoutingFees this_obj);
32146 * Flat routing fee in millisatoshis.
32148 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
32151 * Flat routing fee in millisatoshis.
32153 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
32156 * Liquidity-based routing fee in millionths of a routed amount.
32157 * In other words, 10000 is 1%.
32159 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
32162 * Liquidity-based routing fee in millionths of a routed amount.
32163 * In other words, 10000 is 1%.
32165 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
32168 * Constructs a new RoutingFees given each field
32170 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
32173 * Checks if two RoutingFeess contain equal inner contents.
32174 * This ignores pointers and is_owned flags and looks at the values in fields.
32175 * Two objects with NULL inner values will be considered "equal" here.
32177 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
32180 * Creates a copy of the RoutingFees
32182 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
32185 * Generates a non-cryptographic 64-bit hash of the RoutingFees.
32187 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
32190 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
32192 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
32195 * Read a RoutingFees from a byte array, created by RoutingFees_write
32197 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
32200 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
32202 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
32205 * Protocol features the node announced support for
32207 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
32210 * Protocol features the node announced support for
32212 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
32215 * When the last known update to the node state was issued.
32216 * Value is opaque, as set in the announcement.
32218 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
32221 * When the last known update to the node state was issued.
32222 * Value is opaque, as set in the announcement.
32224 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
32227 * Color assigned to the node
32229 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
32232 * Color assigned to the node
32234 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
32237 * Moniker assigned to the node.
32238 * May be invalid or malicious (eg control chars),
32239 * should not be exposed to the user.
32241 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
32244 * Moniker assigned to the node.
32245 * May be invalid or malicious (eg control chars),
32246 * should not be exposed to the user.
32248 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
32251 * An initial announcement of the node
32252 * Mostly redundant with the data we store in fields explicitly.
32253 * Everything else is useful only for sending out for initial routing sync.
32254 * Not stored if contains excess data to prevent DoS.
32256 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32258 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
32261 * An initial announcement of the node
32262 * Mostly redundant with the data we store in fields explicitly.
32263 * Everything else is useful only for sending out for initial routing sync.
32264 * Not stored if contains excess data to prevent DoS.
32266 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32268 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
32271 * Constructs a new NodeAnnouncementInfo given each field
32273 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 LDKNodeAnnouncement announcement_message_arg);
32276 * Creates a copy of the NodeAnnouncementInfo
32278 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
32281 * Checks if two NodeAnnouncementInfos contain equal inner contents.
32282 * This ignores pointers and is_owned flags and looks at the values in fields.
32283 * Two objects with NULL inner values will be considered "equal" here.
32285 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
32288 * Internet-level addresses via which one can connect to the node
32290 MUST_USE_RES struct LDKCVec_NetAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
32293 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
32295 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
32298 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
32300 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
32303 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
32305 void NodeAlias_free(struct LDKNodeAlias this_obj);
32307 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
32309 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32312 * Constructs a new NodeAlias given each field
32314 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
32317 * Creates a copy of the NodeAlias
32319 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
32322 * Checks if two NodeAliass contain equal inner contents.
32323 * This ignores pointers and is_owned flags and looks at the values in fields.
32324 * Two objects with NULL inner values will be considered "equal" here.
32326 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
32329 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
32331 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
32334 * Read a NodeAlias from a byte array, created by NodeAlias_write
32336 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
32339 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
32341 void NodeInfo_free(struct LDKNodeInfo this_obj);
32344 * All valid channels a node has announced
32346 * Returns a copy of the field.
32348 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
32351 * All valid channels a node has announced
32353 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
32356 * More information about a node from node_announcement.
32357 * Optional because we store a Node entry after learning about it from
32358 * a channel announcement, but before receiving a node announcement.
32360 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32362 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
32365 * More information about a node from node_announcement.
32366 * Optional because we store a Node entry after learning about it from
32367 * a channel announcement, but before receiving a node announcement.
32369 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32371 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
32374 * Constructs a new NodeInfo given each field
32376 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
32379 * Creates a copy of the NodeInfo
32381 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
32384 * Checks if two NodeInfos contain equal inner contents.
32385 * This ignores pointers and is_owned flags and looks at the values in fields.
32386 * Two objects with NULL inner values will be considered "equal" here.
32388 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
32391 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
32393 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
32396 * Read a NodeInfo from a byte array, created by NodeInfo_write
32398 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
32401 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
32403 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
32406 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
32408 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
32411 * Creates a new, empty, network graph.
32413 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
32416 * Returns a read-only view of the network graph.
32418 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
32421 * The unix timestamp provided by the most recent rapid gossip sync.
32422 * It will be set by the rapid sync process after every sync completion.
32424 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
32427 * Update the unix timestamp provided by the most recent rapid gossip sync.
32428 * This should be done automatically by the rapid sync process after every sync completion.
32430 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
32433 * For an already known node (from channel announcements), update its stored properties from a
32434 * given node announcement.
32436 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
32437 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
32438 * routing messages from a source using a protocol other than the lightning P2P protocol.
32440 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
32443 * For an already known node (from channel announcements), update its stored properties from a
32444 * given node announcement without verifying the associated signatures. Because we aren't
32445 * given the associated signatures here we cannot relay the node announcement to any of our
32448 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);
32451 * Store or update channel info from a channel announcement.
32453 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
32454 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
32455 * routing messages from a source using a protocol other than the lightning P2P protocol.
32457 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
32458 * the corresponding UTXO exists on chain and is correctly-formatted.
32460 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_UtxoLookupZ utxo_lookup);
32463 * Store or update channel info from a channel announcement without verifying the associated
32464 * signatures. Because we aren't given the associated signatures here we cannot relay the
32465 * channel announcement to any of our peers.
32467 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
32468 * the corresponding UTXO exists on chain and is correctly-formatted.
32470 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_UtxoLookupZ utxo_lookup);
32473 * Update channel from partial announcement data received via rapid gossip sync
32475 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
32476 * rapid gossip sync server)
32478 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
32480 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);
32483 * Marks a channel in the graph as failed permanently.
32485 * The channel and any node for which this was their last channel are removed from the graph.
32487 void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
32490 * Marks a node in the graph as permanently failed, effectively removing it and its channels
32491 * from local storage.
32493 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
32496 * Removes information about channels that we haven't heard any updates about in some time.
32497 * This can be used regularly to prune the network graph of channels that likely no longer
32500 * While there is no formal requirement that nodes regularly re-broadcast their channel
32501 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
32502 * pruning occur for updates which are at least two weeks old, which we implement here.
32504 * Note that for users of the `lightning-background-processor` crate this method may be
32505 * automatically called regularly for you.
32507 * This method will also cause us to stop tracking removed nodes and channels if they have been
32508 * in the map for a while so that these can be resynced from gossip in the future.
32510 * This method is only available with the `std` feature. See
32511 * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
32513 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
32516 * Removes information about channels that we haven't heard any updates about in some time.
32517 * This can be used regularly to prune the network graph of channels that likely no longer
32520 * While there is no formal requirement that nodes regularly re-broadcast their channel
32521 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
32522 * pruning occur for updates which are at least two weeks old, which we implement here.
32524 * This method will also cause us to stop tracking removed nodes and channels if they have been
32525 * in the map for a while so that these can be resynced from gossip in the future.
32527 * This function takes the current unix time as an argument. For users with the `std` feature
32528 * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
32530 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
32533 * For an already known (from announcement) channel, update info about one of the directions
32536 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
32537 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
32538 * routing messages from a source using a protocol other than the lightning P2P protocol.
32540 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
32541 * materially in the future will be rejected.
32543 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
32546 * For an already known (from announcement) channel, update info about one of the directions
32547 * of the channel without verifying the associated signatures. Because we aren't given the
32548 * associated signatures here we cannot relay the channel update to any of our peers.
32550 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
32551 * materially in the future will be rejected.
32553 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
32556 * Returns information on a channel with the given id.
32558 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32560 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
32563 * Returns the list of channels in the graph
32565 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
32568 * Returns information on a node with the given id.
32570 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32572 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
32575 * Returns the list of nodes in the graph
32577 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
32580 * Get network addresses by node id.
32581 * Returns None if the requested node is completely unknown,
32582 * or if node announcement for the node was never received.
32584 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
32587 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
32589 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
32592 * Creates a new router.
32594 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes, struct LDKLockableScore scorer);
32597 * Constructs a new Router which calls the relevant methods on this_arg.
32598 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
32600 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
32603 * Calls the free function if one is set
32605 void Router_free(struct LDKRouter this_ptr);
32608 * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
32610 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
32613 * Initialize a new `ScorerAccountingForInFlightHtlcs`.
32615 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScore scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
32618 * Serialize the ScorerAccountingForInFlightHtlcs object into a byte array which can be read by ScorerAccountingForInFlightHtlcs_read
32620 struct LDKCVec_u8Z ScorerAccountingForInFlightHtlcs_write(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR obj);
32623 * Constructs a new Score which calls the relevant methods on this_arg.
32624 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
32626 struct LDKScore ScorerAccountingForInFlightHtlcs_as_Score(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
32629 * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
32631 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
32634 * Creates a copy of the InFlightHtlcs
32636 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
32639 * Constructs an empty `InFlightHtlcs`.
32641 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
32644 * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
32646 void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
32649 * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
32652 MUST_USE_RES struct LDKCOption_u64Z InFlightHtlcs_used_liquidity_msat(const struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid);
32655 * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
32657 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
32660 * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
32662 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
32665 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
32667 void RouteHop_free(struct LDKRouteHop this_obj);
32670 * The node_id of the node at this hop.
32672 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
32675 * The node_id of the node at this hop.
32677 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32680 * The node_announcement features of the node at this hop. For the last hop, these may be
32681 * amended to match the features present in the invoice this node generated.
32683 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
32686 * The node_announcement features of the node at this hop. For the last hop, these may be
32687 * amended to match the features present in the invoice this node generated.
32689 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
32692 * The channel that should be used from the previous hop to reach this node.
32694 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
32697 * The channel that should be used from the previous hop to reach this node.
32699 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
32702 * The channel_announcement features of the channel that should be used from the previous hop
32703 * to reach this node.
32705 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
32708 * The channel_announcement features of the channel that should be used from the previous hop
32709 * to reach this node.
32711 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
32714 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
32715 * If this is the last hop in [`Path::hops`]:
32716 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
32717 * * otherwise, this is the full value of this [`Path`]'s part of the payment
32719 * [`BlindedPath`]: crate::blinded_path::BlindedPath
32721 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
32724 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
32725 * If this is the last hop in [`Path::hops`]:
32726 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
32727 * * otherwise, this is the full value of this [`Path`]'s part of the payment
32729 * [`BlindedPath`]: crate::blinded_path::BlindedPath
32731 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
32734 * The CLTV delta added for this hop.
32735 * If this is the last hop in [`Path::hops`]:
32736 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
32737 * * otherwise, this is the CLTV delta expected at the destination
32739 * [`BlindedPath`]: crate::blinded_path::BlindedPath
32741 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
32744 * The CLTV delta added for this hop.
32745 * If this is the last hop in [`Path::hops`]:
32746 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
32747 * * otherwise, this is the CLTV delta expected at the destination
32749 * [`BlindedPath`]: crate::blinded_path::BlindedPath
32751 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
32754 * Constructs a new RouteHop given each field
32756 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);
32759 * Creates a copy of the RouteHop
32761 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
32764 * Generates a non-cryptographic 64-bit hash of the RouteHop.
32766 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
32769 * Checks if two RouteHops contain equal inner contents.
32770 * This ignores pointers and is_owned flags and looks at the values in fields.
32771 * Two objects with NULL inner values will be considered "equal" here.
32773 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
32776 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
32778 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
32781 * Read a RouteHop from a byte array, created by RouteHop_write
32783 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
32786 * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
32788 void BlindedTail_free(struct LDKBlindedTail this_obj);
32791 * The hops of the [`BlindedPath`] provided by the recipient.
32793 * [`BlindedPath`]: crate::blinded_path::BlindedPath
32795 struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
32798 * The hops of the [`BlindedPath`] provided by the recipient.
32800 * [`BlindedPath`]: crate::blinded_path::BlindedPath
32802 void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
32805 * The blinding point of the [`BlindedPath`] provided by the recipient.
32807 * [`BlindedPath`]: crate::blinded_path::BlindedPath
32809 struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
32812 * The blinding point of the [`BlindedPath`] provided by the recipient.
32814 * [`BlindedPath`]: crate::blinded_path::BlindedPath
32816 void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32819 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
32820 * inferring the destination. May be 0.
32822 uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
32825 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
32826 * inferring the destination. May be 0.
32828 void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
32831 * The total amount paid on this [`Path`], excluding the fees.
32833 uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
32836 * The total amount paid on this [`Path`], excluding the fees.
32838 void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
32841 * Constructs a new BlindedTail given each field
32843 MUST_USE_RES struct LDKBlindedTail BlindedTail_new(struct LDKCVec_BlindedHopZ hops_arg, struct LDKPublicKey blinding_point_arg, uint32_t excess_final_cltv_expiry_delta_arg, uint64_t final_value_msat_arg);
32846 * Creates a copy of the BlindedTail
32848 struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
32851 * Generates a non-cryptographic 64-bit hash of the BlindedTail.
32853 uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
32856 * Checks if two BlindedTails contain equal inner contents.
32857 * This ignores pointers and is_owned flags and looks at the values in fields.
32858 * Two objects with NULL inner values will be considered "equal" here.
32860 bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
32863 * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
32865 struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
32868 * Read a BlindedTail from a byte array, created by BlindedTail_write
32870 struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
32873 * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
32875 void Path_free(struct LDKPath this_obj);
32878 * The list of unblinded hops in this [`Path`]. Must be at least length one.
32880 struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
32883 * The list of unblinded hops in this [`Path`]. Must be at least length one.
32885 void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
32888 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
32890 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32892 struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
32895 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
32897 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32899 void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
32902 * Constructs a new Path given each field
32904 MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
32907 * Creates a copy of the Path
32909 struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
32912 * Generates a non-cryptographic 64-bit hash of the Path.
32914 uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
32917 * Checks if two Paths contain equal inner contents.
32918 * This ignores pointers and is_owned flags and looks at the values in fields.
32919 * Two objects with NULL inner values will be considered "equal" here.
32921 bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
32924 * Gets the fees for a given path, excluding any excess paid to the recipient.
32926 MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
32929 * Gets the total amount paid on this [`Path`], excluding the fees.
32931 MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
32934 * Gets the final hop's CLTV expiry delta.
32936 MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
32939 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
32941 void Route_free(struct LDKRoute this_obj);
32944 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
32945 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
32948 struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
32951 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
32952 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
32955 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
32958 * The `payment_params` parameter passed to [`find_route`].
32959 * This is used by `ChannelManager` to track information which may be required for retries,
32960 * provided back to you via [`Event::PaymentPathFailed`].
32962 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
32964 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32966 struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr);
32969 * The `payment_params` parameter passed to [`find_route`].
32970 * This is used by `ChannelManager` to track information which may be required for retries,
32971 * provided back to you via [`Event::PaymentPathFailed`].
32973 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
32975 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32977 void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
32980 * Constructs a new Route given each field
32982 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKPaymentParameters payment_params_arg);
32985 * Creates a copy of the Route
32987 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
32990 * Generates a non-cryptographic 64-bit hash of the Route.
32992 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
32995 * Checks if two Routes contain equal inner contents.
32996 * This ignores pointers and is_owned flags and looks at the values in fields.
32997 * Two objects with NULL inner values will be considered "equal" here.
32999 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
33002 * Returns the total amount of fees paid on this [`Route`].
33004 * This doesn't include any extra payment made to the recipient, which can happen in excess of
33005 * the amount passed to [`find_route`]'s `params.final_value_msat`.
33007 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
33010 * Returns the total amount paid on this [`Route`], excluding the fees. Might be more than
33011 * requested if we had to reach htlc_minimum_msat.
33013 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
33016 * Serialize the Route object into a byte array which can be read by Route_read
33018 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
33021 * Read a Route from a byte array, created by Route_write
33023 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
33026 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
33028 void RouteParameters_free(struct LDKRouteParameters this_obj);
33031 * The parameters of the failed payment path.
33033 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
33036 * The parameters of the failed payment path.
33038 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
33041 * The amount in msats sent on the failed payment path.
33043 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
33046 * The amount in msats sent on the failed payment path.
33048 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
33051 * Constructs a new RouteParameters given each field
33053 MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPaymentParameters payment_params_arg, uint64_t final_value_msat_arg);
33056 * Creates a copy of the RouteParameters
33058 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
33061 * Checks if two RouteParameterss contain equal inner contents.
33062 * This ignores pointers and is_owned flags and looks at the values in fields.
33063 * Two objects with NULL inner values will be considered "equal" here.
33065 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
33068 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
33070 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
33073 * Read a RouteParameters from a byte array, created by RouteParameters_write
33075 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
33078 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
33080 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
33083 * The node id of the payee.
33085 struct LDKPublicKey PaymentParameters_get_payee_pubkey(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
33088 * The node id of the payee.
33090 void PaymentParameters_set_payee_pubkey(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33093 * Features supported by the payee.
33095 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
33096 * does not contain any features.
33098 * [`for_keysend`]: Self::for_keysend
33100 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33102 struct LDKInvoiceFeatures PaymentParameters_get_features(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
33105 * Features supported by the payee.
33107 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
33108 * does not contain any features.
33110 * [`for_keysend`]: Self::for_keysend
33112 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
33114 void PaymentParameters_set_features(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
33117 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
33119 struct LDKHints PaymentParameters_get_route_hints(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
33122 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
33124 void PaymentParameters_set_route_hints(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKHints val);
33127 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
33129 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
33132 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
33134 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
33137 * The maximum total CLTV delta we accept for the route.
33138 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
33140 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
33143 * The maximum total CLTV delta we accept for the route.
33144 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
33146 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
33149 * The maximum number of paths that may be used by (MPP) payments.
33150 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
33152 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
33155 * The maximum number of paths that may be used by (MPP) payments.
33156 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
33158 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
33161 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
33162 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
33163 * a lower value prefers to send larger MPP parts, potentially saturating channels and
33164 * increasing failure probability for those paths.
33166 * Note that this restriction will be relaxed during pathfinding after paths which meet this
33167 * restriction have been found. While paths which meet this criteria will be searched for, it
33168 * is ultimately up to the scorer to select them over other paths.
33170 * A value of 0 will allow payments up to and including a channel's total announced usable
33171 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
33175 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
33178 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
33179 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
33180 * a lower value prefers to send larger MPP parts, potentially saturating channels and
33181 * increasing failure probability for those paths.
33183 * Note that this restriction will be relaxed during pathfinding after paths which meet this
33184 * restriction have been found. While paths which meet this criteria will be searched for, it
33185 * is ultimately up to the scorer to select them over other paths.
33187 * A value of 0 will allow payments up to and including a channel's total announced usable
33188 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
33192 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
33195 * A list of SCIDs which this payment was previously attempted over and which caused the
33196 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
33199 * Returns a copy of the field.
33201 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
33204 * A list of SCIDs which this payment was previously attempted over and which caused the
33205 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
33208 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
33211 * The minimum CLTV delta at the end of the route. This value must not be zero.
33213 uint32_t PaymentParameters_get_final_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
33216 * The minimum CLTV delta at the end of the route. This value must not be zero.
33218 void PaymentParameters_set_final_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
33221 * Constructs a new PaymentParameters given each field
33223 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPublicKey payee_pubkey_arg, struct LDKInvoiceFeatures features_arg, struct LDKHints 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, uint32_t final_cltv_expiry_delta_arg);
33226 * Creates a copy of the PaymentParameters
33228 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
33231 * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
33233 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
33236 * Checks if two PaymentParameterss contain equal inner contents.
33237 * This ignores pointers and is_owned flags and looks at the values in fields.
33238 * Two objects with NULL inner values will be considered "equal" here.
33240 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
33243 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
33245 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
33248 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
33250 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
33253 * Creates a payee with the node id of the given `pubkey`.
33255 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
33258 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
33261 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
33263 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
33266 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
33269 * Frees any resources used by the Hints
33271 void Hints_free(struct LDKHints this_ptr);
33274 * Creates a copy of the Hints
33276 struct LDKHints Hints_clone(const struct LDKHints *NONNULL_PTR orig);
33279 * Utility method to constructs a new Blinded-variant Hints
33281 struct LDKHints Hints_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ a);
33284 * Utility method to constructs a new Clear-variant Hints
33286 struct LDKHints Hints_clear(struct LDKCVec_RouteHintZ a);
33289 * Generates a non-cryptographic 64-bit hash of the Hints.
33291 uint64_t Hints_hash(const struct LDKHints *NONNULL_PTR o);
33294 * Checks if two Hintss contain equal inner contents.
33295 * This ignores pointers and is_owned flags and looks at the values in fields.
33297 bool Hints_eq(const struct LDKHints *NONNULL_PTR a, const struct LDKHints *NONNULL_PTR b);
33300 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
33302 void RouteHint_free(struct LDKRouteHint this_obj);
33304 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
33306 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
33309 * Constructs a new RouteHint given each field
33311 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
33314 * Creates a copy of the RouteHint
33316 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
33319 * Generates a non-cryptographic 64-bit hash of the RouteHint.
33321 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
33324 * Checks if two RouteHints contain equal inner contents.
33325 * This ignores pointers and is_owned flags and looks at the values in fields.
33326 * Two objects with NULL inner values will be considered "equal" here.
33328 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
33331 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
33333 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
33336 * Read a RouteHint from a byte array, created by RouteHint_write
33338 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
33341 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
33343 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
33346 * The node_id of the non-target end of the route
33348 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
33351 * The node_id of the non-target end of the route
33353 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33356 * The short_channel_id of this channel
33358 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
33361 * The short_channel_id of this channel
33363 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
33366 * The fees which must be paid to use this channel
33368 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
33371 * The fees which must be paid to use this channel
33373 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
33376 * The difference in CLTV values between this node and the next node.
33378 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
33381 * The difference in CLTV values between this node and the next node.
33383 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
33386 * The minimum value, in msat, which must be relayed to the next hop.
33388 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
33391 * The minimum value, in msat, which must be relayed to the next hop.
33393 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
33396 * The maximum value in msat available for routing with a single HTLC.
33398 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
33401 * The maximum value in msat available for routing with a single HTLC.
33403 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
33406 * Constructs a new RouteHintHop given each field
33408 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);
33411 * Creates a copy of the RouteHintHop
33413 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
33416 * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
33418 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
33421 * Checks if two RouteHintHops contain equal inner contents.
33422 * This ignores pointers and is_owned flags and looks at the values in fields.
33423 * Two objects with NULL inner values will be considered "equal" here.
33425 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
33428 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
33430 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
33433 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
33435 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
33438 * Finds a route from us (payer) to the given target node (payee).
33440 * If the payee provided features in their invoice, they should be provided via `params.payee`.
33441 * Without this, MPP will only be used if the payee's features are available in the network graph.
33443 * Private routing paths between a public node and the target may be included in `params.payee`.
33445 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
33446 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
33447 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
33449 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
33450 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
33451 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
33455 * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
33456 * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
33461 * Panics if first_hops contains channels without short_channel_ids;
33462 * [`ChannelManager::list_usable_channels`] will never include such channels.
33464 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
33465 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
33466 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
33468 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
33470 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]);
33473 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
33474 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
33476 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
33478 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]);
33481 * Calls the free function if one is set
33483 void Score_free(struct LDKScore this_ptr);
33486 * Calls the free function if one is set
33488 void LockableScore_free(struct LDKLockableScore this_ptr);
33491 * Calls the free function if one is set
33493 void WriteableScore_free(struct LDKWriteableScore this_ptr);
33496 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
33498 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
33501 * Frees any resources used by the MultiThreadedScoreLock, if is_owned is set and inner is non-NULL.
33503 void MultiThreadedScoreLock_free(struct LDKMultiThreadedScoreLock this_obj);
33506 * Constructs a new Score which calls the relevant methods on this_arg.
33507 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
33509 struct LDKScore MultiThreadedScoreLock_as_Score(const struct LDKMultiThreadedScoreLock *NONNULL_PTR this_arg);
33512 * Serialize the MultiThreadedScoreLock object into a byte array which can be read by MultiThreadedScoreLock_read
33514 struct LDKCVec_u8Z MultiThreadedScoreLock_write(const struct LDKMultiThreadedScoreLock *NONNULL_PTR obj);
33517 * Constructs a new LockableScore which calls the relevant methods on this_arg.
33518 * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
33520 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
33523 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
33525 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
33528 * Constructs a new WriteableScore which calls the relevant methods on this_arg.
33529 * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
33531 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
33534 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
33536 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
33539 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
33541 void ChannelUsage_free(struct LDKChannelUsage this_obj);
33544 * The amount to send through the channel, denominated in millisatoshis.
33546 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
33549 * The amount to send through the channel, denominated in millisatoshis.
33551 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
33554 * Total amount, denominated in millisatoshis, already allocated to send through the channel
33555 * as part of a multi-path payment.
33557 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
33560 * Total amount, denominated in millisatoshis, already allocated to send through the channel
33561 * as part of a multi-path payment.
33563 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
33566 * The effective capacity of the channel.
33568 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
33571 * The effective capacity of the channel.
33573 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
33576 * Constructs a new ChannelUsage given each field
33578 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
33581 * Creates a copy of the ChannelUsage
33583 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
33586 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
33588 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
33591 * Creates a copy of the FixedPenaltyScorer
33593 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
33596 * Creates a new scorer using `penalty_msat`.
33598 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
33601 * Constructs a new Score which calls the relevant methods on this_arg.
33602 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
33604 struct LDKScore FixedPenaltyScorer_as_Score(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
33607 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
33609 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
33612 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
33614 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
33617 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
33619 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
33622 * Frees any resources used by the ProbabilisticScoringParameters, if is_owned is set and inner is non-NULL.
33624 void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj);
33627 * A fixed penalty in msats to apply to each channel.
33629 * Default value: 500 msat
33631 uint64_t ProbabilisticScoringParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
33634 * A fixed penalty in msats to apply to each channel.
33636 * Default value: 500 msat
33638 void ProbabilisticScoringParameters_set_base_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
33641 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
33642 * channel, in excess of the [`base_penalty_msat`].
33644 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
33645 * fees plus penalty) for large payments. The penalty is computed as the product of this
33646 * multiplier and `2^30`ths of the payment amount.
33648 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
33650 * Default value: 8,192 msat
33652 * [`base_penalty_msat`]: Self::base_penalty_msat
33654 uint64_t ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
33657 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
33658 * channel, in excess of the [`base_penalty_msat`].
33660 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
33661 * fees plus penalty) for large payments. The penalty is computed as the product of this
33662 * multiplier and `2^30`ths of the payment amount.
33664 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
33666 * Default value: 8,192 msat
33668 * [`base_penalty_msat`]: Self::base_penalty_msat
33670 void ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
33673 * A multiplier used in conjunction with the negative `log10` of the channel's success
33674 * probability for a payment, as determined by our latest estimates of the channel's
33675 * liquidity, to determine the liquidity penalty.
33677 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
33678 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
33679 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
33680 * lower bounding the success probability to `0.01`) when the amount falls within the
33681 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
33682 * result in a `u64::max_value` penalty, however.
33684 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
33686 * Default value: 30,000 msat
33688 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
33690 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
33693 * A multiplier used in conjunction with the negative `log10` of the channel's success
33694 * probability for a payment, as determined by our latest estimates of the channel's
33695 * liquidity, to determine the liquidity penalty.
33697 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
33698 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
33699 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
33700 * lower bounding the success probability to `0.01`) when the amount falls within the
33701 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
33702 * result in a `u64::max_value` penalty, however.
33704 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
33706 * Default value: 30,000 msat
33708 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
33710 void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
33713 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
33714 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
33715 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
33718 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
33719 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
33720 * struct documentation for more info on the way the liquidity bounds are used.
33722 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
33723 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
33724 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
33726 * Default value: 6 hours
33730 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
33731 * liquidity knowledge will never decay except when the bounds cross.
33733 uint64_t ProbabilisticScoringParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
33736 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
33737 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
33738 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
33741 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
33742 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
33743 * struct documentation for more info on the way the liquidity bounds are used.
33745 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
33746 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
33747 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
33749 * Default value: 6 hours
33753 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
33754 * liquidity knowledge will never decay except when the bounds cross.
33756 void ProbabilisticScoringParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
33759 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
33760 * channel's success probability for the payment, as determined by our latest estimates of the
33761 * channel's liquidity, to determine the amount penalty.
33763 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
33764 * fees plus penalty) for large payments. The penalty is computed as the product of this
33765 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
33766 * success probability.
33768 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
33770 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
33771 * the amount will result in a penalty of the multiplier. And, as the success probability
33772 * decreases, the negative `log10` weighting will increase dramatically. For higher success
33773 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
33776 * Default value: 192 msat
33778 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
33781 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
33782 * channel's success probability for the payment, as determined by our latest estimates of the
33783 * channel's liquidity, to determine the amount penalty.
33785 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
33786 * fees plus penalty) for large payments. The penalty is computed as the product of this
33787 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
33788 * success probability.
33790 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
33792 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
33793 * the amount will result in a penalty of the multiplier. And, as the success probability
33794 * decreases, the negative `log10` weighting will increase dramatically. For higher success
33795 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
33798 * Default value: 192 msat
33800 void ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
33803 * A multiplier used in conjunction with the negative `log10` of the channel's success
33804 * probability for the payment, as determined based on the history of our estimates of the
33805 * channel's available liquidity, to determine a penalty.
33807 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
33808 * only our latest estimate for the current liquidity available in the channel, it estimates
33809 * success probability based on the estimated liquidity available in the channel through
33810 * history. Specifically, every time we update our liquidity bounds on a given channel, we
33811 * track which of several buckets those bounds fall into, exponentially decaying the
33812 * probability of each bucket as new samples are added.
33814 * Default value: 10,000 msat
33816 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
33818 uint64_t ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
33821 * A multiplier used in conjunction with the negative `log10` of the channel's success
33822 * probability for the payment, as determined based on the history of our estimates of the
33823 * channel's available liquidity, to determine a penalty.
33825 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
33826 * only our latest estimate for the current liquidity available in the channel, it estimates
33827 * success probability based on the estimated liquidity available in the channel through
33828 * history. Specifically, every time we update our liquidity bounds on a given channel, we
33829 * track which of several buckets those bounds fall into, exponentially decaying the
33830 * probability of each bucket as new samples are added.
33832 * Default value: 10,000 msat
33834 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
33836 void ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
33839 * A multiplier used in conjunction with the payment amount and the negative `log10` of the
33840 * channel's success probability for the payment, as determined based on the history of our
33841 * estimates of the channel's available liquidity, to determine a penalty.
33843 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
33844 * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths
33845 * of the payment amount, weighted by the negative `log10` of the success probability.
33847 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
33848 * of using only our latest estimate for the current liquidity available in the channel, it
33849 * estimates success probability based on the estimated liquidity available in the channel
33850 * through history. Specifically, every time we update our liquidity bounds on a given
33851 * channel, we track which of several buckets those bounds fall into, exponentially decaying
33852 * the probability of each bucket as new samples are added.
33854 * Default value: 64 msat
33856 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
33858 uint64_t ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
33861 * A multiplier used in conjunction with the payment amount and the negative `log10` of the
33862 * channel's success probability for the payment, as determined based on the history of our
33863 * estimates of the channel's available liquidity, to determine a penalty.
33865 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
33866 * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths
33867 * of the payment amount, weighted by the negative `log10` of the success probability.
33869 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
33870 * of using only our latest estimate for the current liquidity available in the channel, it
33871 * estimates success probability based on the estimated liquidity available in the channel
33872 * through history. Specifically, every time we update our liquidity bounds on a given
33873 * channel, we track which of several buckets those bounds fall into, exponentially decaying
33874 * the probability of each bucket as new samples are added.
33876 * Default value: 64 msat
33878 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
33880 void ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
33883 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
33884 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
33885 * seen a liquidity estimate update for this amount of time, the historical datapoints are
33888 * Note that after 16 or more half lives all historical data will be completely gone.
33890 * Default value: 14 days
33892 uint64_t ProbabilisticScoringParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
33895 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
33896 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
33897 * seen a liquidity estimate update for this amount of time, the historical datapoints are
33900 * Note that after 16 or more half lives all historical data will be completely gone.
33902 * Default value: 14 days
33904 void ProbabilisticScoringParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
33907 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
33908 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
33909 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
33910 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
33912 * Default value: 250 msat
33914 uint64_t ProbabilisticScoringParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
33917 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
33918 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
33919 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
33920 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
33922 * Default value: 250 msat
33924 void ProbabilisticScoringParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
33927 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
33928 * current estimate of the channel's available liquidity.
33930 * Note that in this case all other penalties, including the
33931 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
33932 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
33933 * applicable, are still included in the overall penalty.
33935 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
33936 * `u64::max_value()` will guarantee that.
33938 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
33940 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
33941 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
33942 * [`base_penalty_msat`]: Self::base_penalty_msat
33943 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
33945 uint64_t ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
33948 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
33949 * current estimate of the channel's available liquidity.
33951 * Note that in this case all other penalties, including the
33952 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
33953 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
33954 * applicable, are still included in the overall penalty.
33956 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
33957 * `u64::max_value()` will guarantee that.
33959 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
33961 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
33962 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
33963 * [`base_penalty_msat`]: Self::base_penalty_msat
33964 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
33966 void ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
33969 * Creates a copy of the ProbabilisticScoringParameters
33971 struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig);
33974 * Creates a new scorer using the given scoring parameters for sending payments from a node
33975 * through a network graph.
33977 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
33980 * Dump the contents of this scorer into the configured logger.
33982 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
33983 * which may be a substantial amount of log output.
33985 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
33988 * Query the estimated minimum and maximum liquidity available for sending a payment over the
33989 * channel with `scid` towards the given `target` node.
33991 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);
33994 * Query the historical estimated minimum and maximum liquidity available for sending a
33995 * payment over the channel with `scid` towards the given `target` node.
33997 * Returns two sets of 8 buckets. The first set describes the octiles for lower-bound
33998 * liquidity estimates, the second set describes the octiles for upper-bound liquidity
33999 * estimates. Each bucket describes the relative frequency at which we've seen a liquidity
34000 * bound in the octile relative to the channel's total capacity, on an arbitrary scale.
34001 * Because the values are slowly decayed, more recent data points are weighted more heavily
34002 * than older datapoints.
34004 * When scoring, the estimated probability that an upper-/lower-bound lies in a given octile
34005 * relative to the channel's total capacity is calculated by dividing that bucket's value with
34006 * the total of all buckets for the given bound.
34008 * For example, a value of `[0, 0, 0, 0, 0, 0, 32]` indicates that we believe the probability
34009 * of a bound being in the top octile to be 100%, and have never (recently) seen it in any
34010 * other octiles. A value of `[31, 0, 0, 0, 0, 0, 0, 32]` indicates we've seen the bound being
34011 * both in the top and bottom octile, and roughly with similar (recent) frequency.
34013 * Because the datapoints are decayed slowly over time, values will eventually return to
34014 * `Some(([0; 8], [0; 8]))`.
34016 MUST_USE_RES struct LDKCOption_C2Tuple_EightU16sEightU16sZZ ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target);
34019 * Marks the node with the given `node_id` as banned, i.e.,
34020 * it will be avoided during path finding.
34022 void ProbabilisticScorer_add_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
34025 * Removes the node with the given `node_id` from the list of nodes to avoid.
34027 void ProbabilisticScorer_remove_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
34030 * Sets a manual penalty for the given node.
34032 void ProbabilisticScorer_set_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
34035 * Removes the node with the given `node_id` from the list of manual penalties.
34037 void ProbabilisticScorer_remove_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
34040 * Clears the list of manual penalties that are applied during path finding.
34042 void ProbabilisticScorer_clear_manual_penalties(struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
34045 * Marks all nodes in the given list as banned, i.e.,
34046 * they will be avoided during path finding.
34048 void ProbabilisticScoringParameters_add_banned_from_list(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
34051 * Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.
34053 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void);
34056 * Constructs a new Score which calls the relevant methods on this_arg.
34057 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
34059 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
34062 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
34064 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
34067 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
34069 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
34072 * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
34074 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
34077 * Frees any resources used by the Destination
34079 void Destination_free(struct LDKDestination this_ptr);
34082 * Creates a copy of the Destination
34084 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
34087 * Utility method to constructs a new Node-variant Destination
34089 struct LDKDestination Destination_node(struct LDKPublicKey a);
34092 * Utility method to constructs a new BlindedPath-variant Destination
34094 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
34097 * Frees any resources used by the SendError
34099 void SendError_free(struct LDKSendError this_ptr);
34102 * Creates a copy of the SendError
34104 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
34107 * Utility method to constructs a new Secp256k1-variant SendError
34109 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
34112 * Utility method to constructs a new TooBigPacket-variant SendError
34114 struct LDKSendError SendError_too_big_packet(void);
34117 * Utility method to constructs a new TooFewBlindedHops-variant SendError
34119 struct LDKSendError SendError_too_few_blinded_hops(void);
34122 * Utility method to constructs a new InvalidFirstHop-variant SendError
34124 struct LDKSendError SendError_invalid_first_hop(void);
34127 * Utility method to constructs a new InvalidMessage-variant SendError
34129 struct LDKSendError SendError_invalid_message(void);
34132 * Utility method to constructs a new BufferFull-variant SendError
34134 struct LDKSendError SendError_buffer_full(void);
34137 * Utility method to constructs a new GetNodeIdFailed-variant SendError
34139 struct LDKSendError SendError_get_node_id_failed(void);
34142 * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
34144 struct LDKSendError SendError_blinded_path_advance_failed(void);
34147 * Checks if two SendErrors contain equal inner contents.
34148 * This ignores pointers and is_owned flags and looks at the values in fields.
34150 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
34153 * Calls the free function if one is set
34155 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
34158 * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
34159 * their respective handlers.
34161 MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
34164 * Send an onion message with contents `message` to `destination`, routing it through `intermediate_nodes`.
34165 * See [`OnionMessenger`] for example usage.
34167 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
34169 MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKCVec_PublicKeyZ intermediate_nodes, struct LDKDestination destination, struct LDKOnionMessageContents message, struct LDKBlindedPath reply_path);
34172 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
34173 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
34175 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
34178 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
34179 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
34181 struct LDKOnionMessageProvider OnionMessenger_as_OnionMessageProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
34184 * Frees any resources used by the OnionMessageContents
34186 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
34189 * Utility method to constructs a new Custom-variant OnionMessageContents
34191 struct LDKOnionMessageContents OnionMessageContents_custom(struct LDKCustomOnionMessageContents a);
34194 * Calls the free function if one is set
34196 void CustomOnionMessageContents_free(struct LDKCustomOnionMessageContents this_ptr);
34199 * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
34201 void BlindedPath_free(struct LDKBlindedPath this_obj);
34204 * Creates a copy of the BlindedPath
34206 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
34209 * Generates a non-cryptographic 64-bit hash of the BlindedPath.
34211 uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
34214 * Checks if two BlindedPaths contain equal inner contents.
34215 * This ignores pointers and is_owned flags and looks at the values in fields.
34216 * Two objects with NULL inner values will be considered "equal" here.
34218 bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
34221 * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
34223 void BlindedHop_free(struct LDKBlindedHop this_obj);
34226 * Creates a copy of the BlindedHop
34228 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
34231 * Generates a non-cryptographic 64-bit hash of the BlindedHop.
34233 uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
34236 * Checks if two BlindedHops contain equal inner contents.
34237 * This ignores pointers and is_owned flags and looks at the values in fields.
34238 * Two objects with NULL inner values will be considered "equal" here.
34240 bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
34243 * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
34244 * pubkey in `node_pks` will be the destination node.
34246 * Errors if less than two hops are provided or if `node_pk`(s) are invalid.
34248 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, const struct LDKEntropySource *NONNULL_PTR entropy_source);
34251 * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
34253 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
34256 * Read a BlindedPath from a byte array, created by BlindedPath_write
34258 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
34261 * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
34263 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
34266 * Read a BlindedHop from a byte array, created by BlindedHop_write
34268 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
34271 * Frees any resources used by the PaymentPurpose
34273 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
34276 * Creates a copy of the PaymentPurpose
34278 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
34281 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
34283 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
34286 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
34288 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
34291 * Checks if two PaymentPurposes contain equal inner contents.
34292 * This ignores pointers and is_owned flags and looks at the values in fields.
34294 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
34297 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
34299 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
34302 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
34304 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
34307 * Frees any resources used by the PathFailure
34309 void PathFailure_free(struct LDKPathFailure this_ptr);
34312 * Creates a copy of the PathFailure
34314 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
34317 * Utility method to constructs a new InitialSend-variant PathFailure
34319 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
34322 * Utility method to constructs a new OnPath-variant PathFailure
34324 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
34327 * Checks if two PathFailures contain equal inner contents.
34328 * This ignores pointers and is_owned flags and looks at the values in fields.
34330 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
34333 * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
34335 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
34338 * Read a PathFailure from a byte array, created by PathFailure_write
34340 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
34343 * Frees any resources used by the ClosureReason
34345 void ClosureReason_free(struct LDKClosureReason this_ptr);
34348 * Creates a copy of the ClosureReason
34350 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
34353 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
34355 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
34358 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
34360 struct LDKClosureReason ClosureReason_holder_force_closed(void);
34363 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
34365 struct LDKClosureReason ClosureReason_cooperative_closure(void);
34368 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
34370 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
34373 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
34375 struct LDKClosureReason ClosureReason_funding_timed_out(void);
34378 * Utility method to constructs a new ProcessingError-variant ClosureReason
34380 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
34383 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
34385 struct LDKClosureReason ClosureReason_disconnected_peer(void);
34388 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
34390 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
34393 * Checks if two ClosureReasons contain equal inner contents.
34394 * This ignores pointers and is_owned flags and looks at the values in fields.
34396 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
34399 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
34401 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
34404 * Read a ClosureReason from a byte array, created by ClosureReason_write
34406 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
34409 * Frees any resources used by the HTLCDestination
34411 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
34414 * Creates a copy of the HTLCDestination
34416 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
34419 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
34421 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
34424 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
34426 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
34429 * Utility method to constructs a new InvalidForward-variant HTLCDestination
34431 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
34434 * Utility method to constructs a new FailedPayment-variant HTLCDestination
34436 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
34439 * Checks if two HTLCDestinations contain equal inner contents.
34440 * This ignores pointers and is_owned flags and looks at the values in fields.
34442 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
34445 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
34447 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
34450 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
34452 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
34455 * Creates a copy of the PaymentFailureReason
34457 enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
34460 * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
34462 enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
34465 * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
34467 enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
34470 * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
34472 enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
34475 * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
34477 enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
34480 * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
34482 enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
34485 * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
34487 enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
34490 * Checks if two PaymentFailureReasons contain equal inner contents.
34491 * This ignores pointers and is_owned flags and looks at the values in fields.
34493 bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
34496 * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
34498 struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
34501 * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
34503 struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
34506 * Frees any resources used by the Event
34508 void Event_free(struct LDKEvent this_ptr);
34511 * Creates a copy of the Event
34513 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
34516 * Utility method to constructs a new FundingGenerationReady-variant Event
34518 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, struct LDKU128 user_channel_id);
34521 * Utility method to constructs a new PaymentClaimable-variant Event
34523 struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields onion_fields, uint64_t amount_msat, struct LDKPaymentPurpose purpose, struct LDKThirtyTwoBytes via_channel_id, struct LDKCOption_u128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline);
34526 * Utility method to constructs a new PaymentClaimed-variant Event
34528 struct LDKEvent Event_payment_claimed(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
34531 * Utility method to constructs a new PaymentSent-variant Event
34533 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
34536 * Utility method to constructs a new PaymentFailed-variant Event
34538 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
34541 * Utility method to constructs a new PaymentPathSuccessful-variant Event
34543 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
34546 * Utility method to constructs a new PaymentPathFailed-variant Event
34548 struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool payment_failed_permanently, struct LDKPathFailure failure, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
34551 * Utility method to constructs a new ProbeSuccessful-variant Event
34553 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
34556 * Utility method to constructs a new ProbeFailed-variant Event
34558 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
34561 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
34563 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
34566 * Utility method to constructs a new HTLCIntercepted-variant Event
34568 struct LDKEvent Event_htlcintercepted(struct LDKThirtyTwoBytes intercept_id, uint64_t requested_next_hop_scid, struct LDKThirtyTwoBytes payment_hash, uint64_t inbound_amount_msat, uint64_t expected_outbound_amount_msat);
34571 * Utility method to constructs a new SpendableOutputs-variant Event
34573 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
34576 * Utility method to constructs a new PaymentForwarded-variant Event
34578 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, struct LDKCOption_u64Z outbound_amount_forwarded_msat);
34581 * Utility method to constructs a new ChannelPending-variant Event
34583 struct LDKEvent Event_channel_pending(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKThirtyTwoBytes former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo);
34586 * Utility method to constructs a new ChannelReady-variant Event
34588 struct LDKEvent Event_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
34591 * Utility method to constructs a new ChannelClosed-variant Event
34593 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason);
34596 * Utility method to constructs a new DiscardFunding-variant Event
34598 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
34601 * Utility method to constructs a new OpenChannelRequest-variant Event
34603 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);
34606 * Utility method to constructs a new HTLCHandlingFailed-variant Event
34608 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
34611 * Checks if two Events contain equal inner contents.
34612 * This ignores pointers and is_owned flags and looks at the values in fields.
34614 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
34617 * Serialize the Event object into a byte array which can be read by Event_read
34619 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
34622 * Read a Event from a byte array, created by Event_write
34624 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
34627 * Frees any resources used by the MessageSendEvent
34629 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
34632 * Creates a copy of the MessageSendEvent
34634 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
34637 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
34639 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
34642 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
34644 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
34647 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
34649 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
34652 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
34654 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
34657 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
34659 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
34662 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
34664 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
34667 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
34669 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
34672 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
34674 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
34677 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
34679 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
34682 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
34684 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
34687 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
34689 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
34692 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
34694 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
34697 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
34699 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
34702 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
34704 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
34707 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
34709 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
34712 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
34714 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
34717 * Utility method to constructs a new HandleError-variant MessageSendEvent
34719 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
34722 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
34724 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
34727 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
34729 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
34732 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
34734 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
34737 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
34739 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
34742 * Calls the free function if one is set
34744 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
34747 * Calls the free function if one is set
34749 void OnionMessageProvider_free(struct LDKOnionMessageProvider this_ptr);
34752 * Calls the free function if one is set
34754 void EventsProvider_free(struct LDKEventsProvider this_ptr);
34757 * Calls the free function if one is set
34759 void EventHandler_free(struct LDKEventHandler this_ptr);
34762 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
34764 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
34767 * Initialize a new FilesystemPersister and set the path to the individual channels'
34770 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
34773 * Get the directory which was provided when this persister was initialized.
34775 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
34778 * Read `ChannelMonitor`s from disk.
34780 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ FilesystemPersister_read_channelmonitors(const struct LDKFilesystemPersister *NONNULL_PTR this_arg, struct LDKEntropySource entropy_source, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
34783 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
34785 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
34788 * Frees any resources used by the GossipSync
34790 void GossipSync_free(struct LDKGossipSync this_ptr);
34793 * Utility method to constructs a new P2P-variant GossipSync
34795 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
34798 * Utility method to constructs a new Rapid-variant GossipSync
34800 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
34803 * Utility method to constructs a new None-variant GossipSync
34805 struct LDKGossipSync GossipSync_none(void);
34808 * Start a background thread that takes care of responsibilities enumerated in the [top-level
34811 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
34812 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
34813 * either [`join`] or [`stop`].
34815 * # Data Persistence
34817 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
34818 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
34819 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
34820 * provided implementation.
34822 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
34823 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
34824 * See the `lightning-persister` crate for LDK's provided implementation.
34826 * Typically, users should either implement [`Persister::persist_manager`] to never return an
34827 * error or call [`join`] and handle any error that may arise. For the latter case,
34828 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
34832 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
34833 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
34834 * functionality implemented by other handlers.
34835 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
34837 * # Rapid Gossip Sync
34839 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
34840 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
34841 * until the [`RapidGossipSync`] instance completes its first sync.
34843 * [top-level documentation]: BackgroundProcessor
34844 * [`join`]: Self::join
34845 * [`stop`]: Self::stop
34846 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
34847 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
34848 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
34849 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
34850 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
34851 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
34853 MUST_USE_RES struct LDKBackgroundProcessor BackgroundProcessor_start(struct LDKPersister persister, struct LDKEventHandler event_handler, const struct LDKChainMonitor *NONNULL_PTR chain_monitor, const struct LDKChannelManager *NONNULL_PTR channel_manager, struct LDKGossipSync gossip_sync, const struct LDKPeerManager *NONNULL_PTR peer_manager, struct LDKLogger logger, struct LDKCOption_WriteableScoreZ scorer);
34856 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
34857 * [`ChannelManager`].
34861 * This function panics if the background thread has panicked such as while persisting or
34864 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
34866 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
34869 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
34870 * [`ChannelManager`].
34874 * This function panics if the background thread has panicked such as while persisting or
34877 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
34879 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
34882 * Frees any resources used by the ParseError
34884 void ParseError_free(struct LDKParseError this_ptr);
34887 * Creates a copy of the ParseError
34889 struct LDKParseError ParseError_clone(const struct LDKParseError *NONNULL_PTR orig);
34892 * Utility method to constructs a new Bech32Error-variant ParseError
34894 struct LDKParseError ParseError_bech32_error(struct LDKBech32Error a);
34897 * Utility method to constructs a new ParseAmountError-variant ParseError
34899 struct LDKParseError ParseError_parse_amount_error(struct LDKError a);
34902 * Utility method to constructs a new MalformedSignature-variant ParseError
34904 struct LDKParseError ParseError_malformed_signature(enum LDKSecp256k1Error a);
34907 * Utility method to constructs a new BadPrefix-variant ParseError
34909 struct LDKParseError ParseError_bad_prefix(void);
34912 * Utility method to constructs a new UnknownCurrency-variant ParseError
34914 struct LDKParseError ParseError_unknown_currency(void);
34917 * Utility method to constructs a new UnknownSiPrefix-variant ParseError
34919 struct LDKParseError ParseError_unknown_si_prefix(void);
34922 * Utility method to constructs a new MalformedHRP-variant ParseError
34924 struct LDKParseError ParseError_malformed_hrp(void);
34927 * Utility method to constructs a new TooShortDataPart-variant ParseError
34929 struct LDKParseError ParseError_too_short_data_part(void);
34932 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant ParseError
34934 struct LDKParseError ParseError_unexpected_end_of_tagged_fields(void);
34937 * Utility method to constructs a new DescriptionDecodeError-variant ParseError
34939 struct LDKParseError ParseError_description_decode_error(struct LDKError a);
34942 * Utility method to constructs a new PaddingError-variant ParseError
34944 struct LDKParseError ParseError_padding_error(void);
34947 * Utility method to constructs a new IntegerOverflowError-variant ParseError
34949 struct LDKParseError ParseError_integer_overflow_error(void);
34952 * Utility method to constructs a new InvalidSegWitProgramLength-variant ParseError
34954 struct LDKParseError ParseError_invalid_seg_wit_program_length(void);
34957 * Utility method to constructs a new InvalidPubKeyHashLength-variant ParseError
34959 struct LDKParseError ParseError_invalid_pub_key_hash_length(void);
34962 * Utility method to constructs a new InvalidScriptHashLength-variant ParseError
34964 struct LDKParseError ParseError_invalid_script_hash_length(void);
34967 * Utility method to constructs a new InvalidRecoveryId-variant ParseError
34969 struct LDKParseError ParseError_invalid_recovery_id(void);
34972 * Utility method to constructs a new InvalidSliceLength-variant ParseError
34974 struct LDKParseError ParseError_invalid_slice_length(struct LDKStr a);
34977 * Utility method to constructs a new Skip-variant ParseError
34979 struct LDKParseError ParseError_skip(void);
34982 * Checks if two ParseErrors contain equal inner contents.
34983 * This ignores pointers and is_owned flags and looks at the values in fields.
34985 bool ParseError_eq(const struct LDKParseError *NONNULL_PTR a, const struct LDKParseError *NONNULL_PTR b);
34988 * Frees any resources used by the ParseOrSemanticError
34990 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
34993 * Creates a copy of the ParseOrSemanticError
34995 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
34998 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
35000 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKParseError a);
35003 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
35005 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKSemanticError a);
35008 * Checks if two ParseOrSemanticErrors contain equal inner contents.
35009 * This ignores pointers and is_owned flags and looks at the values in fields.
35011 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
35014 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
35016 void Invoice_free(struct LDKInvoice this_obj);
35019 * Checks if two Invoices contain equal inner contents.
35020 * This ignores pointers and is_owned flags and looks at the values in fields.
35021 * Two objects with NULL inner values will be considered "equal" here.
35023 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
35026 * Creates a copy of the Invoice
35028 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
35031 * Generates a non-cryptographic 64-bit hash of the Invoice.
35033 uint64_t Invoice_hash(const struct LDKInvoice *NONNULL_PTR o);
35036 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
35038 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
35041 * Checks if two SignedRawInvoices contain equal inner contents.
35042 * This ignores pointers and is_owned flags and looks at the values in fields.
35043 * Two objects with NULL inner values will be considered "equal" here.
35045 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
35048 * Creates a copy of the SignedRawInvoice
35050 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
35053 * Generates a non-cryptographic 64-bit hash of the SignedRawInvoice.
35055 uint64_t SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR o);
35058 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
35060 void RawInvoice_free(struct LDKRawInvoice this_obj);
35065 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
35070 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
35073 * Checks if two RawInvoices contain equal inner contents.
35074 * This ignores pointers and is_owned flags and looks at the values in fields.
35075 * Two objects with NULL inner values will be considered "equal" here.
35077 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
35080 * Creates a copy of the RawInvoice
35082 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
35085 * Generates a non-cryptographic 64-bit hash of the RawInvoice.
35087 uint64_t RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR o);
35090 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
35092 void RawDataPart_free(struct LDKRawDataPart this_obj);
35095 * generation time of the invoice
35097 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
35100 * generation time of the invoice
35102 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
35105 * Checks if two RawDataParts contain equal inner contents.
35106 * This ignores pointers and is_owned flags and looks at the values in fields.
35107 * Two objects with NULL inner values will be considered "equal" here.
35109 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
35112 * Creates a copy of the RawDataPart
35114 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
35117 * Generates a non-cryptographic 64-bit hash of the RawDataPart.
35119 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
35122 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
35124 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
35127 * Checks if two PositiveTimestamps contain equal inner contents.
35128 * This ignores pointers and is_owned flags and looks at the values in fields.
35129 * Two objects with NULL inner values will be considered "equal" here.
35131 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
35134 * Creates a copy of the PositiveTimestamp
35136 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
35139 * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp.
35141 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
35144 * Creates a copy of the SiPrefix
35146 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
35149 * Utility method to constructs a new Milli-variant SiPrefix
35151 enum LDKSiPrefix SiPrefix_milli(void);
35154 * Utility method to constructs a new Micro-variant SiPrefix
35156 enum LDKSiPrefix SiPrefix_micro(void);
35159 * Utility method to constructs a new Nano-variant SiPrefix
35161 enum LDKSiPrefix SiPrefix_nano(void);
35164 * Utility method to constructs a new Pico-variant SiPrefix
35166 enum LDKSiPrefix SiPrefix_pico(void);
35169 * Checks if two SiPrefixs contain equal inner contents.
35170 * This ignores pointers and is_owned flags and looks at the values in fields.
35172 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
35175 * Generates a non-cryptographic 64-bit hash of the SiPrefix.
35177 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
35180 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
35181 * This is effectively 10^12 * the prefix multiplier
35183 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
35186 * Creates a copy of the Currency
35188 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
35191 * Utility method to constructs a new Bitcoin-variant Currency
35193 enum LDKCurrency Currency_bitcoin(void);
35196 * Utility method to constructs a new BitcoinTestnet-variant Currency
35198 enum LDKCurrency Currency_bitcoin_testnet(void);
35201 * Utility method to constructs a new Regtest-variant Currency
35203 enum LDKCurrency Currency_regtest(void);
35206 * Utility method to constructs a new Simnet-variant Currency
35208 enum LDKCurrency Currency_simnet(void);
35211 * Utility method to constructs a new Signet-variant Currency
35213 enum LDKCurrency Currency_signet(void);
35216 * Generates a non-cryptographic 64-bit hash of the Currency.
35218 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
35221 * Checks if two Currencys contain equal inner contents.
35222 * This ignores pointers and is_owned flags and looks at the values in fields.
35224 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
35227 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
35229 void Sha256_free(struct LDKSha256 this_obj);
35232 * Creates a copy of the Sha256
35234 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
35237 * Generates a non-cryptographic 64-bit hash of the Sha256.
35239 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
35242 * Checks if two Sha256s contain equal inner contents.
35243 * This ignores pointers and is_owned flags and looks at the values in fields.
35244 * Two objects with NULL inner values will be considered "equal" here.
35246 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
35249 * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a
35250 * single sha256 hash.
35252 MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]);
35255 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
35257 void Description_free(struct LDKDescription this_obj);
35260 * Creates a copy of the Description
35262 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
35265 * Generates a non-cryptographic 64-bit hash of the Description.
35267 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
35270 * Checks if two Descriptions contain equal inner contents.
35271 * This ignores pointers and is_owned flags and looks at the values in fields.
35272 * Two objects with NULL inner values will be considered "equal" here.
35274 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
35277 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
35279 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
35281 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
35283 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35286 * Constructs a new PayeePubKey given each field
35288 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
35291 * Creates a copy of the PayeePubKey
35293 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
35296 * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
35298 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
35301 * Checks if two PayeePubKeys contain equal inner contents.
35302 * This ignores pointers and is_owned flags and looks at the values in fields.
35303 * Two objects with NULL inner values will be considered "equal" here.
35305 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
35308 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
35310 void ExpiryTime_free(struct LDKExpiryTime this_obj);
35313 * Creates a copy of the ExpiryTime
35315 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
35318 * Generates a non-cryptographic 64-bit hash of the ExpiryTime.
35320 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
35323 * Checks if two ExpiryTimes contain equal inner contents.
35324 * This ignores pointers and is_owned flags and looks at the values in fields.
35325 * Two objects with NULL inner values will be considered "equal" here.
35327 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
35330 * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
35332 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
35334 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
35336 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
35339 * Constructs a new MinFinalCltvExpiryDelta given each field
35341 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
35344 * Creates a copy of the MinFinalCltvExpiryDelta
35346 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
35349 * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
35351 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
35354 * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
35355 * This ignores pointers and is_owned flags and looks at the values in fields.
35356 * Two objects with NULL inner values will be considered "equal" here.
35358 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
35361 * Frees any resources used by the Fallback
35363 void Fallback_free(struct LDKFallback this_ptr);
35366 * Creates a copy of the Fallback
35368 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
35371 * Utility method to constructs a new SegWitProgram-variant Fallback
35373 struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
35376 * Utility method to constructs a new PubKeyHash-variant Fallback
35378 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
35381 * Utility method to constructs a new ScriptHash-variant Fallback
35383 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
35386 * Generates a non-cryptographic 64-bit hash of the Fallback.
35388 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
35391 * Checks if two Fallbacks contain equal inner contents.
35392 * This ignores pointers and is_owned flags and looks at the values in fields.
35394 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
35397 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
35399 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
35402 * Creates a copy of the InvoiceSignature
35404 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
35407 * Generates a non-cryptographic 64-bit hash of the InvoiceSignature.
35409 uint64_t InvoiceSignature_hash(const struct LDKInvoiceSignature *NONNULL_PTR o);
35412 * Checks if two InvoiceSignatures contain equal inner contents.
35413 * This ignores pointers and is_owned flags and looks at the values in fields.
35414 * Two objects with NULL inner values will be considered "equal" here.
35416 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
35419 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
35421 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
35424 * Creates a copy of the PrivateRoute
35426 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
35429 * Generates a non-cryptographic 64-bit hash of the PrivateRoute.
35431 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
35434 * Checks if two PrivateRoutes contain equal inner contents.
35435 * This ignores pointers and is_owned flags and looks at the values in fields.
35436 * Two objects with NULL inner values will be considered "equal" here.
35438 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
35441 * Disassembles the `SignedRawInvoice` into its three parts:
35443 * 2. hash of the raw invoice
35446 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
35449 * The [`RawInvoice`] which was signed.
35451 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
35454 * The hash of the [`RawInvoice`] that was signed.
35456 MUST_USE_RES const uint8_t (*SignedRawInvoice_signable_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
35459 * Signature for the invoice.
35461 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
35464 * Recovers the public key used for signing the invoice from the recoverable signature.
35466 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
35469 * Checks if the signature is valid for the included payee public key or if none exists if it's
35470 * valid for the recovered signature (which should always be true?).
35472 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
35475 * Calculate the hash of the encoded `RawInvoice` which should be signed.
35477 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_signable_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
35481 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35483 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
35487 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35489 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
35493 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35495 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
35499 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35501 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
35505 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35507 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
35511 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35513 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawInvoice_min_final_cltv_expiry_delta(const struct LDKRawInvoice *NONNULL_PTR this_arg);
35517 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35519 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
35521 MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawInvoice_payment_metadata(const struct LDKRawInvoice *NONNULL_PTR this_arg);
35525 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35527 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
35529 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
35531 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
35533 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
35536 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
35538 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
35540 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
35543 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
35544 * the range `0..=MAX_TIMESTAMP`.
35546 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
35548 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
35550 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
35553 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
35554 * `0..=MAX_TIMESTAMP`.
35556 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
35558 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
35560 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
35563 * Returns the Unix timestamp representing the stored time
35565 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
35568 * Returns the duration of the stored time since the Unix epoch
35570 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
35573 * Returns the [`SystemTime`] representing the stored time
35575 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
35578 * The hash of the [`RawInvoice`] that was signed.
35580 MUST_USE_RES struct LDKThirtyTwoBytes Invoice_signable_hash(const struct LDKInvoice *NONNULL_PTR this_arg);
35583 * Transform the `Invoice` into it's unchecked version
35585 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
35588 * Check that the invoice is signed correctly and that key recovery works
35590 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
35593 * Constructs an `Invoice` from a [`SignedRawInvoice`] by checking all its invariants.
35595 * use lightning_invoice::*;
35597 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
35598 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
35599 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
35600 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
35601 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
35602 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
35603 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
35604 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
35605 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
35606 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
35607 * j5r6drg6k6zcqj0fcwg\";
35609 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
35611 * assert!(Invoice::from_signed(signed).is_ok());
35614 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
35617 * Returns the `Invoice`'s timestamp (should equal its creation time)
35619 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
35622 * Returns the `Invoice`'s timestamp as a duration since the Unix epoch
35624 MUST_USE_RES uint64_t Invoice_duration_since_epoch(const struct LDKInvoice *NONNULL_PTR this_arg);
35627 * Returns the hash to which we will receive the preimage on completion of the payment
35629 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
35632 * Get the payee's public key if one was included in the invoice
35634 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35636 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
35639 * Get the payment secret if one was included in the invoice
35641 MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
35644 * Get the payment metadata blob if one was included in the invoice
35646 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Invoice_payment_metadata(const struct LDKInvoice *NONNULL_PTR this_arg);
35649 * Get the invoice features if they were included in the invoice
35651 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35653 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
35656 * Recover the payee's public key (only to be used if none was included in the invoice)
35658 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
35661 * Returns the Duration since the Unix epoch at which the invoice expires.
35662 * Returning None if overflow occurred.
35664 MUST_USE_RES struct LDKCOption_DurationZ Invoice_expires_at(const struct LDKInvoice *NONNULL_PTR this_arg);
35667 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
35669 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
35672 * Returns whether the invoice has expired.
35674 MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
35677 * Returns the Duration remaining until the invoice expires.
35679 MUST_USE_RES uint64_t Invoice_duration_until_expiry(const struct LDKInvoice *NONNULL_PTR this_arg);
35682 * Returns the Duration remaining until the invoice expires given the current time.
35683 * `time` is the timestamp as a duration since the Unix epoch.
35685 MUST_USE_RES uint64_t Invoice_expiration_remaining_from_epoch(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t time);
35688 * Returns whether the expiry time would pass at the given point in time.
35689 * `at_time` is the timestamp as a duration since the Unix epoch.
35691 MUST_USE_RES bool Invoice_would_expire(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t at_time);
35694 * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
35695 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
35697 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry_delta(const struct LDKInvoice *NONNULL_PTR this_arg);
35700 * Returns a list of all fallback addresses as [`Address`]es
35702 MUST_USE_RES struct LDKCVec_AddressZ Invoice_fallback_addresses(const struct LDKInvoice *NONNULL_PTR this_arg);
35705 * Returns a list of all routes included in the invoice
35707 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
35710 * Returns a list of all routes included in the invoice as the underlying hints
35712 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
35715 * Returns the currency for which the invoice was issued
35717 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
35720 * Returns the amount if specified in the invoice as millisatoshis.
35722 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
35725 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
35726 * returns [`CreationError::DescriptionTooLong`] otherwise
35728 * Please note that single characters may use more than one byte due to UTF8 encoding.
35730 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
35733 * Returns the underlying description [`String`]
35735 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
35738 * Construct an `ExpiryTime` from seconds.
35740 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
35743 * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part.
35745 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
35748 * Returns the expiry time in seconds
35750 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
35753 * Returns a reference to the underlying [`Duration`] (=expiry time)
35755 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
35758 * Creates a new (partial) route from a list of hops
35760 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
35763 * Returns the underlying list of hops
35765 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
35768 * Creates a copy of the CreationError
35770 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
35773 * Utility method to constructs a new DescriptionTooLong-variant CreationError
35775 enum LDKCreationError CreationError_description_too_long(void);
35778 * Utility method to constructs a new RouteTooLong-variant CreationError
35780 enum LDKCreationError CreationError_route_too_long(void);
35783 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
35785 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
35788 * Utility method to constructs a new InvalidAmount-variant CreationError
35790 enum LDKCreationError CreationError_invalid_amount(void);
35793 * Utility method to constructs a new MissingRouteHints-variant CreationError
35795 enum LDKCreationError CreationError_missing_route_hints(void);
35798 * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
35800 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
35803 * Checks if two CreationErrors contain equal inner contents.
35804 * This ignores pointers and is_owned flags and looks at the values in fields.
35806 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
35809 * Get the string representation of a CreationError object
35811 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
35814 * Creates a copy of the SemanticError
35816 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
35819 * Utility method to constructs a new NoPaymentHash-variant SemanticError
35821 enum LDKSemanticError SemanticError_no_payment_hash(void);
35824 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
35826 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
35829 * Utility method to constructs a new NoDescription-variant SemanticError
35831 enum LDKSemanticError SemanticError_no_description(void);
35834 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
35836 enum LDKSemanticError SemanticError_multiple_descriptions(void);
35839 * Utility method to constructs a new NoPaymentSecret-variant SemanticError
35841 enum LDKSemanticError SemanticError_no_payment_secret(void);
35844 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
35846 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
35849 * Utility method to constructs a new InvalidFeatures-variant SemanticError
35851 enum LDKSemanticError SemanticError_invalid_features(void);
35854 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
35856 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
35859 * Utility method to constructs a new InvalidSignature-variant SemanticError
35861 enum LDKSemanticError SemanticError_invalid_signature(void);
35864 * Utility method to constructs a new ImpreciseAmount-variant SemanticError
35866 enum LDKSemanticError SemanticError_imprecise_amount(void);
35869 * Checks if two SemanticErrors contain equal inner contents.
35870 * This ignores pointers and is_owned flags and looks at the values in fields.
35872 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
35875 * Get the string representation of a SemanticError object
35877 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
35880 * Frees any resources used by the SignOrCreationError
35882 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
35885 * Creates a copy of the SignOrCreationError
35887 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
35890 * Utility method to constructs a new SignError-variant SignOrCreationError
35892 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
35895 * Utility method to constructs a new CreationError-variant SignOrCreationError
35897 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
35900 * Checks if two SignOrCreationErrors contain equal inner contents.
35901 * This ignores pointers and is_owned flags and looks at the values in fields.
35903 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
35906 * Get the string representation of a SignOrCreationError object
35908 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
35911 * Pays the given [`Invoice`], retrying if needed based on [`Retry`].
35913 * [`Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
35914 * as the payment is still pending. Once the payment completes or fails, you must ensure that
35915 * a second payment with the same [`PaymentHash`] is never sent.
35917 * If you wish to use a different payment idempotency token, see [`pay_invoice_with_id`].
35919 struct LDKCResult_PaymentIdPaymentErrorZ pay_invoice(const struct LDKInvoice *NONNULL_PTR invoice, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
35922 * Pays the given [`Invoice`] with a custom idempotency key, retrying if needed based on [`Retry`].
35924 * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
35925 * payment completes or fails, no idempotency guarantees are made.
35927 * You should ensure that the [`Invoice::payment_hash`] is unique and the same [`PaymentHash`]
35928 * has never been paid before.
35930 * See [`pay_invoice`] for a variant which uses the [`PaymentHash`] for the idempotency token.
35932 struct LDKCResult_NonePaymentErrorZ pay_invoice_with_id(const struct LDKInvoice *NONNULL_PTR invoice, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
35935 * Pays the given zero-value [`Invoice`] using the given amount, retrying if needed based on
35938 * [`Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
35939 * as the payment is still pending. Once the payment completes or fails, you must ensure that
35940 * a second payment with the same [`PaymentHash`] is never sent.
35942 * If you wish to use a different payment idempotency token, see
35943 * [`pay_zero_value_invoice_with_id`].
35945 struct LDKCResult_PaymentIdPaymentErrorZ pay_zero_value_invoice(const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
35948 * Pays the given zero-value [`Invoice`] using the given amount and custom idempotency key,
35949 * , retrying if needed based on [`Retry`].
35951 * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
35952 * payment completes or fails, no idempotency guarantees are made.
35954 * You should ensure that the [`Invoice::payment_hash`] is unique and the same [`PaymentHash`]
35955 * has never been paid before.
35957 * See [`pay_zero_value_invoice`] for a variant which uses the [`PaymentHash`] for the
35958 * idempotency token.
35960 struct LDKCResult_NonePaymentErrorZ pay_zero_value_invoice_with_id(const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
35963 * Frees any resources used by the PaymentError
35965 void PaymentError_free(struct LDKPaymentError this_ptr);
35968 * Creates a copy of the PaymentError
35970 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
35973 * Utility method to constructs a new Invoice-variant PaymentError
35975 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
35978 * Utility method to constructs a new Sending-variant PaymentError
35980 struct LDKPaymentError PaymentError_sending(enum LDKRetryableSendFailure a);
35983 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
35984 * See [`PhantomKeysManager`] for more information on phantom node payments.
35986 * `phantom_route_hints` parameter:
35987 * * Contains channel info for all nodes participating in the phantom invoice
35988 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
35989 * participating node
35990 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
35991 * updated when a channel becomes disabled or closes
35992 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
35993 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
35996 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
35997 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
35998 * If `None` is provided for `payment_hash`, then one will be created.
36000 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
36001 * in excess of the current time.
36003 * `duration_since_epoch` is the current time since epoch in seconds.
36005 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
36006 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
36007 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
36008 * confirmations during routing.
36010 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
36011 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
36014 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
36015 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
36016 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
36017 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
36018 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
36019 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
36021 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
36022 * available and the current time is supplied by the caller.
36024 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
36026 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 LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch);
36029 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
36030 * See [`PhantomKeysManager`] for more information on phantom node payments.
36032 * `phantom_route_hints` parameter:
36033 * * Contains channel info for all nodes participating in the phantom invoice
36034 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
36035 * participating node
36036 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
36037 * updated when a channel becomes disabled or closes
36038 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
36039 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
36042 * `description_hash` is a SHA-256 hash of the description text
36044 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
36045 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
36046 * If `None` is provided for `payment_hash`, then one will be created.
36048 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
36049 * in excess of the current time.
36051 * `duration_since_epoch` is the current time since epoch in seconds.
36053 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
36054 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
36057 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
36058 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
36059 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
36060 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
36061 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
36063 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
36064 * available and the current time is supplied by the caller.
36066 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
36068 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 LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u16Z min_final_cltv_expiry_delta, uint64_t duration_since_epoch);
36071 * Utility to construct an invoice. Generally, unless you want to do something like a custom
36072 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
36073 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
36074 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
36075 * that the payment secret is valid when the invoice is paid.
36077 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
36078 * in excess of the current time.
36080 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
36081 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
36082 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
36083 * confirmations during routing.
36085 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
36087 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
36090 * Utility to construct an invoice. Generally, unless you want to do something like a custom
36091 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
36092 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
36093 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
36094 * that the payment secret is valid when the invoice is paid.
36095 * Use this variant if you want to pass the `description_hash` to the invoice.
36097 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
36098 * in excess of the current time.
36100 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
36101 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
36102 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
36103 * confirmations during routing.
36105 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
36107 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
36110 * See [`create_invoice_from_channelmanager_with_description_hash`]
36111 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
36112 * available and the current time is supplied by the caller.
36114 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
36117 * See [`create_invoice_from_channelmanager`]
36118 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
36119 * available and the current time is supplied by the caller.
36121 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
36124 * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
36125 * This version allows for providing a custom [`PaymentHash`] for the invoice.
36126 * This may be useful if you're building an on-chain swap or involving another protocol where
36127 * the payment hash is also involved outside the scope of lightning.
36129 struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKNodeSigner node_signer, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u16Z min_final_cltv_expiry_delta);
36132 * Read a SiPrefix object from a string
36134 struct LDKCResult_SiPrefixParseErrorZ SiPrefix_from_str(struct LDKStr s);
36137 * Read a Invoice object from a string
36139 struct LDKCResult_InvoiceParseOrSemanticErrorZ Invoice_from_str(struct LDKStr s);
36142 * Read a SignedRawInvoice object from a string
36144 struct LDKCResult_SignedRawInvoiceParseErrorZ SignedRawInvoice_from_str(struct LDKStr s);
36147 * Get the string representation of a ParseError object
36149 struct LDKStr ParseError_to_str(const struct LDKParseError *NONNULL_PTR o);
36152 * Get the string representation of a ParseOrSemanticError object
36154 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
36157 * Get the string representation of a Invoice object
36159 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
36162 * Get the string representation of a SignedRawInvoice object
36164 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
36167 * Get the string representation of a Currency object
36169 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
36172 * Get the string representation of a SiPrefix object
36174 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
36177 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
36179 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
36182 * Instantiate a new [`RapidGossipSync`] instance.
36184 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
36187 * Update network graph from binary data.
36188 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
36190 * `update_data`: `&[u8]` binary stream that comprises the update data
36191 * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
36193 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph_no_std(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data, struct LDKCOption_u64Z current_time_unix);
36196 * Returns whether a rapid gossip sync has completed at least once.
36198 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
36201 * Frees any resources used by the GraphSyncError
36203 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
36206 * Creates a copy of the GraphSyncError
36208 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
36211 * Utility method to constructs a new DecodeError-variant GraphSyncError
36213 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
36216 * Utility method to constructs a new LightningError-variant GraphSyncError
36218 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
36220 #endif /* LDK_C_BINDINGS_H */
36222 #include "ldk_ver.h"