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(…)`](./struct.Description.html#method.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 * Specifies the recipient of an invoice.
363 * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign
366 typedef enum LDKRecipient {
368 * The invoice should be signed with the local node secret key.
372 * The invoice should be signed with the phantom node secret key. This secret key must be the
373 * same for all nodes participating in the [phantom node payment].
375 * [phantom node payment]: PhantomKeysManager
377 LDKRecipient_PhantomNode,
379 * Must be last for serialization purposes
381 LDKRecipient_Sentinel,
385 * Indicates an immediate error on [`ChannelManager::send_payment_with_retry`]. Further errors
386 * may be surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
388 * [`ChannelManager::send_payment_with_retry`]: crate::ln::channelmanager::ChannelManager::send_payment_with_retry
389 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
390 * [`Event::PaymentFailed`]: crate::util::events::Event::PaymentFailed
392 typedef enum LDKRetryableSendFailure {
394 * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
395 * that this error is *not* caused by [`Retry::Timeout`].
397 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
399 LDKRetryableSendFailure_PaymentExpired,
401 * We were unable to find a route to the destination.
403 LDKRetryableSendFailure_RouteNotFound,
405 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
406 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
408 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
409 * [`Event::PaymentSent`]: crate::util::events::Event::PaymentSent
410 * [`Event::PaymentFailed`]: crate::util::events::Event::PaymentFailed
412 LDKRetryableSendFailure_DuplicatePayment,
414 * Must be last for serialization purposes
416 LDKRetryableSendFailure_Sentinel,
417 } LDKRetryableSendFailure;
420 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
422 typedef enum LDKSecp256k1Error {
424 * Signature failed verification
426 LDKSecp256k1Error_IncorrectSignature,
428 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
430 LDKSecp256k1Error_InvalidMessage,
434 LDKSecp256k1Error_InvalidPublicKey,
438 LDKSecp256k1Error_InvalidSignature,
442 LDKSecp256k1Error_InvalidSecretKey,
446 LDKSecp256k1Error_InvalidSharedSecret,
450 LDKSecp256k1Error_InvalidRecoveryId,
452 * Invalid tweak for add_assign or mul_assign
454 LDKSecp256k1Error_InvalidTweak,
456 * Didn't pass enough memory to context creation with preallocated memory
458 LDKSecp256k1Error_NotEnoughMemory,
460 * Bad set of public keys.
462 LDKSecp256k1Error_InvalidPublicKeySum,
464 * The only valid parity values are 0 or 1.
466 LDKSecp256k1Error_InvalidParityValue,
468 * Must be last for serialization purposes
470 LDKSecp256k1Error_Sentinel,
474 * Errors that may occur when converting a `RawInvoice` to an `Invoice`. They relate to the
475 * requirements sections in BOLT #11
477 typedef enum LDKSemanticError {
479 * The invoice is missing the mandatory payment hash
481 LDKSemanticError_NoPaymentHash,
483 * The invoice has multiple payment hashes which isn't allowed
485 LDKSemanticError_MultiplePaymentHashes,
487 * No description or description hash are part of the invoice
489 LDKSemanticError_NoDescription,
491 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
493 LDKSemanticError_MultipleDescriptions,
495 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
498 LDKSemanticError_NoPaymentSecret,
500 * The invoice contains multiple payment secrets
502 LDKSemanticError_MultiplePaymentSecrets,
504 * The invoice's features are invalid
506 LDKSemanticError_InvalidFeatures,
508 * The recovery id doesn't fit the signature/pub key
510 LDKSemanticError_InvalidRecoveryId,
512 * The invoice's signature is invalid
514 LDKSemanticError_InvalidSignature,
516 * The invoice's amount was not a whole number of millisatoshis
518 LDKSemanticError_ImpreciseAmount,
520 * Must be last for serialization purposes
522 LDKSemanticError_Sentinel,
526 * SI prefixes for the human readable part
528 typedef enum LDKSiPrefix {
546 * Must be last for serialization purposes
548 LDKSiPrefix_Sentinel,
552 * An error when accessing the chain via [`UtxoLookup`].
554 typedef enum LDKUtxoLookupError {
556 * The requested chain is unknown.
558 LDKUtxoLookupError_UnknownChain,
560 * The requested transaction doesn't exist or hasn't confirmed.
562 LDKUtxoLookupError_UnknownTx,
564 * Must be last for serialization purposes
566 LDKUtxoLookupError_Sentinel,
567 } LDKUtxoLookupError;
570 * A Rust str object, ie a reference to a UTF8-valid string.
571 * This is *not* null-terminated so cannot be used directly as a C string!
573 typedef struct LDKStr {
575 * A pointer to the string's bytes, in UTF8 encoding
577 const uint8_t *chars;
579 * The number of bytes (not characters!) pointed to by `chars`
583 * Whether the data pointed to by `chars` should be freed or not.
589 * A 16-byte byte array.
591 typedef struct LDKSixteenBytes {
599 * Unsigned, 128-bit integer.
601 * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
602 * See https://github.com/rust-lang/rust/issues/54341 for more details.
604 typedef struct LDKU128 {
606 * The 128-bit integer, as 16 little-endian bytes
608 uint8_t le_bytes[16];
612 * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
614 typedef struct LDKBigEndianScalar {
616 * The bytes of the scalar value.
618 uint8_t big_endian_bytes[32];
619 } LDKBigEndianScalar;
622 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
623 * look up the corresponding function in rust-lightning's docs.
625 typedef struct LDKThirtyTwoBytes {
627 * The thirty-two bytes
633 * Represents an error returned from the bech32 library during validation of some bech32 data
635 typedef enum LDKBech32Error_Tag {
637 * String does not contain the separator character
639 LDKBech32Error_MissingSeparator,
641 * The checksum does not match the rest of the data
643 LDKBech32Error_InvalidChecksum,
645 * The data or human-readable part is too long or too short
647 LDKBech32Error_InvalidLength,
649 * Some part of the string contains an invalid character
651 LDKBech32Error_InvalidChar,
653 * Some part of the data has an invalid value
655 LDKBech32Error_InvalidData,
657 * The bit conversion failed due to a padding issue
659 LDKBech32Error_InvalidPadding,
661 * The whole string must be of one case
663 LDKBech32Error_MixedCase,
665 * Must be last for serialization purposes
667 LDKBech32Error_Sentinel,
668 } LDKBech32Error_Tag;
670 typedef struct LDKBech32Error {
671 LDKBech32Error_Tag tag;
674 uint32_t invalid_char;
677 uint8_t invalid_data;
683 * A serialized transaction, in (pointer, length) form.
685 * This type optionally owns its own memory, and thus the semantics around access change based on
686 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
687 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
688 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
689 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
690 * you would be invalid.
692 * Note that, while it may change in the future, because transactions on the Rust side are stored
693 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
694 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
695 * `data_is_owned` either set or unset at your discretion.
697 typedef struct LDKTransaction {
699 * The serialized transaction data.
701 * This is non-const for your convenience, an object passed to Rust is never written to.
705 * The length of the serialized transaction
709 * Whether the data pointed to by `data` should be freed or not.
715 * A serialized witness.
717 typedef struct LDKWitness {
719 * The serialized transaction data.
721 * This is non-const for your convenience, an object passed to Rust is never written to.
725 * The length of the serialized transaction
729 * Whether the data pointed to by `data` should be freed or not.
735 * A dynamically-allocated array of u8s of arbitrary size.
736 * This corresponds to std::vector in C++
738 typedef struct LDKCVec_u8Z {
740 * The elements in the array.
741 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
745 * The number of elements pointed to by `data`.
751 * A transaction output including a scriptPubKey and value.
752 * This type *does* own its own memory, so must be free'd appropriately.
754 typedef struct LDKTxOut {
756 * The script_pubkey in this output
758 struct LDKCVec_u8Z script_pubkey;
760 * The value, in satoshis, of this output
768 * A script pubkey for shutting down a channel as defined by [BOLT #2].
770 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
772 typedef struct MUST_USE_STRUCT LDKShutdownScript {
774 * A pointer to the opaque Rust object.
775 * Nearly everywhere, inner must be non-null, however in places where
776 * the Rust equivalent takes an Option, it may be set to null to indicate None.
778 LDKnativeShutdownScript *inner;
780 * Indicates that this is the only struct which contains the same pointer.
781 * Rust functions which take ownership of an object provided via an argument require
782 * this to be true and invalidate the object pointed to by inner.
788 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
791 typedef enum LDKAPIError_Tag {
793 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
794 * are documented, but generally indicates some precondition of a function was violated.
796 LDKAPIError_APIMisuseError,
798 * Due to a high feerate, we were unable to complete the request.
799 * For example, this may be returned if the feerate implies we cannot open a channel at the
800 * requested value, but opening a larger channel would succeed.
802 LDKAPIError_FeeRateTooHigh,
804 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
805 * too-many-hops, etc).
807 LDKAPIError_InvalidRoute,
809 * We were unable to complete the request as the Channel required to do so is unable to
810 * complete the request (or was not found). This can take many forms, including disconnected
811 * peer, channel at capacity, channel shutting down, etc.
813 LDKAPIError_ChannelUnavailable,
815 * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
816 * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
817 * monitor update is awaiting async resolution. Once it resolves the attempted action should
818 * complete automatically.
820 * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
821 * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
822 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
824 LDKAPIError_MonitorUpdateInProgress,
826 * [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
827 * with the channel counterparty as negotiated in [`InitFeatures`].
829 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
830 * a channel or cooperatively close one with this peer (and will have to force-close instead).
832 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::SignerProvider::get_shutdown_scriptpubkey
833 * [`InitFeatures`]: crate::ln::features::InitFeatures
835 LDKAPIError_IncompatibleShutdownScript,
837 * Must be last for serialization purposes
839 LDKAPIError_Sentinel,
842 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
844 * A human-readable error message
847 } LDKAPIError_LDKAPIMisuseError_Body;
849 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
851 * A human-readable error message
855 * The feerate which was too high.
858 } LDKAPIError_LDKFeeRateTooHigh_Body;
860 typedef struct LDKAPIError_LDKInvalidRoute_Body {
862 * A human-readable error message
865 } LDKAPIError_LDKInvalidRoute_Body;
867 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
869 * A human-readable error message
872 } LDKAPIError_LDKChannelUnavailable_Body;
874 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
876 * The incompatible shutdown script.
878 struct LDKShutdownScript script;
879 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
881 typedef struct MUST_USE_STRUCT LDKAPIError {
884 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
885 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
886 LDKAPIError_LDKInvalidRoute_Body invalid_route;
887 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
888 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
893 * The contents of CResult_NoneAPIErrorZ
895 typedef union LDKCResult_NoneAPIErrorZPtr {
897 * Note that this value is always NULL, as there are no contents in the OK variant
901 * A pointer to the contents in the error state.
902 * Reading from this pointer when `result_ok` is set is undefined.
904 struct LDKAPIError *err;
905 } LDKCResult_NoneAPIErrorZPtr;
908 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
909 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
910 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
912 typedef struct LDKCResult_NoneAPIErrorZ {
914 * The contents of this CResult_NoneAPIErrorZ, accessible via either
915 * `err` or `result` depending on the state of `result_ok`.
917 union LDKCResult_NoneAPIErrorZPtr contents;
919 * Whether this CResult_NoneAPIErrorZ represents a success state.
922 } LDKCResult_NoneAPIErrorZ;
925 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
926 * This corresponds to std::vector in C++
928 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
930 * The elements in the array.
931 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
933 struct LDKCResult_NoneAPIErrorZ *data;
935 * The number of elements pointed to by `data`.
938 } LDKCVec_CResult_NoneAPIErrorZZ;
941 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
942 * This corresponds to std::vector in C++
944 typedef struct LDKCVec_APIErrorZ {
946 * The elements in the array.
947 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
949 struct LDKAPIError *data;
951 * The number of elements pointed to by `data`.
957 * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
959 typedef enum LDKCOption_HTLCClaimZ_Tag {
961 * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
963 LDKCOption_HTLCClaimZ_Some,
965 * When we're in this state, this COption_HTLCClaimZ contains nothing
967 LDKCOption_HTLCClaimZ_None,
969 * Must be last for serialization purposes
971 LDKCOption_HTLCClaimZ_Sentinel,
972 } LDKCOption_HTLCClaimZ_Tag;
974 typedef struct LDKCOption_HTLCClaimZ {
975 LDKCOption_HTLCClaimZ_Tag tag;
978 enum LDKHTLCClaim some;
981 } LDKCOption_HTLCClaimZ;
984 * The contents of CResult_NoneNoneZ
986 typedef union LDKCResult_NoneNoneZPtr {
988 * Note that this value is always NULL, as there are no contents in the OK variant
992 * Note that this value is always NULL, as there are no contents in the Err variant
995 } LDKCResult_NoneNoneZPtr;
998 * A CResult_NoneNoneZ represents the result of a fallible operation,
999 * containing a () on success and a () on failure.
1000 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1002 typedef struct LDKCResult_NoneNoneZ {
1004 * The contents of this CResult_NoneNoneZ, accessible via either
1005 * `err` or `result` depending on the state of `result_ok`.
1007 union LDKCResult_NoneNoneZPtr contents;
1009 * Whether this CResult_NoneNoneZ represents a success state.
1012 } LDKCResult_NoneNoneZ;
1017 * Implements the per-commitment secret storage scheme from
1018 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
1020 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
1023 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
1025 * A pointer to the opaque Rust object.
1026 * Nearly everywhere, inner must be non-null, however in places where
1027 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1029 LDKnativeCounterpartyCommitmentSecrets *inner;
1031 * Indicates that this is the only struct which contains the same pointer.
1032 * Rust functions which take ownership of an object provided via an argument require
1033 * this to be true and invalidate the object pointed to by inner.
1036 } LDKCounterpartyCommitmentSecrets;
1039 * An error in decoding a message or struct.
1041 typedef enum LDKDecodeError_Tag {
1043 * A version byte specified something we don't know how to handle.
1045 * Includes unknown realm byte in an onion hop data packet.
1047 LDKDecodeError_UnknownVersion,
1049 * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
1051 LDKDecodeError_UnknownRequiredFeature,
1053 * Value was invalid.
1055 * For example, a byte which was supposed to be a bool was something other than a 0
1056 * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
1057 * syntactically incorrect, etc.
1059 LDKDecodeError_InvalidValue,
1061 * The buffer to be read was too short.
1063 LDKDecodeError_ShortRead,
1065 * A length descriptor in the packet didn't describe the later data correctly.
1067 LDKDecodeError_BadLengthDescriptor,
1069 * Error from [`std::io`].
1073 * The message included zlib-compressed values, which we don't support.
1075 LDKDecodeError_UnsupportedCompression,
1077 * Must be last for serialization purposes
1079 LDKDecodeError_Sentinel,
1080 } LDKDecodeError_Tag;
1082 typedef struct MUST_USE_STRUCT LDKDecodeError {
1083 LDKDecodeError_Tag tag;
1092 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
1094 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
1096 * A pointer to the contents in the success state.
1097 * Reading from this pointer when `result_ok` is not set is undefined.
1099 struct LDKCounterpartyCommitmentSecrets *result;
1101 * A pointer to the contents in the error state.
1102 * Reading from this pointer when `result_ok` is set is undefined.
1104 struct LDKDecodeError *err;
1105 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
1108 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
1109 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
1110 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1112 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
1114 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
1115 * `err` or `result` depending on the state of `result_ok`.
1117 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
1119 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
1122 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
1127 * The set of public keys which are used in the creation of one commitment transaction.
1128 * These are derived from the channel base keys and per-commitment data.
1130 * A broadcaster key is provided from potential broadcaster of the computed transaction.
1131 * A countersignatory key is coming from a protocol participant unable to broadcast the
1134 * These keys are assumed to be good, either because the code derived them from
1135 * channel basepoints via the new function, or they were obtained via
1136 * CommitmentTransaction.trust().keys() because we trusted the source of the
1137 * pre-calculated keys.
1139 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
1141 * A pointer to the opaque Rust object.
1142 * Nearly everywhere, inner must be non-null, however in places where
1143 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1145 LDKnativeTxCreationKeys *inner;
1147 * Indicates that this is the only struct which contains the same pointer.
1148 * Rust functions which take ownership of an object provided via an argument require
1149 * this to be true and invalidate the object pointed to by inner.
1152 } LDKTxCreationKeys;
1155 * The contents of CResult_TxCreationKeysDecodeErrorZ
1157 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
1159 * A pointer to the contents in the success state.
1160 * Reading from this pointer when `result_ok` is not set is undefined.
1162 struct LDKTxCreationKeys *result;
1164 * A pointer to the contents in the error state.
1165 * Reading from this pointer when `result_ok` is set is undefined.
1167 struct LDKDecodeError *err;
1168 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
1171 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
1172 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
1173 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1175 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
1177 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
1178 * `err` or `result` depending on the state of `result_ok`.
1180 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
1182 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
1185 } LDKCResult_TxCreationKeysDecodeErrorZ;
1190 * One counterparty's public keys which do not change over the life of a channel.
1192 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
1194 * A pointer to the opaque Rust object.
1195 * Nearly everywhere, inner must be non-null, however in places where
1196 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1198 LDKnativeChannelPublicKeys *inner;
1200 * Indicates that this is the only struct which contains the same pointer.
1201 * Rust functions which take ownership of an object provided via an argument require
1202 * this to be true and invalidate the object pointed to by inner.
1205 } LDKChannelPublicKeys;
1208 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
1210 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
1212 * A pointer to the contents in the success state.
1213 * Reading from this pointer when `result_ok` is not set is undefined.
1215 struct LDKChannelPublicKeys *result;
1217 * A pointer to the contents in the error state.
1218 * Reading from this pointer when `result_ok` is set is undefined.
1220 struct LDKDecodeError *err;
1221 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
1224 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
1225 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
1226 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1228 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
1230 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
1231 * `err` or `result` depending on the state of `result_ok`.
1233 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
1235 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
1238 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
1241 * An enum which can either contain a u32 or not
1243 typedef enum LDKCOption_u32Z_Tag {
1245 * When we're in this state, this COption_u32Z contains a u32
1247 LDKCOption_u32Z_Some,
1249 * When we're in this state, this COption_u32Z contains nothing
1251 LDKCOption_u32Z_None,
1253 * Must be last for serialization purposes
1255 LDKCOption_u32Z_Sentinel,
1256 } LDKCOption_u32Z_Tag;
1258 typedef struct LDKCOption_u32Z {
1259 LDKCOption_u32Z_Tag tag;
1270 * Information about an HTLC as it appears in a commitment transaction
1272 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
1274 * A pointer to the opaque Rust object.
1275 * Nearly everywhere, inner must be non-null, however in places where
1276 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1278 LDKnativeHTLCOutputInCommitment *inner;
1280 * Indicates that this is the only struct which contains the same pointer.
1281 * Rust functions which take ownership of an object provided via an argument require
1282 * this to be true and invalidate the object pointed to by inner.
1285 } LDKHTLCOutputInCommitment;
1288 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
1290 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
1292 * A pointer to the contents in the success state.
1293 * Reading from this pointer when `result_ok` is not set is undefined.
1295 struct LDKHTLCOutputInCommitment *result;
1297 * A pointer to the contents in the error state.
1298 * Reading from this pointer when `result_ok` is set is undefined.
1300 struct LDKDecodeError *err;
1301 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
1304 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
1305 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
1306 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1308 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
1310 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
1311 * `err` or `result` depending on the state of `result_ok`.
1313 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
1315 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
1318 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
1323 * Late-bound per-channel counterparty data used to build transactions.
1325 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
1327 * A pointer to the opaque Rust object.
1328 * Nearly everywhere, inner must be non-null, however in places where
1329 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1331 LDKnativeCounterpartyChannelTransactionParameters *inner;
1333 * Indicates that this is the only struct which contains the same pointer.
1334 * Rust functions which take ownership of an object provided via an argument require
1335 * this to be true and invalidate the object pointed to by inner.
1338 } LDKCounterpartyChannelTransactionParameters;
1341 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
1343 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
1345 * A pointer to the contents in the success state.
1346 * Reading from this pointer when `result_ok` is not set is undefined.
1348 struct LDKCounterpartyChannelTransactionParameters *result;
1350 * A pointer to the contents in the error state.
1351 * Reading from this pointer when `result_ok` is set is undefined.
1353 struct LDKDecodeError *err;
1354 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
1357 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1358 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1359 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1361 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
1363 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
1364 * `err` or `result` depending on the state of `result_ok`.
1366 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
1368 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
1371 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
1376 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
1377 * The fields are organized by holder/counterparty.
1379 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
1380 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
1382 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
1384 * A pointer to the opaque Rust object.
1385 * Nearly everywhere, inner must be non-null, however in places where
1386 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1388 LDKnativeChannelTransactionParameters *inner;
1390 * Indicates that this is the only struct which contains the same pointer.
1391 * Rust functions which take ownership of an object provided via an argument require
1392 * this to be true and invalidate the object pointed to by inner.
1395 } LDKChannelTransactionParameters;
1398 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
1400 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
1402 * A pointer to the contents in the success state.
1403 * Reading from this pointer when `result_ok` is not set is undefined.
1405 struct LDKChannelTransactionParameters *result;
1407 * A pointer to the contents in the error state.
1408 * Reading from this pointer when `result_ok` is set is undefined.
1410 struct LDKDecodeError *err;
1411 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
1414 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
1415 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
1416 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1418 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
1420 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
1421 * `err` or `result` depending on the state of `result_ok`.
1423 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
1425 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
1428 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
1431 * Represents a secp256k1 signature serialized as two 32-byte numbers
1433 typedef struct LDKSignature {
1435 * The bytes of the signature in "compact" form
1437 uint8_t compact_form[64];
1441 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
1442 * This corresponds to std::vector in C++
1444 typedef struct LDKCVec_SignatureZ {
1446 * The elements in the array.
1447 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1449 struct LDKSignature *data;
1451 * The number of elements pointed to by `data`.
1454 } LDKCVec_SignatureZ;
1459 * Information needed to build and sign a holder's commitment transaction.
1461 * The transaction is only signed once we are ready to broadcast.
1463 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
1465 * A pointer to the opaque Rust object.
1466 * Nearly everywhere, inner must be non-null, however in places where
1467 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1469 LDKnativeHolderCommitmentTransaction *inner;
1471 * Indicates that this is the only struct which contains the same pointer.
1472 * Rust functions which take ownership of an object provided via an argument require
1473 * this to be true and invalidate the object pointed to by inner.
1476 } LDKHolderCommitmentTransaction;
1479 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
1481 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
1483 * A pointer to the contents in the success state.
1484 * Reading from this pointer when `result_ok` is not set is undefined.
1486 struct LDKHolderCommitmentTransaction *result;
1488 * A pointer to the contents in the error state.
1489 * Reading from this pointer when `result_ok` is set is undefined.
1491 struct LDKDecodeError *err;
1492 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
1495 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1496 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1497 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1499 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
1501 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
1502 * `err` or `result` depending on the state of `result_ok`.
1504 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
1506 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
1509 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
1514 * A pre-built Bitcoin commitment transaction and its txid.
1516 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
1518 * A pointer to the opaque Rust object.
1519 * Nearly everywhere, inner must be non-null, however in places where
1520 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1522 LDKnativeBuiltCommitmentTransaction *inner;
1524 * Indicates that this is the only struct which contains the same pointer.
1525 * Rust functions which take ownership of an object provided via an argument require
1526 * this to be true and invalidate the object pointed to by inner.
1529 } LDKBuiltCommitmentTransaction;
1532 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
1534 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
1536 * A pointer to the contents in the success state.
1537 * Reading from this pointer when `result_ok` is not set is undefined.
1539 struct LDKBuiltCommitmentTransaction *result;
1541 * A pointer to the contents in the error state.
1542 * Reading from this pointer when `result_ok` is set is undefined.
1544 struct LDKDecodeError *err;
1545 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
1548 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1549 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1550 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1552 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
1554 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
1555 * `err` or `result` depending on the state of `result_ok`.
1557 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
1559 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
1562 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
1567 * A wrapper on ClosingTransaction indicating that the built bitcoin
1568 * transaction is trusted.
1570 * See trust() and verify() functions on CommitmentTransaction.
1572 * This structure implements Deref.
1574 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
1576 * A pointer to the opaque Rust object.
1577 * Nearly everywhere, inner must be non-null, however in places where
1578 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1580 LDKnativeTrustedClosingTransaction *inner;
1582 * Indicates that this is the only struct which contains the same pointer.
1583 * Rust functions which take ownership of an object provided via an argument require
1584 * this to be true and invalidate the object pointed to by inner.
1587 } LDKTrustedClosingTransaction;
1590 * The contents of CResult_TrustedClosingTransactionNoneZ
1592 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
1594 * A pointer to the contents in the success state.
1595 * Reading from this pointer when `result_ok` is not set is undefined.
1597 struct LDKTrustedClosingTransaction *result;
1599 * Note that this value is always NULL, as there are no contents in the Err variant
1602 } LDKCResult_TrustedClosingTransactionNoneZPtr;
1605 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
1606 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
1607 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1609 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
1611 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
1612 * `err` or `result` depending on the state of `result_ok`.
1614 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
1616 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
1619 } LDKCResult_TrustedClosingTransactionNoneZ;
1624 * This class tracks the per-transaction information needed to build a commitment transaction and will
1625 * actually build it and sign. It is used for holder transactions that we sign only when needed
1626 * and for transactions we sign for the counterparty.
1628 * This class can be used inside a signer implementation to generate a signature given the relevant
1631 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
1633 * A pointer to the opaque Rust object.
1634 * Nearly everywhere, inner must be non-null, however in places where
1635 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1637 LDKnativeCommitmentTransaction *inner;
1639 * Indicates that this is the only struct which contains the same pointer.
1640 * Rust functions which take ownership of an object provided via an argument require
1641 * this to be true and invalidate the object pointed to by inner.
1644 } LDKCommitmentTransaction;
1647 * The contents of CResult_CommitmentTransactionDecodeErrorZ
1649 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
1651 * A pointer to the contents in the success state.
1652 * Reading from this pointer when `result_ok` is not set is undefined.
1654 struct LDKCommitmentTransaction *result;
1656 * A pointer to the contents in the error state.
1657 * Reading from this pointer when `result_ok` is set is undefined.
1659 struct LDKDecodeError *err;
1660 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
1663 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
1664 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
1665 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1667 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
1669 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
1670 * `err` or `result` depending on the state of `result_ok`.
1672 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
1674 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
1677 } LDKCResult_CommitmentTransactionDecodeErrorZ;
1682 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
1683 * transaction and the transaction creation keys) are trusted.
1685 * See trust() and verify() functions on CommitmentTransaction.
1687 * This structure implements Deref.
1689 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
1691 * A pointer to the opaque Rust object.
1692 * Nearly everywhere, inner must be non-null, however in places where
1693 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1695 LDKnativeTrustedCommitmentTransaction *inner;
1697 * Indicates that this is the only struct which contains the same pointer.
1698 * Rust functions which take ownership of an object provided via an argument require
1699 * this to be true and invalidate the object pointed to by inner.
1702 } LDKTrustedCommitmentTransaction;
1705 * The contents of CResult_TrustedCommitmentTransactionNoneZ
1707 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
1709 * A pointer to the contents in the success state.
1710 * Reading from this pointer when `result_ok` is not set is undefined.
1712 struct LDKTrustedCommitmentTransaction *result;
1714 * Note that this value is always NULL, as there are no contents in the Err variant
1717 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
1720 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
1721 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
1722 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1724 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
1726 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
1727 * `err` or `result` depending on the state of `result_ok`.
1729 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
1731 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
1734 } LDKCResult_TrustedCommitmentTransactionNoneZ;
1737 * The contents of CResult_CVec_SignatureZNoneZ
1739 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
1741 * A pointer to the contents in the success state.
1742 * Reading from this pointer when `result_ok` is not set is undefined.
1744 struct LDKCVec_SignatureZ *result;
1746 * Note that this value is always NULL, as there are no contents in the Err variant
1749 } LDKCResult_CVec_SignatureZNoneZPtr;
1752 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
1753 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
1754 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1756 typedef struct LDKCResult_CVec_SignatureZNoneZ {
1758 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
1759 * `err` or `result` depending on the state of `result_ok`.
1761 union LDKCResult_CVec_SignatureZNoneZPtr contents;
1763 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
1766 } LDKCResult_CVec_SignatureZNoneZ;
1769 * The contents of CResult_ShutdownScriptDecodeErrorZ
1771 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
1773 * A pointer to the contents in the success state.
1774 * Reading from this pointer when `result_ok` is not set is undefined.
1776 struct LDKShutdownScript *result;
1778 * A pointer to the contents in the error state.
1779 * Reading from this pointer when `result_ok` is set is undefined.
1781 struct LDKDecodeError *err;
1782 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
1785 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
1786 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
1787 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1789 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
1791 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
1792 * `err` or `result` depending on the state of `result_ok`.
1794 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
1796 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
1799 } LDKCResult_ShutdownScriptDecodeErrorZ;
1804 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
1806 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
1808 * A pointer to the opaque Rust object.
1809 * Nearly everywhere, inner must be non-null, however in places where
1810 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1812 LDKnativeInvalidShutdownScript *inner;
1814 * Indicates that this is the only struct which contains the same pointer.
1815 * Rust functions which take ownership of an object provided via an argument require
1816 * this to be true and invalidate the object pointed to by inner.
1819 } LDKInvalidShutdownScript;
1822 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
1824 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
1826 * A pointer to the contents in the success state.
1827 * Reading from this pointer when `result_ok` is not set is undefined.
1829 struct LDKShutdownScript *result;
1831 * A pointer to the contents in the error state.
1832 * Reading from this pointer when `result_ok` is set is undefined.
1834 struct LDKInvalidShutdownScript *err;
1835 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
1838 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
1839 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
1840 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1842 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
1844 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
1845 * `err` or `result` depending on the state of `result_ok`.
1847 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
1849 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
1852 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
1855 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
1857 typedef struct LDKPublicKey {
1859 * The bytes of the public key
1861 uint8_t compressed_form[33];
1865 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
1866 * This corresponds to std::vector in C++
1868 typedef struct LDKCVec_PublicKeyZ {
1870 * The elements in the array.
1871 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1873 struct LDKPublicKey *data;
1875 * The number of elements pointed to by `data`.
1878 } LDKCVec_PublicKeyZ;
1883 * Onion messages can be sent and received to blinded paths, which serve to hide the identity of
1886 typedef struct MUST_USE_STRUCT LDKBlindedPath {
1888 * A pointer to the opaque Rust object.
1889 * Nearly everywhere, inner must be non-null, however in places where
1890 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1892 LDKnativeBlindedPath *inner;
1894 * Indicates that this is the only struct which contains the same pointer.
1895 * Rust functions which take ownership of an object provided via an argument require
1896 * this to be true and invalidate the object pointed to by inner.
1902 * The contents of CResult_BlindedPathNoneZ
1904 typedef union LDKCResult_BlindedPathNoneZPtr {
1906 * A pointer to the contents in the success state.
1907 * Reading from this pointer when `result_ok` is not set is undefined.
1909 struct LDKBlindedPath *result;
1911 * Note that this value is always NULL, as there are no contents in the Err variant
1914 } LDKCResult_BlindedPathNoneZPtr;
1917 * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
1918 * containing a crate::lightning::onion_message::blinded_path::BlindedPath on success and a () on failure.
1919 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1921 typedef struct LDKCResult_BlindedPathNoneZ {
1923 * The contents of this CResult_BlindedPathNoneZ, accessible via either
1924 * `err` or `result` depending on the state of `result_ok`.
1926 union LDKCResult_BlindedPathNoneZPtr contents;
1928 * Whether this CResult_BlindedPathNoneZ represents a success state.
1931 } LDKCResult_BlindedPathNoneZ;
1934 * The contents of CResult_BlindedPathDecodeErrorZ
1936 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
1938 * A pointer to the contents in the success state.
1939 * Reading from this pointer when `result_ok` is not set is undefined.
1941 struct LDKBlindedPath *result;
1943 * A pointer to the contents in the error state.
1944 * Reading from this pointer when `result_ok` is set is undefined.
1946 struct LDKDecodeError *err;
1947 } LDKCResult_BlindedPathDecodeErrorZPtr;
1950 * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
1951 * containing a crate::lightning::onion_message::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
1952 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1954 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
1956 * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
1957 * `err` or `result` depending on the state of `result_ok`.
1959 union LDKCResult_BlindedPathDecodeErrorZPtr contents;
1961 * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
1964 } LDKCResult_BlindedPathDecodeErrorZ;
1969 * Used to construct the blinded hops portion of a blinded path. These hops cannot be identified
1970 * by outside observers and thus can be used to hide the identity of the recipient.
1972 typedef struct MUST_USE_STRUCT LDKBlindedHop {
1974 * A pointer to the opaque Rust object.
1975 * Nearly everywhere, inner must be non-null, however in places where
1976 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1978 LDKnativeBlindedHop *inner;
1980 * Indicates that this is the only struct which contains the same pointer.
1981 * Rust functions which take ownership of an object provided via an argument require
1982 * this to be true and invalidate the object pointed to by inner.
1988 * The contents of CResult_BlindedHopDecodeErrorZ
1990 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
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 LDKBlindedHop *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_BlindedHopDecodeErrorZPtr;
2004 * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
2005 * containing a crate::lightning::onion_message::blinded_path::BlindedHop 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_BlindedHopDecodeErrorZ {
2010 * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
2011 * `err` or `result` depending on the state of `result_ok`.
2013 union LDKCResult_BlindedHopDecodeErrorZPtr contents;
2015 * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
2018 } LDKCResult_BlindedHopDecodeErrorZ;
2023 * Represents the compressed public key of a node
2025 typedef struct MUST_USE_STRUCT LDKNodeId {
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 LDKnativeNodeId *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.
2043 * Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`].
2045 typedef struct MUST_USE_STRUCT LDKChannelUsage {
2047 * A pointer to the opaque Rust object.
2048 * Nearly everywhere, inner must be non-null, however in places where
2049 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2051 LDKnativeChannelUsage *inner;
2053 * Indicates that this is the only struct which contains the same pointer.
2054 * Rust functions which take ownership of an object provided via an argument require
2055 * this to be true and invalidate the object pointed to by inner.
2065 typedef struct MUST_USE_STRUCT LDKRouteHop {
2067 * A pointer to the opaque Rust object.
2068 * Nearly everywhere, inner must be non-null, however in places where
2069 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2071 LDKnativeRouteHop *inner;
2073 * Indicates that this is the only struct which contains the same pointer.
2074 * Rust functions which take ownership of an object provided via an argument require
2075 * this to be true and invalidate the object pointed to by inner.
2081 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
2082 * This corresponds to std::vector in C++
2084 typedef struct LDKCVec_RouteHopZ {
2086 * The elements in the array.
2087 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2089 struct LDKRouteHop *data;
2091 * The number of elements pointed to by `data`.
2094 } LDKCVec_RouteHopZ;
2097 * An interface used to score payment channels for path finding.
2099 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
2101 typedef struct LDKScore {
2103 * An opaque pointer which is passed to your function implementations as an argument.
2104 * This has no meaning in the LDK, and can be NULL or any other value.
2108 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
2109 * given channel in the direction from `source` to `target`.
2111 * The channel's capacity (less any other MPP parts that are also being considered for use in
2112 * the same payment) is given by `capacity_msat`. It may be determined from various sources
2113 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
2114 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
2115 * Thus, implementations should be overflow-safe.
2117 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);
2119 * Handles updating channel penalties after failing to route through a channel.
2121 void (*payment_path_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
2123 * Handles updating channel penalties after successfully routing along a path.
2125 void (*payment_path_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
2127 * Handles updating channel penalties after a probe over the given path failed.
2129 void (*probe_failed)(void *this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id);
2131 * Handles updating channel penalties after a probe over the given path succeeded.
2133 void (*probe_successful)(void *this_arg, struct LDKCVec_RouteHopZ path);
2135 * Serialize the object into a byte array
2137 struct LDKCVec_u8Z (*write)(const void *this_arg);
2139 * Frees any resources associated with this object given its this_arg pointer.
2140 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2142 void (*free)(void *this_arg);
2146 * A scorer that is accessed under a lock.
2148 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
2149 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
2150 * implementations. Internal locking would be detrimental to route finding performance and could
2151 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
2153 * [`find_route`]: crate::routing::router::find_route
2155 typedef struct LDKLockableScore {
2157 * An opaque pointer which is passed to your function implementations as an argument.
2158 * This has no meaning in the LDK, and can be NULL or any other value.
2162 * Returns the locked scorer.
2164 struct LDKScore (*lock)(const void *this_arg);
2166 * Frees any resources associated with this object given its this_arg pointer.
2167 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2169 void (*free)(void *this_arg);
2173 * Refers to a scorer that is accessible under lock and also writeable to disk
2175 * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
2176 * use the Persister to persist it.
2178 typedef struct LDKWriteableScore {
2180 * An opaque pointer which is passed to your function implementations as an argument.
2181 * This has no meaning in the LDK, and can be NULL or any other value.
2185 * Implementation of LockableScore for this object.
2187 struct LDKLockableScore LockableScore;
2189 * Serialize the object into a byte array
2191 struct LDKCVec_u8Z (*write)(const void *this_arg);
2193 * Frees any resources associated with this object given its this_arg pointer.
2194 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2196 void (*free)(void *this_arg);
2197 } LDKWriteableScore;
2200 * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
2202 typedef enum LDKCOption_WriteableScoreZ_Tag {
2204 * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
2206 LDKCOption_WriteableScoreZ_Some,
2208 * When we're in this state, this COption_WriteableScoreZ contains nothing
2210 LDKCOption_WriteableScoreZ_None,
2212 * Must be last for serialization purposes
2214 LDKCOption_WriteableScoreZ_Sentinel,
2215 } LDKCOption_WriteableScoreZ_Tag;
2217 typedef struct LDKCOption_WriteableScoreZ {
2218 LDKCOption_WriteableScoreZ_Tag tag;
2221 struct LDKWriteableScore some;
2224 } LDKCOption_WriteableScoreZ;
2227 * The contents of CResult_NoneErrorZ
2229 typedef union LDKCResult_NoneErrorZPtr {
2231 * Note that this value is always NULL, as there are no contents in the OK variant
2235 * A pointer to the contents in the error state.
2236 * Reading from this pointer when `result_ok` is set is undefined.
2238 enum LDKIOError *err;
2239 } LDKCResult_NoneErrorZPtr;
2242 * A CResult_NoneErrorZ represents the result of a fallible operation,
2243 * containing a () on success and a crate::c_types::IOError on failure.
2244 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2246 typedef struct LDKCResult_NoneErrorZ {
2248 * The contents of this CResult_NoneErrorZ, accessible via either
2249 * `err` or `result` depending on the state of `result_ok`.
2251 union LDKCResult_NoneErrorZPtr contents;
2253 * Whether this CResult_NoneErrorZ represents a success state.
2256 } LDKCResult_NoneErrorZ;
2261 * Details of a channel, as returned by ChannelManager::list_channels and ChannelManager::list_usable_channels
2263 typedef struct MUST_USE_STRUCT LDKChannelDetails {
2265 * A pointer to the opaque Rust object.
2266 * Nearly everywhere, inner must be non-null, however in places where
2267 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2269 LDKnativeChannelDetails *inner;
2271 * Indicates that this is the only struct which contains the same pointer.
2272 * Rust functions which take ownership of an object provided via an argument require
2273 * this to be true and invalidate the object pointed to by inner.
2276 } LDKChannelDetails;
2279 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
2280 * This corresponds to std::vector in C++
2282 typedef struct LDKCVec_ChannelDetailsZ {
2284 * The elements in the array.
2285 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2287 struct LDKChannelDetails *data;
2289 * The number of elements pointed to by `data`.
2292 } LDKCVec_ChannelDetailsZ;
2297 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
2298 * it can take multiple paths. Each path is composed of one or more hops through the network.
2300 typedef struct MUST_USE_STRUCT LDKRoute {
2302 * A pointer to the opaque Rust object.
2303 * Nearly everywhere, inner must be non-null, however in places where
2304 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2306 LDKnativeRoute *inner;
2308 * Indicates that this is the only struct which contains the same pointer.
2309 * Rust functions which take ownership of an object provided via an argument require
2310 * this to be true and invalidate the object pointed to by inner.
2318 * An Err type for failure to process messages.
2320 typedef struct MUST_USE_STRUCT LDKLightningError {
2322 * A pointer to the opaque Rust object.
2323 * Nearly everywhere, inner must be non-null, however in places where
2324 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2326 LDKnativeLightningError *inner;
2328 * Indicates that this is the only struct which contains the same pointer.
2329 * Rust functions which take ownership of an object provided via an argument require
2330 * this to be true and invalidate the object pointed to by inner.
2333 } LDKLightningError;
2336 * The contents of CResult_RouteLightningErrorZ
2338 typedef union LDKCResult_RouteLightningErrorZPtr {
2340 * A pointer to the contents in the success state.
2341 * Reading from this pointer when `result_ok` is not set is undefined.
2343 struct LDKRoute *result;
2345 * A pointer to the contents in the error state.
2346 * Reading from this pointer when `result_ok` is set is undefined.
2348 struct LDKLightningError *err;
2349 } LDKCResult_RouteLightningErrorZPtr;
2352 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
2353 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
2354 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2356 typedef struct LDKCResult_RouteLightningErrorZ {
2358 * The contents of this CResult_RouteLightningErrorZ, accessible via either
2359 * `err` or `result` depending on the state of `result_ok`.
2361 union LDKCResult_RouteLightningErrorZPtr contents;
2363 * Whether this CResult_RouteLightningErrorZ represents a success state.
2366 } LDKCResult_RouteLightningErrorZ;
2369 * An enum which can either contain a u64 or not
2371 typedef enum LDKCOption_u64Z_Tag {
2373 * When we're in this state, this COption_u64Z contains a u64
2375 LDKCOption_u64Z_Some,
2377 * When we're in this state, this COption_u64Z contains nothing
2379 LDKCOption_u64Z_None,
2381 * Must be last for serialization purposes
2383 LDKCOption_u64Z_Sentinel,
2384 } LDKCOption_u64Z_Tag;
2386 typedef struct LDKCOption_u64Z {
2387 LDKCOption_u64Z_Tag tag;
2398 * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
2399 * in-use channel liquidity.
2401 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
2403 * A pointer to the opaque Rust object.
2404 * Nearly everywhere, inner must be non-null, however in places where
2405 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2407 LDKnativeInFlightHtlcs *inner;
2409 * Indicates that this is the only struct which contains the same pointer.
2410 * Rust functions which take ownership of an object provided via an argument require
2411 * this to be true and invalidate the object pointed to by inner.
2417 * The contents of CResult_InFlightHtlcsDecodeErrorZ
2419 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
2421 * A pointer to the contents in the success state.
2422 * Reading from this pointer when `result_ok` is not set is undefined.
2424 struct LDKInFlightHtlcs *result;
2426 * A pointer to the contents in the error state.
2427 * Reading from this pointer when `result_ok` is set is undefined.
2429 struct LDKDecodeError *err;
2430 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
2433 * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
2434 * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
2435 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2437 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
2439 * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
2440 * `err` or `result` depending on the state of `result_ok`.
2442 union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
2444 * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
2447 } LDKCResult_InFlightHtlcsDecodeErrorZ;
2450 * The contents of CResult_RouteHopDecodeErrorZ
2452 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
2454 * A pointer to the contents in the success state.
2455 * Reading from this pointer when `result_ok` is not set is undefined.
2457 struct LDKRouteHop *result;
2459 * A pointer to the contents in the error state.
2460 * Reading from this pointer when `result_ok` is set is undefined.
2462 struct LDKDecodeError *err;
2463 } LDKCResult_RouteHopDecodeErrorZPtr;
2466 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
2467 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
2468 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2470 typedef struct LDKCResult_RouteHopDecodeErrorZ {
2472 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
2473 * `err` or `result` depending on the state of `result_ok`.
2475 union LDKCResult_RouteHopDecodeErrorZPtr contents;
2477 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
2480 } LDKCResult_RouteHopDecodeErrorZ;
2483 * A dynamically-allocated array of crate::c_types::derived::CVec_RouteHopZs of arbitrary size.
2484 * This corresponds to std::vector in C++
2486 typedef struct LDKCVec_CVec_RouteHopZZ {
2488 * The elements in the array.
2489 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2491 struct LDKCVec_RouteHopZ *data;
2493 * The number of elements pointed to by `data`.
2496 } LDKCVec_CVec_RouteHopZZ;
2499 * The contents of CResult_RouteDecodeErrorZ
2501 typedef union LDKCResult_RouteDecodeErrorZPtr {
2503 * A pointer to the contents in the success state.
2504 * Reading from this pointer when `result_ok` is not set is undefined.
2506 struct LDKRoute *result;
2508 * A pointer to the contents in the error state.
2509 * Reading from this pointer when `result_ok` is set is undefined.
2511 struct LDKDecodeError *err;
2512 } LDKCResult_RouteDecodeErrorZPtr;
2515 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
2516 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
2517 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2519 typedef struct LDKCResult_RouteDecodeErrorZ {
2521 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
2522 * `err` or `result` depending on the state of `result_ok`.
2524 union LDKCResult_RouteDecodeErrorZPtr contents;
2526 * Whether this CResult_RouteDecodeErrorZ represents a success state.
2529 } LDKCResult_RouteDecodeErrorZ;
2534 * Parameters needed to find a [`Route`].
2536 * Passed to [`find_route`] and [`build_route_from_hops`], but also provided in
2537 * [`Event::PaymentPathFailed`].
2539 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
2541 typedef struct MUST_USE_STRUCT LDKRouteParameters {
2543 * A pointer to the opaque Rust object.
2544 * Nearly everywhere, inner must be non-null, however in places where
2545 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2547 LDKnativeRouteParameters *inner;
2549 * Indicates that this is the only struct which contains the same pointer.
2550 * Rust functions which take ownership of an object provided via an argument require
2551 * this to be true and invalidate the object pointed to by inner.
2554 } LDKRouteParameters;
2557 * The contents of CResult_RouteParametersDecodeErrorZ
2559 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
2561 * A pointer to the contents in the success state.
2562 * Reading from this pointer when `result_ok` is not set is undefined.
2564 struct LDKRouteParameters *result;
2566 * A pointer to the contents in the error state.
2567 * Reading from this pointer when `result_ok` is set is undefined.
2569 struct LDKDecodeError *err;
2570 } LDKCResult_RouteParametersDecodeErrorZPtr;
2573 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
2574 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2575 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2577 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
2579 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
2580 * `err` or `result` depending on the state of `result_ok`.
2582 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
2584 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
2587 } LDKCResult_RouteParametersDecodeErrorZ;
2592 * A list of hops along a payment path terminating with a channel to the recipient.
2594 typedef struct MUST_USE_STRUCT LDKRouteHint {
2596 * A pointer to the opaque Rust object.
2597 * Nearly everywhere, inner must be non-null, however in places where
2598 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2600 LDKnativeRouteHint *inner;
2602 * Indicates that this is the only struct which contains the same pointer.
2603 * Rust functions which take ownership of an object provided via an argument require
2604 * this to be true and invalidate the object pointed to by inner.
2610 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
2611 * This corresponds to std::vector in C++
2613 typedef struct LDKCVec_RouteHintZ {
2615 * The elements in the array.
2616 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2618 struct LDKRouteHint *data;
2620 * The number of elements pointed to by `data`.
2623 } LDKCVec_RouteHintZ;
2626 * A dynamically-allocated array of u64s of arbitrary size.
2627 * This corresponds to std::vector in C++
2629 typedef struct LDKCVec_u64Z {
2631 * The elements in the array.
2632 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2636 * The number of elements pointed to by `data`.
2644 * The recipient of a payment.
2646 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
2648 * A pointer to the opaque Rust object.
2649 * Nearly everywhere, inner must be non-null, however in places where
2650 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2652 LDKnativePaymentParameters *inner;
2654 * Indicates that this is the only struct which contains the same pointer.
2655 * Rust functions which take ownership of an object provided via an argument require
2656 * this to be true and invalidate the object pointed to by inner.
2659 } LDKPaymentParameters;
2662 * The contents of CResult_PaymentParametersDecodeErrorZ
2664 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
2666 * A pointer to the contents in the success state.
2667 * Reading from this pointer when `result_ok` is not set is undefined.
2669 struct LDKPaymentParameters *result;
2671 * A pointer to the contents in the error state.
2672 * Reading from this pointer when `result_ok` is set is undefined.
2674 struct LDKDecodeError *err;
2675 } LDKCResult_PaymentParametersDecodeErrorZPtr;
2678 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
2679 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2680 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2682 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
2684 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
2685 * `err` or `result` depending on the state of `result_ok`.
2687 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
2689 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
2692 } LDKCResult_PaymentParametersDecodeErrorZ;
2697 * A channel descriptor for a hop along a payment path.
2699 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
2701 * A pointer to the opaque Rust object.
2702 * Nearly everywhere, inner must be non-null, however in places where
2703 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2705 LDKnativeRouteHintHop *inner;
2707 * Indicates that this is the only struct which contains the same pointer.
2708 * Rust functions which take ownership of an object provided via an argument require
2709 * this to be true and invalidate the object pointed to by inner.
2715 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
2716 * This corresponds to std::vector in C++
2718 typedef struct LDKCVec_RouteHintHopZ {
2720 * The elements in the array.
2721 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2723 struct LDKRouteHintHop *data;
2725 * The number of elements pointed to by `data`.
2728 } LDKCVec_RouteHintHopZ;
2731 * The contents of CResult_RouteHintDecodeErrorZ
2733 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
2735 * A pointer to the contents in the success state.
2736 * Reading from this pointer when `result_ok` is not set is undefined.
2738 struct LDKRouteHint *result;
2740 * A pointer to the contents in the error state.
2741 * Reading from this pointer when `result_ok` is set is undefined.
2743 struct LDKDecodeError *err;
2744 } LDKCResult_RouteHintDecodeErrorZPtr;
2747 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
2748 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
2749 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2751 typedef struct LDKCResult_RouteHintDecodeErrorZ {
2753 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
2754 * `err` or `result` depending on the state of `result_ok`.
2756 union LDKCResult_RouteHintDecodeErrorZPtr contents;
2758 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
2761 } LDKCResult_RouteHintDecodeErrorZ;
2764 * The contents of CResult_RouteHintHopDecodeErrorZ
2766 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
2768 * A pointer to the contents in the success state.
2769 * Reading from this pointer when `result_ok` is not set is undefined.
2771 struct LDKRouteHintHop *result;
2773 * A pointer to the contents in the error state.
2774 * Reading from this pointer when `result_ok` is set is undefined.
2776 struct LDKDecodeError *err;
2777 } LDKCResult_RouteHintHopDecodeErrorZPtr;
2780 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
2781 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
2782 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2784 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
2786 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
2787 * `err` or `result` depending on the state of `result_ok`.
2789 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
2791 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
2794 } LDKCResult_RouteHintHopDecodeErrorZ;
2797 * Some information provided on receipt of payment depends on whether the payment received is a
2798 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
2800 typedef enum LDKPaymentPurpose_Tag {
2802 * Information for receiving a payment that we generated an invoice for.
2804 LDKPaymentPurpose_InvoicePayment,
2806 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
2807 * (the payee) providing a preimage.
2809 LDKPaymentPurpose_SpontaneousPayment,
2811 * Must be last for serialization purposes
2813 LDKPaymentPurpose_Sentinel,
2814 } LDKPaymentPurpose_Tag;
2816 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
2818 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
2819 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
2820 * [`ChannelManager::claim_funds`].
2822 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2823 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
2825 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2827 struct LDKThirtyTwoBytes payment_preimage;
2829 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
2830 * number of deanonymization attacks during the routing process.
2831 * It is provided here for your reference, however its accuracy is enforced directly by
2832 * [`ChannelManager`] using the values you previously provided to
2833 * [`ChannelManager::create_inbound_payment`] or
2834 * [`ChannelManager::create_inbound_payment_for_hash`].
2836 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2837 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
2838 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
2840 struct LDKThirtyTwoBytes payment_secret;
2841 } LDKPaymentPurpose_LDKInvoicePayment_Body;
2843 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
2844 LDKPaymentPurpose_Tag tag;
2846 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
2848 struct LDKThirtyTwoBytes spontaneous_payment;
2851 } LDKPaymentPurpose;
2854 * The contents of CResult_PaymentPurposeDecodeErrorZ
2856 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
2858 * A pointer to the contents in the success state.
2859 * Reading from this pointer when `result_ok` is not set is undefined.
2861 struct LDKPaymentPurpose *result;
2863 * A pointer to the contents in the error state.
2864 * Reading from this pointer when `result_ok` is set is undefined.
2866 struct LDKDecodeError *err;
2867 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
2870 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
2871 * containing a crate::lightning::util::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
2872 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2874 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
2876 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
2877 * `err` or `result` depending on the state of `result_ok`.
2879 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
2881 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
2884 } LDKCResult_PaymentPurposeDecodeErrorZ;
2889 * A [`channel_update`] message to be sent to or received from a peer.
2891 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
2893 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
2895 * A pointer to the opaque Rust object.
2896 * Nearly everywhere, inner must be non-null, however in places where
2897 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2899 LDKnativeChannelUpdate *inner;
2901 * Indicates that this is the only struct which contains the same pointer.
2902 * Rust functions which take ownership of an object provided via an argument require
2903 * this to be true and invalidate the object pointed to by inner.
2909 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
2910 * return packet by a node along the route. See [BOLT #4] for details.
2912 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
2914 typedef enum LDKNetworkUpdate_Tag {
2916 * An error indicating a `channel_update` messages should be applied via
2917 * [`NetworkGraph::update_channel`].
2919 LDKNetworkUpdate_ChannelUpdateMessage,
2921 * An error indicating that a channel failed to route a payment, which should be applied via
2922 * [`NetworkGraph::channel_failed`].
2924 LDKNetworkUpdate_ChannelFailure,
2926 * An error indicating that a node failed to route a payment, which should be applied via
2927 * [`NetworkGraph::node_failed_permanent`] if permanent.
2929 LDKNetworkUpdate_NodeFailure,
2931 * Must be last for serialization purposes
2933 LDKNetworkUpdate_Sentinel,
2934 } LDKNetworkUpdate_Tag;
2936 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
2938 * The update to apply via [`NetworkGraph::update_channel`].
2940 struct LDKChannelUpdate msg;
2941 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
2943 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
2945 * The short channel id of the closed channel.
2947 uint64_t short_channel_id;
2949 * Whether the channel should be permanently removed or temporarily disabled until a new
2950 * `channel_update` message is received.
2953 } LDKNetworkUpdate_LDKChannelFailure_Body;
2955 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
2957 * The node id of the failed node.
2959 struct LDKPublicKey node_id;
2961 * Whether the node should be permanently removed from consideration or can be restored
2962 * when a new `channel_update` message is received.
2965 } LDKNetworkUpdate_LDKNodeFailure_Body;
2967 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
2968 LDKNetworkUpdate_Tag tag;
2970 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
2971 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
2972 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
2977 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
2979 typedef enum LDKCOption_NetworkUpdateZ_Tag {
2981 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
2983 LDKCOption_NetworkUpdateZ_Some,
2985 * When we're in this state, this COption_NetworkUpdateZ contains nothing
2987 LDKCOption_NetworkUpdateZ_None,
2989 * Must be last for serialization purposes
2991 LDKCOption_NetworkUpdateZ_Sentinel,
2992 } LDKCOption_NetworkUpdateZ_Tag;
2994 typedef struct LDKCOption_NetworkUpdateZ {
2995 LDKCOption_NetworkUpdateZ_Tag tag;
2998 struct LDKNetworkUpdate some;
3001 } LDKCOption_NetworkUpdateZ;
3004 * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
3005 * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
3007 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
3008 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
3010 typedef enum LDKPathFailure_Tag {
3012 * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
3015 LDKPathFailure_InitialSend,
3017 * A hop on the path failed to forward our payment.
3019 LDKPathFailure_OnPath,
3021 * Must be last for serialization purposes
3023 LDKPathFailure_Sentinel,
3024 } LDKPathFailure_Tag;
3026 typedef struct LDKPathFailure_LDKInitialSend_Body {
3028 * The error surfaced from initial send.
3030 struct LDKAPIError err;
3031 } LDKPathFailure_LDKInitialSend_Body;
3033 typedef struct LDKPathFailure_LDKOnPath_Body {
3035 * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
3036 * decisions can take into account the update.
3038 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
3039 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
3041 struct LDKCOption_NetworkUpdateZ network_update;
3042 } LDKPathFailure_LDKOnPath_Body;
3044 typedef struct MUST_USE_STRUCT LDKPathFailure {
3045 LDKPathFailure_Tag tag;
3047 LDKPathFailure_LDKInitialSend_Body initial_send;
3048 LDKPathFailure_LDKOnPath_Body on_path;
3053 * An enum which can either contain a crate::lightning::util::events::PathFailure or not
3055 typedef enum LDKCOption_PathFailureZ_Tag {
3057 * When we're in this state, this COption_PathFailureZ contains a crate::lightning::util::events::PathFailure
3059 LDKCOption_PathFailureZ_Some,
3061 * When we're in this state, this COption_PathFailureZ contains nothing
3063 LDKCOption_PathFailureZ_None,
3065 * Must be last for serialization purposes
3067 LDKCOption_PathFailureZ_Sentinel,
3068 } LDKCOption_PathFailureZ_Tag;
3070 typedef struct LDKCOption_PathFailureZ {
3071 LDKCOption_PathFailureZ_Tag tag;
3074 struct LDKPathFailure some;
3077 } LDKCOption_PathFailureZ;
3080 * The contents of CResult_COption_PathFailureZDecodeErrorZ
3082 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
3084 * A pointer to the contents in the success state.
3085 * Reading from this pointer when `result_ok` is not set is undefined.
3087 struct LDKCOption_PathFailureZ *result;
3089 * A pointer to the contents in the error state.
3090 * Reading from this pointer when `result_ok` is set is undefined.
3092 struct LDKDecodeError *err;
3093 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
3096 * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
3097 * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3098 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3100 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
3102 * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
3103 * `err` or `result` depending on the state of `result_ok`.
3105 union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
3107 * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
3110 } LDKCResult_COption_PathFailureZDecodeErrorZ;
3113 * The reason the channel was closed. See individual variants more details.
3115 typedef enum LDKClosureReason_Tag {
3117 * Closure generated from receiving a peer error message.
3119 * Our counterparty may have broadcasted their latest commitment state, and we have
3122 LDKClosureReason_CounterpartyForceClosed,
3124 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
3126 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
3128 LDKClosureReason_HolderForceClosed,
3130 * The channel was closed after negotiating a cooperative close and we've now broadcasted
3131 * the cooperative close transaction. Note the shutdown may have been initiated by us.
3133 LDKClosureReason_CooperativeClosure,
3135 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
3136 * commitment transaction came from our counterparty, but it may also have come from
3137 * a copy of our own `ChannelMonitor`.
3139 LDKClosureReason_CommitmentTxConfirmed,
3141 * The funding transaction failed to confirm in a timely manner on an inbound channel.
3143 LDKClosureReason_FundingTimedOut,
3145 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
3147 LDKClosureReason_ProcessingError,
3149 * The peer disconnected prior to funding completing. In this case the spec mandates that we
3150 * forget the channel entirely - we can attempt again if the peer reconnects.
3152 * This includes cases where we restarted prior to funding completion, including prior to the
3153 * initial [`ChannelMonitor`] persistence completing.
3155 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
3156 * peer because of mutual incompatibility between us and our channel counterparty.
3158 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3160 LDKClosureReason_DisconnectedPeer,
3162 * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
3163 * the [`ChannelManager`] deserialized.
3165 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3166 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3168 LDKClosureReason_OutdatedChannelManager,
3170 * Must be last for serialization purposes
3172 LDKClosureReason_Sentinel,
3173 } LDKClosureReason_Tag;
3175 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
3177 * The error which the peer sent us.
3179 * The string should be sanitized before it is used (e.g emitted to logs
3180 * or printed to stdout). Otherwise, a well crafted error message may exploit
3181 * a security vulnerability in the terminal emulator or the logging subsystem.
3183 struct LDKStr peer_msg;
3184 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
3186 typedef struct LDKClosureReason_LDKProcessingError_Body {
3188 * A developer-readable error message which we generated.
3191 } LDKClosureReason_LDKProcessingError_Body;
3193 typedef struct MUST_USE_STRUCT LDKClosureReason {
3194 LDKClosureReason_Tag tag;
3196 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
3197 LDKClosureReason_LDKProcessingError_Body processing_error;
3202 * An enum which can either contain a crate::lightning::util::events::ClosureReason or not
3204 typedef enum LDKCOption_ClosureReasonZ_Tag {
3206 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::util::events::ClosureReason
3208 LDKCOption_ClosureReasonZ_Some,
3210 * When we're in this state, this COption_ClosureReasonZ contains nothing
3212 LDKCOption_ClosureReasonZ_None,
3214 * Must be last for serialization purposes
3216 LDKCOption_ClosureReasonZ_Sentinel,
3217 } LDKCOption_ClosureReasonZ_Tag;
3219 typedef struct LDKCOption_ClosureReasonZ {
3220 LDKCOption_ClosureReasonZ_Tag tag;
3223 struct LDKClosureReason some;
3226 } LDKCOption_ClosureReasonZ;
3229 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
3231 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
3233 * A pointer to the contents in the success state.
3234 * Reading from this pointer when `result_ok` is not set is undefined.
3236 struct LDKCOption_ClosureReasonZ *result;
3238 * A pointer to the contents in the error state.
3239 * Reading from this pointer when `result_ok` is set is undefined.
3241 struct LDKDecodeError *err;
3242 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
3245 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
3246 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3247 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3249 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
3251 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
3252 * `err` or `result` depending on the state of `result_ok`.
3254 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
3256 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
3259 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
3262 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
3264 typedef enum LDKHTLCDestination_Tag {
3266 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
3267 * there is insufficient capacity in our outbound channel.
3269 LDKHTLCDestination_NextHopChannel,
3271 * Scenario where we are unsure of the next node to forward the HTLC to.
3273 LDKHTLCDestination_UnknownNextHop,
3275 * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
3278 LDKHTLCDestination_InvalidForward,
3280 * Failure scenario where an HTLC may have been forwarded to be intended for us,
3281 * but is invalid for some reason, so we reject it.
3283 * Some of the reasons may include:
3285 * * Expected MPP amount to claim does not equal HTLC total
3286 * * Claimable amount does not match expected amount
3288 LDKHTLCDestination_FailedPayment,
3290 * Must be last for serialization purposes
3292 LDKHTLCDestination_Sentinel,
3293 } LDKHTLCDestination_Tag;
3295 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
3297 * The `node_id` of the next node. For backwards compatibility, this field is
3298 * marked as optional, versions prior to 0.0.110 may not always be able to provide
3299 * counterparty node information.
3301 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3303 struct LDKPublicKey node_id;
3305 * The outgoing `channel_id` between us and the next node.
3307 struct LDKThirtyTwoBytes channel_id;
3308 } LDKHTLCDestination_LDKNextHopChannel_Body;
3310 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
3312 * Short channel id we are requesting to forward an HTLC to.
3314 uint64_t requested_forward_scid;
3315 } LDKHTLCDestination_LDKUnknownNextHop_Body;
3317 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
3319 * Short channel id we are requesting to forward an HTLC to.
3321 uint64_t requested_forward_scid;
3322 } LDKHTLCDestination_LDKInvalidForward_Body;
3324 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
3326 * The payment hash of the payment we attempted to process.
3328 struct LDKThirtyTwoBytes payment_hash;
3329 } LDKHTLCDestination_LDKFailedPayment_Body;
3331 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
3332 LDKHTLCDestination_Tag tag;
3334 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
3335 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
3336 LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
3337 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
3339 } LDKHTLCDestination;
3342 * An enum which can either contain a crate::lightning::util::events::HTLCDestination or not
3344 typedef enum LDKCOption_HTLCDestinationZ_Tag {
3346 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::util::events::HTLCDestination
3348 LDKCOption_HTLCDestinationZ_Some,
3350 * When we're in this state, this COption_HTLCDestinationZ contains nothing
3352 LDKCOption_HTLCDestinationZ_None,
3354 * Must be last for serialization purposes
3356 LDKCOption_HTLCDestinationZ_Sentinel,
3357 } LDKCOption_HTLCDestinationZ_Tag;
3359 typedef struct LDKCOption_HTLCDestinationZ {
3360 LDKCOption_HTLCDestinationZ_Tag tag;
3363 struct LDKHTLCDestination some;
3366 } LDKCOption_HTLCDestinationZ;
3369 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
3371 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
3373 * A pointer to the contents in the success state.
3374 * Reading from this pointer when `result_ok` is not set is undefined.
3376 struct LDKCOption_HTLCDestinationZ *result;
3378 * A pointer to the contents in the error state.
3379 * Reading from this pointer when `result_ok` is set is undefined.
3381 struct LDKDecodeError *err;
3382 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
3385 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
3386 * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
3387 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3389 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
3391 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
3392 * `err` or `result` depending on the state of `result_ok`.
3394 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
3396 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
3399 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
3402 * An enum which can either contain a crate::c_types::U128 or not
3404 typedef enum LDKCOption_u128Z_Tag {
3406 * When we're in this state, this COption_u128Z contains a crate::c_types::U128
3408 LDKCOption_u128Z_Some,
3410 * When we're in this state, this COption_u128Z contains nothing
3412 LDKCOption_u128Z_None,
3414 * Must be last for serialization purposes
3416 LDKCOption_u128Z_Sentinel,
3417 } LDKCOption_u128Z_Tag;
3419 typedef struct LDKCOption_u128Z {
3420 LDKCOption_u128Z_Tag tag;
3423 struct LDKU128 some;
3431 * A reference to a transaction output.
3433 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
3434 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
3436 typedef struct MUST_USE_STRUCT LDKOutPoint {
3438 * A pointer to the opaque Rust object.
3439 * Nearly everywhere, inner must be non-null, however in places where
3440 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3442 LDKnativeOutPoint *inner;
3444 * Indicates that this is the only struct which contains the same pointer.
3445 * Rust functions which take ownership of an object provided via an argument require
3446 * this to be true and invalidate the object pointed to by inner.
3454 * Information about a spendable output to a P2WSH script.
3456 * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
3458 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
3460 * A pointer to the opaque Rust object.
3461 * Nearly everywhere, inner must be non-null, however in places where
3462 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3464 LDKnativeDelayedPaymentOutputDescriptor *inner;
3466 * Indicates that this is the only struct which contains the same pointer.
3467 * Rust functions which take ownership of an object provided via an argument require
3468 * this to be true and invalidate the object pointed to by inner.
3471 } LDKDelayedPaymentOutputDescriptor;
3476 * Information about a spendable output to our \"payment key\".
3478 * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
3480 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
3482 * A pointer to the opaque Rust object.
3483 * Nearly everywhere, inner must be non-null, however in places where
3484 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3486 LDKnativeStaticPaymentOutputDescriptor *inner;
3488 * Indicates that this is the only struct which contains the same pointer.
3489 * Rust functions which take ownership of an object provided via an argument require
3490 * this to be true and invalidate the object pointed to by inner.
3493 } LDKStaticPaymentOutputDescriptor;
3496 * Describes the necessary information to spend a spendable output.
3498 * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
3499 * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
3500 * to spend on-chain. The information needed to do this is provided in this enum, including the
3501 * outpoint describing which `txid` and output `index` is available, the full output which exists
3502 * at that `txid`/`index`, and any keys or other information required to sign.
3504 * [`SpendableOutputs`]: crate::util::events::Event::SpendableOutputs
3506 typedef enum LDKSpendableOutputDescriptor_Tag {
3508 * An output to a script which was provided via [`SignerProvider`] directly, either from
3509 * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
3510 * know how to spend it. No secret keys are provided as LDK was never given any key.
3511 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
3512 * on-chain using the payment preimage or after it has timed out.
3514 * [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
3515 * [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
3517 LDKSpendableOutputDescriptor_StaticOutput,
3519 * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
3522 * The witness in the spending input should be:
3524 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
3527 * Note that the `nSequence` field in the spending input must be set to
3528 * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
3529 * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
3530 * the outpoint confirms, see [BIP
3531 * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
3532 * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
3535 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
3536 * it is an output from an old state which we broadcast (which should never happen).
3538 * To derive the delayed payment key which is used to sign this input, you must pass the
3539 * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
3540 * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
3541 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The public key can be
3542 * generated without the secret key using [`chan_utils::derive_public_key`] and only the
3543 * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
3545 * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
3546 * used in the witness script generation), you must pass the counterparty
3547 * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
3548 * [`ChannelSigner::provide_channel_parameters`]) and the provided
3549 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
3550 * [`chan_utils::derive_public_revocation_key`].
3552 * The witness script which is hashed and included in the output `script_pubkey` may be
3553 * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
3554 * as explained above), our delayed payment pubkey (derived as explained above), and the
3555 * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
3556 * [`chan_utils::get_revokeable_redeemscript`].
3558 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
3560 * An output to a P2WPKH, spendable exclusively by our payment key (i.e., the private key
3561 * which corresponds to the `payment_point` in [`ChannelSigner::pubkeys`]). The witness
3562 * in the spending input is, thus, simply:
3564 * <BIP 143 signature> <payment key>
3567 * These are generally the result of our counterparty having broadcast the current state,
3568 * allowing us to claim the non-HTLC-encumbered outputs immediately.
3570 LDKSpendableOutputDescriptor_StaticPaymentOutput,
3572 * Must be last for serialization purposes
3574 LDKSpendableOutputDescriptor_Sentinel,
3575 } LDKSpendableOutputDescriptor_Tag;
3577 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
3579 * The outpoint which is spendable.
3581 struct LDKOutPoint outpoint;
3583 * The output which is referenced by the given outpoint.
3585 struct LDKTxOut output;
3586 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
3588 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
3589 LDKSpendableOutputDescriptor_Tag tag;
3591 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
3593 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
3596 struct LDKStaticPaymentOutputDescriptor static_payment_output;
3599 } LDKSpendableOutputDescriptor;
3602 * A dynamically-allocated array of crate::lightning::chain::keysinterface::SpendableOutputDescriptors of arbitrary size.
3603 * This corresponds to std::vector in C++
3605 typedef struct LDKCVec_SpendableOutputDescriptorZ {
3607 * The elements in the array.
3608 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3610 struct LDKSpendableOutputDescriptor *data;
3612 * The number of elements pointed to by `data`.
3615 } LDKCVec_SpendableOutputDescriptorZ;
3620 * Features used within the channel_type field in an OpenChannel message.
3622 * A channel is always of some known \"type\", describing the transaction formats used and the exact
3623 * semantics of our interaction with our peer.
3625 * Note that because a channel is a specific type which is proposed by the opener and accepted by
3626 * the counterparty, only required features are allowed here.
3628 * This is serialized differently from other feature types - it is not prefixed by a length, and
3629 * thus must only appear inside a TLV where its length is known in advance.
3631 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
3633 * A pointer to the opaque Rust object.
3634 * Nearly everywhere, inner must be non-null, however in places where
3635 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3637 LDKnativeChannelTypeFeatures *inner;
3639 * Indicates that this is the only struct which contains the same pointer.
3640 * Rust functions which take ownership of an object provided via an argument require
3641 * this to be true and invalidate the object pointed to by inner.
3644 } LDKChannelTypeFeatures;
3647 * An Event which you should probably take some action in response to.
3649 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
3650 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
3651 * written as it makes no sense to respond to it after reconnecting to peers).
3653 typedef enum LDKEvent_Tag {
3655 * Used to indicate that the client should generate a funding transaction with the given
3656 * parameters and then call [`ChannelManager::funding_transaction_generated`].
3657 * Generated in [`ChannelManager`] message handling.
3658 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
3659 * counterparty can steal your funds!
3661 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3662 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
3664 LDKEvent_FundingGenerationReady,
3666 * Indicates that we've been offered a payment and it needs to be claimed via calling
3667 * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
3669 * Note that if the preimage is not known, you should call
3670 * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
3671 * to free up resources for this HTLC and avoid network congestion.
3672 * If you fail to call either [`ChannelManager::claim_funds`], [`ChannelManager::fail_htlc_backwards`],
3673 * or [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will be
3674 * automatically failed.
3677 * LDK will not stop an inbound payment from being paid multiple times, so multiple
3678 * `PaymentClaimable` events may be generated for the same payment.
3681 * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
3683 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
3684 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
3685 * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
3687 LDKEvent_PaymentClaimable,
3689 * Indicates a payment has been claimed and we've received money!
3691 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
3692 * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
3693 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
3694 * [`Event::PaymentClaimable`] event.
3697 * LDK will not stop an inbound payment from being paid multiple times, so multiple
3698 * `PaymentClaimable` events may be generated for the same payment. If you then call
3699 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
3700 * multiple `PaymentClaimed` events.
3702 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
3704 LDKEvent_PaymentClaimed,
3706 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
3707 * and we got back the payment preimage for it).
3709 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
3710 * event. In this situation, you SHOULD treat this payment as having succeeded.
3712 LDKEvent_PaymentSent,
3714 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
3715 * provide failure information for each path attempt in the payment, including retries.
3717 * This event is provided once there are no further pending HTLCs for the payment and the
3718 * payment is no longer retryable, due either to the [`Retry`] provided or
3719 * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
3721 * [`Retry`]: crate::ln::channelmanager::Retry
3722 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3724 LDKEvent_PaymentFailed,
3726 * Indicates that a path for an outbound payment was successful.
3728 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
3729 * [`Event::PaymentSent`] for obtaining the payment preimage.
3731 LDKEvent_PaymentPathSuccessful,
3733 * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
3736 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
3737 * [`Event::PaymentFailed`].
3739 * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
3742 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3744 LDKEvent_PaymentPathFailed,
3746 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
3748 LDKEvent_ProbeSuccessful,
3750 * Indicates that a probe payment we sent failed at an intermediary node on the path.
3752 LDKEvent_ProbeFailed,
3754 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
3755 * a time in the future.
3757 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
3759 LDKEvent_PendingHTLCsForwardable,
3761 * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
3762 * you've encoded an intercept scid in the receiver's invoice route hints using
3763 * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
3765 * [`ChannelManager::forward_intercepted_htlc`] or
3766 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
3767 * their docs for more information.
3769 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
3770 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
3771 * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
3772 * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
3774 LDKEvent_HTLCIntercepted,
3776 * Used to indicate that an output which you should know how to spend was confirmed on chain
3777 * and is now spendable.
3778 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
3779 * counterparty spending them due to some kind of timeout. Thus, you need to store them
3780 * somewhere and spend them when you create on-chain transactions.
3782 LDKEvent_SpendableOutputs,
3784 * This event is generated when a payment has been successfully forwarded through us and a
3785 * forwarding fee earned.
3787 LDKEvent_PaymentForwarded,
3789 * Used to indicate that a channel with the given `channel_id` is ready to
3790 * be used. This event is emitted either when the funding transaction has been confirmed
3791 * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
3794 LDKEvent_ChannelReady,
3796 * Used to indicate that a previously opened channel with the given `channel_id` is in the
3797 * process of closure.
3799 LDKEvent_ChannelClosed,
3801 * Used to indicate to the user that they can abandon the funding transaction and recycle the
3802 * inputs for another purpose.
3804 LDKEvent_DiscardFunding,
3806 * Indicates a request to open a new channel by a peer.
3808 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the
3809 * request, call [`ChannelManager::force_close_without_broadcasting_txn`].
3811 * The event is only triggered when a new open channel request is received and the
3812 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
3814 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
3815 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
3816 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
3818 LDKEvent_OpenChannelRequest,
3820 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
3823 * Some scenarios where this event may be sent include:
3824 * * Insufficient capacity in the outbound channel
3825 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
3826 * * When an unknown SCID is requested for forwarding a payment.
3827 * * Claiming an amount for an MPP payment that exceeds the HTLC total
3828 * * The HTLC has timed out
3830 * This event, however, does not get generated if an HTLC fails to meet the forwarding
3831 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
3833 LDKEvent_HTLCHandlingFailed,
3835 * Must be last for serialization purposes
3840 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
3842 * The random channel_id we picked which you'll need to pass into
3843 * [`ChannelManager::funding_transaction_generated`].
3845 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
3847 struct LDKThirtyTwoBytes temporary_channel_id;
3849 * The counterparty's node_id, which you'll need to pass back into
3850 * [`ChannelManager::funding_transaction_generated`].
3852 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
3854 struct LDKPublicKey counterparty_node_id;
3856 * The value, in satoshis, that the output should have.
3858 uint64_t channel_value_satoshis;
3860 * The script which should be used in the transaction output.
3862 struct LDKCVec_u8Z output_script;
3864 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or a
3865 * random value for an inbound channel. This may be zero for objects serialized with LDK
3866 * versions prior to 0.0.113.
3868 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
3870 struct LDKU128 user_channel_id;
3871 } LDKEvent_LDKFundingGenerationReady_Body;
3873 typedef struct LDKEvent_LDKPaymentClaimable_Body {
3875 * The node that will receive the payment after it has been claimed.
3876 * This is useful to identify payments received via [phantom nodes].
3877 * This field will always be filled in when the event was generated by LDK versions
3878 * 0.0.113 and above.
3880 * [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager
3882 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3884 struct LDKPublicKey receiver_node_id;
3886 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
3887 * not stop you from registering duplicate payment hashes for inbound payments.
3889 struct LDKThirtyTwoBytes payment_hash;
3891 * The value, in thousandths of a satoshi, that this payment is for.
3893 uint64_t amount_msat;
3895 * Information for claiming this received payment, based on whether the purpose of the
3896 * payment is to pay an invoice or to send a spontaneous payment.
3898 struct LDKPaymentPurpose purpose;
3900 * The `channel_id` indicating over which channel we received the payment.
3902 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3904 struct LDKThirtyTwoBytes via_channel_id;
3906 * The `user_channel_id` indicating over which channel we received the payment.
3908 struct LDKCOption_u128Z via_user_channel_id;
3909 } LDKEvent_LDKPaymentClaimable_Body;
3911 typedef struct LDKEvent_LDKPaymentClaimed_Body {
3913 * The node that received the payment.
3914 * This is useful to identify payments which were received via [phantom nodes].
3915 * This field will always be filled in when the event was generated by LDK versions
3916 * 0.0.113 and above.
3918 * [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager
3920 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3922 struct LDKPublicKey receiver_node_id;
3924 * The payment hash of the claimed payment. Note that LDK will not stop you from
3925 * registering duplicate payment hashes for inbound payments.
3927 struct LDKThirtyTwoBytes payment_hash;
3929 * The value, in thousandths of a satoshi, that this payment is for.
3931 uint64_t amount_msat;
3933 * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
3934 * spontaneous payment.
3936 struct LDKPaymentPurpose purpose;
3937 } LDKEvent_LDKPaymentClaimed_Body;
3939 typedef struct LDKEvent_LDKPaymentSent_Body {
3941 * The id returned by [`ChannelManager::send_payment`].
3943 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3945 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
3947 struct LDKThirtyTwoBytes payment_id;
3949 * The preimage to the hash given to ChannelManager::send_payment.
3950 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
3953 struct LDKThirtyTwoBytes payment_preimage;
3955 * The hash that was given to [`ChannelManager::send_payment`].
3957 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3959 struct LDKThirtyTwoBytes payment_hash;
3961 * The total fee which was spent at intermediate hops in this payment, across all paths.
3963 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
3964 * overpayment to the recipient node.
3966 * If the recipient or an intermediate node misbehaves and gives us free money, this may
3967 * overstate the amount paid, though this is unlikely.
3969 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
3971 struct LDKCOption_u64Z fee_paid_msat;
3972 } LDKEvent_LDKPaymentSent_Body;
3974 typedef struct LDKEvent_LDKPaymentFailed_Body {
3976 * The id returned by [`ChannelManager::send_payment`] and used with
3977 * [`ChannelManager::abandon_payment`].
3979 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3980 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
3982 struct LDKThirtyTwoBytes payment_id;
3984 * The hash that was given to [`ChannelManager::send_payment`].
3986 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3988 struct LDKThirtyTwoBytes payment_hash;
3989 } LDKEvent_LDKPaymentFailed_Body;
3991 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
3993 * The id returned by [`ChannelManager::send_payment`].
3995 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
3997 struct LDKThirtyTwoBytes payment_id;
3999 * The hash that was given to [`ChannelManager::send_payment`].
4001 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
4003 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
4005 struct LDKThirtyTwoBytes payment_hash;
4007 * The payment path that was successful.
4009 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
4011 struct LDKCVec_RouteHopZ path;
4012 } LDKEvent_LDKPaymentPathSuccessful_Body;
4014 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
4016 * The id returned by [`ChannelManager::send_payment`] and used with
4017 * [`ChannelManager::abandon_payment`].
4019 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
4020 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
4022 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
4024 struct LDKThirtyTwoBytes payment_id;
4026 * The hash that was given to [`ChannelManager::send_payment`].
4028 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
4030 struct LDKThirtyTwoBytes payment_hash;
4032 * Indicates the payment was rejected for some reason by the recipient. This implies that
4033 * the payment has failed, not just the route in question. If this is not set, the payment may
4034 * be retried via a different route.
4036 bool payment_failed_permanently;
4038 * Extra error details based on the failure type. May contain an update that needs to be
4039 * applied to the [`NetworkGraph`].
4041 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
4043 struct LDKPathFailure failure;
4045 * The payment path that failed.
4047 struct LDKCVec_RouteHopZ path;
4049 * The channel responsible for the failed payment path.
4051 * Note that for route hints or for the first hop in a path this may be an SCID alias and
4052 * may not refer to a channel in the public network graph. These aliases may also collide
4053 * with channels in the public network graph.
4055 * If this is `Some`, then the corresponding channel should be avoided when the payment is
4056 * retried. May be `None` for older [`Event`] serializations.
4058 struct LDKCOption_u64Z short_channel_id;
4060 * Parameters used by LDK to compute a new [`Route`] when retrying the failed payment path.
4062 * [`Route`]: crate::routing::router::Route
4064 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
4066 struct LDKRouteParameters retry;
4067 } LDKEvent_LDKPaymentPathFailed_Body;
4069 typedef struct LDKEvent_LDKProbeSuccessful_Body {
4071 * The id returned by [`ChannelManager::send_probe`].
4073 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
4075 struct LDKThirtyTwoBytes payment_id;
4077 * The hash generated by [`ChannelManager::send_probe`].
4079 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
4081 struct LDKThirtyTwoBytes payment_hash;
4083 * The payment path that was successful.
4085 struct LDKCVec_RouteHopZ path;
4086 } LDKEvent_LDKProbeSuccessful_Body;
4088 typedef struct LDKEvent_LDKProbeFailed_Body {
4090 * The id returned by [`ChannelManager::send_probe`].
4092 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
4094 struct LDKThirtyTwoBytes payment_id;
4096 * The hash generated by [`ChannelManager::send_probe`].
4098 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
4100 struct LDKThirtyTwoBytes payment_hash;
4102 * The payment path that failed.
4104 struct LDKCVec_RouteHopZ path;
4106 * The channel responsible for the failed probe.
4108 * Note that for route hints or for the first hop in a path this may be an SCID alias and
4109 * may not refer to a channel in the public network graph. These aliases may also collide
4110 * with channels in the public network graph.
4112 struct LDKCOption_u64Z short_channel_id;
4113 } LDKEvent_LDKProbeFailed_Body;
4115 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
4117 * The minimum amount of time that should be waited prior to calling
4118 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
4119 * you should wait a random amount of time in roughly the range (now + time_forwardable,
4120 * now + 5*time_forwardable).
4122 uint64_t time_forwardable;
4123 } LDKEvent_LDKPendingHTLCsForwardable_Body;
4125 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
4127 * An id to help LDK identify which HTLC is being forwarded or failed.
4129 struct LDKThirtyTwoBytes intercept_id;
4131 * The fake scid that was programmed as the next hop's scid, generated using
4132 * [`ChannelManager::get_intercept_scid`].
4134 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
4136 uint64_t requested_next_hop_scid;
4138 * The payment hash used for this HTLC.
4140 struct LDKThirtyTwoBytes payment_hash;
4142 * How many msats were received on the inbound edge of this HTLC.
4144 uint64_t inbound_amount_msat;
4146 * How many msats the payer intended to route to the next node. Depending on the reason you are
4147 * intercepting this payment, you might take a fee by forwarding less than this amount.
4149 * Note that LDK will NOT check that expected fees were factored into this value. You MUST
4150 * check that whatever fee you want has been included here or subtract it as required. Further,
4151 * LDK will not stop you from forwarding more than you received.
4153 uint64_t expected_outbound_amount_msat;
4154 } LDKEvent_LDKHTLCIntercepted_Body;
4156 typedef struct LDKEvent_LDKSpendableOutputs_Body {
4158 * The outputs which you should store as spendable by you.
4160 struct LDKCVec_SpendableOutputDescriptorZ outputs;
4161 } LDKEvent_LDKSpendableOutputs_Body;
4163 typedef struct LDKEvent_LDKPaymentForwarded_Body {
4165 * The incoming channel between the previous node and us. This is only `None` for events
4166 * generated or serialized by versions prior to 0.0.107.
4168 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
4170 struct LDKThirtyTwoBytes prev_channel_id;
4172 * The outgoing channel between the next node and us. This is only `None` for events
4173 * generated or serialized by versions prior to 0.0.107.
4175 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
4177 struct LDKThirtyTwoBytes next_channel_id;
4179 * The fee, in milli-satoshis, which was earned as a result of the payment.
4181 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
4182 * was pending, the amount the next hop claimed will have been rounded down to the nearest
4183 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
4184 * claimed the full value in millisatoshis from the source. In this case,
4185 * `claim_from_onchain_tx` will be set.
4187 * If the channel which sent us the payment has been force-closed, we will claim the funds
4188 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
4189 * fees which we will spend and will instead set this to `None`. It is possible duplicate
4190 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
4193 struct LDKCOption_u64Z fee_earned_msat;
4195 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
4198 bool claim_from_onchain_tx;
4199 } LDKEvent_LDKPaymentForwarded_Body;
4201 typedef struct LDKEvent_LDKChannelReady_Body {
4203 * The channel_id of the channel that is ready.
4205 struct LDKThirtyTwoBytes channel_id;
4207 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
4208 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
4209 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
4210 * `user_channel_id` will be randomized for an inbound channel.
4212 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
4213 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
4214 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
4216 struct LDKU128 user_channel_id;
4218 * The node_id of the channel counterparty.
4220 struct LDKPublicKey counterparty_node_id;
4222 * The features that this channel will operate with.
4224 struct LDKChannelTypeFeatures channel_type;
4225 } LDKEvent_LDKChannelReady_Body;
4227 typedef struct LDKEvent_LDKChannelClosed_Body {
4229 * The channel_id of the channel which has been closed. Note that on-chain transactions
4230 * resolving the channel are likely still awaiting confirmation.
4232 struct LDKThirtyTwoBytes channel_id;
4234 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
4235 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
4236 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
4237 * `user_channel_id` will be randomized for inbound channels.
4238 * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
4239 * zero for objects serialized with LDK versions prior to 0.0.102.
4241 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
4242 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
4243 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
4245 struct LDKU128 user_channel_id;
4247 * The reason the channel was closed.
4249 struct LDKClosureReason reason;
4250 } LDKEvent_LDKChannelClosed_Body;
4252 typedef struct LDKEvent_LDKDiscardFunding_Body {
4254 * The channel_id of the channel which has been closed.
4256 struct LDKThirtyTwoBytes channel_id;
4258 * The full transaction received from the user
4260 struct LDKTransaction transaction;
4261 } LDKEvent_LDKDiscardFunding_Body;
4263 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
4265 * The temporary channel ID of the channel requested to be opened.
4267 * When responding to the request, the `temporary_channel_id` should be passed
4268 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
4269 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
4271 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
4272 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
4274 struct LDKThirtyTwoBytes temporary_channel_id;
4276 * The node_id of the counterparty requesting to open the channel.
4278 * When responding to the request, the `counterparty_node_id` should be passed
4279 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
4280 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
4283 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
4284 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
4286 struct LDKPublicKey counterparty_node_id;
4288 * The channel value of the requested channel.
4290 uint64_t funding_satoshis;
4292 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
4296 * The features that this channel will operate with. If you reject the channel, a
4297 * well-behaved counterparty may automatically re-attempt the channel with a new set of
4300 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
4301 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
4304 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
4305 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
4306 * 0.0.107. Channels setting this type also need to get manually accepted via
4307 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
4308 * or will be rejected otherwise.
4310 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
4312 struct LDKChannelTypeFeatures channel_type;
4313 } LDKEvent_LDKOpenChannelRequest_Body;
4315 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
4317 * The channel over which the HTLC was received.
4319 struct LDKThirtyTwoBytes prev_channel_id;
4321 * Destination of the HTLC that failed to be processed.
4323 struct LDKHTLCDestination failed_next_destination;
4324 } LDKEvent_LDKHTLCHandlingFailed_Body;
4326 typedef struct MUST_USE_STRUCT LDKEvent {
4329 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
4330 LDKEvent_LDKPaymentClaimable_Body payment_claimable;
4331 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
4332 LDKEvent_LDKPaymentSent_Body payment_sent;
4333 LDKEvent_LDKPaymentFailed_Body payment_failed;
4334 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
4335 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
4336 LDKEvent_LDKProbeSuccessful_Body probe_successful;
4337 LDKEvent_LDKProbeFailed_Body probe_failed;
4338 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
4339 LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
4340 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
4341 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
4342 LDKEvent_LDKChannelReady_Body channel_ready;
4343 LDKEvent_LDKChannelClosed_Body channel_closed;
4344 LDKEvent_LDKDiscardFunding_Body discard_funding;
4345 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
4346 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
4351 * An enum which can either contain a crate::lightning::util::events::Event or not
4353 typedef enum LDKCOption_EventZ_Tag {
4355 * When we're in this state, this COption_EventZ contains a crate::lightning::util::events::Event
4357 LDKCOption_EventZ_Some,
4359 * When we're in this state, this COption_EventZ contains nothing
4361 LDKCOption_EventZ_None,
4363 * Must be last for serialization purposes
4365 LDKCOption_EventZ_Sentinel,
4366 } LDKCOption_EventZ_Tag;
4368 typedef struct LDKCOption_EventZ {
4369 LDKCOption_EventZ_Tag tag;
4372 struct LDKEvent some;
4375 } LDKCOption_EventZ;
4378 * The contents of CResult_COption_EventZDecodeErrorZ
4380 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
4382 * A pointer to the contents in the success state.
4383 * Reading from this pointer when `result_ok` is not set is undefined.
4385 struct LDKCOption_EventZ *result;
4387 * A pointer to the contents in the error state.
4388 * Reading from this pointer when `result_ok` is set is undefined.
4390 struct LDKDecodeError *err;
4391 } LDKCResult_COption_EventZDecodeErrorZPtr;
4394 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
4395 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
4396 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4398 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
4400 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
4401 * `err` or `result` depending on the state of `result_ok`.
4403 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
4405 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
4408 } LDKCResult_COption_EventZDecodeErrorZ;
4413 * An [`accept_channel`] message to be sent to or received from a peer.
4415 * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
4417 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
4419 * A pointer to the opaque Rust object.
4420 * Nearly everywhere, inner must be non-null, however in places where
4421 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4423 LDKnativeAcceptChannel *inner;
4425 * Indicates that this is the only struct which contains the same pointer.
4426 * Rust functions which take ownership of an object provided via an argument require
4427 * this to be true and invalidate the object pointed to by inner.
4435 * An [`open_channel`] message to be sent to or received from a peer.
4437 * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
4439 typedef struct MUST_USE_STRUCT LDKOpenChannel {
4441 * A pointer to the opaque Rust object.
4442 * Nearly everywhere, inner must be non-null, however in places where
4443 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4445 LDKnativeOpenChannel *inner;
4447 * Indicates that this is the only struct which contains the same pointer.
4448 * Rust functions which take ownership of an object provided via an argument require
4449 * this to be true and invalidate the object pointed to by inner.
4457 * A [`funding_created`] message to be sent to or received from a peer.
4459 * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
4461 typedef struct MUST_USE_STRUCT LDKFundingCreated {
4463 * A pointer to the opaque Rust object.
4464 * Nearly everywhere, inner must be non-null, however in places where
4465 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4467 LDKnativeFundingCreated *inner;
4469 * Indicates that this is the only struct which contains the same pointer.
4470 * Rust functions which take ownership of an object provided via an argument require
4471 * this to be true and invalidate the object pointed to by inner.
4474 } LDKFundingCreated;
4479 * A [`funding_signed`] message to be sent to or received from a peer.
4481 * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
4483 typedef struct MUST_USE_STRUCT LDKFundingSigned {
4485 * A pointer to the opaque Rust object.
4486 * Nearly everywhere, inner must be non-null, however in places where
4487 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4489 LDKnativeFundingSigned *inner;
4491 * Indicates that this is the only struct which contains the same pointer.
4492 * Rust functions which take ownership of an object provided via an argument require
4493 * this to be true and invalidate the object pointed to by inner.
4501 * A [`channel_ready`] message to be sent to or received from a peer.
4503 * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
4505 typedef struct MUST_USE_STRUCT LDKChannelReady {
4507 * A pointer to the opaque Rust object.
4508 * Nearly everywhere, inner must be non-null, however in places where
4509 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4511 LDKnativeChannelReady *inner;
4513 * Indicates that this is the only struct which contains the same pointer.
4514 * Rust functions which take ownership of an object provided via an argument require
4515 * this to be true and invalidate the object pointed to by inner.
4523 * An [`announcement_signatures`] message to be sent to or received from a peer.
4525 * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
4527 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
4529 * A pointer to the opaque Rust object.
4530 * Nearly everywhere, inner must be non-null, however in places where
4531 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4533 LDKnativeAnnouncementSignatures *inner;
4535 * Indicates that this is the only struct which contains the same pointer.
4536 * Rust functions which take ownership of an object provided via an argument require
4537 * this to be true and invalidate the object pointed to by inner.
4540 } LDKAnnouncementSignatures;
4545 * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
4546 * transaction updates if they were pending.
4548 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
4550 * A pointer to the opaque Rust object.
4551 * Nearly everywhere, inner must be non-null, however in places where
4552 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4554 LDKnativeCommitmentUpdate *inner;
4556 * Indicates that this is the only struct which contains the same pointer.
4557 * Rust functions which take ownership of an object provided via an argument require
4558 * this to be true and invalidate the object pointed to by inner.
4561 } LDKCommitmentUpdate;
4566 * A [`revoke_and_ack`] message to be sent to or received from a peer.
4568 * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
4570 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
4572 * A pointer to the opaque Rust object.
4573 * Nearly everywhere, inner must be non-null, however in places where
4574 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4576 LDKnativeRevokeAndACK *inner;
4578 * Indicates that this is the only struct which contains the same pointer.
4579 * Rust functions which take ownership of an object provided via an argument require
4580 * this to be true and invalidate the object pointed to by inner.
4588 * A [`closing_signed`] message to be sent to or received from a peer.
4590 * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
4592 typedef struct MUST_USE_STRUCT LDKClosingSigned {
4594 * A pointer to the opaque Rust object.
4595 * Nearly everywhere, inner must be non-null, however in places where
4596 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4598 LDKnativeClosingSigned *inner;
4600 * Indicates that this is the only struct which contains the same pointer.
4601 * Rust functions which take ownership of an object provided via an argument require
4602 * this to be true and invalidate the object pointed to by inner.
4610 * A [`shutdown`] message to be sent to or received from a peer.
4612 * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
4614 typedef struct MUST_USE_STRUCT LDKShutdown {
4616 * A pointer to the opaque Rust object.
4617 * Nearly everywhere, inner must be non-null, however in places where
4618 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4620 LDKnativeShutdown *inner;
4622 * Indicates that this is the only struct which contains the same pointer.
4623 * Rust functions which take ownership of an object provided via an argument require
4624 * this to be true and invalidate the object pointed to by inner.
4632 * A [`channel_reestablish`] message to be sent to or received from a peer.
4634 * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
4636 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
4638 * A pointer to the opaque Rust object.
4639 * Nearly everywhere, inner must be non-null, however in places where
4640 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4642 LDKnativeChannelReestablish *inner;
4644 * Indicates that this is the only struct which contains the same pointer.
4645 * Rust functions which take ownership of an object provided via an argument require
4646 * this to be true and invalidate the object pointed to by inner.
4649 } LDKChannelReestablish;
4654 * A [`channel_announcement`] message to be sent to or received from a peer.
4656 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
4658 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
4660 * A pointer to the opaque Rust object.
4661 * Nearly everywhere, inner must be non-null, however in places where
4662 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4664 LDKnativeChannelAnnouncement *inner;
4666 * Indicates that this is the only struct which contains the same pointer.
4667 * Rust functions which take ownership of an object provided via an argument require
4668 * this to be true and invalidate the object pointed to by inner.
4671 } LDKChannelAnnouncement;
4676 * A [`node_announcement`] message to be sent to or received from a peer.
4678 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
4680 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
4682 * A pointer to the opaque Rust object.
4683 * Nearly everywhere, inner must be non-null, however in places where
4684 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4686 LDKnativeNodeAnnouncement *inner;
4688 * Indicates that this is the only struct which contains the same pointer.
4689 * Rust functions which take ownership of an object provided via an argument require
4690 * this to be true and invalidate the object pointed to by inner.
4693 } LDKNodeAnnouncement;
4698 * An [`error`] message to be sent to or received from a peer.
4700 * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
4702 typedef struct MUST_USE_STRUCT LDKErrorMessage {
4704 * A pointer to the opaque Rust object.
4705 * Nearly everywhere, inner must be non-null, however in places where
4706 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4708 LDKnativeErrorMessage *inner;
4710 * Indicates that this is the only struct which contains the same pointer.
4711 * Rust functions which take ownership of an object provided via an argument require
4712 * this to be true and invalidate the object pointed to by inner.
4720 * A [`warning`] message to be sent to or received from a peer.
4722 * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
4724 typedef struct MUST_USE_STRUCT LDKWarningMessage {
4726 * A pointer to the opaque Rust object.
4727 * Nearly everywhere, inner must be non-null, however in places where
4728 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4730 LDKnativeWarningMessage *inner;
4732 * Indicates that this is the only struct which contains the same pointer.
4733 * Rust functions which take ownership of an object provided via an argument require
4734 * this to be true and invalidate the object pointed to by inner.
4737 } LDKWarningMessage;
4740 * Used to put an error message in a [`LightningError`].
4742 typedef enum LDKErrorAction_Tag {
4744 * The peer took some action which made us think they were useless. Disconnect them.
4746 LDKErrorAction_DisconnectPeer,
4748 * The peer did something harmless that we weren't able to process, just log and ignore
4750 LDKErrorAction_IgnoreError,
4752 * The peer did something harmless that we weren't able to meaningfully process.
4753 * If the error is logged, log it at the given level.
4755 LDKErrorAction_IgnoreAndLog,
4757 * The peer provided us with a gossip message which we'd already seen. In most cases this
4758 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
4759 * our own channel announcements.
4761 LDKErrorAction_IgnoreDuplicateGossip,
4763 * The peer did something incorrect. Tell them.
4765 LDKErrorAction_SendErrorMessage,
4767 * The peer did something incorrect. Tell them without closing any channels.
4769 LDKErrorAction_SendWarningMessage,
4771 * Must be last for serialization purposes
4773 LDKErrorAction_Sentinel,
4774 } LDKErrorAction_Tag;
4776 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
4778 * An error message which we should make an effort to send before we disconnect.
4780 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
4782 struct LDKErrorMessage msg;
4783 } LDKErrorAction_LDKDisconnectPeer_Body;
4785 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
4787 * The message to send.
4789 struct LDKErrorMessage msg;
4790 } LDKErrorAction_LDKSendErrorMessage_Body;
4792 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
4794 * The message to send.
4796 struct LDKWarningMessage msg;
4798 * The peer may have done something harmless that we weren't able to meaningfully process,
4799 * though we should still tell them about it.
4800 * If this event is logged, log it at the given level.
4802 enum LDKLevel log_level;
4803 } LDKErrorAction_LDKSendWarningMessage_Body;
4805 typedef struct MUST_USE_STRUCT LDKErrorAction {
4806 LDKErrorAction_Tag tag;
4808 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
4810 enum LDKLevel ignore_and_log;
4812 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
4813 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
4820 * A [`query_channel_range`] message is used to query a peer for channel
4821 * UTXOs in a range of blocks. The recipient of a query makes a best
4822 * effort to reply to the query using one or more [`ReplyChannelRange`]
4825 * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
4827 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
4829 * A pointer to the opaque Rust object.
4830 * Nearly everywhere, inner must be non-null, however in places where
4831 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4833 LDKnativeQueryChannelRange *inner;
4835 * Indicates that this is the only struct which contains the same pointer.
4836 * Rust functions which take ownership of an object provided via an argument require
4837 * this to be true and invalidate the object pointed to by inner.
4840 } LDKQueryChannelRange;
4845 * A [`query_short_channel_ids`] message is used to query a peer for
4846 * routing gossip messages related to one or more `short_channel_id`s.
4848 * The query recipient will reply with the latest, if available,
4849 * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
4850 * it maintains for the requested `short_channel_id`s followed by a
4851 * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
4852 * this query are encoded. We only support `encoding_type=0` uncompressed
4853 * serialization and do not support `encoding_type=1` zlib serialization.
4855 * [`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
4857 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
4859 * A pointer to the opaque Rust object.
4860 * Nearly everywhere, inner must be non-null, however in places where
4861 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4863 LDKnativeQueryShortChannelIds *inner;
4865 * Indicates that this is the only struct which contains the same pointer.
4866 * Rust functions which take ownership of an object provided via an argument require
4867 * this to be true and invalidate the object pointed to by inner.
4870 } LDKQueryShortChannelIds;
4875 * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
4878 * Multiple `reply_channel_range` messages can be sent in reply
4879 * to a single [`QueryChannelRange`] message. The query recipient makes a
4880 * best effort to respond based on their local network view which may
4881 * not be a perfect view of the network. The `short_channel_id`s in the
4882 * reply are encoded. We only support `encoding_type=0` uncompressed
4883 * serialization and do not support `encoding_type=1` zlib serialization.
4885 * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
4887 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
4889 * A pointer to the opaque Rust object.
4890 * Nearly everywhere, inner must be non-null, however in places where
4891 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4893 LDKnativeReplyChannelRange *inner;
4895 * Indicates that this is the only struct which contains the same pointer.
4896 * Rust functions which take ownership of an object provided via an argument require
4897 * this to be true and invalidate the object pointed to by inner.
4900 } LDKReplyChannelRange;
4905 * A [`gossip_timestamp_filter`] message is used by a node to request
4906 * gossip relay for messages in the requested time range when the
4907 * `gossip_queries` feature has been negotiated.
4909 * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
4911 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
4913 * A pointer to the opaque Rust object.
4914 * Nearly everywhere, inner must be non-null, however in places where
4915 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4917 LDKnativeGossipTimestampFilter *inner;
4919 * Indicates that this is the only struct which contains the same pointer.
4920 * Rust functions which take ownership of an object provided via an argument require
4921 * this to be true and invalidate the object pointed to by inner.
4924 } LDKGossipTimestampFilter;
4927 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
4928 * broadcast to most peers).
4929 * These events are handled by PeerManager::process_events if you are using a PeerManager.
4931 typedef enum LDKMessageSendEvent_Tag {
4933 * Used to indicate that we've accepted a channel open and should send the accept_channel
4934 * message provided to the given peer.
4936 LDKMessageSendEvent_SendAcceptChannel,
4938 * Used to indicate that we've initiated a channel open and should send the open_channel
4939 * message provided to the given peer.
4941 LDKMessageSendEvent_SendOpenChannel,
4943 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
4945 LDKMessageSendEvent_SendFundingCreated,
4947 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
4949 LDKMessageSendEvent_SendFundingSigned,
4951 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
4953 LDKMessageSendEvent_SendChannelReady,
4955 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
4957 LDKMessageSendEvent_SendAnnouncementSignatures,
4959 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
4960 * message should be sent to the peer with the given node_id.
4962 LDKMessageSendEvent_UpdateHTLCs,
4964 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
4966 LDKMessageSendEvent_SendRevokeAndACK,
4968 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
4970 LDKMessageSendEvent_SendClosingSigned,
4972 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
4974 LDKMessageSendEvent_SendShutdown,
4976 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
4978 LDKMessageSendEvent_SendChannelReestablish,
4980 * Used to send a channel_announcement and channel_update to a specific peer, likely on
4981 * initial connection to ensure our peers know about our channels.
4983 LDKMessageSendEvent_SendChannelAnnouncement,
4985 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
4986 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
4988 * Note that after doing so, you very likely (unless you did so very recently) want to
4989 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
4990 * ensures that any nodes which see our channel_announcement also have a relevant
4991 * node_announcement, including relevant feature flags which may be important for routing
4994 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
4996 LDKMessageSendEvent_BroadcastChannelAnnouncement,
4998 * Used to indicate that a channel_update should be broadcast to all peers.
5000 LDKMessageSendEvent_BroadcastChannelUpdate,
5002 * Used to indicate that a node_announcement should be broadcast to all peers.
5004 LDKMessageSendEvent_BroadcastNodeAnnouncement,
5006 * Used to indicate that a channel_update should be sent to a single peer.
5007 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
5008 * private channel and we shouldn't be informing all of our peers of channel parameters.
5010 LDKMessageSendEvent_SendChannelUpdate,
5012 * Broadcast an error downstream to be handled
5014 LDKMessageSendEvent_HandleError,
5016 * Query a peer for channels with funding transaction UTXOs in a block range.
5018 LDKMessageSendEvent_SendChannelRangeQuery,
5020 * Request routing gossip messages from a peer for a list of channels identified by
5021 * their short_channel_ids.
5023 LDKMessageSendEvent_SendShortIdsQuery,
5025 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
5026 * emitted during processing of the query.
5028 LDKMessageSendEvent_SendReplyChannelRange,
5030 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
5031 * enable receiving gossip messages from the peer.
5033 LDKMessageSendEvent_SendGossipTimestampFilter,
5035 * Must be last for serialization purposes
5037 LDKMessageSendEvent_Sentinel,
5038 } LDKMessageSendEvent_Tag;
5040 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
5042 * The node_id of the node which should receive this message
5044 struct LDKPublicKey node_id;
5046 * The message which should be sent.
5048 struct LDKAcceptChannel msg;
5049 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
5051 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
5053 * The node_id of the node which should receive this message
5055 struct LDKPublicKey node_id;
5057 * The message which should be sent.
5059 struct LDKOpenChannel msg;
5060 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
5062 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
5064 * The node_id of the node which should receive this message
5066 struct LDKPublicKey node_id;
5068 * The message which should be sent.
5070 struct LDKFundingCreated msg;
5071 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
5073 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
5075 * The node_id of the node which should receive this message
5077 struct LDKPublicKey node_id;
5079 * The message which should be sent.
5081 struct LDKFundingSigned msg;
5082 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
5084 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
5086 * The node_id of the node which should receive these message(s)
5088 struct LDKPublicKey node_id;
5090 * The channel_ready message which should be sent.
5092 struct LDKChannelReady msg;
5093 } LDKMessageSendEvent_LDKSendChannelReady_Body;
5095 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
5097 * The node_id of the node which should receive these message(s)
5099 struct LDKPublicKey node_id;
5101 * The announcement_signatures message which should be sent.
5103 struct LDKAnnouncementSignatures msg;
5104 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
5106 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
5108 * The node_id of the node which should receive these message(s)
5110 struct LDKPublicKey node_id;
5112 * The update messages which should be sent. ALL messages in the struct should be sent!
5114 struct LDKCommitmentUpdate updates;
5115 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
5117 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
5119 * The node_id of the node which should receive this message
5121 struct LDKPublicKey node_id;
5123 * The message which should be sent.
5125 struct LDKRevokeAndACK msg;
5126 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
5128 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
5130 * The node_id of the node which should receive this message
5132 struct LDKPublicKey node_id;
5134 * The message which should be sent.
5136 struct LDKClosingSigned msg;
5137 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
5139 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
5141 * The node_id of the node which should receive this message
5143 struct LDKPublicKey node_id;
5145 * The message which should be sent.
5147 struct LDKShutdown msg;
5148 } LDKMessageSendEvent_LDKSendShutdown_Body;
5150 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
5152 * The node_id of the node which should receive this message
5154 struct LDKPublicKey node_id;
5156 * The message which should be sent.
5158 struct LDKChannelReestablish msg;
5159 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
5161 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
5163 * The node_id of the node which should receive this message
5165 struct LDKPublicKey node_id;
5167 * The channel_announcement which should be sent.
5169 struct LDKChannelAnnouncement msg;
5171 * The followup channel_update which should be sent.
5173 struct LDKChannelUpdate update_msg;
5174 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
5176 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
5178 * The channel_announcement which should be sent.
5180 struct LDKChannelAnnouncement msg;
5182 * The followup channel_update which should be sent.
5184 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
5186 struct LDKChannelUpdate update_msg;
5187 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
5189 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
5191 * The channel_update which should be sent.
5193 struct LDKChannelUpdate msg;
5194 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
5196 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
5198 * The node_announcement which should be sent.
5200 struct LDKNodeAnnouncement msg;
5201 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
5203 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
5205 * The node_id of the node which should receive this message
5207 struct LDKPublicKey node_id;
5209 * The channel_update which should be sent.
5211 struct LDKChannelUpdate msg;
5212 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
5214 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
5216 * The node_id of the node which should receive this message
5218 struct LDKPublicKey node_id;
5220 * The action which should be taken.
5222 struct LDKErrorAction action;
5223 } LDKMessageSendEvent_LDKHandleError_Body;
5225 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
5227 * The node_id of this message recipient
5229 struct LDKPublicKey node_id;
5231 * The query_channel_range which should be sent.
5233 struct LDKQueryChannelRange msg;
5234 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
5236 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
5238 * The node_id of this message recipient
5240 struct LDKPublicKey node_id;
5242 * The query_short_channel_ids which should be sent.
5244 struct LDKQueryShortChannelIds msg;
5245 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
5247 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
5249 * The node_id of this message recipient
5251 struct LDKPublicKey node_id;
5253 * The reply_channel_range which should be sent.
5255 struct LDKReplyChannelRange msg;
5256 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
5258 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
5260 * The node_id of this message recipient
5262 struct LDKPublicKey node_id;
5264 * The gossip_timestamp_filter which should be sent.
5266 struct LDKGossipTimestampFilter msg;
5267 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
5269 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
5270 LDKMessageSendEvent_Tag tag;
5272 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
5273 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
5274 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
5275 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
5276 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
5277 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
5278 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
5279 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
5280 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
5281 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
5282 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
5283 LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
5284 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
5285 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
5286 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
5287 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
5288 LDKMessageSendEvent_LDKHandleError_Body handle_error;
5289 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
5290 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
5291 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
5292 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
5294 } LDKMessageSendEvent;
5297 * A dynamically-allocated array of crate::lightning::util::events::MessageSendEvents of arbitrary size.
5298 * This corresponds to std::vector in C++
5300 typedef struct LDKCVec_MessageSendEventZ {
5302 * The elements in the array.
5303 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5305 struct LDKMessageSendEvent *data;
5307 * The number of elements pointed to by `data`.
5310 } LDKCVec_MessageSendEventZ;
5313 * A tuple of 2 elements. See the individual fields for the types contained.
5315 typedef struct LDKC2Tuple_usizeTransactionZ {
5317 * The element at position 0
5321 * The element at position 1
5323 struct LDKTransaction b;
5324 } LDKC2Tuple_usizeTransactionZ;
5327 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
5328 * This corresponds to std::vector in C++
5330 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
5332 * The elements in the array.
5333 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5335 struct LDKC2Tuple_usizeTransactionZ *data;
5337 * The number of elements pointed to by `data`.
5340 } LDKCVec_C2Tuple_usizeTransactionZZ;
5343 * A tuple of 2 elements. See the individual fields for the types contained.
5345 typedef struct LDKC2Tuple_TxidBlockHashZ {
5347 * The element at position 0
5349 struct LDKThirtyTwoBytes a;
5351 * The element at position 1
5353 struct LDKThirtyTwoBytes b;
5354 } LDKC2Tuple_TxidBlockHashZ;
5357 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidBlockHashZs of arbitrary size.
5358 * This corresponds to std::vector in C++
5360 typedef struct LDKCVec_C2Tuple_TxidBlockHashZZ {
5362 * The elements in the array.
5363 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5365 struct LDKC2Tuple_TxidBlockHashZ *data;
5367 * The number of elements pointed to by `data`.
5370 } LDKCVec_C2Tuple_TxidBlockHashZZ;
5375 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
5376 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
5377 * preimage claim backward will lead to loss of funds.
5379 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
5381 * A pointer to the opaque Rust object.
5382 * Nearly everywhere, inner must be non-null, however in places where
5383 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5385 LDKnativeHTLCUpdate *inner;
5387 * Indicates that this is the only struct which contains the same pointer.
5388 * Rust functions which take ownership of an object provided via an argument require
5389 * this to be true and invalidate the object pointed to by inner.
5395 * An event to be processed by the ChannelManager.
5397 typedef enum LDKMonitorEvent_Tag {
5399 * A monitor event containing an HTLCUpdate.
5401 LDKMonitorEvent_HTLCEvent,
5403 * A monitor event that the Channel's commitment transaction was confirmed.
5405 LDKMonitorEvent_CommitmentTxConfirmed,
5407 * Indicates a [`ChannelMonitor`] update has completed. See
5408 * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
5410 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
5412 LDKMonitorEvent_Completed,
5414 * Indicates a [`ChannelMonitor`] update has failed. See
5415 * [`ChannelMonitorUpdateStatus::PermanentFailure`] for more information on how this is used.
5417 * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
5419 LDKMonitorEvent_UpdateFailed,
5421 * Must be last for serialization purposes
5423 LDKMonitorEvent_Sentinel,
5424 } LDKMonitorEvent_Tag;
5426 typedef struct LDKMonitorEvent_LDKCompleted_Body {
5428 * The funding outpoint of the [`ChannelMonitor`] that was updated
5430 struct LDKOutPoint funding_txo;
5432 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
5433 * [`ChannelMonitor::get_latest_update_id`].
5435 * Note that this should only be set to a given update's ID if all previous updates for the
5436 * same [`ChannelMonitor`] have been applied and persisted.
5438 uint64_t monitor_update_id;
5439 } LDKMonitorEvent_LDKCompleted_Body;
5441 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
5442 LDKMonitorEvent_Tag tag;
5445 struct LDKHTLCUpdate htlc_event;
5448 struct LDKOutPoint commitment_tx_confirmed;
5450 LDKMonitorEvent_LDKCompleted_Body completed;
5452 struct LDKOutPoint update_failed;
5458 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
5459 * This corresponds to std::vector in C++
5461 typedef struct LDKCVec_MonitorEventZ {
5463 * The elements in the array.
5464 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5466 struct LDKMonitorEvent *data;
5468 * The number of elements pointed to by `data`.
5471 } LDKCVec_MonitorEventZ;
5474 * A tuple of 3 elements. See the individual fields for the types contained.
5476 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
5478 * The element at position 0
5480 struct LDKOutPoint a;
5482 * The element at position 1
5484 struct LDKCVec_MonitorEventZ b;
5486 * The element at position 2
5488 struct LDKPublicKey c;
5489 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
5492 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
5493 * This corresponds to std::vector in C++
5495 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
5497 * The elements in the array.
5498 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5500 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
5502 * The number of elements pointed to by `data`.
5505 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
5510 * [`Score`] implementation that uses a fixed penalty.
5512 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
5514 * A pointer to the opaque Rust object.
5515 * Nearly everywhere, inner must be non-null, however in places where
5516 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5518 LDKnativeFixedPenaltyScorer *inner;
5520 * Indicates that this is the only struct which contains the same pointer.
5521 * Rust functions which take ownership of an object provided via an argument require
5522 * this to be true and invalidate the object pointed to by inner.
5525 } LDKFixedPenaltyScorer;
5528 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
5530 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
5532 * A pointer to the contents in the success state.
5533 * Reading from this pointer when `result_ok` is not set is undefined.
5535 struct LDKFixedPenaltyScorer *result;
5537 * A pointer to the contents in the error state.
5538 * Reading from this pointer when `result_ok` is set is undefined.
5540 struct LDKDecodeError *err;
5541 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
5544 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
5545 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5546 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5548 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
5550 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
5551 * `err` or `result` depending on the state of `result_ok`.
5553 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
5555 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
5558 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
5561 * A tuple of 2 elements. See the individual fields for the types contained.
5563 typedef struct LDKC2Tuple_u64u64Z {
5565 * The element at position 0
5569 * The element at position 1
5572 } LDKC2Tuple_u64u64Z;
5575 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
5577 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
5579 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
5581 LDKCOption_C2Tuple_u64u64ZZ_Some,
5583 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
5585 LDKCOption_C2Tuple_u64u64ZZ_None,
5587 * Must be last for serialization purposes
5589 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
5590 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
5592 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
5593 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
5596 struct LDKC2Tuple_u64u64Z some;
5599 } LDKCOption_C2Tuple_u64u64ZZ;
5604 typedef struct LDKEightU16s {
5606 * The eight 16-bit integers
5612 * A tuple of 2 elements. See the individual fields for the types contained.
5614 typedef struct LDKC2Tuple_Z {
5616 * The element at position 0
5618 struct LDKEightU16s a;
5620 * The element at position 1
5622 struct LDKEightU16s b;
5626 * A tuple of 2 elements. See the individual fields for the types contained.
5628 typedef struct LDKC2Tuple__u168_u168Z {
5630 * The element at position 0
5632 struct LDKEightU16s a;
5634 * The element at position 1
5636 struct LDKEightU16s b;
5637 } LDKC2Tuple__u168_u168Z;
5640 * An enum which can either contain a crate::c_types::derived::C2Tuple__u168_u168Z or not
5642 typedef enum LDKCOption_C2Tuple_EightU16sEightU16sZZ_Tag {
5644 * When we're in this state, this COption_C2Tuple_EightU16sEightU16sZZ contains a crate::c_types::derived::C2Tuple__u168_u168Z
5646 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some,
5648 * When we're in this state, this COption_C2Tuple_EightU16sEightU16sZZ contains nothing
5650 LDKCOption_C2Tuple_EightU16sEightU16sZZ_None,
5652 * Must be last for serialization purposes
5654 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Sentinel,
5655 } LDKCOption_C2Tuple_EightU16sEightU16sZZ_Tag;
5657 typedef struct LDKCOption_C2Tuple_EightU16sEightU16sZZ {
5658 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Tag tag;
5661 struct LDKC2Tuple__u168_u168Z some;
5664 } LDKCOption_C2Tuple_EightU16sEightU16sZZ;
5667 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
5668 * This corresponds to std::vector in C++
5670 typedef struct LDKCVec_NodeIdZ {
5672 * The elements in the array.
5673 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5675 struct LDKNodeId *data;
5677 * The number of elements pointed to by `data`.
5685 * A Record, unit of logging output with Metadata to enable filtering
5686 * Module_path, file, line to inform on log's source
5688 typedef struct MUST_USE_STRUCT LDKRecord {
5690 * A pointer to the opaque Rust object.
5691 * Nearly everywhere, inner must be non-null, however in places where
5692 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5694 LDKnativeRecord *inner;
5696 * Indicates that this is the only struct which contains the same pointer.
5697 * Rust functions which take ownership of an object provided via an argument require
5698 * this to be true and invalidate the object pointed to by inner.
5704 * A trait encapsulating the operations required of a logger
5706 typedef struct LDKLogger {
5708 * An opaque pointer which is passed to your function implementations as an argument.
5709 * This has no meaning in the LDK, and can be NULL or any other value.
5715 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
5717 * Frees any resources associated with this object given its this_arg pointer.
5718 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5720 void (*free)(void *this_arg);
5726 * Represents the network as nodes and channels between them
5728 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
5730 * A pointer to the opaque Rust object.
5731 * Nearly everywhere, inner must be non-null, however in places where
5732 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5734 LDKnativeNetworkGraph *inner;
5736 * Indicates that this is the only struct which contains the same pointer.
5737 * Rust functions which take ownership of an object provided via an argument require
5738 * this to be true and invalidate the object pointed to by inner.
5746 * [`Score`] implementation using channel success probability distributions.
5748 * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
5749 * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
5750 * When a payment is forwarded through a channel (but fails later in the route), we learn the
5751 * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
5753 * These bounds are then used to determine a success probability using the formula from
5754 * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
5755 * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
5757 * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
5758 * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
5759 * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
5760 * terms of the entire path's success probability. This allows the router to directly compare
5761 * penalties for different paths. See the documentation of those parameters for the exact formulas.
5763 * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
5765 * Further, we track the history of our upper and lower liquidity bounds for each channel,
5766 * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
5767 * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
5768 * formula, but using the history of a channel rather than our latest estimates for the liquidity
5773 * Mixing the `no-std` feature between serialization and deserialization results in undefined
5776 * [1]: https://arxiv.org/abs/2107.05322
5777 * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringParameters::liquidity_penalty_multiplier_msat
5778 * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringParameters::liquidity_penalty_amount_multiplier_msat
5779 * [`liquidity_offset_half_life`]: ProbabilisticScoringParameters::liquidity_offset_half_life
5780 * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringParameters::historical_liquidity_penalty_multiplier_msat
5781 * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringParameters::historical_liquidity_penalty_amount_multiplier_msat
5783 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
5785 * A pointer to the opaque Rust object.
5786 * Nearly everywhere, inner must be non-null, however in places where
5787 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5789 LDKnativeProbabilisticScorer *inner;
5791 * Indicates that this is the only struct which contains the same pointer.
5792 * Rust functions which take ownership of an object provided via an argument require
5793 * this to be true and invalidate the object pointed to by inner.
5796 } LDKProbabilisticScorer;
5799 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
5801 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
5803 * A pointer to the contents in the success state.
5804 * Reading from this pointer when `result_ok` is not set is undefined.
5806 struct LDKProbabilisticScorer *result;
5808 * A pointer to the contents in the error state.
5809 * Reading from this pointer when `result_ok` is set is undefined.
5811 struct LDKDecodeError *err;
5812 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
5815 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
5816 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
5817 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5819 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
5821 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
5822 * `err` or `result` depending on the state of `result_ok`.
5824 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
5826 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
5829 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
5834 * Features used within an `init` message.
5836 typedef struct MUST_USE_STRUCT LDKInitFeatures {
5838 * A pointer to the opaque Rust object.
5839 * Nearly everywhere, inner must be non-null, however in places where
5840 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5842 LDKnativeInitFeatures *inner;
5844 * Indicates that this is the only struct which contains the same pointer.
5845 * Rust functions which take ownership of an object provided via an argument require
5846 * this to be true and invalidate the object pointed to by inner.
5852 * The contents of CResult_InitFeaturesDecodeErrorZ
5854 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
5856 * A pointer to the contents in the success state.
5857 * Reading from this pointer when `result_ok` is not set is undefined.
5859 struct LDKInitFeatures *result;
5861 * A pointer to the contents in the error state.
5862 * Reading from this pointer when `result_ok` is set is undefined.
5864 struct LDKDecodeError *err;
5865 } LDKCResult_InitFeaturesDecodeErrorZPtr;
5868 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
5869 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5870 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5872 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
5874 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
5875 * `err` or `result` depending on the state of `result_ok`.
5877 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
5879 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
5882 } LDKCResult_InitFeaturesDecodeErrorZ;
5887 * Features used within a `channel_announcement` message.
5889 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
5891 * A pointer to the opaque Rust object.
5892 * Nearly everywhere, inner must be non-null, however in places where
5893 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5895 LDKnativeChannelFeatures *inner;
5897 * Indicates that this is the only struct which contains the same pointer.
5898 * Rust functions which take ownership of an object provided via an argument require
5899 * this to be true and invalidate the object pointed to by inner.
5902 } LDKChannelFeatures;
5905 * The contents of CResult_ChannelFeaturesDecodeErrorZ
5907 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
5909 * A pointer to the contents in the success state.
5910 * Reading from this pointer when `result_ok` is not set is undefined.
5912 struct LDKChannelFeatures *result;
5914 * A pointer to the contents in the error state.
5915 * Reading from this pointer when `result_ok` is set is undefined.
5917 struct LDKDecodeError *err;
5918 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
5921 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
5922 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5923 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5925 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
5927 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
5928 * `err` or `result` depending on the state of `result_ok`.
5930 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
5932 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
5935 } LDKCResult_ChannelFeaturesDecodeErrorZ;
5940 * Features used within a `node_announcement` message.
5942 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
5944 * A pointer to the opaque Rust object.
5945 * Nearly everywhere, inner must be non-null, however in places where
5946 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5948 LDKnativeNodeFeatures *inner;
5950 * Indicates that this is the only struct which contains the same pointer.
5951 * Rust functions which take ownership of an object provided via an argument require
5952 * this to be true and invalidate the object pointed to by inner.
5958 * The contents of CResult_NodeFeaturesDecodeErrorZ
5960 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
5962 * A pointer to the contents in the success state.
5963 * Reading from this pointer when `result_ok` is not set is undefined.
5965 struct LDKNodeFeatures *result;
5967 * A pointer to the contents in the error state.
5968 * Reading from this pointer when `result_ok` is set is undefined.
5970 struct LDKDecodeError *err;
5971 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5974 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5975 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5976 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5978 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5980 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5981 * `err` or `result` depending on the state of `result_ok`.
5983 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5985 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5988 } LDKCResult_NodeFeaturesDecodeErrorZ;
5993 * Features used within an invoice.
5995 typedef struct MUST_USE_STRUCT LDKInvoiceFeatures {
5997 * A pointer to the opaque Rust object.
5998 * Nearly everywhere, inner must be non-null, however in places where
5999 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6001 LDKnativeInvoiceFeatures *inner;
6003 * Indicates that this is the only struct which contains the same pointer.
6004 * Rust functions which take ownership of an object provided via an argument require
6005 * this to be true and invalidate the object pointed to by inner.
6008 } LDKInvoiceFeatures;
6011 * The contents of CResult_InvoiceFeaturesDecodeErrorZ
6013 typedef union LDKCResult_InvoiceFeaturesDecodeErrorZPtr {
6015 * A pointer to the contents in the success state.
6016 * Reading from this pointer when `result_ok` is not set is undefined.
6018 struct LDKInvoiceFeatures *result;
6020 * A pointer to the contents in the error state.
6021 * Reading from this pointer when `result_ok` is set is undefined.
6023 struct LDKDecodeError *err;
6024 } LDKCResult_InvoiceFeaturesDecodeErrorZPtr;
6027 * A CResult_InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
6028 * containing a crate::lightning::ln::features::InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6029 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6031 typedef struct LDKCResult_InvoiceFeaturesDecodeErrorZ {
6033 * The contents of this CResult_InvoiceFeaturesDecodeErrorZ, accessible via either
6034 * `err` or `result` depending on the state of `result_ok`.
6036 union LDKCResult_InvoiceFeaturesDecodeErrorZPtr contents;
6038 * Whether this CResult_InvoiceFeaturesDecodeErrorZ represents a success state.
6041 } LDKCResult_InvoiceFeaturesDecodeErrorZ;
6046 * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
6048 typedef struct MUST_USE_STRUCT LDKBlindedHopFeatures {
6050 * A pointer to the opaque Rust object.
6051 * Nearly everywhere, inner must be non-null, however in places where
6052 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6054 LDKnativeBlindedHopFeatures *inner;
6056 * Indicates that this is the only struct which contains the same pointer.
6057 * Rust functions which take ownership of an object provided via an argument require
6058 * this to be true and invalidate the object pointed to by inner.
6061 } LDKBlindedHopFeatures;
6064 * The contents of CResult_BlindedHopFeaturesDecodeErrorZ
6066 typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
6068 * A pointer to the contents in the success state.
6069 * Reading from this pointer when `result_ok` is not set is undefined.
6071 struct LDKBlindedHopFeatures *result;
6073 * A pointer to the contents in the error state.
6074 * Reading from this pointer when `result_ok` is set is undefined.
6076 struct LDKDecodeError *err;
6077 } LDKCResult_BlindedHopFeaturesDecodeErrorZPtr;
6080 * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
6081 * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6082 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6084 typedef struct LDKCResult_BlindedHopFeaturesDecodeErrorZ {
6086 * The contents of this CResult_BlindedHopFeaturesDecodeErrorZ, accessible via either
6087 * `err` or `result` depending on the state of `result_ok`.
6089 union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr contents;
6091 * Whether this CResult_BlindedHopFeaturesDecodeErrorZ represents a success state.
6094 } LDKCResult_BlindedHopFeaturesDecodeErrorZ;
6097 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
6099 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
6101 * A pointer to the contents in the success state.
6102 * Reading from this pointer when `result_ok` is not set is undefined.
6104 struct LDKChannelTypeFeatures *result;
6106 * A pointer to the contents in the error state.
6107 * Reading from this pointer when `result_ok` is set is undefined.
6109 struct LDKDecodeError *err;
6110 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
6113 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
6114 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
6115 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6117 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
6119 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
6120 * `err` or `result` depending on the state of `result_ok`.
6122 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
6124 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
6127 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
6130 * The contents of CResult_NodeIdDecodeErrorZ
6132 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
6134 * A pointer to the contents in the success state.
6135 * Reading from this pointer when `result_ok` is not set is undefined.
6137 struct LDKNodeId *result;
6139 * A pointer to the contents in the error state.
6140 * Reading from this pointer when `result_ok` is set is undefined.
6142 struct LDKDecodeError *err;
6143 } LDKCResult_NodeIdDecodeErrorZPtr;
6146 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
6147 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
6148 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6150 typedef struct LDKCResult_NodeIdDecodeErrorZ {
6152 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
6153 * `err` or `result` depending on the state of `result_ok`.
6155 union LDKCResult_NodeIdDecodeErrorZPtr contents;
6157 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
6160 } LDKCResult_NodeIdDecodeErrorZ;
6163 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
6165 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
6167 * A pointer to the contents in the success state.
6168 * Reading from this pointer when `result_ok` is not set is undefined.
6170 struct LDKCOption_NetworkUpdateZ *result;
6172 * A pointer to the contents in the error state.
6173 * Reading from this pointer when `result_ok` is set is undefined.
6175 struct LDKDecodeError *err;
6176 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
6179 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
6180 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
6181 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6183 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
6185 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
6186 * `err` or `result` depending on the state of `result_ok`.
6188 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
6190 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
6193 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
6196 * The contents of CResult_TxOutUtxoLookupErrorZ
6198 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
6200 * A pointer to the contents in the success state.
6201 * Reading from this pointer when `result_ok` is not set is undefined.
6203 struct LDKTxOut *result;
6205 * A pointer to the contents in the error state.
6206 * Reading from this pointer when `result_ok` is set is undefined.
6208 enum LDKUtxoLookupError *err;
6209 } LDKCResult_TxOutUtxoLookupErrorZPtr;
6212 * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
6213 * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
6214 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6216 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
6218 * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
6219 * `err` or `result` depending on the state of `result_ok`.
6221 union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
6223 * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
6226 } LDKCResult_TxOutUtxoLookupErrorZ;
6231 * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
6233 * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
6235 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
6237 * A pointer to the opaque Rust object.
6238 * Nearly everywhere, inner must be non-null, however in places where
6239 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6241 LDKnativeUtxoFuture *inner;
6243 * Indicates that this is the only struct which contains the same pointer.
6244 * Rust functions which take ownership of an object provided via an argument require
6245 * this to be true and invalidate the object pointed to by inner.
6251 * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
6252 * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
6255 typedef enum LDKUtxoResult_Tag {
6257 * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
6258 * requested or a [`UtxoLookupError`].
6262 * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
6263 * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
6265 * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
6266 * but only fairly loosely. Because a pending checks block all message processing, leaving
6267 * checks pending for an extended time may cause DoS of other functions. It is recommended you
6268 * keep a tight timeout on lookups, on the order of a few seconds.
6270 LDKUtxoResult_Async,
6272 * Must be last for serialization purposes
6274 LDKUtxoResult_Sentinel,
6275 } LDKUtxoResult_Tag;
6277 typedef struct MUST_USE_STRUCT LDKUtxoResult {
6278 LDKUtxoResult_Tag tag;
6281 struct LDKCResult_TxOutUtxoLookupErrorZ sync;
6284 struct LDKUtxoFuture async;
6290 * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
6292 typedef struct LDKUtxoLookup {
6294 * An opaque pointer which is passed to your function implementations as an argument.
6295 * This has no meaning in the LDK, and can be NULL or any other value.
6299 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
6300 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
6303 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
6305 struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
6307 * Frees any resources associated with this object given its this_arg pointer.
6308 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
6310 void (*free)(void *this_arg);
6314 * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
6316 typedef enum LDKCOption_UtxoLookupZ_Tag {
6318 * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
6320 LDKCOption_UtxoLookupZ_Some,
6322 * When we're in this state, this COption_UtxoLookupZ contains nothing
6324 LDKCOption_UtxoLookupZ_None,
6326 * Must be last for serialization purposes
6328 LDKCOption_UtxoLookupZ_Sentinel,
6329 } LDKCOption_UtxoLookupZ_Tag;
6331 typedef struct LDKCOption_UtxoLookupZ {
6332 LDKCOption_UtxoLookupZ_Tag tag;
6335 struct LDKUtxoLookup some;
6338 } LDKCOption_UtxoLookupZ;
6341 * The contents of CResult_boolLightningErrorZ
6343 typedef union LDKCResult_boolLightningErrorZPtr {
6345 * A pointer to the contents in the success state.
6346 * Reading from this pointer when `result_ok` is not set is undefined.
6350 * A pointer to the contents in the error state.
6351 * Reading from this pointer when `result_ok` is set is undefined.
6353 struct LDKLightningError *err;
6354 } LDKCResult_boolLightningErrorZPtr;
6357 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
6358 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
6359 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6361 typedef struct LDKCResult_boolLightningErrorZ {
6363 * The contents of this CResult_boolLightningErrorZ, accessible via either
6364 * `err` or `result` depending on the state of `result_ok`.
6366 union LDKCResult_boolLightningErrorZPtr contents;
6368 * Whether this CResult_boolLightningErrorZ represents a success state.
6371 } LDKCResult_boolLightningErrorZ;
6374 * A tuple of 3 elements. See the individual fields for the types contained.
6376 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
6378 * The element at position 0
6380 struct LDKChannelAnnouncement a;
6382 * The element at position 1
6384 struct LDKChannelUpdate b;
6386 * The element at position 2
6388 struct LDKChannelUpdate c;
6389 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
6392 * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
6394 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
6396 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
6398 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
6400 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
6402 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
6404 * Must be last for serialization purposes
6406 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
6407 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
6409 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
6410 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
6413 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
6416 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
6419 * The contents of CResult_NoneLightningErrorZ
6421 typedef union LDKCResult_NoneLightningErrorZPtr {
6423 * Note that this value is always NULL, as there are no contents in the OK variant
6427 * A pointer to the contents in the error state.
6428 * Reading from this pointer when `result_ok` is set is undefined.
6430 struct LDKLightningError *err;
6431 } LDKCResult_NoneLightningErrorZPtr;
6434 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
6435 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
6436 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6438 typedef struct LDKCResult_NoneLightningErrorZ {
6440 * The contents of this CResult_NoneLightningErrorZ, accessible via either
6441 * `err` or `result` depending on the state of `result_ok`.
6443 union LDKCResult_NoneLightningErrorZPtr contents;
6445 * Whether this CResult_NoneLightningErrorZ represents a success state.
6448 } LDKCResult_NoneLightningErrorZ;
6453 * Details about one direction of a channel as received within a [`ChannelUpdate`].
6455 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
6457 * A pointer to the opaque Rust object.
6458 * Nearly everywhere, inner must be non-null, however in places where
6459 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6461 LDKnativeChannelUpdateInfo *inner;
6463 * Indicates that this is the only struct which contains the same pointer.
6464 * Rust functions which take ownership of an object provided via an argument require
6465 * this to be true and invalidate the object pointed to by inner.
6468 } LDKChannelUpdateInfo;
6471 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
6473 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
6475 * A pointer to the contents in the success state.
6476 * Reading from this pointer when `result_ok` is not set is undefined.
6478 struct LDKChannelUpdateInfo *result;
6480 * A pointer to the contents in the error state.
6481 * Reading from this pointer when `result_ok` is set is undefined.
6483 struct LDKDecodeError *err;
6484 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
6487 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
6488 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6489 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6491 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
6493 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
6494 * `err` or `result` depending on the state of `result_ok`.
6496 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
6498 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
6501 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
6506 * Details about a channel (both directions).
6507 * Received within a channel announcement.
6509 typedef struct MUST_USE_STRUCT LDKChannelInfo {
6511 * A pointer to the opaque Rust object.
6512 * Nearly everywhere, inner must be non-null, however in places where
6513 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6515 LDKnativeChannelInfo *inner;
6517 * Indicates that this is the only struct which contains the same pointer.
6518 * Rust functions which take ownership of an object provided via an argument require
6519 * this to be true and invalidate the object pointed to by inner.
6525 * The contents of CResult_ChannelInfoDecodeErrorZ
6527 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
6529 * A pointer to the contents in the success state.
6530 * Reading from this pointer when `result_ok` is not set is undefined.
6532 struct LDKChannelInfo *result;
6534 * A pointer to the contents in the error state.
6535 * Reading from this pointer when `result_ok` is set is undefined.
6537 struct LDKDecodeError *err;
6538 } LDKCResult_ChannelInfoDecodeErrorZPtr;
6541 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
6542 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6543 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6545 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
6547 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
6548 * `err` or `result` depending on the state of `result_ok`.
6550 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
6552 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
6555 } LDKCResult_ChannelInfoDecodeErrorZ;
6560 * Fees for routing via a given channel or a node
6562 typedef struct MUST_USE_STRUCT LDKRoutingFees {
6564 * A pointer to the opaque Rust object.
6565 * Nearly everywhere, inner must be non-null, however in places where
6566 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6568 LDKnativeRoutingFees *inner;
6570 * Indicates that this is the only struct which contains the same pointer.
6571 * Rust functions which take ownership of an object provided via an argument require
6572 * this to be true and invalidate the object pointed to by inner.
6578 * The contents of CResult_RoutingFeesDecodeErrorZ
6580 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
6582 * A pointer to the contents in the success state.
6583 * Reading from this pointer when `result_ok` is not set is undefined.
6585 struct LDKRoutingFees *result;
6587 * A pointer to the contents in the error state.
6588 * Reading from this pointer when `result_ok` is set is undefined.
6590 struct LDKDecodeError *err;
6591 } LDKCResult_RoutingFeesDecodeErrorZPtr;
6594 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
6595 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
6596 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6598 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
6600 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
6601 * `err` or `result` depending on the state of `result_ok`.
6603 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
6605 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
6608 } LDKCResult_RoutingFeesDecodeErrorZ;
6611 * A 4-byte byte array.
6613 typedef struct LDKFourBytes {
6621 * A 12-byte byte array.
6623 typedef struct LDKTwelveBytes {
6633 * Represents a hostname for serialization purposes.
6634 * Only the character set and length will be validated.
6635 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
6636 * Its length is guaranteed to be representable by a single byte.
6637 * This serialization is used by [`BOLT 7`] hostnames.
6639 * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
6641 typedef struct MUST_USE_STRUCT LDKHostname {
6643 * A pointer to the opaque Rust object.
6644 * Nearly everywhere, inner must be non-null, however in places where
6645 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6647 LDKnativeHostname *inner;
6649 * Indicates that this is the only struct which contains the same pointer.
6650 * Rust functions which take ownership of an object provided via an argument require
6651 * this to be true and invalidate the object pointed to by inner.
6657 * An address which can be used to connect to a remote peer.
6659 typedef enum LDKNetAddress_Tag {
6661 * An IPv4 address/port on which the peer is listening.
6665 * An IPv6 address/port on which the peer is listening.
6669 * An old-style Tor onion address/port on which the peer is listening.
6671 * This field is deprecated and the Tor network generally no longer supports V2 Onion
6672 * addresses. Thus, the details are not parsed here.
6674 LDKNetAddress_OnionV2,
6676 * A new-style Tor onion address/port on which the peer is listening.
6678 * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
6679 * wrap as base32 and append \".onion\".
6681 LDKNetAddress_OnionV3,
6683 * A hostname/port on which the peer is listening.
6685 LDKNetAddress_Hostname,
6687 * Must be last for serialization purposes
6689 LDKNetAddress_Sentinel,
6690 } LDKNetAddress_Tag;
6692 typedef struct LDKNetAddress_LDKIPv4_Body {
6694 * The 4-byte IPv4 address
6696 struct LDKFourBytes addr;
6698 * The port on which the node is listening
6701 } LDKNetAddress_LDKIPv4_Body;
6703 typedef struct LDKNetAddress_LDKIPv6_Body {
6705 * The 16-byte IPv6 address
6707 struct LDKSixteenBytes addr;
6709 * The port on which the node is listening
6712 } LDKNetAddress_LDKIPv6_Body;
6714 typedef struct LDKNetAddress_LDKOnionV3_Body {
6716 * The ed25519 long-term public key of the peer
6718 struct LDKThirtyTwoBytes ed25519_pubkey;
6720 * The checksum of the pubkey and version, as included in the onion address
6724 * The version byte, as defined by the Tor Onion v3 spec.
6728 * The port on which the node is listening
6731 } LDKNetAddress_LDKOnionV3_Body;
6733 typedef struct LDKNetAddress_LDKHostname_Body {
6735 * The hostname on which the node is listening.
6737 struct LDKHostname hostname;
6739 * The port on which the node is listening.
6742 } LDKNetAddress_LDKHostname_Body;
6744 typedef struct MUST_USE_STRUCT LDKNetAddress {
6745 LDKNetAddress_Tag tag;
6747 LDKNetAddress_LDKIPv4_Body i_pv4;
6748 LDKNetAddress_LDKIPv6_Body i_pv6;
6750 struct LDKTwelveBytes onion_v2;
6752 LDKNetAddress_LDKOnionV3_Body onion_v3;
6753 LDKNetAddress_LDKHostname_Body hostname;
6758 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
6759 * This corresponds to std::vector in C++
6761 typedef struct LDKCVec_NetAddressZ {
6763 * The elements in the array.
6764 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6766 struct LDKNetAddress *data;
6768 * The number of elements pointed to by `data`.
6771 } LDKCVec_NetAddressZ;
6776 * Information received in the latest node_announcement from this node.
6778 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
6780 * A pointer to the opaque Rust object.
6781 * Nearly everywhere, inner must be non-null, however in places where
6782 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6784 LDKnativeNodeAnnouncementInfo *inner;
6786 * Indicates that this is the only struct which contains the same pointer.
6787 * Rust functions which take ownership of an object provided via an argument require
6788 * this to be true and invalidate the object pointed to by inner.
6791 } LDKNodeAnnouncementInfo;
6794 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
6796 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
6798 * A pointer to the contents in the success state.
6799 * Reading from this pointer when `result_ok` is not set is undefined.
6801 struct LDKNodeAnnouncementInfo *result;
6803 * A pointer to the contents in the error state.
6804 * Reading from this pointer when `result_ok` is set is undefined.
6806 struct LDKDecodeError *err;
6807 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
6810 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
6811 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6812 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6814 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
6816 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
6817 * `err` or `result` depending on the state of `result_ok`.
6819 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
6821 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
6824 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
6829 * A user-defined name for a node, which may be used when displaying the node in a graph.
6831 * Since node aliases are provided by third parties, they are a potential avenue for injection
6832 * attacks. Care must be taken when processing.
6834 typedef struct MUST_USE_STRUCT LDKNodeAlias {
6836 * A pointer to the opaque Rust object.
6837 * Nearly everywhere, inner must be non-null, however in places where
6838 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6840 LDKnativeNodeAlias *inner;
6842 * Indicates that this is the only struct which contains the same pointer.
6843 * Rust functions which take ownership of an object provided via an argument require
6844 * this to be true and invalidate the object pointed to by inner.
6850 * The contents of CResult_NodeAliasDecodeErrorZ
6852 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
6854 * A pointer to the contents in the success state.
6855 * Reading from this pointer when `result_ok` is not set is undefined.
6857 struct LDKNodeAlias *result;
6859 * A pointer to the contents in the error state.
6860 * Reading from this pointer when `result_ok` is set is undefined.
6862 struct LDKDecodeError *err;
6863 } LDKCResult_NodeAliasDecodeErrorZPtr;
6866 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
6867 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
6868 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6870 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
6872 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
6873 * `err` or `result` depending on the state of `result_ok`.
6875 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
6877 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
6880 } LDKCResult_NodeAliasDecodeErrorZ;
6885 * Details about a node in the network, known from the network announcement.
6887 typedef struct MUST_USE_STRUCT LDKNodeInfo {
6889 * A pointer to the opaque Rust object.
6890 * Nearly everywhere, inner must be non-null, however in places where
6891 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6893 LDKnativeNodeInfo *inner;
6895 * Indicates that this is the only struct which contains the same pointer.
6896 * Rust functions which take ownership of an object provided via an argument require
6897 * this to be true and invalidate the object pointed to by inner.
6903 * The contents of CResult_NodeInfoDecodeErrorZ
6905 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
6907 * A pointer to the contents in the success state.
6908 * Reading from this pointer when `result_ok` is not set is undefined.
6910 struct LDKNodeInfo *result;
6912 * A pointer to the contents in the error state.
6913 * Reading from this pointer when `result_ok` is set is undefined.
6915 struct LDKDecodeError *err;
6916 } LDKCResult_NodeInfoDecodeErrorZPtr;
6919 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
6920 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6921 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6923 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
6925 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
6926 * `err` or `result` depending on the state of `result_ok`.
6928 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
6930 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
6933 } LDKCResult_NodeInfoDecodeErrorZ;
6936 * The contents of CResult_NetworkGraphDecodeErrorZ
6938 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
6940 * A pointer to the contents in the success state.
6941 * Reading from this pointer when `result_ok` is not set is undefined.
6943 struct LDKNetworkGraph *result;
6945 * A pointer to the contents in the error state.
6946 * Reading from this pointer when `result_ok` is set is undefined.
6948 struct LDKDecodeError *err;
6949 } LDKCResult_NetworkGraphDecodeErrorZPtr;
6952 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
6953 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
6954 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6956 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
6958 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
6959 * `err` or `result` depending on the state of `result_ok`.
6961 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
6963 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
6966 } LDKCResult_NetworkGraphDecodeErrorZ;
6969 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
6971 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
6973 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
6975 LDKCOption_CVec_NetAddressZZ_Some,
6977 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
6979 LDKCOption_CVec_NetAddressZZ_None,
6981 * Must be last for serialization purposes
6983 LDKCOption_CVec_NetAddressZZ_Sentinel,
6984 } LDKCOption_CVec_NetAddressZZ_Tag;
6986 typedef struct LDKCOption_CVec_NetAddressZZ {
6987 LDKCOption_CVec_NetAddressZZ_Tag tag;
6990 struct LDKCVec_NetAddressZ some;
6993 } LDKCOption_CVec_NetAddressZZ;
6996 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
6998 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
7000 * A pointer to the contents in the success state.
7001 * Reading from this pointer when `result_ok` is not set is undefined.
7003 struct LDKDelayedPaymentOutputDescriptor *result;
7005 * A pointer to the contents in the error state.
7006 * Reading from this pointer when `result_ok` is set is undefined.
7008 struct LDKDecodeError *err;
7009 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
7012 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
7013 * containing a crate::lightning::chain::keysinterface::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
7014 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7016 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
7018 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
7019 * `err` or `result` depending on the state of `result_ok`.
7021 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
7023 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
7026 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
7029 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
7031 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
7033 * A pointer to the contents in the success state.
7034 * Reading from this pointer when `result_ok` is not set is undefined.
7036 struct LDKStaticPaymentOutputDescriptor *result;
7038 * A pointer to the contents in the error state.
7039 * Reading from this pointer when `result_ok` is set is undefined.
7041 struct LDKDecodeError *err;
7042 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
7045 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
7046 * containing a crate::lightning::chain::keysinterface::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
7047 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7049 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
7051 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
7052 * `err` or `result` depending on the state of `result_ok`.
7054 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
7056 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
7059 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
7062 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
7064 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
7066 * A pointer to the contents in the success state.
7067 * Reading from this pointer when `result_ok` is not set is undefined.
7069 struct LDKSpendableOutputDescriptor *result;
7071 * A pointer to the contents in the error state.
7072 * Reading from this pointer when `result_ok` is set is undefined.
7074 struct LDKDecodeError *err;
7075 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
7078 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
7079 * containing a crate::lightning::chain::keysinterface::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
7080 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7082 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
7084 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
7085 * `err` or `result` depending on the state of `result_ok`.
7087 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
7089 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
7092 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
7095 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
7096 * This corresponds to std::vector in C++
7098 typedef struct LDKCVec_PaymentPreimageZ {
7100 * The elements in the array.
7101 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7103 struct LDKThirtyTwoBytes *data;
7105 * The number of elements pointed to by `data`.
7108 } LDKCVec_PaymentPreimageZ;
7111 * A tuple of 2 elements. See the individual fields for the types contained.
7113 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
7115 * The element at position 0
7117 struct LDKSignature a;
7119 * The element at position 1
7121 struct LDKCVec_SignatureZ b;
7122 } LDKC2Tuple_SignatureCVec_SignatureZZ;
7125 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
7127 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
7129 * A pointer to the contents in the success state.
7130 * Reading from this pointer when `result_ok` is not set is undefined.
7132 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
7134 * Note that this value is always NULL, as there are no contents in the Err variant
7137 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
7140 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
7141 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
7142 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7144 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
7146 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
7147 * `err` or `result` depending on the state of `result_ok`.
7149 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
7151 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
7154 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
7157 * The contents of CResult_SignatureNoneZ
7159 typedef union LDKCResult_SignatureNoneZPtr {
7161 * A pointer to the contents in the success state.
7162 * Reading from this pointer when `result_ok` is not set is undefined.
7164 struct LDKSignature *result;
7166 * Note that this value is always NULL, as there are no contents in the Err variant
7169 } LDKCResult_SignatureNoneZPtr;
7172 * A CResult_SignatureNoneZ represents the result of a fallible operation,
7173 * containing a crate::c_types::Signature on success and a () on failure.
7174 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7176 typedef struct LDKCResult_SignatureNoneZ {
7178 * The contents of this CResult_SignatureNoneZ, accessible via either
7179 * `err` or `result` depending on the state of `result_ok`.
7181 union LDKCResult_SignatureNoneZPtr contents;
7183 * Whether this CResult_SignatureNoneZ represents a success state.
7186 } LDKCResult_SignatureNoneZ;
7189 * The contents of CResult_PublicKeyNoneZ
7191 typedef union LDKCResult_PublicKeyNoneZPtr {
7193 * A pointer to the contents in the success state.
7194 * Reading from this pointer when `result_ok` is not set is undefined.
7196 struct LDKPublicKey *result;
7198 * Note that this value is always NULL, as there are no contents in the Err variant
7201 } LDKCResult_PublicKeyNoneZPtr;
7204 * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
7205 * containing a crate::c_types::PublicKey on success and a () on failure.
7206 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7208 typedef struct LDKCResult_PublicKeyNoneZ {
7210 * The contents of this CResult_PublicKeyNoneZ, accessible via either
7211 * `err` or `result` depending on the state of `result_ok`.
7213 union LDKCResult_PublicKeyNoneZPtr contents;
7215 * Whether this CResult_PublicKeyNoneZ represents a success state.
7218 } LDKCResult_PublicKeyNoneZ;
7221 * An enum which can either contain a crate::c_types::BigEndianScalar or not
7223 typedef enum LDKCOption_ScalarZ_Tag {
7225 * When we're in this state, this COption_ScalarZ contains a crate::c_types::BigEndianScalar
7227 LDKCOption_ScalarZ_Some,
7229 * When we're in this state, this COption_ScalarZ contains nothing
7231 LDKCOption_ScalarZ_None,
7233 * Must be last for serialization purposes
7235 LDKCOption_ScalarZ_Sentinel,
7236 } LDKCOption_ScalarZ_Tag;
7238 typedef struct LDKCOption_ScalarZ {
7239 LDKCOption_ScalarZ_Tag tag;
7242 struct LDKBigEndianScalar some;
7245 } LDKCOption_ScalarZ;
7248 * The contents of CResult_SharedSecretNoneZ
7250 typedef union LDKCResult_SharedSecretNoneZPtr {
7252 * A pointer to the contents in the success state.
7253 * Reading from this pointer when `result_ok` is not set is undefined.
7255 struct LDKThirtyTwoBytes *result;
7257 * Note that this value is always NULL, as there are no contents in the Err variant
7260 } LDKCResult_SharedSecretNoneZPtr;
7263 * A CResult_SharedSecretNoneZ represents the result of a fallible operation,
7264 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
7265 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7267 typedef struct LDKCResult_SharedSecretNoneZ {
7269 * The contents of this CResult_SharedSecretNoneZ, accessible via either
7270 * `err` or `result` depending on the state of `result_ok`.
7272 union LDKCResult_SharedSecretNoneZPtr contents;
7274 * Whether this CResult_SharedSecretNoneZ represents a success state.
7277 } LDKCResult_SharedSecretNoneZ;
7280 * Integer in the range `0..32`
7282 typedef struct LDKU5 {
7287 * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
7288 * This corresponds to std::vector in C++
7290 typedef struct LDKCVec_U5Z {
7292 * The elements in the array.
7293 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7297 * The number of elements pointed to by `data`.
7303 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
7304 * allows recovering the exact public key which created the signature given the message.
7306 typedef struct LDKRecoverableSignature {
7308 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
7311 uint8_t serialized_form[68];
7312 } LDKRecoverableSignature;
7315 * The contents of CResult_RecoverableSignatureNoneZ
7317 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
7319 * A pointer to the contents in the success state.
7320 * Reading from this pointer when `result_ok` is not set is undefined.
7322 struct LDKRecoverableSignature *result;
7324 * Note that this value is always NULL, as there are no contents in the Err variant
7327 } LDKCResult_RecoverableSignatureNoneZPtr;
7330 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
7331 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
7332 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7334 typedef struct LDKCResult_RecoverableSignatureNoneZ {
7336 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
7337 * `err` or `result` depending on the state of `result_ok`.
7339 union LDKCResult_RecoverableSignatureNoneZPtr contents;
7341 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
7344 } LDKCResult_RecoverableSignatureNoneZ;
7349 * This class tracks the per-transaction information needed to build a closing transaction and will
7350 * actually build it and sign.
7352 * This class can be used inside a signer implementation to generate a signature given the relevant
7355 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
7357 * A pointer to the opaque Rust object.
7358 * Nearly everywhere, inner must be non-null, however in places where
7359 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7361 LDKnativeClosingTransaction *inner;
7363 * Indicates that this is the only struct which contains the same pointer.
7364 * Rust functions which take ownership of an object provided via an argument require
7365 * this to be true and invalidate the object pointed to by inner.
7368 } LDKClosingTransaction;
7373 * The unsigned part of a [`channel_announcement`] message.
7375 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
7377 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
7379 * A pointer to the opaque Rust object.
7380 * Nearly everywhere, inner must be non-null, however in places where
7381 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7383 LDKnativeUnsignedChannelAnnouncement *inner;
7385 * Indicates that this is the only struct which contains the same pointer.
7386 * Rust functions which take ownership of an object provided via an argument require
7387 * this to be true and invalidate the object pointed to by inner.
7390 } LDKUnsignedChannelAnnouncement;
7393 * A trait to handle Lightning channel key material without concretizing the channel type or
7394 * the signature mechanism.
7396 typedef struct LDKChannelSigner {
7398 * An opaque pointer which is passed to your function implementations as an argument.
7399 * This has no meaning in the LDK, and can be NULL or any other value.
7403 * Gets the per-commitment point for a specific commitment number
7405 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
7407 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
7409 * Gets the commitment secret for a specific commitment number as part of the revocation process
7411 * An external signer implementation should error here if the commitment was already signed
7412 * and should refuse to sign it in the future.
7414 * May be called more than once for the same index.
7416 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
7418 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
7420 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
7422 * This is required in order for the signer to make sure that releasing a commitment
7423 * secret won't leave us without a broadcastable holder transaction.
7424 * Policy checks should be implemented in this function, including checking the amount
7425 * sent to us and checking the HTLCs.
7427 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
7428 * A validating signer should ensure that an HTLC output is removed only when the matching
7429 * preimage is provided, or when the value to holder is restored.
7431 * Note that all the relevant preimages will be provided, but there may also be additional
7432 * irrelevant or duplicate preimages.
7434 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages);
7436 * Returns the holder's channel public keys and basepoints.
7438 struct LDKChannelPublicKeys pubkeys;
7440 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
7441 * Note that this takes a pointer to this object, not the this_ptr like other methods do
7442 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
7444 void (*set_pubkeys)(const struct LDKChannelSigner*NONNULL_PTR );
7446 * Returns an arbitrary identifier describing the set of keys which are provided back to you in
7447 * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
7448 * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys.
7450 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
7452 * Set the counterparty static channel data, including basepoints,
7453 * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
7455 * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
7456 * instance, LDK will call this method exactly once - either immediately after construction
7457 * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
7458 * information has been generated.
7460 * channel_parameters.is_populated() MUST be true.
7462 void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
7464 * Frees any resources associated with this object given its this_arg pointer.
7465 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7467 void (*free)(void *this_arg);
7471 * A trait to sign Lightning channel transactions as described in
7472 * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
7474 * Signing services could be implemented on a hardware wallet and should implement signing
7475 * policies in order to be secure. Please refer to the [VLS Policy
7476 * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
7477 * for an example of such policies.
7479 typedef struct LDKEcdsaChannelSigner {
7481 * An opaque pointer which is passed to your function implementations as an argument.
7482 * This has no meaning in the LDK, and can be NULL or any other value.
7486 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
7488 * Note that if signing fails or is rejected, the channel will be force-closed.
7490 * Policy checks should be implemented in this function, including checking the amount
7491 * sent to us and checking the HTLCs.
7493 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
7494 * A validating signer should ensure that an HTLC output is removed only when the matching
7495 * preimage is provided, or when the value to holder is restored.
7497 * Note that all the relevant preimages will be provided, but there may also be additional
7498 * irrelevant or duplicate preimages.
7500 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages);
7502 * Validate the counterparty's revocation.
7504 * This is required in order for the signer to make sure that the state has moved
7505 * forward and it is safe to sign the next counterparty commitment.
7507 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
7509 * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions.
7511 * This will be called
7512 * - with a non-revoked `commitment_tx`.
7513 * - with the latest `commitment_tx` when we initiate a force-close.
7514 * - with the previous `commitment_tx`, just to get claiming HTLC
7515 * signatures, if we are reacting to a [`ChannelMonitor`]
7516 * [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
7517 * that decided to broadcast before it had been updated to the latest `commitment_tx`.
7519 * This may be called multiple times for the same transaction.
7521 * An external signer implementation should check that the commitment has not been revoked.
7523 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
7525 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
7527 * Create a signature for the given input in a transaction spending an HTLC transaction output
7528 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
7530 * A justice transaction may claim multiple outputs at the same time if timelocks are
7531 * similar, but only a signature for the input at index `input` should be signed for here.
7532 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
7533 * to an upcoming timelock expiration.
7535 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
7537 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
7538 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
7539 * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
7542 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]);
7544 * Create a signature for the given input in a transaction spending a commitment transaction
7545 * HTLC output when our counterparty broadcasts an old state.
7547 * A justice transaction may claim multiple outputs at the same time if timelocks are
7548 * similar, but only a signature for the input at index `input` should be signed for here.
7549 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
7550 * to an upcoming timelock expiration.
7552 * `amount` is the value of the output spent by this input, committed to in the BIP 143
7555 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
7556 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
7557 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
7560 * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
7561 * (which is committed to in the BIP 143 signatures).
7563 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);
7565 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
7566 * transaction, either offered or received.
7568 * Such a transaction may claim multiples offered outputs at same time if we know the
7569 * preimage for each when we create it, but only the input at index `input` should be
7570 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
7571 * needed with regards to an upcoming timelock expiration.
7573 * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
7576 * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
7578 * `per_commitment_point` is the dynamic point corresponding to the channel state
7579 * detected onchain. It has been generated by our counterparty and is used to derive
7580 * channel state keys, which are then included in the witness script and committed to in the
7581 * BIP 143 signature.
7583 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);
7585 * Create a signature for a (proposed) closing transaction.
7587 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
7588 * chosen to forgo their output as dust.
7590 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
7592 * Computes the signature for a commitment transaction's anchor output used as an
7593 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
7595 struct LDKCResult_SignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
7597 * Signs a channel announcement message with our funding key proving it comes from one of the
7598 * channel participants.
7600 * Channel announcements also require a signature from each node's network key. Our node
7601 * signature is computed through [`NodeSigner::sign_gossip_message`].
7603 * Note that if this fails or is rejected, the channel will not be publicly announced and
7604 * our counterparty may (though likely will not) close the channel on us for violating the
7607 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement_with_funding_key)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
7609 * Implementation of ChannelSigner for this object.
7611 struct LDKChannelSigner ChannelSigner;
7613 * Frees any resources associated with this object given its this_arg pointer.
7614 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7616 void (*free)(void *this_arg);
7617 } LDKEcdsaChannelSigner;
7620 * A writeable signer.
7622 * There will always be two instances of a signer per channel, one occupied by the
7623 * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
7625 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
7626 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
7628 typedef struct LDKWriteableEcdsaChannelSigner {
7630 * An opaque pointer which is passed to your function implementations as an argument.
7631 * This has no meaning in the LDK, and can be NULL or any other value.
7635 * Implementation of EcdsaChannelSigner for this object.
7637 struct LDKEcdsaChannelSigner EcdsaChannelSigner;
7639 * Serialize the object into a byte array
7641 struct LDKCVec_u8Z (*write)(const void *this_arg);
7643 * Frees any resources associated with this object given its this_arg pointer.
7644 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
7646 void (*free)(void *this_arg);
7647 } LDKWriteableEcdsaChannelSigner;
7650 * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
7652 typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
7654 * A pointer to the contents in the success state.
7655 * Reading from this pointer when `result_ok` is not set is undefined.
7657 struct LDKWriteableEcdsaChannelSigner *result;
7659 * A pointer to the contents in the error state.
7660 * Reading from this pointer when `result_ok` is set is undefined.
7662 struct LDKDecodeError *err;
7663 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr;
7666 * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
7667 * containing a crate::lightning::chain::keysinterface::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
7668 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7670 typedef struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ {
7672 * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
7673 * `err` or `result` depending on the state of `result_ok`.
7675 union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
7677 * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
7680 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
7683 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
7684 * This corresponds to std::vector in C++
7686 typedef struct LDKCVec_CVec_u8ZZ {
7688 * The elements in the array.
7689 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7691 struct LDKCVec_u8Z *data;
7693 * The number of elements pointed to by `data`.
7696 } LDKCVec_CVec_u8ZZ;
7699 * The contents of CResult_CVec_CVec_u8ZZNoneZ
7701 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
7703 * A pointer to the contents in the success state.
7704 * Reading from this pointer when `result_ok` is not set is undefined.
7706 struct LDKCVec_CVec_u8ZZ *result;
7708 * Note that this value is always NULL, as there are no contents in the Err variant
7711 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
7714 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
7715 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
7716 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7718 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
7720 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
7721 * `err` or `result` depending on the state of `result_ok`.
7723 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
7725 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
7728 } LDKCResult_CVec_CVec_u8ZZNoneZ;
7733 * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
7735 * This implementation performs no policy checks and is insufficient by itself as
7736 * a secure external signer.
7738 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
7740 * A pointer to the opaque Rust object.
7741 * Nearly everywhere, inner must be non-null, however in places where
7742 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7744 LDKnativeInMemorySigner *inner;
7746 * Indicates that this is the only struct which contains the same pointer.
7747 * Rust functions which take ownership of an object provided via an argument require
7748 * this to be true and invalidate the object pointed to by inner.
7751 } LDKInMemorySigner;
7754 * The contents of CResult_InMemorySignerDecodeErrorZ
7756 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
7758 * A pointer to the contents in the success state.
7759 * Reading from this pointer when `result_ok` is not set is undefined.
7761 struct LDKInMemorySigner *result;
7763 * A pointer to the contents in the error state.
7764 * Reading from this pointer when `result_ok` is set is undefined.
7766 struct LDKDecodeError *err;
7767 } LDKCResult_InMemorySignerDecodeErrorZPtr;
7770 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
7771 * containing a crate::lightning::chain::keysinterface::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
7772 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7774 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
7776 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
7777 * `err` or `result` depending on the state of `result_ok`.
7779 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
7781 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
7784 } LDKCResult_InMemorySignerDecodeErrorZ;
7787 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
7788 * This corresponds to std::vector in C++
7790 typedef struct LDKCVec_TxOutZ {
7792 * The elements in the array.
7793 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7795 struct LDKTxOut *data;
7797 * The number of elements pointed to by `data`.
7803 * The contents of CResult_TransactionNoneZ
7805 typedef union LDKCResult_TransactionNoneZPtr {
7807 * A pointer to the contents in the success state.
7808 * Reading from this pointer when `result_ok` is not set is undefined.
7810 struct LDKTransaction *result;
7812 * Note that this value is always NULL, as there are no contents in the Err variant
7815 } LDKCResult_TransactionNoneZPtr;
7818 * A CResult_TransactionNoneZ represents the result of a fallible operation,
7819 * containing a crate::c_types::Transaction on success and a () on failure.
7820 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7822 typedef struct LDKCResult_TransactionNoneZ {
7824 * The contents of this CResult_TransactionNoneZ, accessible via either
7825 * `err` or `result` depending on the state of `result_ok`.
7827 union LDKCResult_TransactionNoneZPtr contents;
7829 * Whether this CResult_TransactionNoneZ represents a success state.
7832 } LDKCResult_TransactionNoneZ;
7837 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
7838 * on-chain transactions to ensure no loss of funds occurs.
7840 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
7841 * information and are actively monitoring the chain.
7843 * Pending Events or updated HTLCs which have not yet been read out by
7844 * get_and_clear_pending_monitor_events or get_and_clear_pending_events are serialized to disk and
7845 * reloaded at deserialize-time. Thus, you must ensure that, when handling events, all events
7846 * gotten are fully handled before re-serializing the new state.
7848 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
7849 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
7850 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
7851 * returned block hash and the the current chain and then reconnecting blocks to get to the
7852 * best chain) upon deserializing the object!
7854 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
7856 * A pointer to the opaque Rust object.
7857 * Nearly everywhere, inner must be non-null, however in places where
7858 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7860 LDKnativeChannelMonitor *inner;
7862 * Indicates that this is the only struct which contains the same pointer.
7863 * Rust functions which take ownership of an object provided via an argument require
7864 * this to be true and invalidate the object pointed to by inner.
7867 } LDKChannelMonitor;
7870 * A tuple of 2 elements. See the individual fields for the types contained.
7872 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
7874 * The element at position 0
7876 struct LDKThirtyTwoBytes a;
7878 * The element at position 1
7880 struct LDKChannelMonitor b;
7881 } LDKC2Tuple_BlockHashChannelMonitorZ;
7884 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
7885 * This corresponds to std::vector in C++
7887 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
7889 * The elements in the array.
7890 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7892 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
7894 * The number of elements pointed to by `data`.
7897 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
7900 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
7902 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
7904 * A pointer to the contents in the success state.
7905 * Reading from this pointer when `result_ok` is not set is undefined.
7907 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
7909 * A pointer to the contents in the error state.
7910 * Reading from this pointer when `result_ok` is set is undefined.
7912 enum LDKIOError *err;
7913 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
7916 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
7917 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
7918 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7920 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
7922 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
7923 * `err` or `result` depending on the state of `result_ok`.
7925 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
7927 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
7930 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
7933 * An enum which can either contain a u16 or not
7935 typedef enum LDKCOption_u16Z_Tag {
7937 * When we're in this state, this COption_u16Z contains a u16
7939 LDKCOption_u16Z_Some,
7941 * When we're in this state, this COption_u16Z contains nothing
7943 LDKCOption_u16Z_None,
7945 * Must be last for serialization purposes
7947 LDKCOption_u16Z_Sentinel,
7948 } LDKCOption_u16Z_Tag;
7950 typedef struct LDKCOption_u16Z {
7951 LDKCOption_u16Z_Tag tag;
7960 * The contents of CResult__u832APIErrorZ
7962 typedef union LDKCResult__u832APIErrorZPtr {
7964 * A pointer to the contents in the success state.
7965 * Reading from this pointer when `result_ok` is not set is undefined.
7967 struct LDKThirtyTwoBytes *result;
7969 * A pointer to the contents in the error state.
7970 * Reading from this pointer when `result_ok` is set is undefined.
7972 struct LDKAPIError *err;
7973 } LDKCResult__u832APIErrorZPtr;
7976 * A CResult__u832APIErrorZ represents the result of a fallible operation,
7977 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7978 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7980 typedef struct LDKCResult__u832APIErrorZ {
7982 * The contents of this CResult__u832APIErrorZ, accessible via either
7983 * `err` or `result` depending on the state of `result_ok`.
7985 union LDKCResult__u832APIErrorZPtr contents;
7987 * Whether this CResult__u832APIErrorZ represents a success state.
7990 } LDKCResult__u832APIErrorZ;
7993 * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
7994 * These include payments that have yet to find a successful path, or have unresolved HTLCs.
7996 typedef enum LDKRecentPaymentDetails_Tag {
7998 * When a payment is still being sent and awaiting successful delivery.
8000 LDKRecentPaymentDetails_Pending,
8002 * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
8003 * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
8004 * payment is removed from tracking.
8006 LDKRecentPaymentDetails_Fulfilled,
8008 * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
8009 * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
8010 * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
8012 LDKRecentPaymentDetails_Abandoned,
8014 * Must be last for serialization purposes
8016 LDKRecentPaymentDetails_Sentinel,
8017 } LDKRecentPaymentDetails_Tag;
8019 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
8021 * Hash of the payment that is currently being sent but has yet to be fulfilled or
8024 struct LDKThirtyTwoBytes payment_hash;
8026 * Total amount (in msat, excluding fees) across all paths for this payment,
8027 * not just the amount currently inflight.
8029 uint64_t total_msat;
8030 } LDKRecentPaymentDetails_LDKPending_Body;
8032 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
8034 * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
8035 * made before LDK version 0.0.104.
8037 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8039 struct LDKThirtyTwoBytes payment_hash;
8040 } LDKRecentPaymentDetails_LDKFulfilled_Body;
8042 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
8044 * Hash of the payment that we have given up trying to send.
8046 struct LDKThirtyTwoBytes payment_hash;
8047 } LDKRecentPaymentDetails_LDKAbandoned_Body;
8049 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
8050 LDKRecentPaymentDetails_Tag tag;
8052 LDKRecentPaymentDetails_LDKPending_Body pending;
8053 LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
8054 LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
8056 } LDKRecentPaymentDetails;
8059 * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
8060 * This corresponds to std::vector in C++
8062 typedef struct LDKCVec_RecentPaymentDetailsZ {
8064 * The elements in the array.
8065 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8067 struct LDKRecentPaymentDetails *data;
8069 * The number of elements pointed to by `data`.
8072 } LDKCVec_RecentPaymentDetailsZ;
8075 * If a payment fails to send with [`ChannelManager::send_payment`], it can be in one of several
8076 * states. This enum is returned as the Err() type describing which state the payment is in, see
8077 * the description of individual enum states for more.
8079 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
8081 typedef enum LDKPaymentSendFailure_Tag {
8083 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
8084 * send the payment at all.
8086 * You can freely resend the payment in full (with the parameter error fixed).
8088 * Because the payment failed outright, no payment tracking is done and no
8089 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8091 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
8092 * [`Event::PaymentFailed`]: crate::util::events::Event::PaymentFailed
8094 LDKPaymentSendFailure_ParameterError,
8096 * A parameter in a single path which was passed to send_payment was invalid, preventing us
8097 * from attempting to send the payment at all.
8099 * You can freely resend the payment in full (with the parameter error fixed).
8101 * Because the payment failed outright, no payment tracking is done and no
8102 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8104 * The results here are ordered the same as the paths in the route object which was passed to
8107 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
8108 * [`Event::PaymentFailed`]: crate::util::events::Event::PaymentFailed
8110 LDKPaymentSendFailure_PathParameterError,
8112 * All paths which were attempted failed to send, with no channel state change taking place.
8113 * You can freely resend the payment in full (though you probably want to do so over different
8114 * paths than the ones selected).
8116 * Because the payment failed outright, no payment tracking is done and no
8117 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8119 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
8120 * [`Event::PaymentFailed`]: crate::util::events::Event::PaymentFailed
8122 LDKPaymentSendFailure_AllFailedResendSafe,
8124 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
8125 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
8127 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
8128 * [`Event::PaymentSent`]: crate::util::events::Event::PaymentSent
8129 * [`Event::PaymentFailed`]: crate::util::events::Event::PaymentFailed
8131 LDKPaymentSendFailure_DuplicatePayment,
8133 * Some paths that were attempted failed to send, though some paths may have succeeded. At least
8134 * some paths have irrevocably committed to the HTLC.
8136 * The results here are ordered the same as the paths in the route object that was passed to
8139 * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
8140 * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
8142 * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
8144 LDKPaymentSendFailure_PartialFailure,
8146 * Must be last for serialization purposes
8148 LDKPaymentSendFailure_Sentinel,
8149 } LDKPaymentSendFailure_Tag;
8151 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
8153 * The errors themselves, in the same order as the paths from the route.
8155 struct LDKCVec_CResult_NoneAPIErrorZZ results;
8157 * If some paths failed without irrevocably committing to the new HTLC(s), this will
8158 * contain a [`RouteParameters`] object for the failing paths.
8160 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8162 struct LDKRouteParameters failed_paths_retry;
8164 * The payment id for the payment, which is now at least partially pending.
8166 struct LDKThirtyTwoBytes payment_id;
8167 } LDKPaymentSendFailure_LDKPartialFailure_Body;
8169 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
8170 LDKPaymentSendFailure_Tag tag;
8173 struct LDKAPIError parameter_error;
8176 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
8179 struct LDKCVec_APIErrorZ all_failed_resend_safe;
8181 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
8183 } LDKPaymentSendFailure;
8186 * The contents of CResult_NonePaymentSendFailureZ
8188 typedef union LDKCResult_NonePaymentSendFailureZPtr {
8190 * Note that this value is always NULL, as there are no contents in the OK variant
8194 * A pointer to the contents in the error state.
8195 * Reading from this pointer when `result_ok` is set is undefined.
8197 struct LDKPaymentSendFailure *err;
8198 } LDKCResult_NonePaymentSendFailureZPtr;
8201 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
8202 * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8203 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8205 typedef struct LDKCResult_NonePaymentSendFailureZ {
8207 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
8208 * `err` or `result` depending on the state of `result_ok`.
8210 union LDKCResult_NonePaymentSendFailureZPtr contents;
8212 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
8215 } LDKCResult_NonePaymentSendFailureZ;
8218 * The contents of CResult_NoneRetryableSendFailureZ
8220 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
8222 * Note that this value is always NULL, as there are no contents in the OK variant
8226 * A pointer to the contents in the error state.
8227 * Reading from this pointer when `result_ok` is set is undefined.
8229 enum LDKRetryableSendFailure *err;
8230 } LDKCResult_NoneRetryableSendFailureZPtr;
8233 * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
8234 * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8235 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8237 typedef struct LDKCResult_NoneRetryableSendFailureZ {
8239 * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
8240 * `err` or `result` depending on the state of `result_ok`.
8242 union LDKCResult_NoneRetryableSendFailureZPtr contents;
8244 * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
8247 } LDKCResult_NoneRetryableSendFailureZ;
8250 * The contents of CResult_PaymentHashPaymentSendFailureZ
8252 typedef union LDKCResult_PaymentHashPaymentSendFailureZPtr {
8254 * A pointer to the contents in the success state.
8255 * Reading from this pointer when `result_ok` is not set is undefined.
8257 struct LDKThirtyTwoBytes *result;
8259 * A pointer to the contents in the error state.
8260 * Reading from this pointer when `result_ok` is set is undefined.
8262 struct LDKPaymentSendFailure *err;
8263 } LDKCResult_PaymentHashPaymentSendFailureZPtr;
8266 * A CResult_PaymentHashPaymentSendFailureZ represents the result of a fallible operation,
8267 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8268 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8270 typedef struct LDKCResult_PaymentHashPaymentSendFailureZ {
8272 * The contents of this CResult_PaymentHashPaymentSendFailureZ, accessible via either
8273 * `err` or `result` depending on the state of `result_ok`.
8275 union LDKCResult_PaymentHashPaymentSendFailureZPtr contents;
8277 * Whether this CResult_PaymentHashPaymentSendFailureZ represents a success state.
8280 } LDKCResult_PaymentHashPaymentSendFailureZ;
8283 * The contents of CResult_PaymentHashRetryableSendFailureZ
8285 typedef union LDKCResult_PaymentHashRetryableSendFailureZPtr {
8287 * A pointer to the contents in the success state.
8288 * Reading from this pointer when `result_ok` is not set is undefined.
8290 struct LDKThirtyTwoBytes *result;
8292 * A pointer to the contents in the error state.
8293 * Reading from this pointer when `result_ok` is set is undefined.
8295 enum LDKRetryableSendFailure *err;
8296 } LDKCResult_PaymentHashRetryableSendFailureZPtr;
8299 * A CResult_PaymentHashRetryableSendFailureZ represents the result of a fallible operation,
8300 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8301 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8303 typedef struct LDKCResult_PaymentHashRetryableSendFailureZ {
8305 * The contents of this CResult_PaymentHashRetryableSendFailureZ, accessible via either
8306 * `err` or `result` depending on the state of `result_ok`.
8308 union LDKCResult_PaymentHashRetryableSendFailureZPtr contents;
8310 * Whether this CResult_PaymentHashRetryableSendFailureZ represents a success state.
8313 } LDKCResult_PaymentHashRetryableSendFailureZ;
8316 * A tuple of 2 elements. See the individual fields for the types contained.
8318 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
8320 * The element at position 0
8322 struct LDKThirtyTwoBytes a;
8324 * The element at position 1
8326 struct LDKThirtyTwoBytes b;
8327 } LDKC2Tuple_PaymentHashPaymentIdZ;
8330 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
8332 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
8334 * A pointer to the contents in the success state.
8335 * Reading from this pointer when `result_ok` is not set is undefined.
8337 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
8339 * A pointer to the contents in the error state.
8340 * Reading from this pointer when `result_ok` is set is undefined.
8342 struct LDKPaymentSendFailure *err;
8343 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
8346 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
8347 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8348 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8350 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
8352 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
8353 * `err` or `result` depending on the state of `result_ok`.
8355 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
8357 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
8360 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
8363 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
8364 * This corresponds to std::vector in C++
8366 typedef struct LDKCVec_ThirtyTwoBytesZ {
8368 * The elements in the array.
8369 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8371 struct LDKThirtyTwoBytes *data;
8373 * The number of elements pointed to by `data`.
8376 } LDKCVec_ThirtyTwoBytesZ;
8379 * A tuple of 2 elements. See the individual fields for the types contained.
8381 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
8383 * The element at position 0
8385 struct LDKThirtyTwoBytes a;
8387 * The element at position 1
8389 struct LDKThirtyTwoBytes b;
8390 } LDKC2Tuple_PaymentHashPaymentSecretZ;
8393 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
8395 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
8397 * A pointer to the contents in the success state.
8398 * Reading from this pointer when `result_ok` is not set is undefined.
8400 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
8402 * Note that this value is always NULL, as there are no contents in the Err variant
8405 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
8408 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
8409 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
8410 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8412 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
8414 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
8415 * `err` or `result` depending on the state of `result_ok`.
8417 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
8419 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
8422 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
8425 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ
8427 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr {
8429 * A pointer to the contents in the success state.
8430 * Reading from this pointer when `result_ok` is not set is undefined.
8432 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
8434 * A pointer to the contents in the error state.
8435 * Reading from this pointer when `result_ok` is set is undefined.
8437 struct LDKAPIError *err;
8438 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr;
8441 * A CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents the result of a fallible operation,
8442 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a crate::lightning::util::errors::APIError on failure.
8443 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8445 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ {
8447 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ, accessible via either
8448 * `err` or `result` depending on the state of `result_ok`.
8450 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZPtr contents;
8452 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ represents a success state.
8455 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ;
8458 * The contents of CResult_PaymentSecretNoneZ
8460 typedef union LDKCResult_PaymentSecretNoneZPtr {
8462 * A pointer to the contents in the success state.
8463 * Reading from this pointer when `result_ok` is not set is undefined.
8465 struct LDKThirtyTwoBytes *result;
8467 * Note that this value is always NULL, as there are no contents in the Err variant
8470 } LDKCResult_PaymentSecretNoneZPtr;
8473 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
8474 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
8475 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8477 typedef struct LDKCResult_PaymentSecretNoneZ {
8479 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
8480 * `err` or `result` depending on the state of `result_ok`.
8482 union LDKCResult_PaymentSecretNoneZPtr contents;
8484 * Whether this CResult_PaymentSecretNoneZ represents a success state.
8487 } LDKCResult_PaymentSecretNoneZ;
8490 * The contents of CResult_PaymentSecretAPIErrorZ
8492 typedef union LDKCResult_PaymentSecretAPIErrorZPtr {
8494 * A pointer to the contents in the success state.
8495 * Reading from this pointer when `result_ok` is not set is undefined.
8497 struct LDKThirtyTwoBytes *result;
8499 * A pointer to the contents in the error state.
8500 * Reading from this pointer when `result_ok` is set is undefined.
8502 struct LDKAPIError *err;
8503 } LDKCResult_PaymentSecretAPIErrorZPtr;
8506 * A CResult_PaymentSecretAPIErrorZ represents the result of a fallible operation,
8507 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
8508 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8510 typedef struct LDKCResult_PaymentSecretAPIErrorZ {
8512 * The contents of this CResult_PaymentSecretAPIErrorZ, accessible via either
8513 * `err` or `result` depending on the state of `result_ok`.
8515 union LDKCResult_PaymentSecretAPIErrorZPtr contents;
8517 * Whether this CResult_PaymentSecretAPIErrorZ represents a success state.
8520 } LDKCResult_PaymentSecretAPIErrorZ;
8523 * The contents of CResult_PaymentPreimageAPIErrorZ
8525 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
8527 * A pointer to the contents in the success state.
8528 * Reading from this pointer when `result_ok` is not set is undefined.
8530 struct LDKThirtyTwoBytes *result;
8532 * A pointer to the contents in the error state.
8533 * Reading from this pointer when `result_ok` is set is undefined.
8535 struct LDKAPIError *err;
8536 } LDKCResult_PaymentPreimageAPIErrorZPtr;
8539 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
8540 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
8541 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8543 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
8545 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
8546 * `err` or `result` depending on the state of `result_ok`.
8548 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
8550 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
8553 } LDKCResult_PaymentPreimageAPIErrorZ;
8558 * Information needed for constructing an invoice route hint for this channel.
8560 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
8562 * A pointer to the opaque Rust object.
8563 * Nearly everywhere, inner must be non-null, however in places where
8564 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8566 LDKnativeCounterpartyForwardingInfo *inner;
8568 * Indicates that this is the only struct which contains the same pointer.
8569 * Rust functions which take ownership of an object provided via an argument require
8570 * this to be true and invalidate the object pointed to by inner.
8573 } LDKCounterpartyForwardingInfo;
8576 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
8578 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
8580 * A pointer to the contents in the success state.
8581 * Reading from this pointer when `result_ok` is not set is undefined.
8583 struct LDKCounterpartyForwardingInfo *result;
8585 * A pointer to the contents in the error state.
8586 * Reading from this pointer when `result_ok` is set is undefined.
8588 struct LDKDecodeError *err;
8589 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
8592 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
8593 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8594 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8596 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
8598 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
8599 * `err` or `result` depending on the state of `result_ok`.
8601 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
8603 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
8606 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
8611 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
8612 * to better separate parameters.
8614 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
8616 * A pointer to the opaque Rust object.
8617 * Nearly everywhere, inner must be non-null, however in places where
8618 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8620 LDKnativeChannelCounterparty *inner;
8622 * Indicates that this is the only struct which contains the same pointer.
8623 * Rust functions which take ownership of an object provided via an argument require
8624 * this to be true and invalidate the object pointed to by inner.
8627 } LDKChannelCounterparty;
8630 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
8632 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
8634 * A pointer to the contents in the success state.
8635 * Reading from this pointer when `result_ok` is not set is undefined.
8637 struct LDKChannelCounterparty *result;
8639 * A pointer to the contents in the error state.
8640 * Reading from this pointer when `result_ok` is set is undefined.
8642 struct LDKDecodeError *err;
8643 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
8646 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
8647 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
8648 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8650 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
8652 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
8653 * `err` or `result` depending on the state of `result_ok`.
8655 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
8657 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
8660 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
8663 * The contents of CResult_ChannelDetailsDecodeErrorZ
8665 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
8667 * A pointer to the contents in the success state.
8668 * Reading from this pointer when `result_ok` is not set is undefined.
8670 struct LDKChannelDetails *result;
8672 * A pointer to the contents in the error state.
8673 * Reading from this pointer when `result_ok` is set is undefined.
8675 struct LDKDecodeError *err;
8676 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
8679 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
8680 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
8681 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8683 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
8685 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
8686 * `err` or `result` depending on the state of `result_ok`.
8688 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
8690 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
8693 } LDKCResult_ChannelDetailsDecodeErrorZ;
8698 * Route hints used in constructing invoices for [phantom node payents].
8700 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
8702 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
8704 * A pointer to the opaque Rust object.
8705 * Nearly everywhere, inner must be non-null, however in places where
8706 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8708 LDKnativePhantomRouteHints *inner;
8710 * Indicates that this is the only struct which contains the same pointer.
8711 * Rust functions which take ownership of an object provided via an argument require
8712 * this to be true and invalidate the object pointed to by inner.
8715 } LDKPhantomRouteHints;
8718 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
8720 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
8722 * A pointer to the contents in the success state.
8723 * Reading from this pointer when `result_ok` is not set is undefined.
8725 struct LDKPhantomRouteHints *result;
8727 * A pointer to the contents in the error state.
8728 * Reading from this pointer when `result_ok` is set is undefined.
8730 struct LDKDecodeError *err;
8731 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
8734 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
8735 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
8736 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8738 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
8740 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
8741 * `err` or `result` depending on the state of `result_ok`.
8743 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
8745 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
8748 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
8751 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
8752 * This corresponds to std::vector in C++
8754 typedef struct LDKCVec_ChannelMonitorZ {
8756 * The elements in the array.
8757 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8759 struct LDKChannelMonitor *data;
8761 * The number of elements pointed to by `data`.
8764 } LDKCVec_ChannelMonitorZ;
8769 * An update generated by the underlying channel itself which contains some new information the
8770 * [`ChannelMonitor`] should be made aware of.
8772 * Because this represents only a small number of updates to the underlying state, it is generally
8773 * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
8774 * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
8775 * transaction), a single update may reach upwards of 1 MiB in serialized size.
8777 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
8779 * A pointer to the opaque Rust object.
8780 * Nearly everywhere, inner must be non-null, however in places where
8781 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8783 LDKnativeChannelMonitorUpdate *inner;
8785 * Indicates that this is the only struct which contains the same pointer.
8786 * Rust functions which take ownership of an object provided via an argument require
8787 * this to be true and invalidate the object pointed to by inner.
8790 } LDKChannelMonitorUpdate;
8793 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
8794 * blocks are connected and disconnected.
8796 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
8797 * responsible for maintaining a set of monitors such that they can be updated accordingly as
8798 * channel state changes and HTLCs are resolved. See method documentation for specific
8801 * Implementations **must** ensure that updates are successfully applied and persisted upon method
8802 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
8803 * without taking any further action such as persisting the current state.
8805 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
8806 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
8807 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
8808 * funds in the channel. See [`ChannelMonitorUpdateStatus`] for more details about how to handle
8809 * multiple instances.
8811 * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
8813 typedef struct LDKWatch {
8815 * An opaque pointer which is passed to your function implementations as an argument.
8816 * This has no meaning in the LDK, and can be NULL or any other value.
8820 * Watches a channel identified by `funding_txo` using `monitor`.
8822 * Implementations are responsible for watching the chain for the funding transaction along
8823 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
8824 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
8826 * Note: this interface MUST error with [`ChannelMonitorUpdateStatus::PermanentFailure`] if
8827 * the given `funding_txo` has previously been registered via `watch_channel`.
8829 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
8830 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
8831 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
8833 enum LDKChannelMonitorUpdateStatus (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
8835 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
8837 * Implementations must call [`update_monitor`] with the given update. See
8838 * [`ChannelMonitorUpdateStatus`] for invariants around returning an error.
8840 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
8842 enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
8844 * Returns any monitor events since the last call. Subsequent calls must only return new
8847 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
8848 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
8851 * For details on asynchronous [`ChannelMonitor`] updating and returning
8852 * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
8854 struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
8856 * Frees any resources associated with this object given its this_arg pointer.
8857 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8859 void (*free)(void *this_arg);
8863 * An interface to send a transaction to the Bitcoin network.
8865 typedef struct LDKBroadcasterInterface {
8867 * An opaque pointer which is passed to your function implementations as an argument.
8868 * This has no meaning in the LDK, and can be NULL or any other value.
8872 * Sends a transaction out to (hopefully) be mined.
8874 void (*broadcast_transaction)(const void *this_arg, struct LDKTransaction tx);
8876 * Frees any resources associated with this object given its this_arg pointer.
8877 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8879 void (*free)(void *this_arg);
8880 } LDKBroadcasterInterface;
8883 * A trait that describes a source of entropy.
8885 typedef struct LDKEntropySource {
8887 * An opaque pointer which is passed to your function implementations as an argument.
8888 * This has no meaning in the LDK, and can be NULL or any other value.
8892 * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
8893 * different value each time it is called.
8895 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
8897 * Frees any resources associated with this object given its this_arg pointer.
8898 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8900 void (*free)(void *this_arg);
8904 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
8905 * own the memory pointed to by data.
8907 typedef struct LDKu8slice {
8909 * A pointer to the byte buffer
8911 const uint8_t *data;
8913 * The number of bytes pointed to by `data`.
8921 * The unsigned part of a [`channel_update`] message.
8923 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
8925 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
8927 * A pointer to the opaque Rust object.
8928 * Nearly everywhere, inner must be non-null, however in places where
8929 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8931 LDKnativeUnsignedChannelUpdate *inner;
8933 * Indicates that this is the only struct which contains the same pointer.
8934 * Rust functions which take ownership of an object provided via an argument require
8935 * this to be true and invalidate the object pointed to by inner.
8938 } LDKUnsignedChannelUpdate;
8943 * The unsigned part of a [`node_announcement`] message.
8945 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
8947 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
8949 * A pointer to the opaque Rust object.
8950 * Nearly everywhere, inner must be non-null, however in places where
8951 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8953 LDKnativeUnsignedNodeAnnouncement *inner;
8955 * Indicates that this is the only struct which contains the same pointer.
8956 * Rust functions which take ownership of an object provided via an argument require
8957 * this to be true and invalidate the object pointed to by inner.
8960 } LDKUnsignedNodeAnnouncement;
8963 * Represents the set of gossip messages that require a signature from a node's identity key.
8965 typedef enum LDKUnsignedGossipMessage_Tag {
8967 * An unsigned channel announcement.
8969 LDKUnsignedGossipMessage_ChannelAnnouncement,
8971 * An unsigned channel update.
8973 LDKUnsignedGossipMessage_ChannelUpdate,
8975 * An unsigned node announcement.
8977 LDKUnsignedGossipMessage_NodeAnnouncement,
8979 * Must be last for serialization purposes
8981 LDKUnsignedGossipMessage_Sentinel,
8982 } LDKUnsignedGossipMessage_Tag;
8984 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
8985 LDKUnsignedGossipMessage_Tag tag;
8988 struct LDKUnsignedChannelAnnouncement channel_announcement;
8991 struct LDKUnsignedChannelUpdate channel_update;
8994 struct LDKUnsignedNodeAnnouncement node_announcement;
8997 } LDKUnsignedGossipMessage;
9000 * A trait that can handle cryptographic operations at the scope level of a node.
9002 typedef struct LDKNodeSigner {
9004 * An opaque pointer which is passed to your function implementations as an argument.
9005 * This has no meaning in the LDK, and can be NULL or any other value.
9009 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
9011 * If the implementor of this trait supports [phantom node payments], then every node that is
9012 * intended to be included in the phantom invoice route hints must return the same value from
9015 * This method must return the same value each time it is called.
9017 * [phantom node payments]: PhantomKeysManager
9019 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
9021 * Get node id based on the provided [`Recipient`].
9023 * This method must return the same value each time it is called with a given [`Recipient`]
9026 * Errors if the [`Recipient`] variant is not supported by the implementation.
9028 struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
9030 * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
9031 * one is provided. Note that this tweak can be applied to `other_key` instead of our node
9032 * secret, though this is less efficient.
9034 * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
9035 * should be resolved to allow LDK to resume forwarding HTLCs.
9037 * Errors if the [`Recipient`] variant is not supported by the implementation.
9039 struct LDKCResult_SharedSecretNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_ScalarZ tweak);
9043 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
9044 * this trait to parse the invoice and make sure they're signing what they expect, rather than
9045 * blindly signing the hash.
9047 * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
9049 * The secret key used to sign the invoice is dependent on the [`Recipient`].
9051 * Errors if the [`Recipient`] variant is not supported by the implementation.
9053 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
9055 * Sign a gossip message.
9057 * Note that if this fails, LDK may panic and the message will not be broadcast to the network
9058 * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
9059 * message to be broadcast, as otherwise it may prevent one from receiving funds over the
9060 * corresponding channel.
9062 struct LDKCResult_SignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
9064 * Frees any resources associated with this object given its this_arg pointer.
9065 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9067 void (*free)(void *this_arg);
9071 * A trait that can return signer instances for individual channels.
9073 typedef struct LDKSignerProvider {
9075 * An opaque pointer which is passed to your function implementations as an argument.
9076 * This has no meaning in the LDK, and can be NULL or any other value.
9080 * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::Signer`] through
9081 * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
9082 * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
9083 * `channel_keys_id`.
9085 * This method must return a different value each time it is called.
9087 struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
9089 * Derives the private key material backing a `Signer`.
9091 * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
9092 * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
9093 * re-derived from its `channel_keys_id`, which can be obtained through its trait method
9094 * [`ChannelSigner::channel_keys_id`].
9096 struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
9098 * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
9099 * This is only called during deserialization of other objects which contain
9100 * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
9101 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
9102 * contain no versioning scheme. You may wish to include your own version prefix and ensure
9103 * you've read all of the provided bytes to ensure no corruption occurred.
9105 * This method is slowly being phased out -- it will only be called when reading objects
9106 * written by LDK versions prior to 0.0.113.
9108 * [`Signer`]: Self::Signer
9109 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
9110 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
9112 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
9114 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
9116 * This method should return a different value each time it is called, to avoid linking
9117 * on-chain funds across channels as controlled to the same user.
9119 struct LDKCVec_u8Z (*get_destination_script)(const void *this_arg);
9121 * Get a script pubkey which we will send funds to when closing a channel.
9123 * This method should return a different value each time it is called, to avoid linking
9124 * on-chain funds across channels as controlled to the same user.
9126 struct LDKShutdownScript (*get_shutdown_scriptpubkey)(const void *this_arg);
9128 * Frees any resources associated with this object given its this_arg pointer.
9129 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9131 void (*free)(void *this_arg);
9132 } LDKSignerProvider;
9135 * A trait which should be implemented to provide feerate information on a number of time
9138 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
9139 * called from inside the library in response to chain events, P2P events, or timer events).
9141 typedef struct LDKFeeEstimator {
9143 * An opaque pointer which is passed to your function implementations as an argument.
9144 * This has no meaning in the LDK, and can be NULL or any other value.
9148 * Gets estimated satoshis of fee required per 1000 Weight-Units.
9150 * LDK will wrap this method and ensure that the value returned is no smaller than 253
9151 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
9153 * The following unit conversions can be used to convert to sats/KW:
9154 * * satoshis-per-byte * 250
9155 * * satoshis-per-kbyte / 4
9157 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
9159 * Frees any resources associated with this object given its this_arg pointer.
9160 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9162 void (*free)(void *this_arg);
9166 * A trait defining behavior for routing a payment.
9168 typedef struct LDKRouter {
9170 * An opaque pointer which is passed to your function implementations as an argument.
9171 * This has no meaning in the LDK, and can be NULL or any other value.
9175 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values.
9177 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
9179 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);
9181 * Finds a [`Route`] between `payer` and `payee` for a payment with the given values. Includes
9182 * `PaymentHash` and `PaymentId` to be able to correlate the request with a specific payment.
9184 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
9186 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);
9188 * Frees any resources associated with this object given its this_arg pointer.
9189 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9191 void (*free)(void *this_arg);
9197 * Manager which keeps track of a number of channels and sends messages to the appropriate
9198 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
9200 * Implements ChannelMessageHandler, handling the multi-channel parts and passing things through
9201 * to individual Channels.
9203 * Implements Writeable to write out all channel state to disk. Implies peer_disconnected() for
9204 * all peers during write/read (though does not modify this instance, only the instance being
9205 * serialized). This will result in any channels which have not yet exchanged funding_created (ie
9206 * called funding_transaction_generated for outbound channels).
9208 * Note that you can be a bit lazier about writing out ChannelManager than you can be with
9209 * ChannelMonitors. With ChannelMonitors you MUST write each monitor update out to disk before
9210 * returning from chain::Watch::watch_/update_channel, with ChannelManagers, writing updates
9211 * happens out-of-band (and will prevent any other ChannelManager operations from occurring during
9212 * the serialization process). If the deserialized version is out-of-date compared to the
9213 * ChannelMonitors passed by reference to read(), those channels will be force-closed based on the
9214 * ChannelMonitor state and no funds will be lost (mod on-chain transaction fees).
9216 * Note that the deserializer is only implemented for (BlockHash, ChannelManager), which
9217 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
9218 * the \"reorg path\" (ie call block_disconnected() until you get to a common block and then call
9219 * block_connected() to step towards your best block) upon deserialization before using the
9222 * Note that ChannelManager is responsible for tracking liveness of its channels and generating
9223 * ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
9224 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
9225 * offline for a full minute. In order to track this, you must call
9226 * timer_tick_occurred roughly once per minute, though it doesn't have to be perfect.
9228 * To avoid trivial DoS issues, ChannelManager limits the number of inbound connections and
9229 * inbound channels without confirmed funding transactions. This may result in nodes which we do
9230 * not have a channel with being unable to connect to us or open new channels with us if we have
9231 * many peers with unfunded channels.
9233 * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
9234 * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
9235 * never limited. Please ensure you limit the count of such channels yourself.
9237 * Rather than using a plain ChannelManager, it is preferable to use either a SimpleArcChannelManager
9238 * a SimpleRefChannelManager, for conciseness. See their documentation for more details, but
9239 * essentially you should default to using a SimpleRefChannelManager, and use a
9240 * SimpleArcChannelManager when you require a ChannelManager with a static lifetime, such as when
9241 * you're using lightning-net-tokio.
9243 typedef struct MUST_USE_STRUCT LDKChannelManager {
9245 * A pointer to the opaque Rust object.
9246 * Nearly everywhere, inner must be non-null, however in places where
9247 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9249 LDKnativeChannelManager *inner;
9251 * Indicates that this is the only struct which contains the same pointer.
9252 * Rust functions which take ownership of an object provided via an argument require
9253 * this to be true and invalidate the object pointed to by inner.
9256 } LDKChannelManager;
9259 * A tuple of 2 elements. See the individual fields for the types contained.
9261 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
9263 * The element at position 0
9265 struct LDKThirtyTwoBytes a;
9267 * The element at position 1
9269 struct LDKChannelManager b;
9270 } LDKC2Tuple_BlockHashChannelManagerZ;
9273 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
9275 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
9277 * A pointer to the contents in the success state.
9278 * Reading from this pointer when `result_ok` is not set is undefined.
9280 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
9282 * A pointer to the contents in the error state.
9283 * Reading from this pointer when `result_ok` is set is undefined.
9285 struct LDKDecodeError *err;
9286 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
9289 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
9290 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9291 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9293 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
9295 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
9296 * `err` or `result` depending on the state of `result_ok`.
9298 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
9300 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
9303 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
9308 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
9309 * with our counterparty.
9311 typedef struct MUST_USE_STRUCT LDKChannelConfig {
9313 * A pointer to the opaque Rust object.
9314 * Nearly everywhere, inner must be non-null, however in places where
9315 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9317 LDKnativeChannelConfig *inner;
9319 * Indicates that this is the only struct which contains the same pointer.
9320 * Rust functions which take ownership of an object provided via an argument require
9321 * this to be true and invalidate the object pointed to by inner.
9327 * The contents of CResult_ChannelConfigDecodeErrorZ
9329 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
9331 * A pointer to the contents in the success state.
9332 * Reading from this pointer when `result_ok` is not set is undefined.
9334 struct LDKChannelConfig *result;
9336 * A pointer to the contents in the error state.
9337 * Reading from this pointer when `result_ok` is set is undefined.
9339 struct LDKDecodeError *err;
9340 } LDKCResult_ChannelConfigDecodeErrorZPtr;
9343 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
9344 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
9345 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9347 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
9349 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
9350 * `err` or `result` depending on the state of `result_ok`.
9352 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
9354 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
9357 } LDKCResult_ChannelConfigDecodeErrorZ;
9360 * An enum which can either contain a crate::lightning::util::errors::APIError or not
9362 typedef enum LDKCOption_APIErrorZ_Tag {
9364 * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
9366 LDKCOption_APIErrorZ_Some,
9368 * When we're in this state, this COption_APIErrorZ contains nothing
9370 LDKCOption_APIErrorZ_None,
9372 * Must be last for serialization purposes
9374 LDKCOption_APIErrorZ_Sentinel,
9375 } LDKCOption_APIErrorZ_Tag;
9377 typedef struct LDKCOption_APIErrorZ {
9378 LDKCOption_APIErrorZ_Tag tag;
9381 struct LDKAPIError some;
9384 } LDKCOption_APIErrorZ;
9387 * The contents of CResult_COption_APIErrorZDecodeErrorZ
9389 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
9391 * A pointer to the contents in the success state.
9392 * Reading from this pointer when `result_ok` is not set is undefined.
9394 struct LDKCOption_APIErrorZ *result;
9396 * A pointer to the contents in the error state.
9397 * Reading from this pointer when `result_ok` is set is undefined.
9399 struct LDKDecodeError *err;
9400 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
9403 * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
9404 * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9405 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9407 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
9409 * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
9410 * `err` or `result` depending on the state of `result_ok`.
9412 union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
9414 * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
9417 } LDKCResult_COption_APIErrorZDecodeErrorZ;
9420 * The contents of CResult_OutPointDecodeErrorZ
9422 typedef union LDKCResult_OutPointDecodeErrorZPtr {
9424 * A pointer to the contents in the success state.
9425 * Reading from this pointer when `result_ok` is not set is undefined.
9427 struct LDKOutPoint *result;
9429 * A pointer to the contents in the error state.
9430 * Reading from this pointer when `result_ok` is set is undefined.
9432 struct LDKDecodeError *err;
9433 } LDKCResult_OutPointDecodeErrorZPtr;
9436 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
9437 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
9438 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9440 typedef struct LDKCResult_OutPointDecodeErrorZ {
9442 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
9443 * `err` or `result` depending on the state of `result_ok`.
9445 union LDKCResult_OutPointDecodeErrorZPtr contents;
9447 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
9450 } LDKCResult_OutPointDecodeErrorZ;
9453 * Defines a type identifier for sending messages over the wire.
9455 * Messages implementing this trait specify a type and must be [`Writeable`].
9457 typedef struct LDKType {
9459 * An opaque pointer which is passed to your function implementations as an argument.
9460 * This has no meaning in the LDK, and can be NULL or any other value.
9464 * Returns the type identifying the message payload.
9466 uint16_t (*type_id)(const void *this_arg);
9468 * Return a human-readable "debug" string describing this object
9470 struct LDKStr (*debug_str)(const void *this_arg);
9472 * Serialize the object into a byte array
9474 struct LDKCVec_u8Z (*write)(const void *this_arg);
9476 * Frees any resources associated with this object given its this_arg pointer.
9477 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9479 void (*free)(void *this_arg);
9483 * An enum which can either contain a crate::lightning::ln::wire::Type or not
9485 typedef enum LDKCOption_TypeZ_Tag {
9487 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
9489 LDKCOption_TypeZ_Some,
9491 * When we're in this state, this COption_TypeZ contains nothing
9493 LDKCOption_TypeZ_None,
9495 * Must be last for serialization purposes
9497 LDKCOption_TypeZ_Sentinel,
9498 } LDKCOption_TypeZ_Tag;
9500 typedef struct LDKCOption_TypeZ {
9501 LDKCOption_TypeZ_Tag tag;
9504 struct LDKType some;
9510 * The contents of CResult_COption_TypeZDecodeErrorZ
9512 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
9514 * A pointer to the contents in the success state.
9515 * Reading from this pointer when `result_ok` is not set is undefined.
9517 struct LDKCOption_TypeZ *result;
9519 * A pointer to the contents in the error state.
9520 * Reading from this pointer when `result_ok` is set is undefined.
9522 struct LDKDecodeError *err;
9523 } LDKCResult_COption_TypeZDecodeErrorZPtr;
9526 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
9527 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9528 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9530 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
9532 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
9533 * `err` or `result` depending on the state of `result_ok`.
9535 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
9537 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
9540 } LDKCResult_COption_TypeZDecodeErrorZ;
9543 * An error that may occur when making a payment.
9545 typedef enum LDKPaymentError_Tag {
9547 * An error resulting from the provided [`Invoice`] or payment hash.
9549 LDKPaymentError_Invoice,
9551 * An error occurring when sending a payment.
9553 LDKPaymentError_Sending,
9555 * Must be last for serialization purposes
9557 LDKPaymentError_Sentinel,
9558 } LDKPaymentError_Tag;
9560 typedef struct MUST_USE_STRUCT LDKPaymentError {
9561 LDKPaymentError_Tag tag;
9564 struct LDKStr invoice;
9567 enum LDKRetryableSendFailure sending;
9573 * The contents of CResult_PaymentIdPaymentErrorZ
9575 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
9577 * A pointer to the contents in the success state.
9578 * Reading from this pointer when `result_ok` is not set is undefined.
9580 struct LDKThirtyTwoBytes *result;
9582 * A pointer to the contents in the error state.
9583 * Reading from this pointer when `result_ok` is set is undefined.
9585 struct LDKPaymentError *err;
9586 } LDKCResult_PaymentIdPaymentErrorZPtr;
9589 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
9590 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
9591 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9593 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
9595 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
9596 * `err` or `result` depending on the state of `result_ok`.
9598 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
9600 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
9603 } LDKCResult_PaymentIdPaymentErrorZ;
9606 * The contents of CResult_NonePaymentErrorZ
9608 typedef union LDKCResult_NonePaymentErrorZPtr {
9610 * Note that this value is always NULL, as there are no contents in the OK variant
9614 * A pointer to the contents in the error state.
9615 * Reading from this pointer when `result_ok` is set is undefined.
9617 struct LDKPaymentError *err;
9618 } LDKCResult_NonePaymentErrorZPtr;
9621 * A CResult_NonePaymentErrorZ represents the result of a fallible operation,
9622 * containing a () on success and a crate::lightning_invoice::payment::PaymentError on failure.
9623 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9625 typedef struct LDKCResult_NonePaymentErrorZ {
9627 * The contents of this CResult_NonePaymentErrorZ, accessible via either
9628 * `err` or `result` depending on the state of `result_ok`.
9630 union LDKCResult_NonePaymentErrorZPtr contents;
9632 * Whether this CResult_NonePaymentErrorZ represents a success state.
9635 } LDKCResult_NonePaymentErrorZ;
9638 * The contents of CResult_StringErrorZ
9640 typedef union LDKCResult_StringErrorZPtr {
9642 * A pointer to the contents in the success state.
9643 * Reading from this pointer when `result_ok` is not set is undefined.
9645 struct LDKStr *result;
9647 * A pointer to the contents in the error state.
9648 * Reading from this pointer when `result_ok` is set is undefined.
9650 enum LDKSecp256k1Error *err;
9651 } LDKCResult_StringErrorZPtr;
9654 * A CResult_StringErrorZ represents the result of a fallible operation,
9655 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
9656 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9658 typedef struct LDKCResult_StringErrorZ {
9660 * The contents of this CResult_StringErrorZ, accessible via either
9661 * `err` or `result` depending on the state of `result_ok`.
9663 union LDKCResult_StringErrorZPtr contents;
9665 * Whether this CResult_StringErrorZ represents a success state.
9668 } LDKCResult_StringErrorZ;
9671 * The contents of CResult_PublicKeyErrorZ
9673 typedef union LDKCResult_PublicKeyErrorZPtr {
9675 * A pointer to the contents in the success state.
9676 * Reading from this pointer when `result_ok` is not set is undefined.
9678 struct LDKPublicKey *result;
9680 * A pointer to the contents in the error state.
9681 * Reading from this pointer when `result_ok` is set is undefined.
9683 enum LDKSecp256k1Error *err;
9684 } LDKCResult_PublicKeyErrorZPtr;
9687 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
9688 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
9689 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9691 typedef struct LDKCResult_PublicKeyErrorZ {
9693 * The contents of this CResult_PublicKeyErrorZ, accessible via either
9694 * `err` or `result` depending on the state of `result_ok`.
9696 union LDKCResult_PublicKeyErrorZPtr contents;
9698 * Whether this CResult_PublicKeyErrorZ represents a success state.
9701 } LDKCResult_PublicKeyErrorZ;
9704 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
9706 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
9708 * A pointer to the contents in the success state.
9709 * Reading from this pointer when `result_ok` is not set is undefined.
9711 struct LDKChannelMonitorUpdate *result;
9713 * A pointer to the contents in the error state.
9714 * Reading from this pointer when `result_ok` is set is undefined.
9716 struct LDKDecodeError *err;
9717 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
9720 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
9721 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9722 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9724 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
9726 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
9727 * `err` or `result` depending on the state of `result_ok`.
9729 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
9731 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
9734 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
9737 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
9739 typedef enum LDKCOption_MonitorEventZ_Tag {
9741 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
9743 LDKCOption_MonitorEventZ_Some,
9745 * When we're in this state, this COption_MonitorEventZ contains nothing
9747 LDKCOption_MonitorEventZ_None,
9749 * Must be last for serialization purposes
9751 LDKCOption_MonitorEventZ_Sentinel,
9752 } LDKCOption_MonitorEventZ_Tag;
9754 typedef struct LDKCOption_MonitorEventZ {
9755 LDKCOption_MonitorEventZ_Tag tag;
9758 struct LDKMonitorEvent some;
9761 } LDKCOption_MonitorEventZ;
9764 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
9766 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
9768 * A pointer to the contents in the success state.
9769 * Reading from this pointer when `result_ok` is not set is undefined.
9771 struct LDKCOption_MonitorEventZ *result;
9773 * A pointer to the contents in the error state.
9774 * Reading from this pointer when `result_ok` is set is undefined.
9776 struct LDKDecodeError *err;
9777 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
9780 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
9781 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9782 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9784 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
9786 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
9787 * `err` or `result` depending on the state of `result_ok`.
9789 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
9791 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
9794 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
9797 * The contents of CResult_HTLCUpdateDecodeErrorZ
9799 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
9801 * A pointer to the contents in the success state.
9802 * Reading from this pointer when `result_ok` is not set is undefined.
9804 struct LDKHTLCUpdate *result;
9806 * A pointer to the contents in the error state.
9807 * Reading from this pointer when `result_ok` is set is undefined.
9809 struct LDKDecodeError *err;
9810 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
9813 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
9814 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9815 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9817 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
9819 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
9820 * `err` or `result` depending on the state of `result_ok`.
9822 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
9824 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
9827 } LDKCResult_HTLCUpdateDecodeErrorZ;
9830 * A tuple of 2 elements. See the individual fields for the types contained.
9832 typedef struct LDKC2Tuple_OutPointScriptZ {
9834 * The element at position 0
9836 struct LDKOutPoint a;
9838 * The element at position 1
9840 struct LDKCVec_u8Z b;
9841 } LDKC2Tuple_OutPointScriptZ;
9844 * A tuple of 2 elements. See the individual fields for the types contained.
9846 typedef struct LDKC2Tuple_u32ScriptZ {
9848 * The element at position 0
9852 * The element at position 1
9854 struct LDKCVec_u8Z b;
9855 } LDKC2Tuple_u32ScriptZ;
9858 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
9859 * This corresponds to std::vector in C++
9861 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
9863 * The elements in the array.
9864 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9866 struct LDKC2Tuple_u32ScriptZ *data;
9868 * The number of elements pointed to by `data`.
9871 } LDKCVec_C2Tuple_u32ScriptZZ;
9874 * A tuple of 2 elements. See the individual fields for the types contained.
9876 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
9878 * The element at position 0
9880 struct LDKThirtyTwoBytes a;
9882 * The element at position 1
9884 struct LDKCVec_C2Tuple_u32ScriptZZ b;
9885 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
9888 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
9889 * This corresponds to std::vector in C++
9891 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
9893 * The elements in the array.
9894 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9896 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
9898 * The number of elements pointed to by `data`.
9901 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
9904 * A dynamically-allocated array of crate::lightning::util::events::Events of arbitrary size.
9905 * This corresponds to std::vector in C++
9907 typedef struct LDKCVec_EventZ {
9909 * The elements in the array.
9910 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9912 struct LDKEvent *data;
9914 * The number of elements pointed to by `data`.
9920 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
9921 * This corresponds to std::vector in C++
9923 typedef struct LDKCVec_TransactionZ {
9925 * The elements in the array.
9926 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9928 struct LDKTransaction *data;
9930 * The number of elements pointed to by `data`.
9933 } LDKCVec_TransactionZ;
9936 * A tuple of 2 elements. See the individual fields for the types contained.
9938 typedef struct LDKC2Tuple_u32TxOutZ {
9940 * The element at position 0
9944 * The element at position 1
9947 } LDKC2Tuple_u32TxOutZ;
9950 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
9951 * This corresponds to std::vector in C++
9953 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
9955 * The elements in the array.
9956 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9958 struct LDKC2Tuple_u32TxOutZ *data;
9960 * The number of elements pointed to by `data`.
9963 } LDKCVec_C2Tuple_u32TxOutZZ;
9966 * A tuple of 2 elements. See the individual fields for the types contained.
9968 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
9970 * The element at position 0
9972 struct LDKThirtyTwoBytes a;
9974 * The element at position 1
9976 struct LDKCVec_C2Tuple_u32TxOutZZ b;
9977 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
9980 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
9981 * This corresponds to std::vector in C++
9983 typedef struct LDKCVec_TransactionOutputsZ {
9985 * The elements in the array.
9986 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9988 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
9990 * The number of elements pointed to by `data`.
9993 } LDKCVec_TransactionOutputsZ;
9996 * Details about the balance(s) available for spending once the channel appears on chain.
9998 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
10001 typedef enum LDKBalance_Tag {
10003 * The channel is not yet closed (or the commitment or closing transaction has not yet
10004 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
10005 * force-closed now.
10007 LDKBalance_ClaimableOnChannelClose,
10009 * The channel has been closed, and the given balance is ours but awaiting confirmations until
10010 * we consider it spendable.
10012 LDKBalance_ClaimableAwaitingConfirmations,
10014 * The channel has been closed, and the given balance should be ours but awaiting spending
10015 * transaction confirmation. If the spending transaction does not confirm in time, it is
10016 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
10018 * Once the spending transaction confirms, before it has reached enough confirmations to be
10019 * considered safe from chain reorganizations, the balance will instead be provided via
10020 * [`Balance::ClaimableAwaitingConfirmations`].
10022 LDKBalance_ContentiousClaimable,
10024 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
10025 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
10026 * likely to be claimed by our counterparty before we do.
10028 LDKBalance_MaybeTimeoutClaimableHTLC,
10030 * HTLCs which we received from our counterparty which are claimable with a preimage which we
10031 * do not currently have. This will only be claimable if we receive the preimage from the node
10032 * to which we forwarded this HTLC before the timeout.
10034 LDKBalance_MaybePreimageClaimableHTLC,
10036 * The channel has been closed, and our counterparty broadcasted a revoked commitment
10039 * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
10040 * following amount.
10042 LDKBalance_CounterpartyRevokedOutputClaimable,
10044 * Must be last for serialization purposes
10046 LDKBalance_Sentinel,
10049 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
10051 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
10052 * required to do so.
10054 uint64_t claimable_amount_satoshis;
10055 } LDKBalance_LDKClaimableOnChannelClose_Body;
10057 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
10059 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
10060 * were spent in broadcasting the transaction.
10062 uint64_t claimable_amount_satoshis;
10064 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
10067 uint32_t confirmation_height;
10068 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
10070 typedef struct LDKBalance_LDKContentiousClaimable_Body {
10072 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
10073 * required to do so.
10075 uint64_t claimable_amount_satoshis;
10077 * The height at which the counterparty may be able to claim the balance if we have not
10080 uint32_t timeout_height;
10081 } LDKBalance_LDKContentiousClaimable_Body;
10083 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
10085 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
10086 * which will be required to do so.
10088 uint64_t claimable_amount_satoshis;
10090 * The height at which we will be able to claim the balance if our counterparty has not
10093 uint32_t claimable_height;
10094 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
10096 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
10098 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
10099 * which will be required to do so.
10101 uint64_t claimable_amount_satoshis;
10103 * The height at which our counterparty will be able to claim the balance if we have not
10104 * yet received the preimage and claimed it ourselves.
10106 uint32_t expiry_height;
10107 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
10109 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
10111 * The amount, in satoshis, of the output which we can claim.
10113 * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
10114 * were already spent.
10116 uint64_t claimable_amount_satoshis;
10117 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
10119 typedef struct MUST_USE_STRUCT LDKBalance {
10120 LDKBalance_Tag tag;
10122 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
10123 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
10124 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
10125 LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
10126 LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
10127 LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
10132 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
10133 * This corresponds to std::vector in C++
10135 typedef struct LDKCVec_BalanceZ {
10137 * The elements in the array.
10138 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10140 struct LDKBalance *data;
10142 * The number of elements pointed to by `data`.
10145 } LDKCVec_BalanceZ;
10148 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
10150 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
10152 * A pointer to the contents in the success state.
10153 * Reading from this pointer when `result_ok` is not set is undefined.
10155 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
10157 * A pointer to the contents in the error state.
10158 * Reading from this pointer when `result_ok` is set is undefined.
10160 struct LDKDecodeError *err;
10161 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
10164 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
10165 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10166 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10168 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
10170 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
10171 * `err` or `result` depending on the state of `result_ok`.
10173 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
10175 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
10178 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
10181 * A tuple of 2 elements. See the individual fields for the types contained.
10183 typedef struct LDKC2Tuple_PublicKeyTypeZ {
10185 * The element at position 0
10187 struct LDKPublicKey a;
10189 * The element at position 1
10192 } LDKC2Tuple_PublicKeyTypeZ;
10195 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
10196 * This corresponds to std::vector in C++
10198 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
10200 * The elements in the array.
10201 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10203 struct LDKC2Tuple_PublicKeyTypeZ *data;
10205 * The number of elements pointed to by `data`.
10208 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
10211 * The contents of a custom onion message.
10213 typedef struct LDKCustomOnionMessageContents {
10215 * An opaque pointer which is passed to your function implementations as an argument.
10216 * This has no meaning in the LDK, and can be NULL or any other value.
10220 * Returns the TLV type identifying the message contents. MUST be >= 64.
10222 uint64_t (*tlv_type)(const void *this_arg);
10224 * Serialize the object into a byte array
10226 struct LDKCVec_u8Z (*write)(const void *this_arg);
10228 * Frees any resources associated with this object given its this_arg pointer.
10229 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10231 void (*free)(void *this_arg);
10232 } LDKCustomOnionMessageContents;
10235 * An enum which can either contain a crate::lightning::onion_message::packet::CustomOnionMessageContents or not
10237 typedef enum LDKCOption_CustomOnionMessageContentsZ_Tag {
10239 * When we're in this state, this COption_CustomOnionMessageContentsZ contains a crate::lightning::onion_message::packet::CustomOnionMessageContents
10241 LDKCOption_CustomOnionMessageContentsZ_Some,
10243 * When we're in this state, this COption_CustomOnionMessageContentsZ contains nothing
10245 LDKCOption_CustomOnionMessageContentsZ_None,
10247 * Must be last for serialization purposes
10249 LDKCOption_CustomOnionMessageContentsZ_Sentinel,
10250 } LDKCOption_CustomOnionMessageContentsZ_Tag;
10252 typedef struct LDKCOption_CustomOnionMessageContentsZ {
10253 LDKCOption_CustomOnionMessageContentsZ_Tag tag;
10256 struct LDKCustomOnionMessageContents some;
10259 } LDKCOption_CustomOnionMessageContentsZ;
10262 * The contents of CResult_COption_CustomOnionMessageContentsZDecodeErrorZ
10264 typedef union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr {
10266 * A pointer to the contents in the success state.
10267 * Reading from this pointer when `result_ok` is not set is undefined.
10269 struct LDKCOption_CustomOnionMessageContentsZ *result;
10271 * A pointer to the contents in the error state.
10272 * Reading from this pointer when `result_ok` is set is undefined.
10274 struct LDKDecodeError *err;
10275 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr;
10278 * A CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
10279 * containing a crate::c_types::derived::COption_CustomOnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10280 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10282 typedef struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ {
10284 * The contents of this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ, accessible via either
10285 * `err` or `result` depending on the state of `result_ok`.
10287 union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr contents;
10289 * Whether this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents a success state.
10292 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ;
10295 * An enum which can either contain a crate::lightning::ln::msgs::NetAddress or not
10297 typedef enum LDKCOption_NetAddressZ_Tag {
10299 * When we're in this state, this COption_NetAddressZ contains a crate::lightning::ln::msgs::NetAddress
10301 LDKCOption_NetAddressZ_Some,
10303 * When we're in this state, this COption_NetAddressZ contains nothing
10305 LDKCOption_NetAddressZ_None,
10307 * Must be last for serialization purposes
10309 LDKCOption_NetAddressZ_Sentinel,
10310 } LDKCOption_NetAddressZ_Tag;
10312 typedef struct LDKCOption_NetAddressZ {
10313 LDKCOption_NetAddressZ_Tag tag;
10316 struct LDKNetAddress some;
10319 } LDKCOption_NetAddressZ;
10322 * A tuple of 2 elements. See the individual fields for the types contained.
10324 typedef struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ {
10326 * The element at position 0
10328 struct LDKPublicKey a;
10330 * The element at position 1
10332 struct LDKCOption_NetAddressZ b;
10333 } LDKC2Tuple_PublicKeyCOption_NetAddressZZ;
10336 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCOption_NetAddressZZs of arbitrary size.
10337 * This corresponds to std::vector in C++
10339 typedef struct LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ {
10341 * The elements in the array.
10342 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10344 struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ *data;
10346 * The number of elements pointed to by `data`.
10349 } LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ;
10354 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
10355 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
10358 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
10360 * A pointer to the opaque Rust object.
10361 * Nearly everywhere, inner must be non-null, however in places where
10362 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10364 LDKnativePeerHandleError *inner;
10366 * Indicates that this is the only struct which contains the same pointer.
10367 * Rust functions which take ownership of an object provided via an argument require
10368 * this to be true and invalidate the object pointed to by inner.
10371 } LDKPeerHandleError;
10374 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
10376 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
10378 * A pointer to the contents in the success state.
10379 * Reading from this pointer when `result_ok` is not set is undefined.
10381 struct LDKCVec_u8Z *result;
10383 * A pointer to the contents in the error state.
10384 * Reading from this pointer when `result_ok` is set is undefined.
10386 struct LDKPeerHandleError *err;
10387 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
10390 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
10391 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10392 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10394 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
10396 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
10397 * `err` or `result` depending on the state of `result_ok`.
10399 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
10401 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
10404 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
10407 * The contents of CResult_NonePeerHandleErrorZ
10409 typedef union LDKCResult_NonePeerHandleErrorZPtr {
10411 * Note that this value is always NULL, as there are no contents in the OK variant
10415 * A pointer to the contents in the error state.
10416 * Reading from this pointer when `result_ok` is set is undefined.
10418 struct LDKPeerHandleError *err;
10419 } LDKCResult_NonePeerHandleErrorZPtr;
10422 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
10423 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10424 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10426 typedef struct LDKCResult_NonePeerHandleErrorZ {
10428 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
10429 * `err` or `result` depending on the state of `result_ok`.
10431 union LDKCResult_NonePeerHandleErrorZPtr contents;
10433 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
10436 } LDKCResult_NonePeerHandleErrorZ;
10439 * The contents of CResult_boolPeerHandleErrorZ
10441 typedef union LDKCResult_boolPeerHandleErrorZPtr {
10443 * A pointer to the contents in the success state.
10444 * Reading from this pointer when `result_ok` is not set is undefined.
10448 * A pointer to the contents in the error state.
10449 * Reading from this pointer when `result_ok` is set is undefined.
10451 struct LDKPeerHandleError *err;
10452 } LDKCResult_boolPeerHandleErrorZPtr;
10455 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
10456 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10457 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10459 typedef struct LDKCResult_boolPeerHandleErrorZ {
10461 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
10462 * `err` or `result` depending on the state of `result_ok`.
10464 union LDKCResult_boolPeerHandleErrorZPtr contents;
10466 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
10469 } LDKCResult_boolPeerHandleErrorZ;
10472 * Errors that may occur when [sending an onion message].
10474 * [sending an onion message]: OnionMessenger::send_onion_message
10476 typedef enum LDKSendError_Tag {
10478 * Errored computing onion message packet keys.
10480 LDKSendError_Secp256k1,
10482 * Because implementations such as Eclair will drop onion messages where the message packet
10483 * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
10485 LDKSendError_TooBigPacket,
10487 * The provided [`Destination`] was an invalid [`BlindedPath`], due to having fewer than two
10490 LDKSendError_TooFewBlindedHops,
10492 * Our next-hop peer was offline or does not support onion message forwarding.
10494 LDKSendError_InvalidFirstHop,
10496 * Onion message contents must have a TLV type >= 64.
10498 LDKSendError_InvalidMessage,
10500 * Our next-hop peer's buffer was full or our total outbound buffer was full.
10502 LDKSendError_BufferFull,
10504 * Failed to retrieve our node id from the provided [`NodeSigner`].
10506 * [`NodeSigner`]: crate::chain::keysinterface::NodeSigner
10508 LDKSendError_GetNodeIdFailed,
10510 * We attempted to send to a blinded path where we are the introduction node, and failed to
10511 * advance the blinded path to make the second hop the new introduction node. Either
10512 * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
10513 * new blinding point, or we were attempting to send to ourselves.
10515 LDKSendError_BlindedPathAdvanceFailed,
10517 * Must be last for serialization purposes
10519 LDKSendError_Sentinel,
10520 } LDKSendError_Tag;
10522 typedef struct MUST_USE_STRUCT LDKSendError {
10523 LDKSendError_Tag tag;
10526 enum LDKSecp256k1Error secp256k1;
10532 * The contents of CResult_NoneSendErrorZ
10534 typedef union LDKCResult_NoneSendErrorZPtr {
10536 * Note that this value is always NULL, as there are no contents in the OK variant
10540 * A pointer to the contents in the error state.
10541 * Reading from this pointer when `result_ok` is set is undefined.
10543 struct LDKSendError *err;
10544 } LDKCResult_NoneSendErrorZPtr;
10547 * A CResult_NoneSendErrorZ represents the result of a fallible operation,
10548 * containing a () on success and a crate::lightning::onion_message::messenger::SendError on failure.
10549 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10551 typedef struct LDKCResult_NoneSendErrorZ {
10553 * The contents of this CResult_NoneSendErrorZ, accessible via either
10554 * `err` or `result` depending on the state of `result_ok`.
10556 union LDKCResult_NoneSendErrorZPtr contents;
10558 * Whether this CResult_NoneSendErrorZ represents a success state.
10561 } LDKCResult_NoneSendErrorZ;
10564 * Sub-errors which don't have specific information in them use this type.
10566 typedef struct LDKError {
10568 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
10574 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
10575 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
10577 typedef enum LDKParseError_Tag {
10578 LDKParseError_Bech32Error,
10579 LDKParseError_ParseAmountError,
10580 LDKParseError_MalformedSignature,
10581 LDKParseError_BadPrefix,
10582 LDKParseError_UnknownCurrency,
10583 LDKParseError_UnknownSiPrefix,
10584 LDKParseError_MalformedHRP,
10585 LDKParseError_TooShortDataPart,
10586 LDKParseError_UnexpectedEndOfTaggedFields,
10587 LDKParseError_DescriptionDecodeError,
10588 LDKParseError_PaddingError,
10589 LDKParseError_IntegerOverflowError,
10590 LDKParseError_InvalidSegWitProgramLength,
10591 LDKParseError_InvalidPubKeyHashLength,
10592 LDKParseError_InvalidScriptHashLength,
10593 LDKParseError_InvalidRecoveryId,
10594 LDKParseError_InvalidSliceLength,
10596 * Not an error, but used internally to signal that a part of the invoice should be ignored
10597 * according to BOLT11
10599 LDKParseError_Skip,
10601 * Must be last for serialization purposes
10603 LDKParseError_Sentinel,
10604 } LDKParseError_Tag;
10606 typedef struct MUST_USE_STRUCT LDKParseError {
10607 LDKParseError_Tag tag;
10610 struct LDKBech32Error bech32_error;
10613 struct LDKError parse_amount_error;
10616 enum LDKSecp256k1Error malformed_signature;
10619 struct LDKError description_decode_error;
10622 struct LDKStr invalid_slice_length;
10628 * The contents of CResult_SiPrefixParseErrorZ
10630 typedef union LDKCResult_SiPrefixParseErrorZPtr {
10632 * A pointer to the contents in the success state.
10633 * Reading from this pointer when `result_ok` is not set is undefined.
10635 enum LDKSiPrefix *result;
10637 * A pointer to the contents in the error state.
10638 * Reading from this pointer when `result_ok` is set is undefined.
10640 struct LDKParseError *err;
10641 } LDKCResult_SiPrefixParseErrorZPtr;
10644 * A CResult_SiPrefixParseErrorZ represents the result of a fallible operation,
10645 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::ParseError on failure.
10646 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10648 typedef struct LDKCResult_SiPrefixParseErrorZ {
10650 * The contents of this CResult_SiPrefixParseErrorZ, accessible via either
10651 * `err` or `result` depending on the state of `result_ok`.
10653 union LDKCResult_SiPrefixParseErrorZPtr contents;
10655 * Whether this CResult_SiPrefixParseErrorZ represents a success state.
10658 } LDKCResult_SiPrefixParseErrorZ;
10663 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
10665 * There are three ways to construct an `Invoice`:
10666 * 1. using `InvoiceBuilder`
10667 * 2. using `Invoice::from_signed(SignedRawInvoice)`
10668 * 3. using `str::parse::<Invoice>(&str)`
10670 typedef struct MUST_USE_STRUCT LDKInvoice {
10672 * A pointer to the opaque Rust object.
10673 * Nearly everywhere, inner must be non-null, however in places where
10674 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10676 LDKnativeInvoice *inner;
10678 * Indicates that this is the only struct which contains the same pointer.
10679 * Rust functions which take ownership of an object provided via an argument require
10680 * this to be true and invalidate the object pointed to by inner.
10686 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
10687 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
10688 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
10690 typedef enum LDKParseOrSemanticError_Tag {
10692 * The invoice couldn't be decoded
10694 LDKParseOrSemanticError_ParseError,
10696 * The invoice could be decoded but violates the BOLT11 standard
10698 LDKParseOrSemanticError_SemanticError,
10700 * Must be last for serialization purposes
10702 LDKParseOrSemanticError_Sentinel,
10703 } LDKParseOrSemanticError_Tag;
10705 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
10706 LDKParseOrSemanticError_Tag tag;
10709 struct LDKParseError parse_error;
10712 enum LDKSemanticError semantic_error;
10715 } LDKParseOrSemanticError;
10718 * The contents of CResult_InvoiceParseOrSemanticErrorZ
10720 typedef union LDKCResult_InvoiceParseOrSemanticErrorZPtr {
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 LDKInvoice *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 LDKParseOrSemanticError *err;
10731 } LDKCResult_InvoiceParseOrSemanticErrorZPtr;
10734 * A CResult_InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
10735 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
10736 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10738 typedef struct LDKCResult_InvoiceParseOrSemanticErrorZ {
10740 * The contents of this CResult_InvoiceParseOrSemanticErrorZ, accessible via either
10741 * `err` or `result` depending on the state of `result_ok`.
10743 union LDKCResult_InvoiceParseOrSemanticErrorZPtr contents;
10745 * Whether this CResult_InvoiceParseOrSemanticErrorZ represents a success state.
10748 } LDKCResult_InvoiceParseOrSemanticErrorZ;
10753 * Represents a signed `RawInvoice` with cached hash. The signature is not checked and may be
10757 * The hash has to be either from the deserialized invoice or from the serialized `raw_invoice`.
10759 typedef struct MUST_USE_STRUCT LDKSignedRawInvoice {
10761 * A pointer to the opaque Rust object.
10762 * Nearly everywhere, inner must be non-null, however in places where
10763 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10765 LDKnativeSignedRawInvoice *inner;
10767 * Indicates that this is the only struct which contains the same pointer.
10768 * Rust functions which take ownership of an object provided via an argument require
10769 * this to be true and invalidate the object pointed to by inner.
10772 } LDKSignedRawInvoice;
10775 * The contents of CResult_SignedRawInvoiceParseErrorZ
10777 typedef union LDKCResult_SignedRawInvoiceParseErrorZPtr {
10779 * A pointer to the contents in the success state.
10780 * Reading from this pointer when `result_ok` is not set is undefined.
10782 struct LDKSignedRawInvoice *result;
10784 * A pointer to the contents in the error state.
10785 * Reading from this pointer when `result_ok` is set is undefined.
10787 struct LDKParseError *err;
10788 } LDKCResult_SignedRawInvoiceParseErrorZPtr;
10791 * A CResult_SignedRawInvoiceParseErrorZ represents the result of a fallible operation,
10792 * containing a crate::lightning_invoice::SignedRawInvoice on success and a crate::lightning_invoice::ParseError on failure.
10793 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10795 typedef struct LDKCResult_SignedRawInvoiceParseErrorZ {
10797 * The contents of this CResult_SignedRawInvoiceParseErrorZ, accessible via either
10798 * `err` or `result` depending on the state of `result_ok`.
10800 union LDKCResult_SignedRawInvoiceParseErrorZPtr contents;
10802 * Whether this CResult_SignedRawInvoiceParseErrorZ represents a success state.
10805 } LDKCResult_SignedRawInvoiceParseErrorZ;
10810 * Represents an syntactically correct Invoice for a payment on the lightning network,
10811 * but without the signature information.
10812 * De- and encoding should not lead to information loss but may lead to different hashes.
10814 * For methods without docs see the corresponding methods in `Invoice`.
10816 typedef struct MUST_USE_STRUCT LDKRawInvoice {
10818 * A pointer to the opaque Rust object.
10819 * Nearly everywhere, inner must be non-null, however in places where
10820 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10822 LDKnativeRawInvoice *inner;
10824 * Indicates that this is the only struct which contains the same pointer.
10825 * Rust functions which take ownership of an object provided via an argument require
10826 * this to be true and invalidate the object pointed to by inner.
10834 * Recoverable signature
10836 typedef struct MUST_USE_STRUCT LDKInvoiceSignature {
10838 * A pointer to the opaque Rust object.
10839 * Nearly everywhere, inner must be non-null, however in places where
10840 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10842 LDKnativeInvoiceSignature *inner;
10844 * Indicates that this is the only struct which contains the same pointer.
10845 * Rust functions which take ownership of an object provided via an argument require
10846 * this to be true and invalidate the object pointed to by inner.
10849 } LDKInvoiceSignature;
10852 * A tuple of 3 elements. See the individual fields for the types contained.
10854 typedef struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ {
10856 * The element at position 0
10858 struct LDKRawInvoice a;
10860 * The element at position 1
10862 struct LDKThirtyTwoBytes b;
10864 * The element at position 2
10866 struct LDKInvoiceSignature c;
10867 } LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ;
10874 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
10876 * A pointer to the opaque Rust object.
10877 * Nearly everywhere, inner must be non-null, however in places where
10878 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10880 LDKnativePayeePubKey *inner;
10882 * Indicates that this is the only struct which contains the same pointer.
10883 * Rust functions which take ownership of an object provided via an argument require
10884 * this to be true and invalidate the object pointed to by inner.
10890 * The contents of CResult_PayeePubKeyErrorZ
10892 typedef union LDKCResult_PayeePubKeyErrorZPtr {
10894 * A pointer to the contents in the success state.
10895 * Reading from this pointer when `result_ok` is not set is undefined.
10897 struct LDKPayeePubKey *result;
10899 * A pointer to the contents in the error state.
10900 * Reading from this pointer when `result_ok` is set is undefined.
10902 enum LDKSecp256k1Error *err;
10903 } LDKCResult_PayeePubKeyErrorZPtr;
10906 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
10907 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
10908 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10910 typedef struct LDKCResult_PayeePubKeyErrorZ {
10912 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
10913 * `err` or `result` depending on the state of `result_ok`.
10915 union LDKCResult_PayeePubKeyErrorZPtr contents;
10917 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
10920 } LDKCResult_PayeePubKeyErrorZ;
10925 * Private routing information
10928 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
10931 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
10933 * A pointer to the opaque Rust object.
10934 * Nearly everywhere, inner must be non-null, however in places where
10935 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10937 LDKnativePrivateRoute *inner;
10939 * Indicates that this is the only struct which contains the same pointer.
10940 * Rust functions which take ownership of an object provided via an argument require
10941 * this to be true and invalidate the object pointed to by inner.
10947 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
10948 * This corresponds to std::vector in C++
10950 typedef struct LDKCVec_PrivateRouteZ {
10952 * The elements in the array.
10953 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10955 struct LDKPrivateRoute *data;
10957 * The number of elements pointed to by `data`.
10960 } LDKCVec_PrivateRouteZ;
10965 * A timestamp that refers to a date after 1 January 1970.
10969 * The Unix timestamp representing the stored time has to be positive and no greater than
10970 * [`MAX_TIMESTAMP`].
10972 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
10974 * A pointer to the opaque Rust object.
10975 * Nearly everywhere, inner must be non-null, however in places where
10976 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10978 LDKnativePositiveTimestamp *inner;
10980 * Indicates that this is the only struct which contains the same pointer.
10981 * Rust functions which take ownership of an object provided via an argument require
10982 * this to be true and invalidate the object pointed to by inner.
10985 } LDKPositiveTimestamp;
10988 * The contents of CResult_PositiveTimestampCreationErrorZ
10990 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
10992 * A pointer to the contents in the success state.
10993 * Reading from this pointer when `result_ok` is not set is undefined.
10995 struct LDKPositiveTimestamp *result;
10997 * A pointer to the contents in the error state.
10998 * Reading from this pointer when `result_ok` is set is undefined.
11000 enum LDKCreationError *err;
11001 } LDKCResult_PositiveTimestampCreationErrorZPtr;
11004 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
11005 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
11006 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11008 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
11010 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
11011 * `err` or `result` depending on the state of `result_ok`.
11013 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
11015 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
11018 } LDKCResult_PositiveTimestampCreationErrorZ;
11021 * The contents of CResult_NoneSemanticErrorZ
11023 typedef union LDKCResult_NoneSemanticErrorZPtr {
11025 * Note that this value is always NULL, as there are no contents in the OK variant
11029 * A pointer to the contents in the error state.
11030 * Reading from this pointer when `result_ok` is set is undefined.
11032 enum LDKSemanticError *err;
11033 } LDKCResult_NoneSemanticErrorZPtr;
11036 * A CResult_NoneSemanticErrorZ represents the result of a fallible operation,
11037 * containing a () on success and a crate::lightning_invoice::SemanticError on failure.
11038 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11040 typedef struct LDKCResult_NoneSemanticErrorZ {
11042 * The contents of this CResult_NoneSemanticErrorZ, accessible via either
11043 * `err` or `result` depending on the state of `result_ok`.
11045 union LDKCResult_NoneSemanticErrorZPtr contents;
11047 * Whether this CResult_NoneSemanticErrorZ represents a success state.
11050 } LDKCResult_NoneSemanticErrorZ;
11053 * The contents of CResult_InvoiceSemanticErrorZ
11055 typedef union LDKCResult_InvoiceSemanticErrorZPtr {
11057 * A pointer to the contents in the success state.
11058 * Reading from this pointer when `result_ok` is not set is undefined.
11060 struct LDKInvoice *result;
11062 * A pointer to the contents in the error state.
11063 * Reading from this pointer when `result_ok` is set is undefined.
11065 enum LDKSemanticError *err;
11066 } LDKCResult_InvoiceSemanticErrorZPtr;
11069 * A CResult_InvoiceSemanticErrorZ represents the result of a fallible operation,
11070 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SemanticError on failure.
11071 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11073 typedef struct LDKCResult_InvoiceSemanticErrorZ {
11075 * The contents of this CResult_InvoiceSemanticErrorZ, accessible via either
11076 * `err` or `result` depending on the state of `result_ok`.
11078 union LDKCResult_InvoiceSemanticErrorZPtr contents;
11080 * Whether this CResult_InvoiceSemanticErrorZ represents a success state.
11083 } LDKCResult_InvoiceSemanticErrorZ;
11088 * Description string
11091 * The description can be at most 639 __bytes__ long
11093 typedef struct MUST_USE_STRUCT LDKDescription {
11095 * A pointer to the opaque Rust object.
11096 * Nearly everywhere, inner must be non-null, however in places where
11097 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11099 LDKnativeDescription *inner;
11101 * Indicates that this is the only struct which contains the same pointer.
11102 * Rust functions which take ownership of an object provided via an argument require
11103 * this to be true and invalidate the object pointed to by inner.
11109 * The contents of CResult_DescriptionCreationErrorZ
11111 typedef union LDKCResult_DescriptionCreationErrorZPtr {
11113 * A pointer to the contents in the success state.
11114 * Reading from this pointer when `result_ok` is not set is undefined.
11116 struct LDKDescription *result;
11118 * A pointer to the contents in the error state.
11119 * Reading from this pointer when `result_ok` is set is undefined.
11121 enum LDKCreationError *err;
11122 } LDKCResult_DescriptionCreationErrorZPtr;
11125 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
11126 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
11127 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11129 typedef struct LDKCResult_DescriptionCreationErrorZ {
11131 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
11132 * `err` or `result` depending on the state of `result_ok`.
11134 union LDKCResult_DescriptionCreationErrorZPtr contents;
11136 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
11139 } LDKCResult_DescriptionCreationErrorZ;
11142 * The contents of CResult_PrivateRouteCreationErrorZ
11144 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
11146 * A pointer to the contents in the success state.
11147 * Reading from this pointer when `result_ok` is not set is undefined.
11149 struct LDKPrivateRoute *result;
11151 * A pointer to the contents in the error state.
11152 * Reading from this pointer when `result_ok` is set is undefined.
11154 enum LDKCreationError *err;
11155 } LDKCResult_PrivateRouteCreationErrorZPtr;
11158 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
11159 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
11160 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11162 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
11164 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
11165 * `err` or `result` depending on the state of `result_ok`.
11167 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
11169 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
11172 } LDKCResult_PrivateRouteCreationErrorZ;
11175 * All-encompassing standard error type that processing can return
11177 typedef enum LDKGraphSyncError_Tag {
11179 * Error trying to read the update data, typically due to an erroneous data length indication
11180 * that is greater than the actual amount of data provided
11182 LDKGraphSyncError_DecodeError,
11184 * Error applying the patch to the network graph, usually the result of updates that are too
11185 * old or missing prerequisite data to the application of updates out of order
11187 LDKGraphSyncError_LightningError,
11189 * Must be last for serialization purposes
11191 LDKGraphSyncError_Sentinel,
11192 } LDKGraphSyncError_Tag;
11194 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
11195 LDKGraphSyncError_Tag tag;
11198 struct LDKDecodeError decode_error;
11201 struct LDKLightningError lightning_error;
11204 } LDKGraphSyncError;
11207 * The contents of CResult_u32GraphSyncErrorZ
11209 typedef union LDKCResult_u32GraphSyncErrorZPtr {
11211 * A pointer to the contents in the success state.
11212 * Reading from this pointer when `result_ok` is not set is undefined.
11216 * A pointer to the contents in the error state.
11217 * Reading from this pointer when `result_ok` is set is undefined.
11219 struct LDKGraphSyncError *err;
11220 } LDKCResult_u32GraphSyncErrorZPtr;
11223 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
11224 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
11225 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11227 typedef struct LDKCResult_u32GraphSyncErrorZ {
11229 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
11230 * `err` or `result` depending on the state of `result_ok`.
11232 union LDKCResult_u32GraphSyncErrorZPtr contents;
11234 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
11237 } LDKCResult_u32GraphSyncErrorZ;
11240 * The contents of CResult_NetAddressDecodeErrorZ
11242 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
11244 * A pointer to the contents in the success state.
11245 * Reading from this pointer when `result_ok` is not set is undefined.
11247 struct LDKNetAddress *result;
11249 * A pointer to the contents in the error state.
11250 * Reading from this pointer when `result_ok` is set is undefined.
11252 struct LDKDecodeError *err;
11253 } LDKCResult_NetAddressDecodeErrorZPtr;
11256 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
11257 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
11258 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11260 typedef struct LDKCResult_NetAddressDecodeErrorZ {
11262 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
11263 * `err` or `result` depending on the state of `result_ok`.
11265 union LDKCResult_NetAddressDecodeErrorZPtr contents;
11267 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
11270 } LDKCResult_NetAddressDecodeErrorZ;
11275 * An [`update_add_htlc`] message to be sent to or received from a peer.
11277 * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
11279 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
11281 * A pointer to the opaque Rust object.
11282 * Nearly everywhere, inner must be non-null, however in places where
11283 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11285 LDKnativeUpdateAddHTLC *inner;
11287 * Indicates that this is the only struct which contains the same pointer.
11288 * Rust functions which take ownership of an object provided via an argument require
11289 * this to be true and invalidate the object pointed to by inner.
11292 } LDKUpdateAddHTLC;
11295 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
11296 * This corresponds to std::vector in C++
11298 typedef struct LDKCVec_UpdateAddHTLCZ {
11300 * The elements in the array.
11301 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11303 struct LDKUpdateAddHTLC *data;
11305 * The number of elements pointed to by `data`.
11308 } LDKCVec_UpdateAddHTLCZ;
11313 * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
11315 * [`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
11317 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
11319 * A pointer to the opaque Rust object.
11320 * Nearly everywhere, inner must be non-null, however in places where
11321 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11323 LDKnativeUpdateFulfillHTLC *inner;
11325 * Indicates that this is the only struct which contains the same pointer.
11326 * Rust functions which take ownership of an object provided via an argument require
11327 * this to be true and invalidate the object pointed to by inner.
11330 } LDKUpdateFulfillHTLC;
11333 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
11334 * This corresponds to std::vector in C++
11336 typedef struct LDKCVec_UpdateFulfillHTLCZ {
11338 * The elements in the array.
11339 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11341 struct LDKUpdateFulfillHTLC *data;
11343 * The number of elements pointed to by `data`.
11346 } LDKCVec_UpdateFulfillHTLCZ;
11351 * An [`update_fail_htlc`] message to be sent to or received from a peer.
11353 * [`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
11355 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
11357 * A pointer to the opaque Rust object.
11358 * Nearly everywhere, inner must be non-null, however in places where
11359 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11361 LDKnativeUpdateFailHTLC *inner;
11363 * Indicates that this is the only struct which contains the same pointer.
11364 * Rust functions which take ownership of an object provided via an argument require
11365 * this to be true and invalidate the object pointed to by inner.
11368 } LDKUpdateFailHTLC;
11371 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
11372 * This corresponds to std::vector in C++
11374 typedef struct LDKCVec_UpdateFailHTLCZ {
11376 * The elements in the array.
11377 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11379 struct LDKUpdateFailHTLC *data;
11381 * The number of elements pointed to by `data`.
11384 } LDKCVec_UpdateFailHTLCZ;
11389 * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
11391 * [`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
11393 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
11395 * A pointer to the opaque Rust object.
11396 * Nearly everywhere, inner must be non-null, however in places where
11397 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11399 LDKnativeUpdateFailMalformedHTLC *inner;
11401 * Indicates that this is the only struct which contains the same pointer.
11402 * Rust functions which take ownership of an object provided via an argument require
11403 * this to be true and invalidate the object pointed to by inner.
11406 } LDKUpdateFailMalformedHTLC;
11409 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
11410 * This corresponds to std::vector in C++
11412 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
11414 * The elements in the array.
11415 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11417 struct LDKUpdateFailMalformedHTLC *data;
11419 * The number of elements pointed to by `data`.
11422 } LDKCVec_UpdateFailMalformedHTLCZ;
11425 * The contents of CResult_AcceptChannelDecodeErrorZ
11427 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
11429 * A pointer to the contents in the success state.
11430 * Reading from this pointer when `result_ok` is not set is undefined.
11432 struct LDKAcceptChannel *result;
11434 * A pointer to the contents in the error state.
11435 * Reading from this pointer when `result_ok` is set is undefined.
11437 struct LDKDecodeError *err;
11438 } LDKCResult_AcceptChannelDecodeErrorZPtr;
11441 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
11442 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
11443 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11445 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
11447 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
11448 * `err` or `result` depending on the state of `result_ok`.
11450 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
11452 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
11455 } LDKCResult_AcceptChannelDecodeErrorZ;
11458 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
11460 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
11462 * A pointer to the contents in the success state.
11463 * Reading from this pointer when `result_ok` is not set is undefined.
11465 struct LDKAnnouncementSignatures *result;
11467 * A pointer to the contents in the error state.
11468 * Reading from this pointer when `result_ok` is set is undefined.
11470 struct LDKDecodeError *err;
11471 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
11474 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
11475 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
11476 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11478 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
11480 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
11481 * `err` or `result` depending on the state of `result_ok`.
11483 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
11485 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
11488 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
11491 * The contents of CResult_ChannelReestablishDecodeErrorZ
11493 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
11495 * A pointer to the contents in the success state.
11496 * Reading from this pointer when `result_ok` is not set is undefined.
11498 struct LDKChannelReestablish *result;
11500 * A pointer to the contents in the error state.
11501 * Reading from this pointer when `result_ok` is set is undefined.
11503 struct LDKDecodeError *err;
11504 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
11507 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
11508 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
11509 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11511 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
11513 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
11514 * `err` or `result` depending on the state of `result_ok`.
11516 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
11518 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
11521 } LDKCResult_ChannelReestablishDecodeErrorZ;
11524 * The contents of CResult_ClosingSignedDecodeErrorZ
11526 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
11528 * A pointer to the contents in the success state.
11529 * Reading from this pointer when `result_ok` is not set is undefined.
11531 struct LDKClosingSigned *result;
11533 * A pointer to the contents in the error state.
11534 * Reading from this pointer when `result_ok` is set is undefined.
11536 struct LDKDecodeError *err;
11537 } LDKCResult_ClosingSignedDecodeErrorZPtr;
11540 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
11541 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11542 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11544 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
11546 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
11547 * `err` or `result` depending on the state of `result_ok`.
11549 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
11551 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
11554 } LDKCResult_ClosingSignedDecodeErrorZ;
11559 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
11561 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
11564 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
11566 * A pointer to the opaque Rust object.
11567 * Nearly everywhere, inner must be non-null, however in places where
11568 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11570 LDKnativeClosingSignedFeeRange *inner;
11572 * Indicates that this is the only struct which contains the same pointer.
11573 * Rust functions which take ownership of an object provided via an argument require
11574 * this to be true and invalidate the object pointed to by inner.
11577 } LDKClosingSignedFeeRange;
11580 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
11582 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
11584 * A pointer to the contents in the success state.
11585 * Reading from this pointer when `result_ok` is not set is undefined.
11587 struct LDKClosingSignedFeeRange *result;
11589 * A pointer to the contents in the error state.
11590 * Reading from this pointer when `result_ok` is set is undefined.
11592 struct LDKDecodeError *err;
11593 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
11596 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
11597 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
11598 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11600 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
11602 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
11603 * `err` or `result` depending on the state of `result_ok`.
11605 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
11607 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
11610 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
11615 * A [`commitment_signed`] message to be sent to or received from a peer.
11617 * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
11619 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
11621 * A pointer to the opaque Rust object.
11622 * Nearly everywhere, inner must be non-null, however in places where
11623 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11625 LDKnativeCommitmentSigned *inner;
11627 * Indicates that this is the only struct which contains the same pointer.
11628 * Rust functions which take ownership of an object provided via an argument require
11629 * this to be true and invalidate the object pointed to by inner.
11632 } LDKCommitmentSigned;
11635 * The contents of CResult_CommitmentSignedDecodeErrorZ
11637 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
11639 * A pointer to the contents in the success state.
11640 * Reading from this pointer when `result_ok` is not set is undefined.
11642 struct LDKCommitmentSigned *result;
11644 * A pointer to the contents in the error state.
11645 * Reading from this pointer when `result_ok` is set is undefined.
11647 struct LDKDecodeError *err;
11648 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
11651 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
11652 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11653 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11655 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
11657 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
11658 * `err` or `result` depending on the state of `result_ok`.
11660 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
11662 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
11665 } LDKCResult_CommitmentSignedDecodeErrorZ;
11668 * The contents of CResult_FundingCreatedDecodeErrorZ
11670 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
11672 * A pointer to the contents in the success state.
11673 * Reading from this pointer when `result_ok` is not set is undefined.
11675 struct LDKFundingCreated *result;
11677 * A pointer to the contents in the error state.
11678 * Reading from this pointer when `result_ok` is set is undefined.
11680 struct LDKDecodeError *err;
11681 } LDKCResult_FundingCreatedDecodeErrorZPtr;
11684 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
11685 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
11686 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11688 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
11690 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
11691 * `err` or `result` depending on the state of `result_ok`.
11693 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
11695 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
11698 } LDKCResult_FundingCreatedDecodeErrorZ;
11701 * The contents of CResult_FundingSignedDecodeErrorZ
11703 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
11705 * A pointer to the contents in the success state.
11706 * Reading from this pointer when `result_ok` is not set is undefined.
11708 struct LDKFundingSigned *result;
11710 * A pointer to the contents in the error state.
11711 * Reading from this pointer when `result_ok` is set is undefined.
11713 struct LDKDecodeError *err;
11714 } LDKCResult_FundingSignedDecodeErrorZPtr;
11717 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
11718 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11719 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11721 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
11723 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
11724 * `err` or `result` depending on the state of `result_ok`.
11726 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
11728 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
11731 } LDKCResult_FundingSignedDecodeErrorZ;
11734 * The contents of CResult_ChannelReadyDecodeErrorZ
11736 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
11738 * A pointer to the contents in the success state.
11739 * Reading from this pointer when `result_ok` is not set is undefined.
11741 struct LDKChannelReady *result;
11743 * A pointer to the contents in the error state.
11744 * Reading from this pointer when `result_ok` is set is undefined.
11746 struct LDKDecodeError *err;
11747 } LDKCResult_ChannelReadyDecodeErrorZPtr;
11750 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
11751 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
11752 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11754 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
11756 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
11757 * `err` or `result` depending on the state of `result_ok`.
11759 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
11761 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
11764 } LDKCResult_ChannelReadyDecodeErrorZ;
11769 * An [`init`] message to be sent to or received from a peer.
11771 * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
11773 typedef struct MUST_USE_STRUCT LDKInit {
11775 * A pointer to the opaque Rust object.
11776 * Nearly everywhere, inner must be non-null, however in places where
11777 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11779 LDKnativeInit *inner;
11781 * Indicates that this is the only struct which contains the same pointer.
11782 * Rust functions which take ownership of an object provided via an argument require
11783 * this to be true and invalidate the object pointed to by inner.
11789 * The contents of CResult_InitDecodeErrorZ
11791 typedef union LDKCResult_InitDecodeErrorZPtr {
11793 * A pointer to the contents in the success state.
11794 * Reading from this pointer when `result_ok` is not set is undefined.
11796 struct LDKInit *result;
11798 * A pointer to the contents in the error state.
11799 * Reading from this pointer when `result_ok` is set is undefined.
11801 struct LDKDecodeError *err;
11802 } LDKCResult_InitDecodeErrorZPtr;
11805 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
11806 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
11807 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11809 typedef struct LDKCResult_InitDecodeErrorZ {
11811 * The contents of this CResult_InitDecodeErrorZ, accessible via either
11812 * `err` or `result` depending on the state of `result_ok`.
11814 union LDKCResult_InitDecodeErrorZPtr contents;
11816 * Whether this CResult_InitDecodeErrorZ represents a success state.
11819 } LDKCResult_InitDecodeErrorZ;
11822 * The contents of CResult_OpenChannelDecodeErrorZ
11824 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
11826 * A pointer to the contents in the success state.
11827 * Reading from this pointer when `result_ok` is not set is undefined.
11829 struct LDKOpenChannel *result;
11831 * A pointer to the contents in the error state.
11832 * Reading from this pointer when `result_ok` is set is undefined.
11834 struct LDKDecodeError *err;
11835 } LDKCResult_OpenChannelDecodeErrorZPtr;
11838 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
11839 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
11840 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11842 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
11844 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
11845 * `err` or `result` depending on the state of `result_ok`.
11847 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
11849 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
11852 } LDKCResult_OpenChannelDecodeErrorZ;
11855 * The contents of CResult_RevokeAndACKDecodeErrorZ
11857 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
11859 * A pointer to the contents in the success state.
11860 * Reading from this pointer when `result_ok` is not set is undefined.
11862 struct LDKRevokeAndACK *result;
11864 * A pointer to the contents in the error state.
11865 * Reading from this pointer when `result_ok` is set is undefined.
11867 struct LDKDecodeError *err;
11868 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
11871 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
11872 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
11873 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11875 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
11877 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
11878 * `err` or `result` depending on the state of `result_ok`.
11880 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
11882 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
11885 } LDKCResult_RevokeAndACKDecodeErrorZ;
11888 * The contents of CResult_ShutdownDecodeErrorZ
11890 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
11892 * A pointer to the contents in the success state.
11893 * Reading from this pointer when `result_ok` is not set is undefined.
11895 struct LDKShutdown *result;
11897 * A pointer to the contents in the error state.
11898 * Reading from this pointer when `result_ok` is set is undefined.
11900 struct LDKDecodeError *err;
11901 } LDKCResult_ShutdownDecodeErrorZPtr;
11904 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
11905 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
11906 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11908 typedef struct LDKCResult_ShutdownDecodeErrorZ {
11910 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
11911 * `err` or `result` depending on the state of `result_ok`.
11913 union LDKCResult_ShutdownDecodeErrorZPtr contents;
11915 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
11918 } LDKCResult_ShutdownDecodeErrorZ;
11921 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
11923 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
11925 * A pointer to the contents in the success state.
11926 * Reading from this pointer when `result_ok` is not set is undefined.
11928 struct LDKUpdateFailHTLC *result;
11930 * A pointer to the contents in the error state.
11931 * Reading from this pointer when `result_ok` is set is undefined.
11933 struct LDKDecodeError *err;
11934 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
11937 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
11938 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
11939 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11941 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
11943 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
11944 * `err` or `result` depending on the state of `result_ok`.
11946 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
11948 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
11951 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
11954 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
11956 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
11958 * A pointer to the contents in the success state.
11959 * Reading from this pointer when `result_ok` is not set is undefined.
11961 struct LDKUpdateFailMalformedHTLC *result;
11963 * A pointer to the contents in the error state.
11964 * Reading from this pointer when `result_ok` is set is undefined.
11966 struct LDKDecodeError *err;
11967 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
11970 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
11971 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
11972 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11974 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
11976 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
11977 * `err` or `result` depending on the state of `result_ok`.
11979 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
11981 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
11984 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
11989 * An [`update_fee`] message to be sent to or received from a peer
11991 * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
11993 typedef struct MUST_USE_STRUCT LDKUpdateFee {
11995 * A pointer to the opaque Rust object.
11996 * Nearly everywhere, inner must be non-null, however in places where
11997 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11999 LDKnativeUpdateFee *inner;
12001 * Indicates that this is the only struct which contains the same pointer.
12002 * Rust functions which take ownership of an object provided via an argument require
12003 * this to be true and invalidate the object pointed to by inner.
12009 * The contents of CResult_UpdateFeeDecodeErrorZ
12011 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
12013 * A pointer to the contents in the success state.
12014 * Reading from this pointer when `result_ok` is not set is undefined.
12016 struct LDKUpdateFee *result;
12018 * A pointer to the contents in the error state.
12019 * Reading from this pointer when `result_ok` is set is undefined.
12021 struct LDKDecodeError *err;
12022 } LDKCResult_UpdateFeeDecodeErrorZPtr;
12025 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
12026 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
12027 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12029 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
12031 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
12032 * `err` or `result` depending on the state of `result_ok`.
12034 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
12036 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
12039 } LDKCResult_UpdateFeeDecodeErrorZ;
12042 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
12044 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
12046 * A pointer to the contents in the success state.
12047 * Reading from this pointer when `result_ok` is not set is undefined.
12049 struct LDKUpdateFulfillHTLC *result;
12051 * A pointer to the contents in the error state.
12052 * Reading from this pointer when `result_ok` is set is undefined.
12054 struct LDKDecodeError *err;
12055 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
12058 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
12059 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12060 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12062 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
12064 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
12065 * `err` or `result` depending on the state of `result_ok`.
12067 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
12069 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
12072 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
12075 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
12077 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
12079 * A pointer to the contents in the success state.
12080 * Reading from this pointer when `result_ok` is not set is undefined.
12082 struct LDKUpdateAddHTLC *result;
12084 * A pointer to the contents in the error state.
12085 * Reading from this pointer when `result_ok` is set is undefined.
12087 struct LDKDecodeError *err;
12088 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
12091 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
12092 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
12093 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12095 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
12097 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
12098 * `err` or `result` depending on the state of `result_ok`.
12100 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
12102 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
12105 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
12110 * An onion message to be sent to or received from a peer.
12113 typedef struct MUST_USE_STRUCT LDKOnionMessage {
12115 * A pointer to the opaque Rust object.
12116 * Nearly everywhere, inner must be non-null, however in places where
12117 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12119 LDKnativeOnionMessage *inner;
12121 * Indicates that this is the only struct which contains the same pointer.
12122 * Rust functions which take ownership of an object provided via an argument require
12123 * this to be true and invalidate the object pointed to by inner.
12129 * The contents of CResult_OnionMessageDecodeErrorZ
12131 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
12133 * A pointer to the contents in the success state.
12134 * Reading from this pointer when `result_ok` is not set is undefined.
12136 struct LDKOnionMessage *result;
12138 * A pointer to the contents in the error state.
12139 * Reading from this pointer when `result_ok` is set is undefined.
12141 struct LDKDecodeError *err;
12142 } LDKCResult_OnionMessageDecodeErrorZPtr;
12145 * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
12146 * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12147 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12149 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
12151 * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
12152 * `err` or `result` depending on the state of `result_ok`.
12154 union LDKCResult_OnionMessageDecodeErrorZPtr contents;
12156 * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
12159 } LDKCResult_OnionMessageDecodeErrorZ;
12164 * A [`ping`] message to be sent to or received from a peer.
12166 * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
12168 typedef struct MUST_USE_STRUCT LDKPing {
12170 * A pointer to the opaque Rust object.
12171 * Nearly everywhere, inner must be non-null, however in places where
12172 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12174 LDKnativePing *inner;
12176 * Indicates that this is the only struct which contains the same pointer.
12177 * Rust functions which take ownership of an object provided via an argument require
12178 * this to be true and invalidate the object pointed to by inner.
12184 * The contents of CResult_PingDecodeErrorZ
12186 typedef union LDKCResult_PingDecodeErrorZPtr {
12188 * A pointer to the contents in the success state.
12189 * Reading from this pointer when `result_ok` is not set is undefined.
12191 struct LDKPing *result;
12193 * A pointer to the contents in the error state.
12194 * Reading from this pointer when `result_ok` is set is undefined.
12196 struct LDKDecodeError *err;
12197 } LDKCResult_PingDecodeErrorZPtr;
12200 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
12201 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
12202 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12204 typedef struct LDKCResult_PingDecodeErrorZ {
12206 * The contents of this CResult_PingDecodeErrorZ, accessible via either
12207 * `err` or `result` depending on the state of `result_ok`.
12209 union LDKCResult_PingDecodeErrorZPtr contents;
12211 * Whether this CResult_PingDecodeErrorZ represents a success state.
12214 } LDKCResult_PingDecodeErrorZ;
12219 * A [`pong`] message to be sent to or received from a peer.
12221 * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
12223 typedef struct MUST_USE_STRUCT LDKPong {
12225 * A pointer to the opaque Rust object.
12226 * Nearly everywhere, inner must be non-null, however in places where
12227 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12229 LDKnativePong *inner;
12231 * Indicates that this is the only struct which contains the same pointer.
12232 * Rust functions which take ownership of an object provided via an argument require
12233 * this to be true and invalidate the object pointed to by inner.
12239 * The contents of CResult_PongDecodeErrorZ
12241 typedef union LDKCResult_PongDecodeErrorZPtr {
12243 * A pointer to the contents in the success state.
12244 * Reading from this pointer when `result_ok` is not set is undefined.
12246 struct LDKPong *result;
12248 * A pointer to the contents in the error state.
12249 * Reading from this pointer when `result_ok` is set is undefined.
12251 struct LDKDecodeError *err;
12252 } LDKCResult_PongDecodeErrorZPtr;
12255 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
12256 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
12257 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12259 typedef struct LDKCResult_PongDecodeErrorZ {
12261 * The contents of this CResult_PongDecodeErrorZ, accessible via either
12262 * `err` or `result` depending on the state of `result_ok`.
12264 union LDKCResult_PongDecodeErrorZPtr contents;
12266 * Whether this CResult_PongDecodeErrorZ represents a success state.
12269 } LDKCResult_PongDecodeErrorZ;
12272 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
12274 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
12276 * A pointer to the contents in the success state.
12277 * Reading from this pointer when `result_ok` is not set is undefined.
12279 struct LDKUnsignedChannelAnnouncement *result;
12281 * A pointer to the contents in the error state.
12282 * Reading from this pointer when `result_ok` is set is undefined.
12284 struct LDKDecodeError *err;
12285 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
12288 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
12289 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12290 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12292 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
12294 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
12295 * `err` or `result` depending on the state of `result_ok`.
12297 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
12299 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
12302 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
12305 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
12307 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
12309 * A pointer to the contents in the success state.
12310 * Reading from this pointer when `result_ok` is not set is undefined.
12312 struct LDKChannelAnnouncement *result;
12314 * A pointer to the contents in the error state.
12315 * Reading from this pointer when `result_ok` is set is undefined.
12317 struct LDKDecodeError *err;
12318 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
12321 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
12322 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12323 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12325 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
12327 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
12328 * `err` or `result` depending on the state of `result_ok`.
12330 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
12332 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
12335 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
12338 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
12340 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
12342 * A pointer to the contents in the success state.
12343 * Reading from this pointer when `result_ok` is not set is undefined.
12345 struct LDKUnsignedChannelUpdate *result;
12347 * A pointer to the contents in the error state.
12348 * Reading from this pointer when `result_ok` is set is undefined.
12350 struct LDKDecodeError *err;
12351 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
12354 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12355 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12356 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12358 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
12360 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
12361 * `err` or `result` depending on the state of `result_ok`.
12363 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
12365 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
12368 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
12371 * The contents of CResult_ChannelUpdateDecodeErrorZ
12373 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
12375 * A pointer to the contents in the success state.
12376 * Reading from this pointer when `result_ok` is not set is undefined.
12378 struct LDKChannelUpdate *result;
12380 * A pointer to the contents in the error state.
12381 * Reading from this pointer when `result_ok` is set is undefined.
12383 struct LDKDecodeError *err;
12384 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
12387 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12388 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12389 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12391 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
12393 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
12394 * `err` or `result` depending on the state of `result_ok`.
12396 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
12398 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
12401 } LDKCResult_ChannelUpdateDecodeErrorZ;
12404 * The contents of CResult_ErrorMessageDecodeErrorZ
12406 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
12408 * A pointer to the contents in the success state.
12409 * Reading from this pointer when `result_ok` is not set is undefined.
12411 struct LDKErrorMessage *result;
12413 * A pointer to the contents in the error state.
12414 * Reading from this pointer when `result_ok` is set is undefined.
12416 struct LDKDecodeError *err;
12417 } LDKCResult_ErrorMessageDecodeErrorZPtr;
12420 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
12421 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12422 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12424 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
12426 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
12427 * `err` or `result` depending on the state of `result_ok`.
12429 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
12431 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
12434 } LDKCResult_ErrorMessageDecodeErrorZ;
12437 * The contents of CResult_WarningMessageDecodeErrorZ
12439 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
12441 * A pointer to the contents in the success state.
12442 * Reading from this pointer when `result_ok` is not set is undefined.
12444 struct LDKWarningMessage *result;
12446 * A pointer to the contents in the error state.
12447 * Reading from this pointer when `result_ok` is set is undefined.
12449 struct LDKDecodeError *err;
12450 } LDKCResult_WarningMessageDecodeErrorZPtr;
12453 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
12454 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12455 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12457 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
12459 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
12460 * `err` or `result` depending on the state of `result_ok`.
12462 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
12464 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
12467 } LDKCResult_WarningMessageDecodeErrorZ;
12470 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
12472 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
12474 * A pointer to the contents in the success state.
12475 * Reading from this pointer when `result_ok` is not set is undefined.
12477 struct LDKUnsignedNodeAnnouncement *result;
12479 * A pointer to the contents in the error state.
12480 * Reading from this pointer when `result_ok` is set is undefined.
12482 struct LDKDecodeError *err;
12483 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
12486 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
12487 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12488 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12490 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
12492 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
12493 * `err` or `result` depending on the state of `result_ok`.
12495 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
12497 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
12500 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
12503 * The contents of CResult_NodeAnnouncementDecodeErrorZ
12505 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
12507 * A pointer to the contents in the success state.
12508 * Reading from this pointer when `result_ok` is not set is undefined.
12510 struct LDKNodeAnnouncement *result;
12512 * A pointer to the contents in the error state.
12513 * Reading from this pointer when `result_ok` is set is undefined.
12515 struct LDKDecodeError *err;
12516 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
12519 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
12520 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12521 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12523 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
12525 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
12526 * `err` or `result` depending on the state of `result_ok`.
12528 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
12530 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
12533 } LDKCResult_NodeAnnouncementDecodeErrorZ;
12536 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
12538 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
12540 * A pointer to the contents in the success state.
12541 * Reading from this pointer when `result_ok` is not set is undefined.
12543 struct LDKQueryShortChannelIds *result;
12545 * A pointer to the contents in the error state.
12546 * Reading from this pointer when `result_ok` is set is undefined.
12548 struct LDKDecodeError *err;
12549 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
12552 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
12553 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
12554 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12556 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
12558 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
12559 * `err` or `result` depending on the state of `result_ok`.
12561 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
12563 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
12566 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
12571 * A [`reply_short_channel_ids_end`] message is sent as a reply to a
12572 * message. The query recipient makes a best
12573 * effort to respond based on their local network view which may not be
12574 * a perfect view of the network.
12576 * [`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
12578 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
12580 * A pointer to the opaque Rust object.
12581 * Nearly everywhere, inner must be non-null, however in places where
12582 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12584 LDKnativeReplyShortChannelIdsEnd *inner;
12586 * Indicates that this is the only struct which contains the same pointer.
12587 * Rust functions which take ownership of an object provided via an argument require
12588 * this to be true and invalidate the object pointed to by inner.
12591 } LDKReplyShortChannelIdsEnd;
12594 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
12596 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
12598 * A pointer to the contents in the success state.
12599 * Reading from this pointer when `result_ok` is not set is undefined.
12601 struct LDKReplyShortChannelIdsEnd *result;
12603 * A pointer to the contents in the error state.
12604 * Reading from this pointer when `result_ok` is set is undefined.
12606 struct LDKDecodeError *err;
12607 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
12610 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
12611 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
12612 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12614 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
12616 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
12617 * `err` or `result` depending on the state of `result_ok`.
12619 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
12621 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
12624 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
12627 * The contents of CResult_QueryChannelRangeDecodeErrorZ
12629 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
12631 * A pointer to the contents in the success state.
12632 * Reading from this pointer when `result_ok` is not set is undefined.
12634 struct LDKQueryChannelRange *result;
12636 * A pointer to the contents in the error state.
12637 * Reading from this pointer when `result_ok` is set is undefined.
12639 struct LDKDecodeError *err;
12640 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
12643 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
12644 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
12645 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12647 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
12649 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
12650 * `err` or `result` depending on the state of `result_ok`.
12652 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
12654 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
12657 } LDKCResult_QueryChannelRangeDecodeErrorZ;
12660 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
12662 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
12664 * A pointer to the contents in the success state.
12665 * Reading from this pointer when `result_ok` is not set is undefined.
12667 struct LDKReplyChannelRange *result;
12669 * A pointer to the contents in the error state.
12670 * Reading from this pointer when `result_ok` is set is undefined.
12672 struct LDKDecodeError *err;
12673 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
12676 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
12677 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
12678 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12680 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
12682 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
12683 * `err` or `result` depending on the state of `result_ok`.
12685 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
12687 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
12690 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
12693 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
12695 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
12697 * A pointer to the contents in the success state.
12698 * Reading from this pointer when `result_ok` is not set is undefined.
12700 struct LDKGossipTimestampFilter *result;
12702 * A pointer to the contents in the error state.
12703 * Reading from this pointer when `result_ok` is set is undefined.
12705 struct LDKDecodeError *err;
12706 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
12709 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
12710 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
12711 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12713 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
12715 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
12716 * `err` or `result` depending on the state of `result_ok`.
12718 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
12720 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
12723 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
12726 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
12727 * This corresponds to std::vector in C++
12729 typedef struct LDKCVec_PhantomRouteHintsZ {
12731 * The elements in the array.
12732 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12734 struct LDKPhantomRouteHints *data;
12736 * The number of elements pointed to by `data`.
12739 } LDKCVec_PhantomRouteHintsZ;
12742 * When signing using a fallible method either an user-supplied `SignError` or a `CreationError`
12745 typedef enum LDKSignOrCreationError_Tag {
12747 * An error occurred during signing
12749 LDKSignOrCreationError_SignError,
12751 * An error occurred while building the transaction
12753 LDKSignOrCreationError_CreationError,
12755 * Must be last for serialization purposes
12757 LDKSignOrCreationError_Sentinel,
12758 } LDKSignOrCreationError_Tag;
12760 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
12761 LDKSignOrCreationError_Tag tag;
12764 enum LDKCreationError creation_error;
12767 } LDKSignOrCreationError;
12770 * The contents of CResult_InvoiceSignOrCreationErrorZ
12772 typedef union LDKCResult_InvoiceSignOrCreationErrorZPtr {
12774 * A pointer to the contents in the success state.
12775 * Reading from this pointer when `result_ok` is not set is undefined.
12777 struct LDKInvoice *result;
12779 * A pointer to the contents in the error state.
12780 * Reading from this pointer when `result_ok` is set is undefined.
12782 struct LDKSignOrCreationError *err;
12783 } LDKCResult_InvoiceSignOrCreationErrorZPtr;
12786 * A CResult_InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
12787 * containing a crate::lightning_invoice::Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
12788 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12790 typedef struct LDKCResult_InvoiceSignOrCreationErrorZ {
12792 * The contents of this CResult_InvoiceSignOrCreationErrorZ, accessible via either
12793 * `err` or `result` depending on the state of `result_ok`.
12795 union LDKCResult_InvoiceSignOrCreationErrorZPtr contents;
12797 * Whether this CResult_InvoiceSignOrCreationErrorZ represents a success state.
12800 } LDKCResult_InvoiceSignOrCreationErrorZ;
12805 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
12807 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
12808 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
12809 * [`Confirm::transactions_confirmed`].
12811 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
12812 * may have been spent there. See [`Filter::register_output`] for details.
12814 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
12815 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
12817 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
12819 * A pointer to the opaque Rust object.
12820 * Nearly everywhere, inner must be non-null, however in places where
12821 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12823 LDKnativeWatchedOutput *inner;
12825 * Indicates that this is the only struct which contains the same pointer.
12826 * Rust functions which take ownership of an object provided via an argument require
12827 * this to be true and invalidate the object pointed to by inner.
12830 } LDKWatchedOutput;
12833 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
12836 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
12837 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
12838 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
12839 * receiving full blocks from a chain source, any further filtering is unnecessary.
12841 * After an output has been registered, subsequent block retrievals from the chain source must not
12842 * exclude any transactions matching the new criteria nor any in-block descendants of such
12845 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
12846 * should not block on I/O. Implementations should instead queue the newly monitored data to be
12847 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
12848 * invocation that has called the `Filter` must return [`InProgress`].
12850 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
12851 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
12852 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
12854 typedef struct LDKFilter {
12856 * An opaque pointer which is passed to your function implementations as an argument.
12857 * This has no meaning in the LDK, and can be NULL or any other value.
12861 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
12862 * a spending condition.
12864 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
12866 * Registers interest in spends of a transaction output.
12868 * Note that this method might be called during processing of a new block. You therefore need
12869 * to ensure that also dependent output spents within an already connected block are correctly
12870 * handled, e.g., by re-scanning the block in question whenever new outputs have been
12871 * registered mid-processing.
12873 void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
12875 * Frees any resources associated with this object given its this_arg pointer.
12876 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
12878 void (*free)(void *this_arg);
12882 * An enum which can either contain a crate::lightning::chain::Filter or not
12884 typedef enum LDKCOption_FilterZ_Tag {
12886 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
12888 LDKCOption_FilterZ_Some,
12890 * When we're in this state, this COption_FilterZ contains nothing
12892 LDKCOption_FilterZ_None,
12894 * Must be last for serialization purposes
12896 LDKCOption_FilterZ_Sentinel,
12897 } LDKCOption_FilterZ_Tag;
12899 typedef struct LDKCOption_FilterZ {
12900 LDKCOption_FilterZ_Tag tag;
12903 struct LDKFilter some;
12906 } LDKCOption_FilterZ;
12911 * A read-only reference to a current ChannelMonitor.
12913 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
12916 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
12918 * A pointer to the opaque Rust object.
12919 * Nearly everywhere, inner must be non-null, however in places where
12920 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12922 LDKnativeLockedChannelMonitor *inner;
12924 * Indicates that this is the only struct which contains the same pointer.
12925 * Rust functions which take ownership of an object provided via an argument require
12926 * this to be true and invalidate the object pointed to by inner.
12929 } LDKLockedChannelMonitor;
12932 * The contents of CResult_LockedChannelMonitorNoneZ
12934 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
12936 * A pointer to the contents in the success state.
12937 * Reading from this pointer when `result_ok` is not set is undefined.
12939 struct LDKLockedChannelMonitor *result;
12941 * Note that this value is always NULL, as there are no contents in the Err variant
12944 } LDKCResult_LockedChannelMonitorNoneZPtr;
12947 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
12948 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
12949 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12951 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
12953 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
12954 * `err` or `result` depending on the state of `result_ok`.
12956 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
12958 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
12961 } LDKCResult_LockedChannelMonitorNoneZ;
12964 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
12965 * This corresponds to std::vector in C++
12967 typedef struct LDKCVec_OutPointZ {
12969 * The elements in the array.
12970 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12972 struct LDKOutPoint *data;
12974 * The number of elements pointed to by `data`.
12977 } LDKCVec_OutPointZ;
12982 * An opaque identifier describing a specific [`Persist`] method call.
12984 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
12986 * A pointer to the opaque Rust object.
12987 * Nearly everywhere, inner must be non-null, however in places where
12988 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12990 LDKnativeMonitorUpdateId *inner;
12992 * Indicates that this is the only struct which contains the same pointer.
12993 * Rust functions which take ownership of an object provided via an argument require
12994 * this to be true and invalidate the object pointed to by inner.
12997 } LDKMonitorUpdateId;
13000 * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
13001 * This corresponds to std::vector in C++
13003 typedef struct LDKCVec_MonitorUpdateIdZ {
13005 * The elements in the array.
13006 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13008 struct LDKMonitorUpdateId *data;
13010 * The number of elements pointed to by `data`.
13013 } LDKCVec_MonitorUpdateIdZ;
13016 * A tuple of 2 elements. See the individual fields for the types contained.
13018 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
13020 * The element at position 0
13022 struct LDKOutPoint a;
13024 * The element at position 1
13026 struct LDKCVec_MonitorUpdateIdZ b;
13027 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
13030 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
13031 * This corresponds to std::vector in C++
13033 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
13035 * The elements in the array.
13036 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
13038 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
13040 * The number of elements pointed to by `data`.
13043 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
13046 * A trait indicating an object may generate message send events
13048 typedef struct LDKMessageSendEventsProvider {
13050 * An opaque pointer which is passed to your function implementations as an argument.
13051 * This has no meaning in the LDK, and can be NULL or any other value.
13055 * Gets the list of pending events which were generated by previous actions, clearing the list
13058 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
13060 * Frees any resources associated with this object given its this_arg pointer.
13061 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13063 void (*free)(void *this_arg);
13064 } LDKMessageSendEventsProvider;
13067 * A trait indicating an object may generate onion messages to send
13069 typedef struct LDKOnionMessageProvider {
13071 * An opaque pointer which is passed to your function implementations as an argument.
13072 * This has no meaning in the LDK, and can be NULL or any other value.
13076 * Gets the next pending onion message for the peer with the given node id.
13078 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
13080 struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
13082 * Frees any resources associated with this object given its this_arg pointer.
13083 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13085 void (*free)(void *this_arg);
13086 } LDKOnionMessageProvider;
13089 * A trait implemented for objects handling events from [`EventsProvider`].
13091 * An async variation also exists for implementations of [`EventsProvider`] that support async
13092 * event handling. The async event handler should satisfy the generic bounds: `F:
13093 * core::future::Future, H: Fn(Event) -> F`.
13095 typedef struct LDKEventHandler {
13097 * An opaque pointer which is passed to your function implementations as an argument.
13098 * This has no meaning in the LDK, and can be NULL or any other value.
13102 * Handles the given [`Event`].
13104 * See [`EventsProvider`] for details that must be considered when implementing this method.
13106 void (*handle_event)(const void *this_arg, struct LDKEvent event);
13108 * Frees any resources associated with this object given its this_arg pointer.
13109 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13111 void (*free)(void *this_arg);
13115 * A trait indicating an object may generate events.
13117 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
13119 * Implementations of this trait may also feature an async version of event handling, as shown with
13120 * [`ChannelManager::process_pending_events_async`] and
13121 * [`ChainMonitor::process_pending_events_async`].
13125 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
13126 * event since the last invocation.
13128 * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
13129 * and replay any unhandled events on startup. An [`Event`] is considered handled when
13130 * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
13131 * relevant changes to disk *before* returning.
13133 * Further, because an application may crash between an [`Event`] being handled and the
13134 * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
13135 * effect, [`Event`]s may be replayed.
13137 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
13138 * consult the provider's documentation on the implication of processing events and how a handler
13139 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
13140 * [`ChainMonitor::process_pending_events`]).
13142 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
13145 * [`process_pending_events`]: Self::process_pending_events
13146 * [`handle_event`]: EventHandler::handle_event
13147 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
13148 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
13149 * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
13150 * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
13152 typedef struct LDKEventsProvider {
13154 * An opaque pointer which is passed to your function implementations as an argument.
13155 * This has no meaning in the LDK, and can be NULL or any other value.
13159 * Processes any events generated since the last call using the given event handler.
13161 * See the trait-level documentation for requirements.
13163 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
13165 * Frees any resources associated with this object given its this_arg pointer.
13166 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13168 void (*free)(void *this_arg);
13169 } LDKEventsProvider;
13174 * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
13175 * variable-length integers except that it is serialized in big-endian instead of little-endian.
13177 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
13178 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
13179 * you're looking for an example of a variable-length integer to use for your own project, move
13180 * along, this is a rather poor design.
13182 typedef struct MUST_USE_STRUCT LDKBigSize {
13184 * A pointer to the opaque Rust object.
13185 * Nearly everywhere, inner must be non-null, however in places where
13186 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13188 LDKnativeBigSize *inner;
13190 * Indicates that this is the only struct which contains the same pointer.
13191 * Rust functions which take ownership of an object provided via an argument require
13192 * this to be true and invalidate the object pointed to by inner.
13198 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
13200 typedef struct LDKPersister {
13202 * An opaque pointer which is passed to your function implementations as an argument.
13203 * This has no meaning in the LDK, and can be NULL or any other value.
13207 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
13209 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
13211 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
13213 struct LDKCResult_NoneErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
13215 * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
13217 struct LDKCResult_NoneErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
13219 * Frees any resources associated with this object given its this_arg pointer.
13220 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13222 void (*free)(void *this_arg);
13228 * A string that displays only printable characters, replacing control characters with
13229 * [`core::char::REPLACEMENT_CHARACTER`].
13231 typedef struct MUST_USE_STRUCT LDKPrintableString {
13233 * A pointer to the opaque Rust object.
13234 * Nearly everywhere, inner must be non-null, however in places where
13235 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13237 LDKnativePrintableString *inner;
13239 * Indicates that this is the only struct which contains the same pointer.
13240 * Rust functions which take ownership of an object provided via an argument require
13241 * this to be true and invalidate the object pointed to by inner.
13244 } LDKPrintableString;
13247 * A callback which is called when a [`Future`] completes.
13249 * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
13250 * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
13253 * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
13254 * futures when they receive a wake, rather than immediately executing them.
13256 typedef struct LDKFutureCallback {
13258 * An opaque pointer which is passed to your function implementations as an argument.
13259 * This has no meaning in the LDK, and can be NULL or any other value.
13263 * The method which is called.
13265 void (*call)(const void *this_arg);
13267 * Frees any resources associated with this object given its this_arg pointer.
13268 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13270 void (*free)(void *this_arg);
13271 } LDKFutureCallback;
13276 * A simple future which can complete once, and calls some callback(s) when it does so.
13278 typedef struct MUST_USE_STRUCT LDKFuture {
13280 * A pointer to the opaque Rust object.
13281 * Nearly everywhere, inner must be non-null, however in places where
13282 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13284 LDKnativeFuture *inner;
13286 * Indicates that this is the only struct which contains the same pointer.
13287 * Rust functions which take ownership of an object provided via an argument require
13288 * this to be true and invalidate the object pointed to by inner.
13296 * Configuration we set when applicable.
13298 * Default::default() provides sane defaults.
13300 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
13302 * A pointer to the opaque Rust object.
13303 * Nearly everywhere, inner must be non-null, however in places where
13304 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13306 LDKnativeChannelHandshakeConfig *inner;
13308 * Indicates that this is the only struct which contains the same pointer.
13309 * Rust functions which take ownership of an object provided via an argument require
13310 * this to be true and invalidate the object pointed to by inner.
13313 } LDKChannelHandshakeConfig;
13318 * Optional channel limits which are applied during channel creation.
13320 * These limits are only applied to our counterparty's limits, not our own.
13322 * Use 0/`<type>::max_value()` as appropriate to skip checking.
13324 * Provides sane defaults for most configurations.
13326 * Most additional limits are disabled except those with which specify a default in individual
13327 * field documentation. Note that this may result in barely-usable channels, but since they
13328 * are applied mostly only to incoming channels that's not much of a problem.
13330 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
13332 * A pointer to the opaque Rust object.
13333 * Nearly everywhere, inner must be non-null, however in places where
13334 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13336 LDKnativeChannelHandshakeLimits *inner;
13338 * Indicates that this is the only struct which contains the same pointer.
13339 * Rust functions which take ownership of an object provided via an argument require
13340 * this to be true and invalidate the object pointed to by inner.
13343 } LDKChannelHandshakeLimits;
13348 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
13350 * Default::default() provides sane defaults for most configurations
13351 * (but currently with 0 relay fees!)
13353 typedef struct MUST_USE_STRUCT LDKUserConfig {
13355 * A pointer to the opaque Rust object.
13356 * Nearly everywhere, inner must be non-null, however in places where
13357 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13359 LDKnativeUserConfig *inner;
13361 * Indicates that this is the only struct which contains the same pointer.
13362 * Rust functions which take ownership of an object provided via an argument require
13363 * this to be true and invalidate the object pointed to by inner.
13371 * The best known block as identified by its hash and height.
13373 typedef struct MUST_USE_STRUCT LDKBestBlock {
13375 * A pointer to the opaque Rust object.
13376 * Nearly everywhere, inner must be non-null, however in places where
13377 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13379 LDKnativeBestBlock *inner;
13381 * Indicates that this is the only struct which contains the same pointer.
13382 * Rust functions which take ownership of an object provided via an argument require
13383 * this to be true and invalidate the object pointed to by inner.
13389 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
13392 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
13393 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
13394 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
13397 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
13398 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
13399 * other similar filtering.
13401 typedef struct LDKListen {
13403 * An opaque pointer which is passed to your function implementations as an argument.
13404 * This has no meaning in the LDK, and can be NULL or any other value.
13408 * Notifies the listener that a block was added at the given height, with the transaction data
13409 * possibly filtered.
13411 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
13413 * Notifies the listener that a block was added at the given height.
13415 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
13417 * Notifies the listener that a block was removed at the given height.
13419 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
13421 * Frees any resources associated with this object given its this_arg pointer.
13422 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13424 void (*free)(void *this_arg);
13428 * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
13429 * chain or unconfirmed during a chain reorganization.
13431 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
13432 * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
13433 * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
13434 * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
13435 * with reference to the confirmation status of the monitored objects.
13438 * The intended use is as follows:
13439 * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
13440 * outputs are, respectively, confirmed or spent on chain.
13441 * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
13442 * [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
13443 * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
13447 * Clients must call these methods in chain order. Specifically:
13448 * - Transactions which are confirmed in a particular block must be given before transactions
13449 * confirmed in a later block.
13450 * - Dependent transactions within the same block must be given in topological order, possibly in
13452 * - All unconfirmed transactions must be given after the original confirmations and before *any*
13453 * reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
13454 * never be interleaved, but always conduced *en bloc*.
13455 * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
13456 * in regard to the new block.
13458 * See individual method documentation for further details.
13460 * [`transactions_confirmed`]: Self::transactions_confirmed
13461 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
13462 * [`best_block_updated`]: Self::best_block_updated
13463 * [`get_relevant_txids`]: Self::get_relevant_txids
13465 typedef struct LDKConfirm {
13467 * An opaque pointer which is passed to your function implementations as an argument.
13468 * This has no meaning in the LDK, and can be NULL or any other value.
13472 * Notifies LDK of transactions confirmed in a block with a given header and height.
13474 * Must be called for any transactions registered by [`Filter::register_tx`] or any
13475 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
13476 * appearing in the same block do not need to be included in the same call; instead, multiple
13477 * calls with additional transactions may be made so long as they are made in [chain order].
13479 * May be called before or after [`best_block_updated`] for the corresponding block. However,
13480 * in the event of a chain reorganization, it must not be called with a `header` that is no
13481 * longer in the chain as of the last call to [`best_block_updated`].
13483 * [chain order]: Confirm#order
13484 * [`best_block_updated`]: Self::best_block_updated
13486 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
13488 * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
13490 * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
13491 * reorganized out of the best chain or if it is no longer confirmed in the block with the
13492 * given block hash. Once called, the given transaction will not be returned
13493 * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
13495 * [`get_relevant_txids`]: Self::get_relevant_txids
13496 * [`transactions_confirmed`]: Self::transactions_confirmed
13498 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
13500 * Notifies LDK of an update to the best header connected at the given height.
13502 * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
13505 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
13507 * Returns transactions that must be monitored for reorganization out of the chain along
13508 * with the hash of the block as part of which it had been previously confirmed.
13510 * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
13511 * 0.0.112 and prior, in which case you need to manually track previous confirmations.
13513 * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
13514 * confirmations to be safe from a chain reorganization. Will not include any transactions
13515 * passed to [`transaction_unconfirmed`], unless later reconfirmed.
13517 * Must be called to determine the subset of transactions that must be monitored for
13518 * reorganization. Will be idempotent between calls but may change as a result of calls to the
13519 * other interface methods. Thus, this is useful to determine which transactions must be
13520 * given to [`transaction_unconfirmed`].
13522 * If any of the returned transactions are confirmed in a block other than the one with the
13523 * given hash, they need to be unconfirmed and reconfirmed via [`transaction_unconfirmed`] and
13524 * [`transactions_confirmed`], respectively.
13526 * [`transactions_confirmed`]: Self::transactions_confirmed
13527 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
13529 struct LDKCVec_C2Tuple_TxidBlockHashZZ (*get_relevant_txids)(const void *this_arg);
13531 * Frees any resources associated with this object given its this_arg pointer.
13532 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13534 void (*free)(void *this_arg);
13538 * `Persist` defines behavior for persisting channel monitors: this could mean
13539 * writing once to disk, and/or uploading to one or more backup services.
13541 * Each method can return three possible values:
13542 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
13543 * implementation should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal
13544 * channel operation should continue.
13545 * * If persistence happens asynchronously, implementations should first ensure the
13546 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
13547 * [`ChannelMonitorUpdateStatus::InProgress`] while the update continues in the background.
13548 * Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be called with
13549 * the corresponding [`MonitorUpdateId`].
13551 * Note that unlike the direct [`chain::Watch`] interface,
13552 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
13554 * * If persistence fails for some reason, implementations should return
13555 * [`ChannelMonitorUpdateStatus::PermanentFailure`], in which case the channel will likely be
13556 * closed without broadcasting the latest state. See
13557 * [`ChannelMonitorUpdateStatus::PermanentFailure`] for more details.
13559 typedef struct LDKPersist {
13561 * An opaque pointer which is passed to your function implementations as an argument.
13562 * This has no meaning in the LDK, and can be NULL or any other value.
13566 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
13567 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
13569 * The data can be stored any way you want, but the identifier provided by LDK is the
13570 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
13571 * and the stored channel data). Note that you **must** persist every new monitor to disk.
13573 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
13574 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
13576 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
13577 * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
13579 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
13580 * [`Writeable::write`]: crate::util::ser::Writeable::write
13582 enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
13584 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
13587 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
13588 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
13591 * During blockchain synchronization operations, this may be called with no
13592 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
13593 * Note that after the full [`ChannelMonitor`] is persisted any previous
13594 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
13595 * applied to the persisted [`ChannelMonitor`] as they were already applied.
13597 * If an implementer chooses to persist the updates only, they need to make
13598 * sure that all the updates are applied to the `ChannelMonitors` *before*
13599 * the set of channel monitors is given to the `ChannelManager`
13600 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
13601 * applying a monitor update to a monitor. If full `ChannelMonitors` are
13602 * persisted, then there is no need to persist individual updates.
13604 * Note that there could be a performance tradeoff between persisting complete
13605 * channel monitors on every update vs. persisting only updates and applying
13606 * them in batches. The size of each monitor grows `O(number of state updates)`
13607 * whereas updates are small and `O(1)`.
13609 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
13610 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
13612 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
13613 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
13614 * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
13616 * [`Writeable::write`]: crate::util::ser::Writeable::write
13618 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
13620 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);
13622 * Frees any resources associated with this object given its this_arg pointer.
13623 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13625 void (*free)(void *this_arg);
13631 * An implementation of [`chain::Watch`] for monitoring channels.
13633 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
13634 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
13635 * or used independently to monitor channels remotely. See the [module-level documentation] for
13638 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
13639 * [module-level documentation]: crate::chain::chainmonitor
13641 typedef struct MUST_USE_STRUCT LDKChainMonitor {
13643 * A pointer to the opaque Rust object.
13644 * Nearly everywhere, inner must be non-null, however in places where
13645 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13647 LDKnativeChainMonitor *inner;
13649 * Indicates that this is the only struct which contains the same pointer.
13650 * Rust functions which take ownership of an object provided via an argument require
13651 * this to be true and invalidate the object pointed to by inner.
13657 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
13659 typedef struct LDKSecretKey {
13661 * The bytes of the secret key
13669 * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
13670 * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
13672 * Your `node_id` is seed/0'.
13673 * Unilateral closes may use seed/1'.
13674 * Cooperative closes may use seed/2'.
13675 * The two close keys may be needed to claim on-chain funds!
13677 * This struct cannot be used for nodes that wish to support receiving phantom payments;
13678 * [`PhantomKeysManager`] must be used instead.
13680 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
13681 * previously issued invoices and attempts to pay previous invoices will fail.
13683 typedef struct MUST_USE_STRUCT LDKKeysManager {
13685 * A pointer to the opaque Rust object.
13686 * Nearly everywhere, inner must be non-null, however in places where
13687 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13689 LDKnativeKeysManager *inner;
13691 * Indicates that this is the only struct which contains the same pointer.
13692 * Rust functions which take ownership of an object provided via an argument require
13693 * this to be true and invalidate the object pointed to by inner.
13701 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
13704 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
13705 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
13706 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
13707 * itself without ever needing to forward to this fake node.
13709 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
13710 * provide some fault tolerance, because payers will automatically retry paying other provided
13711 * nodes in the case that one node goes down.
13713 * Note that multi-path payments are not supported in phantom invoices for security reasons.
13714 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
13715 * invoices and attempts to pay previous invoices will fail.
13717 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
13719 * A pointer to the opaque Rust object.
13720 * Nearly everywhere, inner must be non-null, however in places where
13721 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13723 LDKnativePhantomKeysManager *inner;
13725 * Indicates that this is the only struct which contains the same pointer.
13726 * Rust functions which take ownership of an object provided via an argument require
13727 * this to be true and invalidate the object pointed to by inner.
13730 } LDKPhantomKeysManager;
13735 * Chain-related parameters used to construct a new `ChannelManager`.
13737 * Typically, the block-specific parameters are derived from the best block hash for the network,
13738 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
13739 * are not needed when deserializing a previously constructed `ChannelManager`.
13741 typedef struct MUST_USE_STRUCT LDKChainParameters {
13743 * A pointer to the opaque Rust object.
13744 * Nearly everywhere, inner must be non-null, however in places where
13745 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13747 LDKnativeChainParameters *inner;
13749 * Indicates that this is the only struct which contains the same pointer.
13750 * Rust functions which take ownership of an object provided via an argument require
13751 * this to be true and invalidate the object pointed to by inner.
13754 } LDKChainParameters;
13757 * Strategies available to retry payment path failures.
13759 typedef enum LDKRetry_Tag {
13761 * Max number of attempts to retry payment.
13763 * Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
13764 * retry, and may retry multiple failed HTLCs at once if they failed around the same time and
13765 * were retried along a route from a single call to [`Router::find_route`].
13769 * Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
13770 * see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
13772 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
13776 * Must be last for serialization purposes
13781 typedef struct MUST_USE_STRUCT LDKRetry {
13785 uintptr_t attempts;
13794 * A trait to describe an object which can receive channel messages.
13796 * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
13797 * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
13799 typedef struct LDKChannelMessageHandler {
13801 * An opaque pointer which is passed to your function implementations as an argument.
13802 * This has no meaning in the LDK, and can be NULL or any other value.
13806 * Handle an incoming `open_channel` message from the given peer.
13808 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
13810 * Handle an incoming `accept_channel` message from the given peer.
13812 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
13814 * Handle an incoming `funding_created` message from the given peer.
13816 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
13818 * Handle an incoming `funding_signed` message from the given peer.
13820 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
13822 * Handle an incoming `channel_ready` message from the given peer.
13824 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
13826 * Handle an incoming `shutdown` message from the given peer.
13828 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
13830 * Handle an incoming `closing_signed` message from the given peer.
13832 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
13834 * Handle an incoming `update_add_htlc` message from the given peer.
13836 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
13838 * Handle an incoming `update_fulfill_htlc` message from the given peer.
13840 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
13842 * Handle an incoming `update_fail_htlc` message from the given peer.
13844 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
13846 * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
13848 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
13850 * Handle an incoming `commitment_signed` message from the given peer.
13852 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
13854 * Handle an incoming `revoke_and_ack` message from the given peer.
13856 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
13858 * Handle an incoming `update_fee` message from the given peer.
13860 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
13862 * Handle an incoming `announcement_signatures` message from the given peer.
13864 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
13866 * Indicates a connection to the peer failed/an existing connection was lost.
13868 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
13870 * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
13872 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
13873 * with us. Implementors should be somewhat conservative about doing so, however, as other
13874 * message handlers may still wish to communicate with this peer.
13876 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
13878 * Handle an incoming `channel_reestablish` message from the given peer.
13880 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
13882 * Handle an incoming `channel_update` message from the given peer.
13884 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
13886 * Handle an incoming `error` message from the given peer.
13888 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
13890 * Gets the node feature flags which this handler itself supports. All available handlers are
13891 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
13892 * which are broadcasted in our [`NodeAnnouncement`] message.
13894 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
13896 * Gets the init feature flags which should be sent to the given peer. All available handlers
13897 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
13898 * which are sent in our [`Init`] message.
13900 * Note that this method is called before [`Self::peer_connected`].
13902 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
13904 * Implementation of MessageSendEventsProvider for this object.
13906 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
13908 * Frees any resources associated with this object given its this_arg pointer.
13909 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
13911 void (*free)(void *this_arg);
13912 } LDKChannelMessageHandler;
13917 * Arguments for the creation of a ChannelManager that are not deserialized.
13919 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
13921 * 1) Deserialize all stored [`ChannelMonitor`]s.
13922 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
13923 * `<(BlockHash, ChannelManager)>::read(reader, args)`
13924 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
13925 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
13926 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
13927 * same way you would handle a [`chain::Filter`] call using
13928 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
13929 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
13930 * 5) Disconnect/connect blocks on the [`ChannelManager`].
13931 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
13932 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
13933 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
13935 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
13936 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
13938 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
13939 * call any other methods on the newly-deserialized [`ChannelManager`].
13941 * Note that because some channels may be closed during deserialization, it is critical that you
13942 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
13943 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
13944 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
13945 * not force-close the same channels but consider them live), you may end up revoking a state for
13946 * which you've already broadcasted the transaction.
13948 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
13950 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
13952 * A pointer to the opaque Rust object.
13953 * Nearly everywhere, inner must be non-null, however in places where
13954 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13956 LDKnativeChannelManagerReadArgs *inner;
13958 * Indicates that this is the only struct which contains the same pointer.
13959 * Rust functions which take ownership of an object provided via an argument require
13960 * this to be true and invalidate the object pointed to by inner.
13963 } LDKChannelManagerReadArgs;
13968 * A set of keys that were HKDF-expanded from an initial call to
13969 * [`NodeSigner::get_inbound_payment_key_material`].
13971 * [`NodeSigner::get_inbound_payment_key_material`]: crate::chain::keysinterface::NodeSigner::get_inbound_payment_key_material
13973 typedef struct MUST_USE_STRUCT LDKExpandedKey {
13975 * A pointer to the opaque Rust object.
13976 * Nearly everywhere, inner must be non-null, however in places where
13977 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13979 LDKnativeExpandedKey *inner;
13981 * Indicates that this is the only struct which contains the same pointer.
13982 * Rust functions which take ownership of an object provided via an argument require
13983 * this to be true and invalidate the object pointed to by inner.
13991 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
13993 * This is used to convince the recipient that the channel is at a certain commitment
13994 * number even if they lost that data due to a local failure. Of course, the peer may lie
13995 * and even later commitments may have been revoked.
13997 typedef struct MUST_USE_STRUCT LDKDataLossProtect {
13999 * A pointer to the opaque Rust object.
14000 * Nearly everywhere, inner must be non-null, however in places where
14001 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14003 LDKnativeDataLossProtect *inner;
14005 * Indicates that this is the only struct which contains the same pointer.
14006 * Rust functions which take ownership of an object provided via an argument require
14007 * this to be true and invalidate the object pointed to by inner.
14010 } LDKDataLossProtect;
14013 * A 3-byte byte array.
14015 typedef struct LDKThreeBytes {
14023 * A trait to describe an object which can receive routing messages.
14025 * # Implementor DoS Warnings
14027 * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
14028 * handling inbound queries. Implementors using an on-disk network graph should be aware of
14029 * repeated disk I/O for queries accessing different parts of the network graph.
14031 typedef struct LDKRoutingMessageHandler {
14033 * An opaque pointer which is passed to your function implementations as an argument.
14034 * This has no meaning in the LDK, and can be NULL or any other value.
14038 * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
14039 * `false` or returning an `Err` otherwise.
14041 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
14043 * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
14044 * or returning an `Err` otherwise.
14046 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
14048 * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
14049 * `false` or returning an `Err` otherwise.
14051 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
14053 * Gets channel announcements and updates required to dump our routing table to a remote node,
14054 * starting at the `short_channel_id` indicated by `starting_point` and including announcements
14055 * for a single channel.
14057 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
14059 * Gets a node announcement required to dump our routing table to a remote node, starting at
14060 * the node *after* the provided pubkey and including up to one announcement immediately
14061 * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
14062 * If `None` is provided for `starting_point`, we start at the first node.
14064 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
14065 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
14067 struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
14069 * Called when a connection is established with a peer. This can be used to
14070 * perform routing table synchronization using a strategy defined by the
14073 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
14074 * with us. Implementors should be somewhat conservative about doing so, however, as other
14075 * message handlers may still wish to communicate with this peer.
14077 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
14079 * Handles the reply of a query we initiated to learn about channels
14080 * for a given range of blocks. We can expect to receive one or more
14081 * replies to a single query.
14083 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
14085 * Handles the reply of a query we initiated asking for routing gossip
14086 * messages for a list of channels. We should receive this message when
14087 * a node has completed its best effort to send us the pertaining routing
14090 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
14092 * Handles when a peer asks us to send a list of `short_channel_id`s
14093 * for the requested range of blocks.
14095 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
14097 * Handles when a peer asks us to send routing gossip messages for a
14098 * list of `short_channel_id`s.
14100 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
14102 * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
14103 * pending some async action. While there is no guarantee of the rate of future messages, the
14104 * caller should seek to reduce the rate of new gossip messages handled, especially
14105 * [`ChannelAnnouncement`]s.
14107 bool (*processing_queue_high)(const void *this_arg);
14109 * Gets the node feature flags which this handler itself supports. All available handlers are
14110 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
14111 * which are broadcasted in our [`NodeAnnouncement`] message.
14113 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
14115 * Gets the init feature flags which should be sent to the given peer. All available handlers
14116 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
14117 * which are sent in our [`Init`] message.
14119 * Note that this method is called before [`Self::peer_connected`].
14121 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
14123 * Implementation of MessageSendEventsProvider for this object.
14125 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
14127 * Frees any resources associated with this object given its this_arg pointer.
14128 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14130 void (*free)(void *this_arg);
14131 } LDKRoutingMessageHandler;
14134 * A trait to describe an object that can receive onion messages.
14136 typedef struct LDKOnionMessageHandler {
14138 * An opaque pointer which is passed to your function implementations as an argument.
14139 * This has no meaning in the LDK, and can be NULL or any other value.
14143 * Handle an incoming `onion_message` message from the given peer.
14145 void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
14147 * Called when a connection is established with a peer. Can be used to track which peers
14148 * advertise onion message support and are online.
14150 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
14151 * with us. Implementors should be somewhat conservative about doing so, however, as other
14152 * message handlers may still wish to communicate with this peer.
14154 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
14156 * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
14157 * drop and refuse to forward onion messages to this peer.
14159 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
14161 * Gets the node feature flags which this handler itself supports. All available handlers are
14162 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
14163 * which are broadcasted in our [`NodeAnnouncement`] message.
14165 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
14167 * Gets the init feature flags which should be sent to the given peer. All available handlers
14168 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
14169 * which are sent in our [`Init`] message.
14171 * Note that this method is called before [`Self::peer_connected`].
14173 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
14175 * Implementation of OnionMessageProvider for this object.
14177 struct LDKOnionMessageProvider OnionMessageProvider;
14179 * Frees any resources associated with this object given its this_arg pointer.
14180 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14182 void (*free)(void *this_arg);
14183 } LDKOnionMessageHandler;
14186 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
14189 typedef struct LDKCustomMessageReader {
14191 * An opaque pointer which is passed to your function implementations as an argument.
14192 * This has no meaning in the LDK, and can be NULL or any other value.
14196 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
14197 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
14198 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
14199 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
14201 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
14203 * Frees any resources associated with this object given its this_arg pointer.
14204 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14206 void (*free)(void *this_arg);
14207 } LDKCustomMessageReader;
14210 * A handler provided to [`PeerManager`] for reading and handling custom messages.
14212 * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
14213 * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
14214 * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
14216 * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
14217 * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
14219 typedef struct LDKCustomMessageHandler {
14221 * An opaque pointer which is passed to your function implementations as an argument.
14222 * This has no meaning in the LDK, and can be NULL or any other value.
14226 * Handles the given message sent from `sender_node_id`, possibly producing messages for
14227 * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
14230 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
14232 * Returns the list of pending messages that were generated by the handler, clearing the list
14233 * in the process. Each message is paired with the node id of the intended recipient. If no
14234 * connection to the node exists, then the message is simply not sent.
14236 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
14238 * Implementation of CustomMessageReader for this object.
14240 struct LDKCustomMessageReader CustomMessageReader;
14242 * Frees any resources associated with this object given its this_arg pointer.
14243 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14245 void (*free)(void *this_arg);
14246 } LDKCustomMessageHandler;
14251 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
14252 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
14254 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
14256 * A pointer to the opaque Rust object.
14257 * Nearly everywhere, inner must be non-null, however in places where
14258 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14260 LDKnativeIgnoringMessageHandler *inner;
14262 * Indicates that this is the only struct which contains the same pointer.
14263 * Rust functions which take ownership of an object provided via an argument require
14264 * this to be true and invalidate the object pointed to by inner.
14267 } LDKIgnoringMessageHandler;
14270 * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
14271 * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
14272 * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
14273 * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
14276 * See [`OnionMessenger`] for example usage.
14278 * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
14279 * [`CustomMessage`]: Self::CustomMessage
14281 typedef struct LDKCustomOnionMessageHandler {
14283 * An opaque pointer which is passed to your function implementations as an argument.
14284 * This has no meaning in the LDK, and can be NULL or any other value.
14288 * Called with the custom message that was received.
14290 void (*handle_custom_message)(const void *this_arg, struct LDKCustomOnionMessageContents msg);
14292 * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
14293 * message type is unknown.
14295 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
14297 * Frees any resources associated with this object given its this_arg pointer.
14298 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14300 void (*free)(void *this_arg);
14301 } LDKCustomOnionMessageHandler;
14306 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
14307 * You can provide one of these as the route_handler in a MessageHandler.
14309 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
14311 * A pointer to the opaque Rust object.
14312 * Nearly everywhere, inner must be non-null, however in places where
14313 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14315 LDKnativeErroringMessageHandler *inner;
14317 * Indicates that this is the only struct which contains the same pointer.
14318 * Rust functions which take ownership of an object provided via an argument require
14319 * this to be true and invalidate the object pointed to by inner.
14322 } LDKErroringMessageHandler;
14327 * Provides references to trait impls which handle different types of messages.
14329 typedef struct MUST_USE_STRUCT LDKMessageHandler {
14331 * A pointer to the opaque Rust object.
14332 * Nearly everywhere, inner must be non-null, however in places where
14333 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14335 LDKnativeMessageHandler *inner;
14337 * Indicates that this is the only struct which contains the same pointer.
14338 * Rust functions which take ownership of an object provided via an argument require
14339 * this to be true and invalidate the object pointed to by inner.
14342 } LDKMessageHandler;
14345 * Provides an object which can be used to send data to and which uniquely identifies a connection
14346 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
14347 * implement Hash to meet the PeerManager API.
14349 * For efficiency, Clone should be relatively cheap for this type.
14351 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
14352 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
14353 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
14354 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
14355 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
14356 * to simply use another value which is guaranteed to be globally unique instead.
14358 typedef struct LDKSocketDescriptor {
14360 * An opaque pointer which is passed to your function implementations as an argument.
14361 * This has no meaning in the LDK, and can be NULL or any other value.
14365 * Attempts to send some data from the given slice to the peer.
14367 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
14368 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
14369 * called and further write attempts may occur until that time.
14371 * If the returned size is smaller than `data.len()`, a
14372 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
14373 * written. Additionally, until a `send_data` event completes fully, no further
14374 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
14375 * prevent denial-of-service issues, you should not read or buffer any data from the socket
14378 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
14379 * (indicating that read events should be paused to prevent DoS in the send buffer),
14380 * `resume_read` may be set indicating that read events on this descriptor should resume. A
14381 * `resume_read` of false carries no meaning, and should not cause any action.
14383 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
14385 * Disconnect the socket pointed to by this SocketDescriptor.
14387 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
14388 * call (doing so is a noop).
14390 void (*disconnect_socket)(void *this_arg);
14392 * Checks if two objects are equal given this object's this_arg pointer and another object.
14394 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
14396 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
14397 * This is used, for example, for inclusion of this object in a hash map.
14399 uint64_t (*hash)(const void *this_arg);
14401 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
14402 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
14403 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
14405 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
14407 * Frees any resources associated with this object given its this_arg pointer.
14408 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
14410 void (*free)(void *this_arg);
14411 } LDKSocketDescriptor;
14416 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
14417 * socket events into messages which it passes on to its [`MessageHandler`].
14419 * Locks are taken internally, so you must never assume that reentrancy from a
14420 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
14422 * Calls to [`read_event`] will decode relevant messages and pass them to the
14423 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
14424 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
14425 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
14426 * calls only after previous ones have returned.
14428 * Rather than using a plain PeerManager, it is preferable to use either a SimpleArcPeerManager
14429 * a SimpleRefPeerManager, for conciseness. See their documentation for more details, but
14430 * essentially you should default to using a SimpleRefPeerManager, and use a
14431 * SimpleArcPeerManager when you require a PeerManager with a static lifetime, such as when
14432 * you're using lightning-net-tokio.
14434 * [`read_event`]: PeerManager::read_event
14436 typedef struct MUST_USE_STRUCT LDKPeerManager {
14438 * A pointer to the opaque Rust object.
14439 * Nearly everywhere, inner must be non-null, however in places where
14440 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14442 LDKnativePeerManager *inner;
14444 * Indicates that this is the only struct which contains the same pointer.
14445 * Rust functions which take ownership of an object provided via an argument require
14446 * this to be true and invalidate the object pointed to by inner.
14454 * Static channel fields used to build transactions given per-commitment fields, organized by
14455 * broadcaster/countersignatory.
14457 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
14458 * as_holder_broadcastable and as_counterparty_broadcastable functions.
14460 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
14462 * A pointer to the opaque Rust object.
14463 * Nearly everywhere, inner must be non-null, however in places where
14464 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14466 LDKnativeDirectedChannelTransactionParameters *inner;
14468 * Indicates that this is the only struct which contains the same pointer.
14469 * Rust functions which take ownership of an object provided via an argument require
14470 * this to be true and invalidate the object pointed to by inner.
14473 } LDKDirectedChannelTransactionParameters;
14478 * Features used within an `offer`.
14480 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
14482 * A pointer to the opaque Rust object.
14483 * Nearly everywhere, inner must be non-null, however in places where
14484 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14486 LDKnativeOfferFeatures *inner;
14488 * Indicates that this is the only struct which contains the same pointer.
14489 * Rust functions which take ownership of an object provided via an argument require
14490 * this to be true and invalidate the object pointed to by inner.
14493 } LDKOfferFeatures;
14498 * Features used within an `invoice_request`.
14500 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
14502 * A pointer to the opaque Rust object.
14503 * Nearly everywhere, inner must be non-null, however in places where
14504 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14506 LDKnativeInvoiceRequestFeatures *inner;
14508 * Indicates that this is the only struct which contains the same pointer.
14509 * Rust functions which take ownership of an object provided via an argument require
14510 * this to be true and invalidate the object pointed to by inner.
14513 } LDKInvoiceRequestFeatures;
14518 * Features used within an `invoice`.
14520 typedef struct MUST_USE_STRUCT LDKBolt12InvoiceFeatures {
14522 * A pointer to the opaque Rust object.
14523 * Nearly everywhere, inner must be non-null, however in places where
14524 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14526 LDKnativeBolt12InvoiceFeatures *inner;
14528 * Indicates that this is the only struct which contains the same pointer.
14529 * Rust functions which take ownership of an object provided via an argument require
14530 * this to be true and invalidate the object pointed to by inner.
14533 } LDKBolt12InvoiceFeatures;
14536 * Integer in the range `0..=16`
14538 typedef struct LDKWitnessVersion {
14540 } LDKWitnessVersion;
14545 * Receives and validates network updates from peers,
14546 * stores authentic and relevant data as a network graph.
14547 * This network graph is then used for routing payments.
14548 * Provides interface to help with initial routing sync by
14549 * serving historical announcements.
14551 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
14553 * A pointer to the opaque Rust object.
14554 * Nearly everywhere, inner must be non-null, however in places where
14555 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14557 LDKnativeP2PGossipSync *inner;
14559 * Indicates that this is the only struct which contains the same pointer.
14560 * Rust functions which take ownership of an object provided via an argument require
14561 * this to be true and invalidate the object pointed to by inner.
14564 } LDKP2PGossipSync;
14569 * A read-only view of [`NetworkGraph`].
14571 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
14573 * A pointer to the opaque Rust object.
14574 * Nearly everywhere, inner must be non-null, however in places where
14575 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14577 LDKnativeReadOnlyNetworkGraph *inner;
14579 * Indicates that this is the only struct which contains the same pointer.
14580 * Rust functions which take ownership of an object provided via an argument require
14581 * this to be true and invalidate the object pointed to by inner.
14584 } LDKReadOnlyNetworkGraph;
14589 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
14590 * source node to a target node.
14592 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
14594 * A pointer to the opaque Rust object.
14595 * Nearly everywhere, inner must be non-null, however in places where
14596 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14598 LDKnativeDirectedChannelInfo *inner;
14600 * Indicates that this is the only struct which contains the same pointer.
14601 * Rust functions which take ownership of an object provided via an argument require
14602 * this to be true and invalidate the object pointed to by inner.
14605 } LDKDirectedChannelInfo;
14608 * The effective capacity of a channel for routing purposes.
14610 * While this may be smaller than the actual channel capacity, amounts greater than
14611 * [`Self::as_msat`] should not be routed through the channel.
14613 typedef enum LDKEffectiveCapacity_Tag {
14615 * The available liquidity in the channel known from being a channel counterparty, and thus a
14618 LDKEffectiveCapacity_ExactLiquidity,
14620 * The maximum HTLC amount in one direction as advertised on the gossip network.
14622 LDKEffectiveCapacity_MaximumHTLC,
14624 * The total capacity of the channel as determined by the funding transaction.
14626 LDKEffectiveCapacity_Total,
14628 * A capacity sufficient to route any payment, typically used for private channels provided by
14631 LDKEffectiveCapacity_Infinite,
14633 * A capacity that is unknown possibly because either the chain state is unavailable to know
14634 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
14636 LDKEffectiveCapacity_Unknown,
14638 * Must be last for serialization purposes
14640 LDKEffectiveCapacity_Sentinel,
14641 } LDKEffectiveCapacity_Tag;
14643 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
14645 * Either the inbound or outbound liquidity depending on the direction, denominated in
14648 uint64_t liquidity_msat;
14649 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
14651 typedef struct LDKEffectiveCapacity_LDKMaximumHTLC_Body {
14653 * The maximum HTLC amount denominated in millisatoshi.
14655 uint64_t amount_msat;
14656 } LDKEffectiveCapacity_LDKMaximumHTLC_Body;
14658 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
14660 * The funding amount denominated in millisatoshi.
14662 uint64_t capacity_msat;
14664 * The maximum HTLC amount denominated in millisatoshi.
14666 uint64_t htlc_maximum_msat;
14667 } LDKEffectiveCapacity_LDKTotal_Body;
14669 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
14670 LDKEffectiveCapacity_Tag tag;
14672 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
14673 LDKEffectiveCapacity_LDKMaximumHTLC_Body maximum_htlc;
14674 LDKEffectiveCapacity_LDKTotal_Body total;
14676 } LDKEffectiveCapacity;
14681 * A [`Router`] implemented using [`find_route`].
14683 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
14685 * A pointer to the opaque Rust object.
14686 * Nearly everywhere, inner must be non-null, however in places where
14687 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14689 LDKnativeDefaultRouter *inner;
14691 * Indicates that this is the only struct which contains the same pointer.
14692 * Rust functions which take ownership of an object provided via an argument require
14693 * this to be true and invalidate the object pointed to by inner.
14696 } LDKDefaultRouter;
14701 * [`Score`] implementation that factors in in-flight HTLC liquidity.
14703 * Useful for custom [`Router`] implementations to wrap their [`Score`] on-the-fly when calling
14706 * [`Score`]: crate::routing::scoring::Score
14708 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
14710 * A pointer to the opaque Rust object.
14711 * Nearly everywhere, inner must be non-null, however in places where
14712 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14714 LDKnativeScorerAccountingForInFlightHtlcs *inner;
14716 * Indicates that this is the only struct which contains the same pointer.
14717 * Rust functions which take ownership of an object provided via an argument require
14718 * this to be true and invalidate the object pointed to by inner.
14721 } LDKScorerAccountingForInFlightHtlcs;
14726 * A concrete implementation of [`LockableScore`] which supports multi-threading.
14728 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
14730 * A pointer to the opaque Rust object.
14731 * Nearly everywhere, inner must be non-null, however in places where
14732 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14734 LDKnativeMultiThreadedLockableScore *inner;
14736 * Indicates that this is the only struct which contains the same pointer.
14737 * Rust functions which take ownership of an object provided via an argument require
14738 * this to be true and invalidate the object pointed to by inner.
14741 } LDKMultiThreadedLockableScore;
14746 * A locked `MultiThreadedLockableScore`.
14748 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLock {
14750 * A pointer to the opaque Rust object.
14751 * Nearly everywhere, inner must be non-null, however in places where
14752 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14754 LDKnativeMultiThreadedScoreLock *inner;
14756 * Indicates that this is the only struct which contains the same pointer.
14757 * Rust functions which take ownership of an object provided via an argument require
14758 * this to be true and invalidate the object pointed to by inner.
14761 } LDKMultiThreadedScoreLock;
14766 * Parameters for configuring [`ProbabilisticScorer`].
14768 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
14769 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
14771 * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
14774 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringParameters {
14776 * A pointer to the opaque Rust object.
14777 * Nearly everywhere, inner must be non-null, however in places where
14778 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14780 LDKnativeProbabilisticScoringParameters *inner;
14782 * Indicates that this is the only struct which contains the same pointer.
14783 * Rust functions which take ownership of an object provided via an argument require
14784 * this to be true and invalidate the object pointed to by inner.
14787 } LDKProbabilisticScoringParameters;
14792 * A sender, receiver and forwarder of onion messages. In upcoming releases, this object will be
14793 * used to retrieve invoices and fulfill invoice requests from [offers]. Currently, only sending
14794 * and receiving custom onion messages is supported.
14799 * # extern crate bitcoin;
14800 * # use bitcoin::hashes::_export::_core::time::Duration;
14801 * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
14802 * # use lightning::chain::keysinterface::KeysManager;
14803 * # use lightning::ln::peer_handler::IgnoringMessageHandler;
14804 * # use lightning::onion_message::blinded_path::BlindedPath;
14805 * # use lightning::onion_message::messenger::{Destination, OnionMessenger};
14806 * # use lightning::onion_message::packet::{CustomOnionMessageContents, OnionMessageContents};
14807 * # use lightning::util::logger::{Logger, Record};
14808 * # use lightning::util::ser::{Writeable, Writer};
14809 * # use lightning::io;
14810 * # use std::sync::Arc;
14811 * # struct FakeLogger;
14812 * # impl Logger for FakeLogger {
14813 * # fn log(&self, record: &Record) { unimplemented!() }
14815 * # let seed = [42u8; 32];
14816 * # let time = Duration::from_secs(123456);
14817 * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
14818 * # let logger = Arc::new(FakeLogger {});
14819 * # let node_secret = SecretKey::from_slice(&hex::decode(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
14820 * # let secp_ctx = Secp256k1::new();
14821 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
14822 * # let (hop_node_id2, hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1, hop_node_id1);
14823 * # let destination_node_id = hop_node_id1;
14824 * # let your_custom_message_handler = IgnoringMessageHandler {};
14825 * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
14826 * // ChannelManager.
14827 * let onion_messenger = OnionMessenger::new(&keys_manager, &keys_manager, logger, &your_custom_message_handler);
14829 * # struct YourCustomMessage {}
14830 * impl Writeable for YourCustomMessage {
14831 * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
14833 * \t\t// Write your custom onion message to `w`
14836 * impl CustomOnionMessageContents for YourCustomMessage {
14837 * \tfn tlv_type(&self) -> u64 {
14838 * \t\t# let your_custom_message_type = 42;
14839 * \t\tyour_custom_message_type
14842 * // Send a custom onion message to a node id.
14843 * let intermediate_hops = [hop_node_id1, hop_node_id2];
14844 * let reply_path = None;
14845 * # let your_custom_message = YourCustomMessage {};
14846 * let message = OnionMessageContents::Custom(your_custom_message);
14847 * onion_messenger.send_onion_message(&intermediate_hops, Destination::Node(destination_node_id), message, reply_path);
14849 * // Create a blinded path to yourself, for someone to send an onion message to.
14850 * # let your_node_id = hop_node_id1;
14851 * let hops = [hop_node_id3, hop_node_id4, your_node_id];
14852 * let blinded_path = BlindedPath::new(&hops, &keys_manager, &secp_ctx).unwrap();
14854 * // Send a custom onion message to a blinded path.
14855 * # let intermediate_hops = [hop_node_id1, hop_node_id2];
14856 * let reply_path = None;
14857 * # let your_custom_message = YourCustomMessage {};
14858 * let message = OnionMessageContents::Custom(your_custom_message);
14859 * onion_messenger.send_onion_message(&intermediate_hops, Destination::BlindedPath(blinded_path), message, reply_path);
14862 * [offers]: <https://github.com/lightning/bolts/pull/798>
14863 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
14865 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
14867 * A pointer to the opaque Rust object.
14868 * Nearly everywhere, inner must be non-null, however in places where
14869 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14871 LDKnativeOnionMessenger *inner;
14873 * Indicates that this is the only struct which contains the same pointer.
14874 * Rust functions which take ownership of an object provided via an argument require
14875 * this to be true and invalidate the object pointed to by inner.
14878 } LDKOnionMessenger;
14881 * The destination of an onion message.
14883 typedef enum LDKDestination_Tag {
14885 * We're sending this onion message to a node.
14887 LDKDestination_Node,
14889 * We're sending this onion message to a blinded path.
14891 LDKDestination_BlindedPath,
14893 * Must be last for serialization purposes
14895 LDKDestination_Sentinel,
14896 } LDKDestination_Tag;
14898 typedef struct MUST_USE_STRUCT LDKDestination {
14899 LDKDestination_Tag tag;
14902 struct LDKPublicKey node;
14905 struct LDKBlindedPath blinded_path;
14911 * The contents of an onion message. In the context of offers, this would be the invoice, invoice
14912 * request, or invoice error.
14914 typedef enum LDKOnionMessageContents_Tag {
14916 * A custom onion message specified by the user.
14918 LDKOnionMessageContents_Custom,
14920 * Must be last for serialization purposes
14922 LDKOnionMessageContents_Sentinel,
14923 } LDKOnionMessageContents_Tag;
14925 typedef struct MUST_USE_STRUCT LDKOnionMessageContents {
14926 LDKOnionMessageContents_Tag tag;
14929 struct LDKCustomOnionMessageContents custom;
14932 } LDKOnionMessageContents;
14937 * FilesystemPersister persists channel data on disk, where each channel's
14938 * data is stored in a file named after its funding outpoint.
14940 * Warning: this module does the best it can with calls to persist data, but it
14941 * can only guarantee that the data is passed to the drive. It is up to the
14942 * drive manufacturers to do the actual persistence properly, which they often
14943 * don't (especially on consumer-grade hardware). Therefore, it is up to the
14944 * user to validate their entire storage stack, to ensure the writes are
14946 * Corollary: especially when dealing with larger amounts of money, it is best
14947 * practice to have multiple channel data backups and not rely only on one
14948 * FilesystemPersister.
14950 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
14952 * A pointer to the opaque Rust object.
14953 * Nearly everywhere, inner must be non-null, however in places where
14954 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14956 LDKnativeFilesystemPersister *inner;
14958 * Indicates that this is the only struct which contains the same pointer.
14959 * Rust functions which take ownership of an object provided via an argument require
14960 * this to be true and invalidate the object pointed to by inner.
14963 } LDKFilesystemPersister;
14968 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
14969 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
14970 * responsibilities are:
14971 * * Processing [`Event`]s with a user-provided [`EventHandler`].
14972 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
14973 * writing it to disk/backups by invoking the callback given to it at startup.
14974 * [`ChannelManager`] persistence should be done in the background.
14975 * * Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
14976 * at the appropriate intervals.
14977 * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
14978 * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
14980 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
14981 * upon as doing so may result in high latency.
14985 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
14986 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
14987 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
14988 * unilateral chain closure fees are at risk.
14990 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
14991 * [`Event`]: lightning::util::events::Event
14992 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
14994 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
14996 * A pointer to the opaque Rust object.
14997 * Nearly everywhere, inner must be non-null, however in places where
14998 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15000 LDKnativeBackgroundProcessor *inner;
15002 * Indicates that this is the only struct which contains the same pointer.
15003 * Rust functions which take ownership of an object provided via an argument require
15004 * this to be true and invalidate the object pointed to by inner.
15007 } LDKBackgroundProcessor;
15012 * The main Rapid Gossip Sync object.
15014 * See [crate-level documentation] for usage.
15016 * [crate-level documentation]: crate
15018 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
15020 * A pointer to the opaque Rust object.
15021 * Nearly everywhere, inner must be non-null, however in places where
15022 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15024 LDKnativeRapidGossipSync *inner;
15026 * Indicates that this is the only struct which contains the same pointer.
15027 * Rust functions which take ownership of an object provided via an argument require
15028 * this to be true and invalidate the object pointed to by inner.
15031 } LDKRapidGossipSync;
15034 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
15036 typedef enum LDKGossipSync_Tag {
15038 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
15042 * Rapid gossip sync from a trusted server.
15044 LDKGossipSync_Rapid,
15048 LDKGossipSync_None,
15050 * Must be last for serialization purposes
15052 LDKGossipSync_Sentinel,
15053 } LDKGossipSync_Tag;
15055 typedef struct MUST_USE_STRUCT LDKGossipSync {
15056 LDKGossipSync_Tag tag;
15060 * Note that this field is expected to be a reference.
15062 struct LDKP2PGossipSync p2p;
15066 * Note that this field is expected to be a reference.
15068 struct LDKRapidGossipSync rapid;
15076 * Data of the `RawInvoice` that is encoded in the data part
15078 typedef struct MUST_USE_STRUCT LDKRawDataPart {
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 LDKnativeRawDataPart *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.
15098 typedef struct MUST_USE_STRUCT LDKSha256 {
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 LDKnativeSha256 *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.
15116 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
15119 typedef struct MUST_USE_STRUCT LDKExpiryTime {
15121 * A pointer to the opaque Rust object.
15122 * Nearly everywhere, inner must be non-null, however in places where
15123 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15125 LDKnativeExpiryTime *inner;
15127 * Indicates that this is the only struct which contains the same pointer.
15128 * Rust functions which take ownership of an object provided via an argument require
15129 * this to be true and invalidate the object pointed to by inner.
15137 * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
15139 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
15141 * A pointer to the opaque Rust object.
15142 * Nearly everywhere, inner must be non-null, however in places where
15143 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15145 LDKnativeMinFinalCltvExpiryDelta *inner;
15147 * Indicates that this is the only struct which contains the same pointer.
15148 * Rust functions which take ownership of an object provided via an argument require
15149 * this to be true and invalidate the object pointed to by inner.
15152 } LDKMinFinalCltvExpiryDelta;
15155 * A 20-byte byte array.
15157 typedef struct LDKTwentyBytes {
15165 * Fallback address in case no LN payment is possible
15167 typedef enum LDKFallback_Tag {
15168 LDKFallback_SegWitProgram,
15169 LDKFallback_PubKeyHash,
15170 LDKFallback_ScriptHash,
15172 * Must be last for serialization purposes
15174 LDKFallback_Sentinel,
15177 typedef struct LDKFallback_LDKSegWitProgram_Body {
15178 struct LDKU5 version;
15179 struct LDKCVec_u8Z program;
15180 } LDKFallback_LDKSegWitProgram_Body;
15182 typedef struct MUST_USE_STRUCT LDKFallback {
15183 LDKFallback_Tag tag;
15185 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
15187 struct LDKTwentyBytes pub_key_hash;
15190 struct LDKTwentyBytes script_hash;
15195 extern const uintptr_t MAX_BUF_SIZE;
15197 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
15199 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
15201 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
15203 extern const uint32_t ANTI_REORG_DELAY;
15205 extern const uint16_t BREAKDOWN_TIMEOUT;
15207 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
15209 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
15211 extern const uint16_t MAX_HTLCS;
15213 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
15215 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
15217 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
15219 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
15221 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
15223 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
15225 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
15227 extern const uint64_t MAX_TIMESTAMP;
15229 extern const uint64_t DEFAULT_EXPIRY_TIME;
15231 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
15233 extern const uint8_t TAG_PAYMENT_HASH;
15235 extern const uint8_t TAG_DESCRIPTION;
15237 extern const uint8_t TAG_PAYEE_PUB_KEY;
15239 extern const uint8_t TAG_DESCRIPTION_HASH;
15241 extern const uint8_t TAG_EXPIRY_TIME;
15243 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
15245 extern const uint8_t TAG_FALLBACK;
15247 extern const uint8_t TAG_PRIVATE_ROUTE;
15249 extern const uint8_t TAG_PAYMENT_SECRET;
15251 extern const uint8_t TAG_FEATURES;
15253 struct LDKStr _ldk_get_compiled_version(void);
15255 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
15258 * Gets the 128-bit integer, as 16 little-endian bytes
15260 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
15263 * Constructs a new U128 from 16 little-endian bytes
15265 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
15268 * Convenience function for constructing a new BigEndianScalar
15270 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
15273 * Creates a new Bech32Error which has the same data as `orig`
15275 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
15278 * Releases any memory held by the given `Bech32Error` (which is currently none)
15280 void Bech32Error_free(struct LDKBech32Error o);
15283 * Frees the data buffer, if data_is_owned is set and datalen > 0.
15285 void Transaction_free(struct LDKTransaction _res);
15288 * Frees the data pointed to by data
15290 void Witness_free(struct LDKWitness _res);
15293 * Convenience function for constructing a new TxOut
15295 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
15298 * Frees the data pointed to by script_pubkey.
15300 void TxOut_free(struct LDKTxOut _res);
15303 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
15305 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
15308 * Frees the data buffer, if chars_is_owned is set and len > 0.
15310 void Str_free(struct LDKStr _res);
15312 #if defined(LDK_DEBUG_BUILD)
15314 * This function exists for memory safety testing purposes. It should never be used in production
15317 const void *__unmangle_inner_ptr(const void *ptr);
15321 * Creates a new CResult_NoneAPIErrorZ in the success state.
15323 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
15326 * Creates a new CResult_NoneAPIErrorZ in the error state.
15328 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
15331 * Checks if the given object is currently in the success state
15333 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
15336 * Frees any resources used by the CResult_NoneAPIErrorZ.
15338 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
15341 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
15342 * but with all dynamically-allocated buffers duplicated in new buffers.
15344 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
15347 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15349 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
15352 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15354 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
15357 * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
15359 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
15362 * Constructs a new COption_HTLCClaimZ containing nothing
15364 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
15367 * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
15369 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
15372 * Creates a new CResult_NoneNoneZ in the success state.
15374 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
15377 * Creates a new CResult_NoneNoneZ in the error state.
15379 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
15382 * Checks if the given object is currently in the success state
15384 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
15387 * Frees any resources used by the CResult_NoneNoneZ.
15389 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
15392 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
15393 * but with all dynamically-allocated buffers duplicated in new buffers.
15395 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
15398 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
15400 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
15403 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
15405 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
15408 * Checks if the given object is currently in the success state
15410 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
15413 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
15415 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
15418 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
15419 * but with all dynamically-allocated buffers duplicated in new buffers.
15421 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
15424 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
15426 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
15429 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
15431 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
15434 * Checks if the given object is currently in the success state
15436 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
15439 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
15441 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
15444 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
15445 * but with all dynamically-allocated buffers duplicated in new buffers.
15447 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
15450 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
15452 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
15455 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
15457 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
15460 * Checks if the given object is currently in the success state
15462 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
15465 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
15467 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
15470 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
15471 * but with all dynamically-allocated buffers duplicated in new buffers.
15473 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
15476 * Constructs a new COption_u32Z containing a u32
15478 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
15481 * Constructs a new COption_u32Z containing nothing
15483 struct LDKCOption_u32Z COption_u32Z_none(void);
15486 * Frees any resources associated with the u32, if we are in the Some state
15488 void COption_u32Z_free(struct LDKCOption_u32Z _res);
15491 * Creates a new COption_u32Z which has the same data as `orig`
15492 * but with all dynamically-allocated buffers duplicated in new buffers.
15494 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
15497 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
15499 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
15502 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
15504 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
15507 * Checks if the given object is currently in the success state
15509 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
15512 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
15514 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
15517 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
15518 * but with all dynamically-allocated buffers duplicated in new buffers.
15520 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
15523 * Constructs a new COption_NoneZ containing a
15525 enum LDKCOption_NoneZ COption_NoneZ_some(void);
15528 * Constructs a new COption_NoneZ containing nothing
15530 enum LDKCOption_NoneZ COption_NoneZ_none(void);
15533 * Frees any resources associated with the , if we are in the Some state
15535 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
15538 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
15540 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
15543 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
15545 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
15548 * Checks if the given object is currently in the success state
15550 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
15553 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
15555 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
15558 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
15559 * but with all dynamically-allocated buffers duplicated in new buffers.
15561 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
15564 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
15566 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
15569 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
15571 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
15574 * Checks if the given object is currently in the success state
15576 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
15579 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
15581 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
15584 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
15585 * but with all dynamically-allocated buffers duplicated in new buffers.
15587 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
15590 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15592 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
15595 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
15597 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
15600 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
15602 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
15605 * Checks if the given object is currently in the success state
15607 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
15610 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
15612 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
15615 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
15616 * but with all dynamically-allocated buffers duplicated in new buffers.
15618 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
15621 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
15623 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
15626 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
15628 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
15631 * Checks if the given object is currently in the success state
15633 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
15636 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
15638 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
15641 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
15642 * but with all dynamically-allocated buffers duplicated in new buffers.
15644 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
15647 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
15649 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
15652 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
15654 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
15657 * Checks if the given object is currently in the success state
15659 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
15662 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
15664 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
15667 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
15669 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
15672 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
15674 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
15677 * Checks if the given object is currently in the success state
15679 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
15682 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
15684 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
15687 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
15688 * but with all dynamically-allocated buffers duplicated in new buffers.
15690 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
15693 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
15695 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
15698 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
15700 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
15703 * Checks if the given object is currently in the success state
15705 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
15708 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
15710 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
15713 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
15715 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
15718 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
15720 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
15723 * Checks if the given object is currently in the success state
15725 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
15728 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
15730 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
15733 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
15734 * but with all dynamically-allocated buffers duplicated in new buffers.
15736 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
15739 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
15741 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
15744 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
15746 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
15749 * Checks if the given object is currently in the success state
15751 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
15754 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
15756 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
15759 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
15760 * but with all dynamically-allocated buffers duplicated in new buffers.
15762 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
15765 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
15767 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
15770 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
15772 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
15775 * Checks if the given object is currently in the success state
15777 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
15780 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
15782 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
15785 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
15786 * but with all dynamically-allocated buffers duplicated in new buffers.
15788 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
15791 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15793 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
15796 * Creates a new CResult_BlindedPathNoneZ in the success state.
15798 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
15801 * Creates a new CResult_BlindedPathNoneZ in the error state.
15803 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
15806 * Checks if the given object is currently in the success state
15808 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
15811 * Frees any resources used by the CResult_BlindedPathNoneZ.
15813 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
15816 * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
15817 * but with all dynamically-allocated buffers duplicated in new buffers.
15819 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
15822 * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
15824 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
15827 * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
15829 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
15832 * Checks if the given object is currently in the success state
15834 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
15837 * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
15839 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
15842 * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
15843 * but with all dynamically-allocated buffers duplicated in new buffers.
15845 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
15848 * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
15850 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
15853 * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
15855 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
15858 * Checks if the given object is currently in the success state
15860 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
15863 * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
15865 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
15868 * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
15869 * but with all dynamically-allocated buffers duplicated in new buffers.
15871 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
15874 * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
15876 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
15879 * Constructs a new COption_WriteableScoreZ containing nothing
15881 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
15884 * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
15886 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
15889 * Creates a new CResult_NoneErrorZ in the success state.
15891 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
15894 * Creates a new CResult_NoneErrorZ in the error state.
15896 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
15899 * Checks if the given object is currently in the success state
15901 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
15904 * Frees any resources used by the CResult_NoneErrorZ.
15906 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
15909 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
15910 * but with all dynamically-allocated buffers duplicated in new buffers.
15912 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
15915 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15917 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
15920 * Creates a new CResult_RouteLightningErrorZ in the success state.
15922 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
15925 * Creates a new CResult_RouteLightningErrorZ in the error state.
15927 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
15930 * Checks if the given object is currently in the success state
15932 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
15935 * Frees any resources used by the CResult_RouteLightningErrorZ.
15937 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
15940 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
15941 * but with all dynamically-allocated buffers duplicated in new buffers.
15943 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
15946 * Frees the buffer pointed to by `data` if `datalen` is non-0.
15948 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
15951 * Constructs a new COption_u64Z containing a u64
15953 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
15956 * Constructs a new COption_u64Z containing nothing
15958 struct LDKCOption_u64Z COption_u64Z_none(void);
15961 * Frees any resources associated with the u64, if we are in the Some state
15963 void COption_u64Z_free(struct LDKCOption_u64Z _res);
15966 * Creates a new COption_u64Z which has the same data as `orig`
15967 * but with all dynamically-allocated buffers duplicated in new buffers.
15969 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
15972 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
15974 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
15977 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
15979 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
15982 * Checks if the given object is currently in the success state
15984 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
15987 * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
15989 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
15992 * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
15993 * but with all dynamically-allocated buffers duplicated in new buffers.
15995 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
15998 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
16000 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
16003 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
16005 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
16008 * Checks if the given object is currently in the success state
16010 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
16013 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
16015 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
16018 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
16019 * but with all dynamically-allocated buffers duplicated in new buffers.
16021 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
16024 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16026 void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res);
16029 * Creates a new CResult_RouteDecodeErrorZ in the success state.
16031 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
16034 * Creates a new CResult_RouteDecodeErrorZ in the error state.
16036 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
16039 * Checks if the given object is currently in the success state
16041 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
16044 * Frees any resources used by the CResult_RouteDecodeErrorZ.
16046 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
16049 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
16050 * but with all dynamically-allocated buffers duplicated in new buffers.
16052 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
16055 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
16057 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
16060 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
16062 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
16065 * Checks if the given object is currently in the success state
16067 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
16070 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
16072 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
16075 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
16076 * but with all dynamically-allocated buffers duplicated in new buffers.
16078 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
16081 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16083 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
16086 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16088 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
16091 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
16093 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
16096 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
16098 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
16101 * Checks if the given object is currently in the success state
16103 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
16106 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
16108 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
16111 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
16112 * but with all dynamically-allocated buffers duplicated in new buffers.
16114 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
16117 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16119 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
16122 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
16124 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
16127 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
16129 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
16132 * Checks if the given object is currently in the success state
16134 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
16137 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
16139 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
16142 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
16143 * but with all dynamically-allocated buffers duplicated in new buffers.
16145 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
16148 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
16150 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
16153 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
16155 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
16158 * Checks if the given object is currently in the success state
16160 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
16163 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
16165 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
16168 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
16169 * but with all dynamically-allocated buffers duplicated in new buffers.
16171 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
16174 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
16176 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
16179 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
16181 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
16184 * Checks if the given object is currently in the success state
16186 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
16189 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
16191 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
16194 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
16195 * but with all dynamically-allocated buffers duplicated in new buffers.
16197 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
16200 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
16202 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
16205 * Constructs a new COption_NetworkUpdateZ containing nothing
16207 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
16210 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
16212 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
16215 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
16216 * but with all dynamically-allocated buffers duplicated in new buffers.
16218 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
16221 * Constructs a new COption_PathFailureZ containing a crate::lightning::util::events::PathFailure
16223 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
16226 * Constructs a new COption_PathFailureZ containing nothing
16228 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
16231 * Frees any resources associated with the crate::lightning::util::events::PathFailure, if we are in the Some state
16233 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
16236 * Creates a new COption_PathFailureZ which has the same data as `orig`
16237 * but with all dynamically-allocated buffers duplicated in new buffers.
16239 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
16242 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
16244 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
16247 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
16249 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
16252 * Checks if the given object is currently in the success state
16254 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
16257 * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
16259 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
16262 * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
16263 * but with all dynamically-allocated buffers duplicated in new buffers.
16265 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
16268 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason
16270 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
16273 * Constructs a new COption_ClosureReasonZ containing nothing
16275 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
16278 * Frees any resources associated with the crate::lightning::util::events::ClosureReason, if we are in the Some state
16280 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
16283 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
16284 * but with all dynamically-allocated buffers duplicated in new buffers.
16286 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
16289 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
16291 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
16294 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
16296 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
16299 * Checks if the given object is currently in the success state
16301 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
16304 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
16306 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
16309 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
16310 * but with all dynamically-allocated buffers duplicated in new buffers.
16312 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
16315 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::util::events::HTLCDestination
16317 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
16320 * Constructs a new COption_HTLCDestinationZ containing nothing
16322 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
16325 * Frees any resources associated with the crate::lightning::util::events::HTLCDestination, if we are in the Some state
16327 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
16330 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
16331 * but with all dynamically-allocated buffers duplicated in new buffers.
16333 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
16336 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
16338 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
16341 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
16343 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
16346 * Checks if the given object is currently in the success state
16348 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
16351 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
16353 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
16356 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
16357 * but with all dynamically-allocated buffers duplicated in new buffers.
16359 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
16362 * Constructs a new COption_u128Z containing a crate::c_types::U128
16364 struct LDKCOption_u128Z COption_u128Z_some(struct LDKU128 o);
16367 * Constructs a new COption_u128Z containing nothing
16369 struct LDKCOption_u128Z COption_u128Z_none(void);
16372 * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
16374 void COption_u128Z_free(struct LDKCOption_u128Z _res);
16377 * Creates a new COption_u128Z which has the same data as `orig`
16378 * but with all dynamically-allocated buffers duplicated in new buffers.
16380 struct LDKCOption_u128Z COption_u128Z_clone(const struct LDKCOption_u128Z *NONNULL_PTR orig);
16383 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16385 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
16388 * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event
16390 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
16393 * Constructs a new COption_EventZ containing nothing
16395 struct LDKCOption_EventZ COption_EventZ_none(void);
16398 * Frees any resources associated with the crate::lightning::util::events::Event, if we are in the Some state
16400 void COption_EventZ_free(struct LDKCOption_EventZ _res);
16403 * Creates a new COption_EventZ which has the same data as `orig`
16404 * but with all dynamically-allocated buffers duplicated in new buffers.
16406 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
16409 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
16411 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
16414 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
16416 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
16419 * Checks if the given object is currently in the success state
16421 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
16424 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
16426 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
16429 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
16430 * but with all dynamically-allocated buffers duplicated in new buffers.
16432 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
16435 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16437 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
16440 * Creates a new tuple which has the same data as `orig`
16441 * but with all dynamically-allocated buffers duplicated in new buffers.
16443 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
16446 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
16448 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
16451 * Frees any resources used by the C2Tuple_usizeTransactionZ.
16453 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
16456 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16458 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
16461 * Creates a new tuple which has the same data as `orig`
16462 * but with all dynamically-allocated buffers duplicated in new buffers.
16464 struct LDKC2Tuple_TxidBlockHashZ C2Tuple_TxidBlockHashZ_clone(const struct LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR orig);
16467 * Creates a new C2Tuple_TxidBlockHashZ from the contained elements.
16469 struct LDKC2Tuple_TxidBlockHashZ C2Tuple_TxidBlockHashZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
16472 * Frees any resources used by the C2Tuple_TxidBlockHashZ.
16474 void C2Tuple_TxidBlockHashZ_free(struct LDKC2Tuple_TxidBlockHashZ _res);
16477 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16479 void CVec_C2Tuple_TxidBlockHashZZ_free(struct LDKCVec_C2Tuple_TxidBlockHashZZ _res);
16482 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16484 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
16487 * Creates a new tuple which has the same data as `orig`
16488 * but with all dynamically-allocated buffers duplicated in new buffers.
16490 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
16493 * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
16495 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
16498 * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
16500 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
16503 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16505 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
16508 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
16510 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
16513 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
16515 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
16518 * Checks if the given object is currently in the success state
16520 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
16523 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
16525 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
16528 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
16529 * but with all dynamically-allocated buffers duplicated in new buffers.
16531 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
16534 * Creates a new tuple which has the same data as `orig`
16535 * but with all dynamically-allocated buffers duplicated in new buffers.
16537 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
16540 * Creates a new C2Tuple_u64u64Z from the contained elements.
16542 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
16545 * Frees any resources used by the C2Tuple_u64u64Z.
16547 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
16550 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
16552 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
16555 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
16557 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
16560 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
16562 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
16565 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
16566 * but with all dynamically-allocated buffers duplicated in new buffers.
16568 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
16571 * Creates a new tuple which has the same data as `orig`
16572 * but with all dynamically-allocated buffers duplicated in new buffers.
16574 struct LDKC2Tuple_Z C2Tuple_Z_clone(const struct LDKC2Tuple_Z *NONNULL_PTR orig);
16577 * Creates a new C2Tuple_Z from the contained elements.
16579 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKEightU16s a, struct LDKEightU16s b);
16582 * Frees any resources used by the C2Tuple_Z.
16584 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
16587 * Creates a new tuple which has the same data as `orig`
16588 * but with all dynamically-allocated buffers duplicated in new buffers.
16590 struct LDKC2Tuple__u168_u168Z C2Tuple__u168_u168Z_clone(const struct LDKC2Tuple__u168_u168Z *NONNULL_PTR orig);
16593 * Creates a new C2Tuple__u168_u168Z from the contained elements.
16595 struct LDKC2Tuple__u168_u168Z C2Tuple__u168_u168Z_new(struct LDKEightU16s a, struct LDKEightU16s b);
16598 * Frees any resources used by the C2Tuple__u168_u168Z.
16600 void C2Tuple__u168_u168Z_free(struct LDKC2Tuple__u168_u168Z _res);
16603 * Constructs a new COption_C2Tuple_EightU16sEightU16sZZ containing a crate::c_types::derived::C2Tuple__u168_u168Z
16605 struct LDKCOption_C2Tuple_EightU16sEightU16sZZ COption_C2Tuple_EightU16sEightU16sZZ_some(struct LDKC2Tuple__u168_u168Z o);
16608 * Constructs a new COption_C2Tuple_EightU16sEightU16sZZ containing nothing
16610 struct LDKCOption_C2Tuple_EightU16sEightU16sZZ COption_C2Tuple_EightU16sEightU16sZZ_none(void);
16613 * Frees any resources associated with the crate::c_types::derived::C2Tuple__u168_u168Z, if we are in the Some state
16615 void COption_C2Tuple_EightU16sEightU16sZZ_free(struct LDKCOption_C2Tuple_EightU16sEightU16sZZ _res);
16618 * Creates a new COption_C2Tuple_EightU16sEightU16sZZ which has the same data as `orig`
16619 * but with all dynamically-allocated buffers duplicated in new buffers.
16621 struct LDKCOption_C2Tuple_EightU16sEightU16sZZ COption_C2Tuple_EightU16sEightU16sZZ_clone(const struct LDKCOption_C2Tuple_EightU16sEightU16sZZ *NONNULL_PTR orig);
16624 * Frees the buffer pointed to by `data` if `datalen` is non-0.
16626 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
16629 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
16631 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
16634 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
16636 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
16639 * Checks if the given object is currently in the success state
16641 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
16644 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
16646 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
16649 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
16651 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
16654 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
16656 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
16659 * Checks if the given object is currently in the success state
16661 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
16664 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
16666 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
16669 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
16670 * but with all dynamically-allocated buffers duplicated in new buffers.
16672 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
16675 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
16677 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
16680 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
16682 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
16685 * Checks if the given object is currently in the success state
16687 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
16690 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
16692 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
16695 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
16696 * but with all dynamically-allocated buffers duplicated in new buffers.
16698 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
16701 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
16703 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
16706 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
16708 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
16711 * Checks if the given object is currently in the success state
16713 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
16716 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
16718 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
16721 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
16722 * but with all dynamically-allocated buffers duplicated in new buffers.
16724 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
16727 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state.
16729 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_ok(struct LDKInvoiceFeatures o);
16732 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
16734 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
16737 * Checks if the given object is currently in the success state
16739 bool CResult_InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
16742 * Frees any resources used by the CResult_InvoiceFeaturesDecodeErrorZ.
16744 void CResult_InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceFeaturesDecodeErrorZ _res);
16747 * Creates a new CResult_InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
16748 * but with all dynamically-allocated buffers duplicated in new buffers.
16750 struct LDKCResult_InvoiceFeaturesDecodeErrorZ CResult_InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
16753 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
16755 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
16758 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
16760 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
16763 * Checks if the given object is currently in the success state
16765 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
16768 * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
16770 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
16773 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
16774 * but with all dynamically-allocated buffers duplicated in new buffers.
16776 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
16779 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
16781 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
16784 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
16786 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
16789 * Checks if the given object is currently in the success state
16791 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
16794 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
16796 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
16799 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
16800 * but with all dynamically-allocated buffers duplicated in new buffers.
16802 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
16805 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
16807 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
16810 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
16812 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
16815 * Checks if the given object is currently in the success state
16817 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
16820 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
16822 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
16825 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
16826 * but with all dynamically-allocated buffers duplicated in new buffers.
16828 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
16831 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
16833 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
16836 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
16838 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
16841 * Checks if the given object is currently in the success state
16843 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
16846 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
16848 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
16851 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
16852 * but with all dynamically-allocated buffers duplicated in new buffers.
16854 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
16857 * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
16859 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
16862 * Constructs a new COption_UtxoLookupZ containing nothing
16864 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
16867 * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
16869 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
16872 * Creates a new CResult_boolLightningErrorZ in the success state.
16874 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
16877 * Creates a new CResult_boolLightningErrorZ in the error state.
16879 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
16882 * Checks if the given object is currently in the success state
16884 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
16887 * Frees any resources used by the CResult_boolLightningErrorZ.
16889 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
16892 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
16893 * but with all dynamically-allocated buffers duplicated in new buffers.
16895 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
16898 * Creates a new tuple which has the same data as `orig`
16899 * but with all dynamically-allocated buffers duplicated in new buffers.
16901 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
16904 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
16906 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
16909 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
16911 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
16914 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
16916 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
16919 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
16921 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
16924 * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
16926 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
16929 * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
16930 * but with all dynamically-allocated buffers duplicated in new buffers.
16932 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
16935 * Creates a new CResult_NoneLightningErrorZ in the success state.
16937 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
16940 * Creates a new CResult_NoneLightningErrorZ in the error state.
16942 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
16945 * Checks if the given object is currently in the success state
16947 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
16950 * Frees any resources used by the CResult_NoneLightningErrorZ.
16952 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
16955 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
16956 * but with all dynamically-allocated buffers duplicated in new buffers.
16958 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
16961 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
16963 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
16966 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
16968 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
16971 * Checks if the given object is currently in the success state
16973 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
16976 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
16978 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
16981 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
16982 * but with all dynamically-allocated buffers duplicated in new buffers.
16984 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
16987 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
16989 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
16992 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
16994 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
16997 * Checks if the given object is currently in the success state
16999 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
17002 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
17004 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
17007 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
17008 * but with all dynamically-allocated buffers duplicated in new buffers.
17010 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
17013 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
17015 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
17018 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
17020 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
17023 * Checks if the given object is currently in the success state
17025 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
17028 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
17030 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
17033 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
17034 * but with all dynamically-allocated buffers duplicated in new buffers.
17036 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
17039 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17041 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
17044 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
17046 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
17049 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
17051 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
17054 * Checks if the given object is currently in the success state
17056 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
17059 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
17061 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
17064 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
17065 * but with all dynamically-allocated buffers duplicated in new buffers.
17067 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
17070 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
17072 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
17075 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
17077 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
17080 * Checks if the given object is currently in the success state
17082 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
17085 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
17087 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
17090 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
17091 * but with all dynamically-allocated buffers duplicated in new buffers.
17093 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
17096 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
17098 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
17101 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
17103 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
17106 * Checks if the given object is currently in the success state
17108 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
17111 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
17113 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
17116 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
17117 * but with all dynamically-allocated buffers duplicated in new buffers.
17119 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
17122 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
17124 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
17127 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
17129 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
17132 * Checks if the given object is currently in the success state
17134 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
17137 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
17139 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
17142 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
17144 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
17147 * Constructs a new COption_CVec_NetAddressZZ containing nothing
17149 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
17152 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
17154 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
17157 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
17158 * but with all dynamically-allocated buffers duplicated in new buffers.
17160 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
17163 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
17165 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
17168 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
17170 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
17173 * Checks if the given object is currently in the success state
17175 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
17178 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
17180 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
17183 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
17184 * but with all dynamically-allocated buffers duplicated in new buffers.
17186 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
17189 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
17191 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
17194 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
17196 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
17199 * Checks if the given object is currently in the success state
17201 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
17204 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
17206 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
17209 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
17210 * but with all dynamically-allocated buffers duplicated in new buffers.
17212 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
17215 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
17217 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
17220 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
17222 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
17225 * Checks if the given object is currently in the success state
17227 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
17230 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
17232 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
17235 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
17236 * but with all dynamically-allocated buffers duplicated in new buffers.
17238 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
17241 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17243 void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res);
17246 * Creates a new tuple which has the same data as `orig`
17247 * but with all dynamically-allocated buffers duplicated in new buffers.
17249 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
17252 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
17254 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
17257 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
17259 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
17262 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
17264 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
17267 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
17269 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
17272 * Checks if the given object is currently in the success state
17274 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
17277 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
17279 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
17282 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
17283 * but with all dynamically-allocated buffers duplicated in new buffers.
17285 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
17288 * Creates a new CResult_SignatureNoneZ in the success state.
17290 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
17293 * Creates a new CResult_SignatureNoneZ in the error state.
17295 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
17298 * Checks if the given object is currently in the success state
17300 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
17303 * Frees any resources used by the CResult_SignatureNoneZ.
17305 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
17308 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
17309 * but with all dynamically-allocated buffers duplicated in new buffers.
17311 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
17314 * Creates a new CResult_PublicKeyNoneZ in the success state.
17316 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
17319 * Creates a new CResult_PublicKeyNoneZ in the error state.
17321 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
17324 * Checks if the given object is currently in the success state
17326 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
17329 * Frees any resources used by the CResult_PublicKeyNoneZ.
17331 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
17334 * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
17335 * but with all dynamically-allocated buffers duplicated in new buffers.
17337 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
17340 * Constructs a new COption_ScalarZ containing a crate::c_types::BigEndianScalar
17342 struct LDKCOption_ScalarZ COption_ScalarZ_some(struct LDKBigEndianScalar o);
17345 * Constructs a new COption_ScalarZ containing nothing
17347 struct LDKCOption_ScalarZ COption_ScalarZ_none(void);
17350 * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
17352 void COption_ScalarZ_free(struct LDKCOption_ScalarZ _res);
17355 * Creates a new CResult_SharedSecretNoneZ in the success state.
17357 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
17360 * Creates a new CResult_SharedSecretNoneZ in the error state.
17362 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_err(void);
17365 * Checks if the given object is currently in the success state
17367 bool CResult_SharedSecretNoneZ_is_ok(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR o);
17370 * Frees any resources used by the CResult_SharedSecretNoneZ.
17372 void CResult_SharedSecretNoneZ_free(struct LDKCResult_SharedSecretNoneZ _res);
17375 * Creates a new CResult_SharedSecretNoneZ which has the same data as `orig`
17376 * but with all dynamically-allocated buffers duplicated in new buffers.
17378 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_clone(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR orig);
17381 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17383 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
17386 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
17388 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
17391 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
17393 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
17396 * Checks if the given object is currently in the success state
17398 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
17401 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
17403 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
17406 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
17407 * but with all dynamically-allocated buffers duplicated in new buffers.
17409 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
17412 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
17414 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
17417 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
17419 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
17422 * Checks if the given object is currently in the success state
17424 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
17427 * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
17429 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
17432 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17434 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
17437 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17439 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
17442 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
17444 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
17447 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
17449 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
17452 * Checks if the given object is currently in the success state
17454 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
17457 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
17459 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
17462 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
17463 * but with all dynamically-allocated buffers duplicated in new buffers.
17465 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
17468 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
17470 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
17473 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
17475 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
17478 * Checks if the given object is currently in the success state
17480 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
17483 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
17485 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
17488 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
17489 * but with all dynamically-allocated buffers duplicated in new buffers.
17491 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
17494 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17496 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
17499 * Creates a new CResult_TransactionNoneZ in the success state.
17501 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
17504 * Creates a new CResult_TransactionNoneZ in the error state.
17506 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
17509 * Checks if the given object is currently in the success state
17511 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
17514 * Frees any resources used by the CResult_TransactionNoneZ.
17516 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
17519 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
17520 * but with all dynamically-allocated buffers duplicated in new buffers.
17522 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
17525 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
17527 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
17530 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
17532 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
17535 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17537 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
17540 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
17542 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
17545 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
17547 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
17550 * Checks if the given object is currently in the success state
17552 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
17555 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
17557 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
17560 * Constructs a new COption_u16Z containing a u16
17562 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
17565 * Constructs a new COption_u16Z containing nothing
17567 struct LDKCOption_u16Z COption_u16Z_none(void);
17570 * Frees any resources associated with the u16, if we are in the Some state
17572 void COption_u16Z_free(struct LDKCOption_u16Z _res);
17575 * Creates a new COption_u16Z which has the same data as `orig`
17576 * but with all dynamically-allocated buffers duplicated in new buffers.
17578 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
17581 * Creates a new CResult__u832APIErrorZ in the success state.
17583 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
17586 * Creates a new CResult__u832APIErrorZ in the error state.
17588 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
17591 * Checks if the given object is currently in the success state
17593 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
17596 * Frees any resources used by the CResult__u832APIErrorZ.
17598 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
17601 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
17602 * but with all dynamically-allocated buffers duplicated in new buffers.
17604 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
17607 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17609 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
17612 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
17614 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
17617 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
17619 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
17622 * Checks if the given object is currently in the success state
17624 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
17627 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
17629 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
17632 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
17633 * but with all dynamically-allocated buffers duplicated in new buffers.
17635 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
17638 * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
17640 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
17643 * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
17645 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
17648 * Checks if the given object is currently in the success state
17650 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
17653 * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
17655 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
17658 * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
17659 * but with all dynamically-allocated buffers duplicated in new buffers.
17661 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
17664 * Creates a new CResult_PaymentHashPaymentSendFailureZ in the success state.
17666 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
17669 * Creates a new CResult_PaymentHashPaymentSendFailureZ in the error state.
17671 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
17674 * Checks if the given object is currently in the success state
17676 bool CResult_PaymentHashPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR o);
17679 * Frees any resources used by the CResult_PaymentHashPaymentSendFailureZ.
17681 void CResult_PaymentHashPaymentSendFailureZ_free(struct LDKCResult_PaymentHashPaymentSendFailureZ _res);
17684 * Creates a new CResult_PaymentHashPaymentSendFailureZ which has the same data as `orig`
17685 * but with all dynamically-allocated buffers duplicated in new buffers.
17687 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_clone(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR orig);
17690 * Creates a new CResult_PaymentHashRetryableSendFailureZ in the success state.
17692 struct LDKCResult_PaymentHashRetryableSendFailureZ CResult_PaymentHashRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
17695 * Creates a new CResult_PaymentHashRetryableSendFailureZ in the error state.
17697 struct LDKCResult_PaymentHashRetryableSendFailureZ CResult_PaymentHashRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
17700 * Checks if the given object is currently in the success state
17702 bool CResult_PaymentHashRetryableSendFailureZ_is_ok(const struct LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR o);
17705 * Frees any resources used by the CResult_PaymentHashRetryableSendFailureZ.
17707 void CResult_PaymentHashRetryableSendFailureZ_free(struct LDKCResult_PaymentHashRetryableSendFailureZ _res);
17710 * Creates a new CResult_PaymentHashRetryableSendFailureZ which has the same data as `orig`
17711 * but with all dynamically-allocated buffers duplicated in new buffers.
17713 struct LDKCResult_PaymentHashRetryableSendFailureZ CResult_PaymentHashRetryableSendFailureZ_clone(const struct LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR orig);
17716 * Creates a new tuple which has the same data as `orig`
17717 * but with all dynamically-allocated buffers duplicated in new buffers.
17719 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
17722 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
17724 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
17727 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
17729 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
17732 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
17734 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
17737 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
17739 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
17742 * Checks if the given object is currently in the success state
17744 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
17747 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
17749 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
17752 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
17753 * but with all dynamically-allocated buffers duplicated in new buffers.
17755 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
17758 * Frees the buffer pointed to by `data` if `datalen` is non-0.
17760 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
17763 * Creates a new tuple which has the same data as `orig`
17764 * but with all dynamically-allocated buffers duplicated in new buffers.
17766 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
17769 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
17771 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
17774 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
17776 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
17779 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
17781 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
17784 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
17786 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
17789 * Checks if the given object is currently in the success state
17791 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
17794 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
17796 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
17799 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
17800 * but with all dynamically-allocated buffers duplicated in new buffers.
17802 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
17805 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state.
17807 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
17810 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state.
17812 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(struct LDKAPIError e);
17815 * Checks if the given object is currently in the success state
17817 bool CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR o);
17820 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.
17822 void CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res);
17825 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ which has the same data as `orig`
17826 * but with all dynamically-allocated buffers duplicated in new buffers.
17828 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR orig);
17831 * Creates a new CResult_PaymentSecretNoneZ in the success state.
17833 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
17836 * Creates a new CResult_PaymentSecretNoneZ in the error state.
17838 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
17841 * Checks if the given object is currently in the success state
17843 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
17846 * Frees any resources used by the CResult_PaymentSecretNoneZ.
17848 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
17851 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
17852 * but with all dynamically-allocated buffers duplicated in new buffers.
17854 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
17857 * Creates a new CResult_PaymentSecretAPIErrorZ in the success state.
17859 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
17862 * Creates a new CResult_PaymentSecretAPIErrorZ in the error state.
17864 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_err(struct LDKAPIError e);
17867 * Checks if the given object is currently in the success state
17869 bool CResult_PaymentSecretAPIErrorZ_is_ok(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR o);
17872 * Frees any resources used by the CResult_PaymentSecretAPIErrorZ.
17874 void CResult_PaymentSecretAPIErrorZ_free(struct LDKCResult_PaymentSecretAPIErrorZ _res);
17877 * Creates a new CResult_PaymentSecretAPIErrorZ which has the same data as `orig`
17878 * but with all dynamically-allocated buffers duplicated in new buffers.
17880 struct LDKCResult_PaymentSecretAPIErrorZ CResult_PaymentSecretAPIErrorZ_clone(const struct LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR orig);
17883 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
17885 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
17888 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
17890 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
17893 * Checks if the given object is currently in the success state
17895 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
17898 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
17900 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
17903 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
17904 * but with all dynamically-allocated buffers duplicated in new buffers.
17906 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
17909 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
17911 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
17914 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
17916 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
17919 * Checks if the given object is currently in the success state
17921 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
17924 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
17926 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
17929 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
17930 * but with all dynamically-allocated buffers duplicated in new buffers.
17932 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
17935 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
17937 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
17940 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
17942 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
17945 * Checks if the given object is currently in the success state
17947 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
17950 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
17952 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
17955 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
17956 * but with all dynamically-allocated buffers duplicated in new buffers.
17958 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
17961 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
17963 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
17966 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
17968 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
17971 * Checks if the given object is currently in the success state
17973 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
17976 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
17978 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
17981 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
17982 * but with all dynamically-allocated buffers duplicated in new buffers.
17984 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
17987 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
17989 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
17992 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
17994 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
17997 * Checks if the given object is currently in the success state
17999 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
18002 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
18004 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
18007 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
18008 * but with all dynamically-allocated buffers duplicated in new buffers.
18010 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
18013 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18015 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
18018 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
18020 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
18023 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
18025 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
18028 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
18030 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
18033 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
18035 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
18038 * Checks if the given object is currently in the success state
18040 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
18043 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
18045 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
18048 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
18050 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
18053 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
18055 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
18058 * Checks if the given object is currently in the success state
18060 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
18063 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
18065 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
18068 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
18069 * but with all dynamically-allocated buffers duplicated in new buffers.
18071 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
18074 * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
18076 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
18079 * Constructs a new COption_APIErrorZ containing nothing
18081 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
18084 * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
18086 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
18089 * Creates a new COption_APIErrorZ which has the same data as `orig`
18090 * but with all dynamically-allocated buffers duplicated in new buffers.
18092 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
18095 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
18097 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
18100 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
18102 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
18105 * Checks if the given object is currently in the success state
18107 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
18110 * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
18112 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
18115 * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
18116 * but with all dynamically-allocated buffers duplicated in new buffers.
18118 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
18121 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
18123 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
18126 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
18128 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
18131 * Checks if the given object is currently in the success state
18133 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
18136 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
18138 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
18141 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
18142 * but with all dynamically-allocated buffers duplicated in new buffers.
18144 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
18147 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
18149 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
18152 * Constructs a new COption_TypeZ containing nothing
18154 struct LDKCOption_TypeZ COption_TypeZ_none(void);
18157 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
18159 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
18162 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
18164 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
18167 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
18169 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
18172 * Checks if the given object is currently in the success state
18174 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
18177 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
18179 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
18182 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
18184 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
18187 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
18189 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
18192 * Checks if the given object is currently in the success state
18194 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
18197 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
18199 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
18202 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
18203 * but with all dynamically-allocated buffers duplicated in new buffers.
18205 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
18208 * Creates a new CResult_NonePaymentErrorZ in the success state.
18210 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_ok(void);
18213 * Creates a new CResult_NonePaymentErrorZ in the error state.
18215 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_err(struct LDKPaymentError e);
18218 * Checks if the given object is currently in the success state
18220 bool CResult_NonePaymentErrorZ_is_ok(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR o);
18223 * Frees any resources used by the CResult_NonePaymentErrorZ.
18225 void CResult_NonePaymentErrorZ_free(struct LDKCResult_NonePaymentErrorZ _res);
18228 * Creates a new CResult_NonePaymentErrorZ which has the same data as `orig`
18229 * but with all dynamically-allocated buffers duplicated in new buffers.
18231 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_clone(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR orig);
18234 * Creates a new CResult_StringErrorZ in the success state.
18236 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
18239 * Creates a new CResult_StringErrorZ in the error state.
18241 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
18244 * Checks if the given object is currently in the success state
18246 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
18249 * Frees any resources used by the CResult_StringErrorZ.
18251 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
18254 * Creates a new CResult_StringErrorZ which has the same data as `orig`
18255 * but with all dynamically-allocated buffers duplicated in new buffers.
18257 struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig);
18260 * Creates a new CResult_PublicKeyErrorZ in the success state.
18262 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
18265 * Creates a new CResult_PublicKeyErrorZ in the error state.
18267 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
18270 * Checks if the given object is currently in the success state
18272 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
18275 * Frees any resources used by the CResult_PublicKeyErrorZ.
18277 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
18280 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
18281 * but with all dynamically-allocated buffers duplicated in new buffers.
18283 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
18286 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
18288 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
18291 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
18293 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
18296 * Checks if the given object is currently in the success state
18298 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
18301 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
18303 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
18306 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
18307 * but with all dynamically-allocated buffers duplicated in new buffers.
18309 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
18312 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
18314 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
18317 * Constructs a new COption_MonitorEventZ containing nothing
18319 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
18322 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
18324 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
18327 * Creates a new COption_MonitorEventZ which has the same data as `orig`
18328 * but with all dynamically-allocated buffers duplicated in new buffers.
18330 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
18333 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
18335 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
18338 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
18340 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
18343 * Checks if the given object is currently in the success state
18345 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
18348 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
18350 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
18353 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
18354 * but with all dynamically-allocated buffers duplicated in new buffers.
18356 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
18359 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
18361 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
18364 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
18366 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
18369 * Checks if the given object is currently in the success state
18371 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
18374 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
18376 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
18379 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
18380 * but with all dynamically-allocated buffers duplicated in new buffers.
18382 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
18385 * Creates a new tuple which has the same data as `orig`
18386 * but with all dynamically-allocated buffers duplicated in new buffers.
18388 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
18391 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
18393 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
18396 * Frees any resources used by the C2Tuple_OutPointScriptZ.
18398 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
18401 * Creates a new tuple which has the same data as `orig`
18402 * but with all dynamically-allocated buffers duplicated in new buffers.
18404 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
18407 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
18409 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
18412 * Frees any resources used by the C2Tuple_u32ScriptZ.
18414 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
18417 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18419 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
18422 * Creates a new tuple which has the same data as `orig`
18423 * but with all dynamically-allocated buffers duplicated in new buffers.
18425 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
18428 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
18430 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
18433 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
18435 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
18438 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18440 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
18443 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18445 void CVec_EventZ_free(struct LDKCVec_EventZ _res);
18448 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18450 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
18453 * Creates a new tuple which has the same data as `orig`
18454 * but with all dynamically-allocated buffers duplicated in new buffers.
18456 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
18459 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
18461 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
18464 * Frees any resources used by the C2Tuple_u32TxOutZ.
18466 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
18469 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18471 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
18474 * Creates a new tuple which has the same data as `orig`
18475 * but with all dynamically-allocated buffers duplicated in new buffers.
18477 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
18480 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
18482 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
18485 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
18487 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
18490 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18492 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
18495 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18497 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
18500 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
18502 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
18505 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
18507 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
18510 * Checks if the given object is currently in the success state
18512 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
18515 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
18517 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
18520 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
18522 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
18525 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
18527 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
18530 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18532 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
18535 * Constructs a new COption_CustomOnionMessageContentsZ containing a crate::lightning::onion_message::packet::CustomOnionMessageContents
18537 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_some(struct LDKCustomOnionMessageContents o);
18540 * Constructs a new COption_CustomOnionMessageContentsZ containing nothing
18542 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_none(void);
18545 * Frees any resources associated with the crate::lightning::onion_message::packet::CustomOnionMessageContents, if we are in the Some state
18547 void COption_CustomOnionMessageContentsZ_free(struct LDKCOption_CustomOnionMessageContentsZ _res);
18550 * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the success state.
18552 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_CustomOnionMessageContentsZ o);
18555 * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the error state.
18557 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
18560 * Checks if the given object is currently in the success state
18562 bool CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
18565 * Frees any resources used by the CResult_COption_CustomOnionMessageContentsZDecodeErrorZ.
18567 void CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res);
18570 * Constructs a new COption_NetAddressZ containing a crate::lightning::ln::msgs::NetAddress
18572 struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o);
18575 * Constructs a new COption_NetAddressZ containing nothing
18577 struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void);
18580 * Frees any resources associated with the crate::lightning::ln::msgs::NetAddress, if we are in the Some state
18582 void COption_NetAddressZ_free(struct LDKCOption_NetAddressZ _res);
18585 * Creates a new COption_NetAddressZ which has the same data as `orig`
18586 * but with all dynamically-allocated buffers duplicated in new buffers.
18588 struct LDKCOption_NetAddressZ COption_NetAddressZ_clone(const struct LDKCOption_NetAddressZ *NONNULL_PTR orig);
18591 * Creates a new tuple which has the same data as `orig`
18592 * but with all dynamically-allocated buffers duplicated in new buffers.
18594 struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ C2Tuple_PublicKeyCOption_NetAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR orig);
18597 * Creates a new C2Tuple_PublicKeyCOption_NetAddressZZ from the contained elements.
18599 struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ C2Tuple_PublicKeyCOption_NetAddressZZ_new(struct LDKPublicKey a, struct LDKCOption_NetAddressZ b);
18602 * Frees any resources used by the C2Tuple_PublicKeyCOption_NetAddressZZ.
18604 void C2Tuple_PublicKeyCOption_NetAddressZZ_free(struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ _res);
18607 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18609 void CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ _res);
18612 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
18614 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
18617 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
18619 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
18622 * Checks if the given object is currently in the success state
18624 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
18627 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
18629 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
18632 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
18633 * but with all dynamically-allocated buffers duplicated in new buffers.
18635 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
18638 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
18640 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
18643 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
18645 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
18648 * Checks if the given object is currently in the success state
18650 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
18653 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
18655 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
18658 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
18659 * but with all dynamically-allocated buffers duplicated in new buffers.
18661 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
18664 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
18666 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
18669 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
18671 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
18674 * Checks if the given object is currently in the success state
18676 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
18679 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
18681 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
18684 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
18685 * but with all dynamically-allocated buffers duplicated in new buffers.
18687 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
18690 * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
18692 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
18695 * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
18697 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
18700 * Checks if the given object is currently in the success state
18702 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
18705 * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
18707 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
18710 * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
18711 * but with all dynamically-allocated buffers duplicated in new buffers.
18713 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
18716 * Creates a new CResult_NoneSendErrorZ in the success state.
18718 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void);
18721 * Creates a new CResult_NoneSendErrorZ in the error state.
18723 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e);
18726 * Checks if the given object is currently in the success state
18728 bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o);
18731 * Frees any resources used by the CResult_NoneSendErrorZ.
18733 void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res);
18736 * Creates a new CResult_SiPrefixParseErrorZ in the success state.
18738 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o);
18741 * Creates a new CResult_SiPrefixParseErrorZ in the error state.
18743 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e);
18746 * Checks if the given object is currently in the success state
18748 bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o);
18751 * Frees any resources used by the CResult_SiPrefixParseErrorZ.
18753 void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res);
18756 * Creates a new CResult_SiPrefixParseErrorZ which has the same data as `orig`
18757 * but with all dynamically-allocated buffers duplicated in new buffers.
18759 struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig);
18762 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the success state.
18764 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o);
18767 * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the error state.
18769 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
18772 * Checks if the given object is currently in the success state
18774 bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
18777 * Frees any resources used by the CResult_InvoiceParseOrSemanticErrorZ.
18779 void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res);
18782 * Creates a new CResult_InvoiceParseOrSemanticErrorZ which has the same data as `orig`
18783 * but with all dynamically-allocated buffers duplicated in new buffers.
18785 struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
18788 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the success state.
18790 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o);
18793 * Creates a new CResult_SignedRawInvoiceParseErrorZ in the error state.
18795 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e);
18798 * Checks if the given object is currently in the success state
18800 bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o);
18803 * Frees any resources used by the CResult_SignedRawInvoiceParseErrorZ.
18805 void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res);
18808 * Creates a new CResult_SignedRawInvoiceParseErrorZ which has the same data as `orig`
18809 * but with all dynamically-allocated buffers duplicated in new buffers.
18811 struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig);
18814 * Creates a new tuple which has the same data as `orig`
18815 * but with all dynamically-allocated buffers duplicated in new buffers.
18817 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig);
18820 * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements.
18822 struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c);
18825 * Frees any resources used by the C3Tuple_RawInvoice_u832InvoiceSignatureZ.
18827 void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res);
18830 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
18832 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
18835 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
18837 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
18840 * Checks if the given object is currently in the success state
18842 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
18845 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
18847 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
18850 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
18851 * but with all dynamically-allocated buffers duplicated in new buffers.
18853 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
18856 * Frees the buffer pointed to by `data` if `datalen` is non-0.
18858 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
18861 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
18863 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
18866 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
18868 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
18871 * Checks if the given object is currently in the success state
18873 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
18876 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
18878 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
18881 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
18882 * but with all dynamically-allocated buffers duplicated in new buffers.
18884 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
18887 * Creates a new CResult_NoneSemanticErrorZ in the success state.
18889 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void);
18892 * Creates a new CResult_NoneSemanticErrorZ in the error state.
18894 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e);
18897 * Checks if the given object is currently in the success state
18899 bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o);
18902 * Frees any resources used by the CResult_NoneSemanticErrorZ.
18904 void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res);
18907 * Creates a new CResult_NoneSemanticErrorZ which has the same data as `orig`
18908 * but with all dynamically-allocated buffers duplicated in new buffers.
18910 struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig);
18913 * Creates a new CResult_InvoiceSemanticErrorZ in the success state.
18915 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o);
18918 * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
18920 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e);
18923 * Checks if the given object is currently in the success state
18925 bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o);
18928 * Frees any resources used by the CResult_InvoiceSemanticErrorZ.
18930 void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res);
18933 * Creates a new CResult_InvoiceSemanticErrorZ which has the same data as `orig`
18934 * but with all dynamically-allocated buffers duplicated in new buffers.
18936 struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig);
18939 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
18941 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
18944 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
18946 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
18949 * Checks if the given object is currently in the success state
18951 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
18954 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
18956 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
18959 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
18960 * but with all dynamically-allocated buffers duplicated in new buffers.
18962 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
18965 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
18967 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
18970 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
18972 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
18975 * Checks if the given object is currently in the success state
18977 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
18980 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
18982 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
18985 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
18986 * but with all dynamically-allocated buffers duplicated in new buffers.
18988 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
18991 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
18993 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
18996 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
18998 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
19001 * Checks if the given object is currently in the success state
19003 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
19006 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
19008 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
19011 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
19013 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
19016 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
19018 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
19021 * Checks if the given object is currently in the success state
19023 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
19026 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
19028 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
19031 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
19032 * but with all dynamically-allocated buffers duplicated in new buffers.
19034 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
19037 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19039 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
19042 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19044 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
19047 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19049 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
19052 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19054 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
19057 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
19059 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
19062 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
19064 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
19067 * Checks if the given object is currently in the success state
19069 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
19072 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
19074 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
19077 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
19078 * but with all dynamically-allocated buffers duplicated in new buffers.
19080 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
19083 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
19085 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
19088 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
19090 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
19093 * Checks if the given object is currently in the success state
19095 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
19098 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
19100 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
19103 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
19104 * but with all dynamically-allocated buffers duplicated in new buffers.
19106 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
19109 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
19111 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
19114 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
19116 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
19119 * Checks if the given object is currently in the success state
19121 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
19124 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
19126 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
19129 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
19130 * but with all dynamically-allocated buffers duplicated in new buffers.
19132 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
19135 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
19137 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
19140 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
19142 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
19145 * Checks if the given object is currently in the success state
19147 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
19150 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
19152 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
19155 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
19156 * but with all dynamically-allocated buffers duplicated in new buffers.
19158 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
19161 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
19163 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
19166 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
19168 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
19171 * Checks if the given object is currently in the success state
19173 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
19176 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
19178 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
19181 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
19182 * but with all dynamically-allocated buffers duplicated in new buffers.
19184 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
19187 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
19189 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
19192 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
19194 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
19197 * Checks if the given object is currently in the success state
19199 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
19202 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
19204 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
19207 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
19208 * but with all dynamically-allocated buffers duplicated in new buffers.
19210 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
19213 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
19215 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
19218 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
19220 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
19223 * Checks if the given object is currently in the success state
19225 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
19228 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
19230 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
19233 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
19234 * but with all dynamically-allocated buffers duplicated in new buffers.
19236 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
19239 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
19241 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
19244 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
19246 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
19249 * Checks if the given object is currently in the success state
19251 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
19254 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
19256 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
19259 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
19260 * but with all dynamically-allocated buffers duplicated in new buffers.
19262 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
19265 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
19267 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
19270 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
19272 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
19275 * Checks if the given object is currently in the success state
19277 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
19280 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
19282 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
19285 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
19286 * but with all dynamically-allocated buffers duplicated in new buffers.
19288 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
19291 * Creates a new CResult_InitDecodeErrorZ in the success state.
19293 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
19296 * Creates a new CResult_InitDecodeErrorZ in the error state.
19298 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
19301 * Checks if the given object is currently in the success state
19303 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
19306 * Frees any resources used by the CResult_InitDecodeErrorZ.
19308 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
19311 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
19312 * but with all dynamically-allocated buffers duplicated in new buffers.
19314 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
19317 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
19319 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
19322 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
19324 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
19327 * Checks if the given object is currently in the success state
19329 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
19332 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
19334 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
19337 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
19338 * but with all dynamically-allocated buffers duplicated in new buffers.
19340 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
19343 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
19345 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
19348 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
19350 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
19353 * Checks if the given object is currently in the success state
19355 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
19358 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
19360 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
19363 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
19364 * but with all dynamically-allocated buffers duplicated in new buffers.
19366 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
19369 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
19371 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
19374 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
19376 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
19379 * Checks if the given object is currently in the success state
19381 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
19384 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
19386 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
19389 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
19390 * but with all dynamically-allocated buffers duplicated in new buffers.
19392 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
19395 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
19397 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
19400 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
19402 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
19405 * Checks if the given object is currently in the success state
19407 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
19410 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
19412 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
19415 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
19416 * but with all dynamically-allocated buffers duplicated in new buffers.
19418 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
19421 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
19423 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
19426 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
19428 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
19431 * Checks if the given object is currently in the success state
19433 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
19436 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
19438 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
19441 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
19442 * but with all dynamically-allocated buffers duplicated in new buffers.
19444 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
19447 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
19449 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
19452 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
19454 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
19457 * Checks if the given object is currently in the success state
19459 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
19462 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
19464 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
19467 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
19468 * but with all dynamically-allocated buffers duplicated in new buffers.
19470 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
19473 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
19475 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
19478 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
19480 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
19483 * Checks if the given object is currently in the success state
19485 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
19488 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
19490 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
19493 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
19494 * but with all dynamically-allocated buffers duplicated in new buffers.
19496 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
19499 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
19501 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
19504 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
19506 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
19509 * Checks if the given object is currently in the success state
19511 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
19514 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
19516 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
19519 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
19520 * but with all dynamically-allocated buffers duplicated in new buffers.
19522 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
19525 * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
19527 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
19530 * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
19532 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
19535 * Checks if the given object is currently in the success state
19537 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
19540 * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
19542 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
19545 * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
19546 * but with all dynamically-allocated buffers duplicated in new buffers.
19548 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
19551 * Creates a new CResult_PingDecodeErrorZ in the success state.
19553 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
19556 * Creates a new CResult_PingDecodeErrorZ in the error state.
19558 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
19561 * Checks if the given object is currently in the success state
19563 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
19566 * Frees any resources used by the CResult_PingDecodeErrorZ.
19568 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
19571 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
19572 * but with all dynamically-allocated buffers duplicated in new buffers.
19574 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
19577 * Creates a new CResult_PongDecodeErrorZ in the success state.
19579 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
19582 * Creates a new CResult_PongDecodeErrorZ in the error state.
19584 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
19587 * Checks if the given object is currently in the success state
19589 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
19592 * Frees any resources used by the CResult_PongDecodeErrorZ.
19594 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
19597 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
19598 * but with all dynamically-allocated buffers duplicated in new buffers.
19600 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
19603 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
19605 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
19608 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
19610 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
19613 * Checks if the given object is currently in the success state
19615 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
19618 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
19620 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
19623 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
19624 * but with all dynamically-allocated buffers duplicated in new buffers.
19626 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
19629 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
19631 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
19634 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
19636 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
19639 * Checks if the given object is currently in the success state
19641 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
19644 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
19646 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
19649 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
19650 * but with all dynamically-allocated buffers duplicated in new buffers.
19652 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
19655 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
19657 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
19660 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
19662 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
19665 * Checks if the given object is currently in the success state
19667 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
19670 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
19672 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
19675 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
19676 * but with all dynamically-allocated buffers duplicated in new buffers.
19678 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
19681 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
19683 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
19686 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
19688 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
19691 * Checks if the given object is currently in the success state
19693 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
19696 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
19698 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
19701 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
19702 * but with all dynamically-allocated buffers duplicated in new buffers.
19704 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
19707 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
19709 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
19712 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
19714 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
19717 * Checks if the given object is currently in the success state
19719 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
19722 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
19724 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
19727 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
19728 * but with all dynamically-allocated buffers duplicated in new buffers.
19730 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
19733 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
19735 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
19738 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
19740 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
19743 * Checks if the given object is currently in the success state
19745 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
19748 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
19750 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
19753 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
19754 * but with all dynamically-allocated buffers duplicated in new buffers.
19756 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
19759 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
19761 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
19764 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
19766 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
19769 * Checks if the given object is currently in the success state
19771 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
19774 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
19776 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
19779 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
19780 * but with all dynamically-allocated buffers duplicated in new buffers.
19782 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
19785 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
19787 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
19790 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
19792 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
19795 * Checks if the given object is currently in the success state
19797 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
19800 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
19802 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
19805 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
19806 * but with all dynamically-allocated buffers duplicated in new buffers.
19808 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
19811 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
19813 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
19816 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
19818 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
19821 * Checks if the given object is currently in the success state
19823 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
19826 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
19828 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
19831 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
19832 * but with all dynamically-allocated buffers duplicated in new buffers.
19834 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
19837 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
19839 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
19842 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
19844 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
19847 * Checks if the given object is currently in the success state
19849 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
19852 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
19854 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
19857 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
19858 * but with all dynamically-allocated buffers duplicated in new buffers.
19860 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
19863 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
19865 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
19868 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
19870 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
19873 * Checks if the given object is currently in the success state
19875 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
19878 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
19880 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
19883 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
19884 * but with all dynamically-allocated buffers duplicated in new buffers.
19886 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
19889 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
19891 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
19894 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
19896 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
19899 * Checks if the given object is currently in the success state
19901 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
19904 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
19906 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
19909 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
19910 * but with all dynamically-allocated buffers duplicated in new buffers.
19912 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
19915 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
19917 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
19920 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
19922 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
19925 * Checks if the given object is currently in the success state
19927 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
19930 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
19932 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
19935 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
19936 * but with all dynamically-allocated buffers duplicated in new buffers.
19938 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
19941 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19943 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
19946 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state.
19948 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_ok(struct LDKInvoice o);
19951 * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state.
19953 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
19956 * Checks if the given object is currently in the success state
19958 bool CResult_InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
19961 * Frees any resources used by the CResult_InvoiceSignOrCreationErrorZ.
19963 void CResult_InvoiceSignOrCreationErrorZ_free(struct LDKCResult_InvoiceSignOrCreationErrorZ _res);
19966 * Creates a new CResult_InvoiceSignOrCreationErrorZ which has the same data as `orig`
19967 * but with all dynamically-allocated buffers duplicated in new buffers.
19969 struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
19972 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
19974 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
19977 * Constructs a new COption_FilterZ containing nothing
19979 struct LDKCOption_FilterZ COption_FilterZ_none(void);
19982 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
19984 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
19987 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
19989 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
19992 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
19994 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
19997 * Checks if the given object is currently in the success state
19999 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
20002 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
20004 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
20007 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20009 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
20012 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20014 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
20017 * Creates a new tuple which has the same data as `orig`
20018 * but with all dynamically-allocated buffers duplicated in new buffers.
20020 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
20023 * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
20025 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
20028 * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
20030 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
20033 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20035 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
20038 * Frees any resources used by the PaymentPurpose
20040 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
20043 * Creates a copy of the PaymentPurpose
20045 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
20048 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
20050 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret);
20053 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
20055 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
20058 * Checks if two PaymentPurposes contain equal inner contents.
20059 * This ignores pointers and is_owned flags and looks at the values in fields.
20061 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
20064 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
20066 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
20069 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
20071 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
20074 * Frees any resources used by the PathFailure
20076 void PathFailure_free(struct LDKPathFailure this_ptr);
20079 * Creates a copy of the PathFailure
20081 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
20084 * Utility method to constructs a new InitialSend-variant PathFailure
20086 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
20089 * Utility method to constructs a new OnPath-variant PathFailure
20091 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
20094 * Checks if two PathFailures contain equal inner contents.
20095 * This ignores pointers and is_owned flags and looks at the values in fields.
20097 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
20100 * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
20102 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
20105 * Read a PathFailure from a byte array, created by PathFailure_write
20107 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
20110 * Frees any resources used by the ClosureReason
20112 void ClosureReason_free(struct LDKClosureReason this_ptr);
20115 * Creates a copy of the ClosureReason
20117 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
20120 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
20122 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKStr peer_msg);
20125 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
20127 struct LDKClosureReason ClosureReason_holder_force_closed(void);
20130 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
20132 struct LDKClosureReason ClosureReason_cooperative_closure(void);
20135 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
20137 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
20140 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
20142 struct LDKClosureReason ClosureReason_funding_timed_out(void);
20145 * Utility method to constructs a new ProcessingError-variant ClosureReason
20147 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
20150 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
20152 struct LDKClosureReason ClosureReason_disconnected_peer(void);
20155 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
20157 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
20160 * Checks if two ClosureReasons contain equal inner contents.
20161 * This ignores pointers and is_owned flags and looks at the values in fields.
20163 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
20166 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
20168 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
20171 * Read a ClosureReason from a byte array, created by ClosureReason_write
20173 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
20176 * Frees any resources used by the HTLCDestination
20178 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
20181 * Creates a copy of the HTLCDestination
20183 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
20186 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
20188 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
20191 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
20193 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
20196 * Utility method to constructs a new InvalidForward-variant HTLCDestination
20198 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
20201 * Utility method to constructs a new FailedPayment-variant HTLCDestination
20203 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
20206 * Checks if two HTLCDestinations contain equal inner contents.
20207 * This ignores pointers and is_owned flags and looks at the values in fields.
20209 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
20212 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
20214 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
20217 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
20219 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
20222 * Frees any resources used by the Event
20224 void Event_free(struct LDKEvent this_ptr);
20227 * Creates a copy of the Event
20229 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
20232 * Utility method to constructs a new FundingGenerationReady-variant Event
20234 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);
20237 * Utility method to constructs a new PaymentClaimable-variant Event
20239 struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose, struct LDKThirtyTwoBytes via_channel_id, struct LDKCOption_u128Z via_user_channel_id);
20242 * Utility method to constructs a new PaymentClaimed-variant Event
20244 struct LDKEvent Event_payment_claimed(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
20247 * Utility method to constructs a new PaymentSent-variant Event
20249 struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
20252 * Utility method to constructs a new PaymentFailed-variant Event
20254 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
20257 * Utility method to constructs a new PaymentPathSuccessful-variant Event
20259 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
20262 * Utility method to constructs a new PaymentPathFailed-variant Event
20264 struct LDKEvent Event_payment_path_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, bool payment_failed_permanently, struct LDKPathFailure failure, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id, struct LDKRouteParameters retry);
20267 * Utility method to constructs a new ProbeSuccessful-variant Event
20269 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path);
20272 * Utility method to constructs a new ProbeFailed-variant Event
20274 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCVec_RouteHopZ path, struct LDKCOption_u64Z short_channel_id);
20277 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
20279 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
20282 * Utility method to constructs a new HTLCIntercepted-variant Event
20284 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);
20287 * Utility method to constructs a new SpendableOutputs-variant Event
20289 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
20292 * Utility method to constructs a new PaymentForwarded-variant Event
20294 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);
20297 * Utility method to constructs a new ChannelReady-variant Event
20299 struct LDKEvent Event_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
20302 * Utility method to constructs a new ChannelClosed-variant Event
20304 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason);
20307 * Utility method to constructs a new DiscardFunding-variant Event
20309 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
20312 * Utility method to constructs a new OpenChannelRequest-variant Event
20314 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);
20317 * Utility method to constructs a new HTLCHandlingFailed-variant Event
20319 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
20322 * Checks if two Events contain equal inner contents.
20323 * This ignores pointers and is_owned flags and looks at the values in fields.
20325 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
20328 * Serialize the Event object into a byte array which can be read by Event_read
20330 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
20333 * Read a Event from a byte array, created by Event_write
20335 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
20338 * Frees any resources used by the MessageSendEvent
20340 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
20343 * Creates a copy of the MessageSendEvent
20345 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
20348 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
20350 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
20353 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
20355 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
20358 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
20360 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
20363 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
20365 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
20368 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
20370 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
20373 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
20375 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
20378 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
20380 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
20383 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
20385 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
20388 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
20390 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
20393 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
20395 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
20398 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
20400 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
20403 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
20405 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
20408 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
20410 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
20413 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
20415 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
20418 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
20420 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
20423 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
20425 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
20428 * Utility method to constructs a new HandleError-variant MessageSendEvent
20430 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
20433 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
20435 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
20438 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
20440 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
20443 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
20445 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
20448 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
20450 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
20453 * Calls the free function if one is set
20455 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
20458 * Calls the free function if one is set
20460 void OnionMessageProvider_free(struct LDKOnionMessageProvider this_ptr);
20463 * Calls the free function if one is set
20465 void EventsProvider_free(struct LDKEventsProvider this_ptr);
20468 * Calls the free function if one is set
20470 void EventHandler_free(struct LDKEventHandler this_ptr);
20473 * Frees any resources used by the APIError
20475 void APIError_free(struct LDKAPIError this_ptr);
20478 * Creates a copy of the APIError
20480 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
20483 * Utility method to constructs a new APIMisuseError-variant APIError
20485 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
20488 * Utility method to constructs a new FeeRateTooHigh-variant APIError
20490 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
20493 * Utility method to constructs a new InvalidRoute-variant APIError
20495 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
20498 * Utility method to constructs a new ChannelUnavailable-variant APIError
20500 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
20503 * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
20505 struct LDKAPIError APIError_monitor_update_in_progress(void);
20508 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
20510 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
20513 * Checks if two APIErrors contain equal inner contents.
20514 * This ignores pointers and is_owned flags and looks at the values in fields.
20516 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
20519 * Serialize the APIError object into a byte array which can be read by APIError_read
20521 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
20524 * Read a APIError from a byte array, created by APIError_write
20526 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
20529 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
20531 void BigSize_free(struct LDKBigSize this_obj);
20533 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
20535 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
20538 * Constructs a new BigSize given each field
20540 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
20543 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
20545 void Hostname_free(struct LDKHostname this_obj);
20548 * Creates a copy of the Hostname
20550 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
20553 * Checks if two Hostnames contain equal inner contents.
20554 * This ignores pointers and is_owned flags and looks at the values in fields.
20555 * Two objects with NULL inner values will be considered "equal" here.
20557 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
20560 * Returns the length of the hostname.
20562 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
20565 * Creates a digital signature of a message given a SecretKey, like the node's secret.
20566 * 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.
20567 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
20569 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
20572 * Recovers the PublicKey of the signer of the message given the message and the signature.
20574 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
20577 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
20578 * and the PublicKey.
20580 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
20583 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
20585 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
20588 * Calls the free function if one is set
20590 void Persister_free(struct LDKPersister this_ptr);
20593 * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
20595 void PrintableString_free(struct LDKPrintableString this_obj);
20597 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
20599 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
20602 * Constructs a new PrintableString given each field
20604 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
20607 * Calls the free function if one is set
20609 void FutureCallback_free(struct LDKFutureCallback this_ptr);
20612 * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
20614 void Future_free(struct LDKFuture this_obj);
20617 * Registers a callback to be called upon completion of this future. If the future has already
20618 * completed, the callback will be called immediately.
20620 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
20623 * Creates a copy of the Level
20625 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
20628 * Utility method to constructs a new Gossip-variant Level
20630 enum LDKLevel Level_gossip(void);
20633 * Utility method to constructs a new Trace-variant Level
20635 enum LDKLevel Level_trace(void);
20638 * Utility method to constructs a new Debug-variant Level
20640 enum LDKLevel Level_debug(void);
20643 * Utility method to constructs a new Info-variant Level
20645 enum LDKLevel Level_info(void);
20648 * Utility method to constructs a new Warn-variant Level
20650 enum LDKLevel Level_warn(void);
20653 * Utility method to constructs a new Error-variant Level
20655 enum LDKLevel Level_error(void);
20658 * Checks if two Levels contain equal inner contents.
20659 * This ignores pointers and is_owned flags and looks at the values in fields.
20661 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
20664 * Checks if two Levels contain equal inner contents.
20666 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
20669 * Returns the most verbose logging level.
20671 MUST_USE_RES enum LDKLevel Level_max(void);
20674 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
20676 void Record_free(struct LDKRecord this_obj);
20679 * The verbosity level of the message.
20681 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
20684 * The verbosity level of the message.
20686 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
20689 * The message body.
20691 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
20694 * The message body.
20696 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
20699 * The module path of the message.
20701 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
20704 * The module path of the message.
20706 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
20709 * The source file containing the message.
20711 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
20714 * The source file containing the message.
20716 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
20719 * The line containing the message.
20721 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
20724 * The line containing the message.
20726 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
20729 * Creates a copy of the Record
20731 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
20734 * Calls the free function if one is set
20736 void Logger_free(struct LDKLogger this_ptr);
20739 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
20741 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
20744 * Confirmations we will wait for before considering the channel locked in.
20745 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
20746 * equivalent limit applied to outbound channels).
20748 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
20749 * transaction before operation. If you wish to accept channels with zero confirmations, see
20750 * [`UserConfig::manually_accept_inbound_channels`] and
20751 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
20753 * Default value: 6.
20755 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
20756 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
20758 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20761 * Confirmations we will wait for before considering the channel locked in.
20762 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
20763 * equivalent limit applied to outbound channels).
20765 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
20766 * transaction before operation. If you wish to accept channels with zero confirmations, see
20767 * [`UserConfig::manually_accept_inbound_channels`] and
20768 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
20770 * Default value: 6.
20772 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
20773 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
20775 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
20778 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
20779 * the number of blocks we have to punish our counterparty if they broadcast a revoked
20782 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
20783 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
20784 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
20785 * possibly with time in between to RBF the spending transaction).
20787 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
20788 * case of an honest unilateral channel close, which implicitly decrease the economic value of
20791 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
20792 * can tweak config to ask for more security, not less.
20794 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20797 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
20798 * the number of blocks we have to punish our counterparty if they broadcast a revoked
20801 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
20802 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
20803 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
20804 * possibly with time in between to RBF the spending transaction).
20806 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
20807 * case of an honest unilateral channel close, which implicitly decrease the economic value of
20810 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
20811 * can tweak config to ask for more security, not less.
20813 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
20816 * Set to the smallest value HTLC we will accept to process.
20818 * This value is sent to our counterparty on channel-open and we close the channel any time
20819 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
20821 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
20824 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20827 * Set to the smallest value HTLC we will accept to process.
20829 * This value is sent to our counterparty on channel-open and we close the channel any time
20830 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
20832 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
20835 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
20838 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
20841 * This can be set to a value between 1-100, where the value corresponds to the percent of the
20842 * channel value in whole percentages.
20845 * * If configured to another value than the default value 10, any new channels created with
20846 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
20847 * `ChannelManager`.
20849 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
20850 * no way to configure the cap for the total value of outbound HTLCs in-flight.
20852 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
20853 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
20854 * restrict exposure to loss due to being offline for too long.
20855 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
20856 * for more information.
20858 * Default value: 10.
20859 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
20860 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
20862 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20865 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
20868 * This can be set to a value between 1-100, where the value corresponds to the percent of the
20869 * channel value in whole percentages.
20872 * * If configured to another value than the default value 10, any new channels created with
20873 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
20874 * `ChannelManager`.
20876 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
20877 * no way to configure the cap for the total value of outbound HTLCs in-flight.
20879 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
20880 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
20881 * restrict exposure to loss due to being offline for too long.
20882 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
20883 * for more information.
20885 * Default value: 10.
20886 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
20887 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
20889 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
20892 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
20893 * BOLTs) option for outbound private channels. This provides better privacy by not including
20894 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
20895 * relay HTLCs to us using the channel's SCID alias.
20897 * If this option is set, channels may be created that will not be readable by LDK versions
20898 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
20899 * [`DecodeError::InvalidValue`].
20901 * Note that setting this to true does *not* prevent us from opening channels with
20902 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
20903 * private channel without that option.
20905 * Ignored if the channel is negotiated to be announced, see
20906 * [`ChannelHandshakeConfig::announced_channel`] and
20907 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
20909 * Default value: false. This value is likely to change to true in the future.
20911 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
20912 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
20914 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20917 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
20918 * BOLTs) option for outbound private channels. This provides better privacy by not including
20919 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
20920 * relay HTLCs to us using the channel's SCID alias.
20922 * If this option is set, channels may be created that will not be readable by LDK versions
20923 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
20924 * [`DecodeError::InvalidValue`].
20926 * Note that setting this to true does *not* prevent us from opening channels with
20927 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
20928 * private channel without that option.
20930 * Ignored if the channel is negotiated to be announced, see
20931 * [`ChannelHandshakeConfig::announced_channel`] and
20932 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
20934 * Default value: false. This value is likely to change to true in the future.
20936 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
20937 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
20939 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
20942 * Set to announce the channel publicly and notify all nodes that they can route via this
20945 * This should only be set to true for nodes which expect to be online reliably.
20947 * As the node which funds a channel picks this value this will only apply for new outbound
20948 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
20950 * Default value: false.
20952 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20955 * Set to announce the channel publicly and notify all nodes that they can route via this
20958 * This should only be set to true for nodes which expect to be online reliably.
20960 * As the node which funds a channel picks this value this will only apply for new outbound
20961 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
20963 * Default value: false.
20965 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
20968 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
20969 * supports it, they will then enforce the mutual-close output to us matches what we provided
20970 * at intialization, preventing us from closing to an alternate pubkey.
20972 * This is set to true by default to provide a slight increase in security, though ultimately
20973 * any attacker who is able to take control of a channel can just as easily send the funds via
20974 * lightning payments, so we never require that our counterparties support this option.
20976 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
20978 * Default value: true.
20980 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::SignerProvider::get_shutdown_scriptpubkey
20982 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
20985 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
20986 * supports it, they will then enforce the mutual-close output to us matches what we provided
20987 * at intialization, preventing us from closing to an alternate pubkey.
20989 * This is set to true by default to provide a slight increase in security, though ultimately
20990 * any attacker who is able to take control of a channel can just as easily send the funds via
20991 * lightning payments, so we never require that our counterparties support this option.
20993 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
20995 * Default value: true.
20997 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::SignerProvider::get_shutdown_scriptpubkey
20999 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
21002 * The Proportion of the channel value to configure as counterparty's channel reserve,
21003 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
21005 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
21006 * on their side, at all times.
21007 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
21008 * claiming at least this value on chain.
21010 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
21011 * amount can never be used for payments.
21012 * Also, if our selected channel reserve for counterparty and counterparty's selected
21013 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
21016 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
21017 * other than the default value.
21019 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
21020 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
21021 * as 1000 sats instead, which is a safe implementation-specific lower bound.
21022 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
21023 * instead, although channel negotiations will fail in that case.
21025 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
21028 * The Proportion of the channel value to configure as counterparty's channel reserve,
21029 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
21031 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
21032 * on their side, at all times.
21033 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
21034 * claiming at least this value on chain.
21036 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
21037 * amount can never be used for payments.
21038 * Also, if our selected channel reserve for counterparty and counterparty's selected
21039 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
21042 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
21043 * other than the default value.
21045 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
21046 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
21047 * as 1000 sats instead, which is a safe implementation-specific lower bound.
21048 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
21049 * instead, although channel negotiations will fail in that case.
21051 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
21054 * Constructs a new ChannelHandshakeConfig given each field
21056 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);
21059 * Creates a copy of the ChannelHandshakeConfig
21061 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
21064 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
21066 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
21069 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
21071 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
21074 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
21075 * only applies to inbound channels.
21077 * Default value: 0.
21079 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21082 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
21083 * only applies to inbound channels.
21085 * Default value: 0.
21087 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
21090 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
21091 * only applies to inbound channels.
21093 * Default value: 2^24 - 1.
21095 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21098 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
21099 * only applies to inbound channels.
21101 * Default value: 2^24 - 1.
21103 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
21106 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
21107 * you to limit the maximum minimum-size they can require.
21109 * Default value: u64::max_value.
21111 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21114 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
21115 * you to limit the maximum minimum-size they can require.
21117 * Default value: u64::max_value.
21119 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
21122 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
21123 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
21125 * Default value: 0.
21127 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21130 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
21131 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
21133 * Default value: 0.
21135 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
21138 * The remote node will require we keep a certain amount in direct payment to ourselves at all
21139 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
21140 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
21142 * Default value: u64::max_value.
21144 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21147 * The remote node will require we keep a certain amount in direct payment to ourselves at all
21148 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
21149 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
21151 * Default value: u64::max_value.
21153 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
21156 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
21157 * time. This allows you to set a minimum such value.
21159 * Default value: 0.
21161 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21164 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
21165 * time. This allows you to set a minimum such value.
21167 * Default value: 0.
21169 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
21172 * Before a channel is usable the funding transaction will need to be confirmed by at least a
21173 * certain number of blocks, specified by the node which is not the funder (as the funder can
21174 * assume they aren't going to double-spend themselves).
21175 * This config allows you to set a limit on the maximum amount of time to wait.
21177 * Default value: 144, or roughly one day and only applies to outbound channels.
21179 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21182 * Before a channel is usable the funding transaction will need to be confirmed by at least a
21183 * certain number of blocks, specified by the node which is not the funder (as the funder can
21184 * assume they aren't going to double-spend themselves).
21185 * This config allows you to set a limit on the maximum amount of time to wait.
21187 * Default value: 144, or roughly one day and only applies to outbound channels.
21189 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
21192 * Whether we implicitly trust funding transactions generated by us for our own outbound
21193 * channels to not be double-spent.
21195 * If this is set, we assume that our own funding transactions are *never* double-spent, and
21196 * thus we can trust them without any confirmations. This is generally a reasonable
21197 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
21198 * control of the signing keys).
21200 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
21201 * double-spend the funding transaction to RBF with an alternative channel open.
21203 * This only applies if our counterparty set their confirmations-required value to 0, and we
21204 * always trust our own funding transaction at 1 confirmation irrespective of this value.
21205 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
21206 * `true` (0) and `false` (1).
21208 * Default value: true
21210 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21213 * Whether we implicitly trust funding transactions generated by us for our own outbound
21214 * channels to not be double-spent.
21216 * If this is set, we assume that our own funding transactions are *never* double-spent, and
21217 * thus we can trust them without any confirmations. This is generally a reasonable
21218 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
21219 * control of the signing keys).
21221 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
21222 * double-spend the funding transaction to RBF with an alternative channel open.
21224 * This only applies if our counterparty set their confirmations-required value to 0, and we
21225 * always trust our own funding transaction at 1 confirmation irrespective of this value.
21226 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
21227 * `true` (0) and `false` (1).
21229 * Default value: true
21231 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
21234 * Set to force an incoming channel to match our announced channel preference in
21235 * [`ChannelHandshakeConfig::announced_channel`].
21237 * For a node which is not online reliably, this should be set to true and
21238 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
21239 * channels will ever be opened.
21241 * Default value: true.
21243 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21246 * Set to force an incoming channel to match our announced channel preference in
21247 * [`ChannelHandshakeConfig::announced_channel`].
21249 * For a node which is not online reliably, this should be set to true and
21250 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
21251 * channels will ever be opened.
21253 * Default value: true.
21255 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
21258 * Set to the amount of time we're willing to wait to claim money back to us.
21260 * Not checking this value would be a security issue, as our peer would be able to set it to
21261 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
21263 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
21264 * reduce the loss of having useless locked funds (if your peer accepts)
21266 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
21269 * Set to the amount of time we're willing to wait to claim money back to us.
21271 * Not checking this value would be a security issue, as our peer would be able to set it to
21272 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
21274 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
21275 * reduce the loss of having useless locked funds (if your peer accepts)
21277 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
21280 * Constructs a new ChannelHandshakeLimits given each field
21282 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);
21285 * Creates a copy of the ChannelHandshakeLimits
21287 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
21290 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
21292 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
21295 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
21297 void ChannelConfig_free(struct LDKChannelConfig this_obj);
21300 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
21301 * over the channel.
21302 * This may be allowed to change at runtime in a later update, however doing so must result in
21303 * update messages sent to notify all nodes of our updated relay fee.
21305 * Default value: 0.
21307 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
21310 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
21311 * over the channel.
21312 * This may be allowed to change at runtime in a later update, however doing so must result in
21313 * update messages sent to notify all nodes of our updated relay fee.
21315 * Default value: 0.
21317 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
21320 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
21321 * excess of [`forwarding_fee_proportional_millionths`].
21322 * This may be allowed to change at runtime in a later update, however doing so must result in
21323 * update messages sent to notify all nodes of our updated relay fee.
21325 * The default value of a single satoshi roughly matches the market rate on many routing nodes
21326 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
21329 * Default value: 1000.
21331 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
21333 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
21336 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
21337 * excess of [`forwarding_fee_proportional_millionths`].
21338 * This may be allowed to change at runtime in a later update, however doing so must result in
21339 * update messages sent to notify all nodes of our updated relay fee.
21341 * The default value of a single satoshi roughly matches the market rate on many routing nodes
21342 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
21345 * Default value: 1000.
21347 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
21349 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
21352 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
21353 * the channel this config applies to.
21355 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
21356 * HTLC balance when a channel appears on-chain whereas
21357 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
21358 * (non-HTLC-encumbered) balance.
21360 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
21361 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
21362 * commitment transaction at least once per this many blocks (minus some margin to allow us
21363 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
21364 * the spending transaction).
21366 * Default value: 72 (12 hours at an average of 6 blocks/hour).
21367 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
21368 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
21370 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
21372 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
21375 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
21376 * the channel this config applies to.
21378 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
21379 * HTLC balance when a channel appears on-chain whereas
21380 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
21381 * (non-HTLC-encumbered) balance.
21383 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
21384 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
21385 * commitment transaction at least once per this many blocks (minus some margin to allow us
21386 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
21387 * the spending transaction).
21389 * Default value: 72 (12 hours at an average of 6 blocks/hour).
21390 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
21391 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
21393 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
21395 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
21398 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
21399 * small to claim on-chain.
21401 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
21402 * not be claimable on-chain, instead being turned into additional miner fees if either
21403 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
21404 * to such payments may be sustantial if there are many dust HTLCs present when the
21405 * channel is force-closed.
21407 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
21408 * channel negotiated throughout the channel open process, along with the fees required to have
21409 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
21410 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
21411 * account the HTLC transaction fee as it is zero.
21413 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
21414 * exposure across all three types per-channel. Setting this too low may prevent the
21415 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
21416 * important to prevent stealing of dust HTLCs by miners.
21418 * Default value: 5_000_000 msat.
21420 uint64_t ChannelConfig_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
21423 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
21424 * small to claim on-chain.
21426 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
21427 * not be claimable on-chain, instead being turned into additional miner fees if either
21428 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
21429 * to such payments may be sustantial if there are many dust HTLCs present when the
21430 * channel is force-closed.
21432 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
21433 * channel negotiated throughout the channel open process, along with the fees required to have
21434 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
21435 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
21436 * account the HTLC transaction fee as it is zero.
21438 * This limit is applied for sent, forwarded, and received HTLCs and limits the total
21439 * exposure across all three types per-channel. Setting this too low may prevent the
21440 * sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
21441 * important to prevent stealing of dust HTLCs by miners.
21443 * Default value: 5_000_000 msat.
21445 void ChannelConfig_set_max_dust_htlc_exposure_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
21448 * The additional fee we're willing to pay to avoid waiting for the counterparty's
21449 * `to_self_delay` to reclaim funds.
21451 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
21452 * closing transaction which both sides find acceptable, ultimately paid by the channel
21453 * funder/initiator.
21455 * When we are the funder, because we have to pay the channel closing fee, we bound the
21456 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
21457 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
21458 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
21459 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
21462 * When we are not the funder, we require the closing transaction fee pay at least our
21463 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
21464 * Thus, this value is ignored when we are not the funder.
21466 * Default value: 1000 satoshis.
21468 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
21469 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
21471 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
21474 * The additional fee we're willing to pay to avoid waiting for the counterparty's
21475 * `to_self_delay` to reclaim funds.
21477 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
21478 * closing transaction which both sides find acceptable, ultimately paid by the channel
21479 * funder/initiator.
21481 * When we are the funder, because we have to pay the channel closing fee, we bound the
21482 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
21483 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
21484 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
21485 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
21488 * When we are not the funder, we require the closing transaction fee pay at least our
21489 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
21490 * Thus, this value is ignored when we are not the funder.
21492 * Default value: 1000 satoshis.
21494 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
21495 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
21497 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
21500 * Constructs a new ChannelConfig given each field
21502 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);
21505 * Creates a copy of the ChannelConfig
21507 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
21510 * Checks if two ChannelConfigs contain equal inner contents.
21511 * This ignores pointers and is_owned flags and looks at the values in fields.
21512 * Two objects with NULL inner values will be considered "equal" here.
21514 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
21517 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
21519 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
21522 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
21524 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
21527 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
21529 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
21532 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
21534 void UserConfig_free(struct LDKUserConfig this_obj);
21537 * Channel handshake config that we propose to our counterparty.
21539 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
21542 * Channel handshake config that we propose to our counterparty.
21544 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
21547 * Limits applied to our counterparty's proposed channel handshake config settings.
21549 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
21552 * Limits applied to our counterparty's proposed channel handshake config settings.
21554 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
21557 * Channel config which affects behavior during channel lifetime.
21559 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
21562 * Channel config which affects behavior during channel lifetime.
21564 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
21567 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
21568 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
21569 * node which is not online reliably.
21571 * For nodes which are not online reliably, you should set all channels to *not* be announced
21572 * (using [`ChannelHandshakeConfig::announced_channel`] and
21573 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
21574 * ensure you are not exposed to any forwarding risk.
21576 * Note that because you cannot change a channel's announced state after creation, there is no
21577 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
21578 * from a publicly-announced forwarding node to a private non-forwarding node you must close
21579 * all your channels and open new ones. For privacy, you should also change your node_id
21580 * (swapping all private and public key material for new ones) at that time.
21582 * Default value: false.
21584 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
21587 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
21588 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
21589 * node which is not online reliably.
21591 * For nodes which are not online reliably, you should set all channels to *not* be announced
21592 * (using [`ChannelHandshakeConfig::announced_channel`] and
21593 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
21594 * ensure you are not exposed to any forwarding risk.
21596 * Note that because you cannot change a channel's announced state after creation, there is no
21597 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
21598 * from a publicly-announced forwarding node to a private non-forwarding node you must close
21599 * all your channels and open new ones. For privacy, you should also change your node_id
21600 * (swapping all private and public key material for new ones) at that time.
21602 * Default value: false.
21604 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
21607 * If this is set to false, we do not accept inbound requests to open a new channel.
21608 * Default value: true.
21610 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
21613 * If this is set to false, we do not accept inbound requests to open a new channel.
21614 * Default value: true.
21616 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
21619 * If this is set to true, the user needs to manually accept inbound requests to open a new
21622 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
21623 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
21624 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
21625 * user explicitly chooses to accept the request.
21627 * Default value: false.
21629 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
21630 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
21631 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
21633 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
21636 * If this is set to true, the user needs to manually accept inbound requests to open a new
21639 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
21640 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
21641 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
21642 * user explicitly chooses to accept the request.
21644 * Default value: false.
21646 * [`Event::OpenChannelRequest`]: crate::util::events::Event::OpenChannelRequest
21647 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
21648 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
21650 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
21653 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
21654 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
21655 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
21657 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
21659 * Default value: false.
21661 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
21662 * [`Event::HTLCIntercepted`]: crate::util::events::Event::HTLCIntercepted
21664 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
21667 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
21668 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
21669 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
21671 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
21673 * Default value: false.
21675 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
21676 * [`Event::HTLCIntercepted`]: crate::util::events::Event::HTLCIntercepted
21678 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
21681 * Constructs a new UserConfig given each field
21683 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);
21686 * Creates a copy of the UserConfig
21688 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
21691 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
21693 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
21696 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
21698 void BestBlock_free(struct LDKBestBlock this_obj);
21701 * Creates a copy of the BestBlock
21703 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
21706 * Checks if two BestBlocks contain equal inner contents.
21707 * This ignores pointers and is_owned flags and looks at the values in fields.
21708 * Two objects with NULL inner values will be considered "equal" here.
21710 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
21713 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
21716 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
21719 * Returns a `BestBlock` as identified by the given block hash and height.
21721 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
21724 * Returns the best block hash.
21726 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
21729 * Returns the best block height.
21731 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
21734 * Calls the free function if one is set
21736 void Listen_free(struct LDKListen this_ptr);
21739 * Calls the free function if one is set
21741 void Confirm_free(struct LDKConfirm this_ptr);
21744 * Creates a copy of the ChannelMonitorUpdateStatus
21746 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
21749 * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
21751 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
21754 * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
21756 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
21759 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateStatus
21761 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_permanent_failure(void);
21764 * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
21765 * This ignores pointers and is_owned flags and looks at the values in fields.
21767 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
21770 * Calls the free function if one is set
21772 void Watch_free(struct LDKWatch this_ptr);
21775 * Calls the free function if one is set
21777 void Filter_free(struct LDKFilter this_ptr);
21780 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
21782 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
21785 * First block where the transaction output may have been spent.
21787 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
21789 struct LDKThirtyTwoBytes WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
21792 * First block where the transaction output may have been spent.
21794 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
21796 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
21799 * Outpoint identifying the transaction output.
21801 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
21804 * Outpoint identifying the transaction output.
21806 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
21809 * Spending condition of the transaction output.
21811 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
21814 * Spending condition of the transaction output.
21816 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
21819 * Constructs a new WatchedOutput given each field
21821 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKThirtyTwoBytes block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
21824 * Creates a copy of the WatchedOutput
21826 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
21829 * Checks if two WatchedOutputs contain equal inner contents.
21830 * This ignores pointers and is_owned flags and looks at the values in fields.
21831 * Two objects with NULL inner values will be considered "equal" here.
21833 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
21836 * Checks if two WatchedOutputs contain equal inner contents.
21838 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
21841 * Calls the free function if one is set
21843 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
21846 * Creates a copy of the ConfirmationTarget
21848 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
21851 * Utility method to constructs a new Background-variant ConfirmationTarget
21853 enum LDKConfirmationTarget ConfirmationTarget_background(void);
21856 * Utility method to constructs a new Normal-variant ConfirmationTarget
21858 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
21861 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
21863 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
21866 * Checks if two ConfirmationTargets contain equal inner contents.
21868 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
21871 * Checks if two ConfirmationTargets contain equal inner contents.
21872 * This ignores pointers and is_owned flags and looks at the values in fields.
21874 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
21877 * Calls the free function if one is set
21879 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
21882 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
21884 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
21887 * Creates a copy of the MonitorUpdateId
21889 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
21892 * Checks if two MonitorUpdateIds contain equal inner contents.
21894 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
21897 * Checks if two MonitorUpdateIds contain equal inner contents.
21898 * This ignores pointers and is_owned flags and looks at the values in fields.
21899 * Two objects with NULL inner values will be considered "equal" here.
21901 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
21904 * Calls the free function if one is set
21906 void Persist_free(struct LDKPersist this_ptr);
21909 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
21911 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
21914 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
21916 void ChainMonitor_free(struct LDKChainMonitor this_obj);
21919 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
21921 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
21922 * will call back to it indicating transactions and outputs of interest. This allows clients to
21923 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
21924 * always need to fetch full blocks absent another means for determining which blocks contain
21925 * transactions relevant to the watched channels.
21927 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
21930 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
21931 * claims which are awaiting confirmation.
21933 * Includes the balances from each [`ChannelMonitor`] *except* those included in
21934 * `ignored_channels`, allowing you to filter out balances from channels which are still open
21935 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
21937 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
21938 * inclusion in the return value.
21940 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
21943 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
21944 * such [`ChannelMonitor`] is currently being monitored for.
21946 * Note that the result holds a mutex over our monitor set, and should not be held
21949 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
21952 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
21954 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
21955 * monitoring for on-chain state resolutions.
21957 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
21960 * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
21962 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
21965 * Indicates the persistence of a [`ChannelMonitor`] has completed after
21966 * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
21968 * Thus, the anticipated use is, at a high level:
21969 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
21970 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
21971 * returning [`ChannelMonitorUpdateStatus::InProgress`],
21972 * 2) once all remote copies are updated, you call this function with the
21973 * `completed_update_id` that completed, and once all pending updates have completed the
21974 * channel will be re-enabled.
21976 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
21977 * registered [`ChannelMonitor`]s.
21979 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);
21982 * Constructs a new Listen which calls the relevant methods on this_arg.
21983 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
21985 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
21988 * Constructs a new Confirm which calls the relevant methods on this_arg.
21989 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
21991 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
21994 * Constructs a new Watch which calls the relevant methods on this_arg.
21995 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
21997 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
22000 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
22001 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
22003 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
22006 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
22008 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
22011 * The sequence number of this update. Updates *must* be replayed in-order according to this
22012 * sequence number (and updates may panic if they are not). The update_id values are strictly
22013 * increasing and increase by one for each new update, with one exception specified below.
22015 * This sequence number is also used to track up to which points updates which returned
22016 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
22017 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
22019 * The only instance where update_id values are not strictly increasing is the case where we
22020 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
22021 * its docs for more details.
22023 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
22025 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
22028 * The sequence number of this update. Updates *must* be replayed in-order according to this
22029 * sequence number (and updates may panic if they are not). The update_id values are strictly
22030 * increasing and increase by one for each new update, with one exception specified below.
22032 * This sequence number is also used to track up to which points updates which returned
22033 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
22034 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
22036 * The only instance where update_id values are not strictly increasing is the case where we
22037 * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
22038 * its docs for more details.
22040 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
22042 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
22045 * Creates a copy of the ChannelMonitorUpdate
22047 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
22050 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
22052 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
22055 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
22057 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
22060 * Frees any resources used by the MonitorEvent
22062 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
22065 * Creates a copy of the MonitorEvent
22067 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
22070 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
22072 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
22075 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
22077 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
22080 * Utility method to constructs a new Completed-variant MonitorEvent
22082 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
22085 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
22087 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
22090 * Checks if two MonitorEvents contain equal inner contents.
22091 * This ignores pointers and is_owned flags and looks at the values in fields.
22093 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
22096 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
22098 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
22101 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
22103 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
22106 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
22108 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
22111 * Creates a copy of the HTLCUpdate
22113 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
22116 * Checks if two HTLCUpdates contain equal inner contents.
22117 * This ignores pointers and is_owned flags and looks at the values in fields.
22118 * Two objects with NULL inner values will be considered "equal" here.
22120 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
22123 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
22125 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
22128 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
22130 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
22133 * Frees any resources used by the Balance
22135 void Balance_free(struct LDKBalance this_ptr);
22138 * Creates a copy of the Balance
22140 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
22143 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
22145 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
22148 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
22150 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
22153 * Utility method to constructs a new ContentiousClaimable-variant Balance
22155 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height);
22158 * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
22160 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t claimable_height);
22163 * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
22165 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t expiry_height);
22168 * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
22170 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t claimable_amount_satoshis);
22173 * Checks if two Balances contain equal inner contents.
22174 * This ignores pointers and is_owned flags and looks at the values in fields.
22176 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
22179 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
22181 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
22184 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
22186 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
22189 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
22192 * panics if the given update is not the next update by update_id.
22194 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);
22197 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
22200 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
22203 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
22205 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
22208 * Gets a list of txids, with their output scripts (in the order they appear in the
22209 * transaction), which we must learn about spends of via block_connected().
22211 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
22214 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
22215 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
22216 * have been registered.
22218 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
22221 * Get the list of HTLCs who's status has been updated on chain. This should be called by
22222 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
22224 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
22227 * Gets the list of pending events which were generated by previous actions, clearing the list
22230 * This is called by the [`EventsProvider::process_pending_events`] implementation for
22231 * [`ChainMonitor`].
22233 * [`EventsProvider::process_pending_events`]: crate::util::events::EventsProvider::process_pending_events
22234 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
22236 MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
22239 * Gets the `node_id` of the counterparty for this channel.
22241 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
22244 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
22246 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
22249 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
22250 * the Channel was out-of-date.
22252 * You may also use this to broadcast the latest local commitment transaction, either because
22253 * a monitor update failed with [`ChannelMonitorUpdateStatus::PermanentFailure`] or because we've
22254 * fallen behind (i.e. we've received proof that our counterparty side knows a revocation
22255 * secret we gave them that they shouldn't know).
22257 * Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty
22258 * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
22259 * close channel with their commitment transaction after a substantial amount of time. Best
22260 * may be to contact the other node operator out-of-band to coordinate other options available
22261 * to you. In any-case, the choice is up to you.
22263 * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
22265 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);
22268 * Processes transactions in a newly connected block, which may result in any of the following:
22269 * - update the monitor's state against resolved HTLCs
22270 * - punish the counterparty in the case of seeing a revoked commitment transaction
22271 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
22272 * - detect settled outputs for later spending
22273 * - schedule and bump any in-flight claims
22275 * Returns any new outputs to watch from `txdata`; after called, these are also included in
22276 * [`get_outputs_to_watch`].
22278 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
22280 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);
22283 * Determines if the disconnected block contained any transactions of interest and updates
22286 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);
22289 * Processes transactions confirmed in a block with the given header and height, returning new
22290 * outputs to watch. See [`block_connected`] for details.
22292 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
22293 * blocks. See [`chain::Confirm`] for calling expectations.
22295 * [`block_connected`]: Self::block_connected
22297 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);
22300 * Processes a transaction that was reorganized out of the chain.
22302 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
22303 * than blocks. See [`chain::Confirm`] for calling expectations.
22305 * [`block_disconnected`]: Self::block_disconnected
22307 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);
22310 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
22311 * [`block_connected`] for details.
22313 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
22314 * blocks. See [`chain::Confirm`] for calling expectations.
22316 * [`block_connected`]: Self::block_connected
22318 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);
22321 * Returns the set of txids that should be monitored for re-organization out of the chain.
22323 MUST_USE_RES struct LDKCVec_C2Tuple_TxidBlockHashZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
22326 * Gets the latest best block which was connected either via the [`chain::Listen`] or
22327 * [`chain::Confirm`] interfaces.
22329 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
22332 * Gets the balances in this channel which are either claimable by us if we were to
22333 * force-close the channel now or which are claimable on-chain (possibly awaiting
22336 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
22337 * included here until an [`Event::SpendableOutputs`] event has been generated for the
22338 * balance, or until our counterparty has claimed the balance and accrued several
22339 * confirmations on the claim transaction.
22341 * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
22342 * LDK prior to 0.0.111, balances may not be fully captured if our counterparty broadcasted
22345 * See [`Balance`] for additional details on the types of claimable balances which
22346 * may be returned here and their meanings.
22348 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
22351 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
22353 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
22356 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
22358 void OutPoint_free(struct LDKOutPoint this_obj);
22361 * The referenced transaction's txid.
22363 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
22366 * The referenced transaction's txid.
22368 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22371 * The index of the referenced output in its transaction's vout.
22373 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
22376 * The index of the referenced output in its transaction's vout.
22378 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
22381 * Constructs a new OutPoint given each field
22383 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
22386 * Creates a copy of the OutPoint
22388 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
22391 * Checks if two OutPoints contain equal inner contents.
22392 * This ignores pointers and is_owned flags and looks at the values in fields.
22393 * Two objects with NULL inner values will be considered "equal" here.
22395 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
22398 * Checks if two OutPoints contain equal inner contents.
22400 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
22403 * Convert an `OutPoint` to a lightning channel id.
22405 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
22408 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
22410 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
22413 * Read a OutPoint from a byte array, created by OutPoint_write
22415 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
22418 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
22420 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
22423 * The outpoint which is spendable.
22425 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
22428 * The outpoint which is spendable.
22430 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
22433 * Per commitment point to derive the delayed payment key by key holder.
22435 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
22438 * Per commitment point to derive the delayed payment key by key holder.
22440 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22443 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
22444 * the witness_script.
22446 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
22449 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
22450 * the witness_script.
22452 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
22455 * The output which is referenced by the given outpoint.
22457 * Returns a copy of the field.
22459 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
22462 * The output which is referenced by the given outpoint.
22464 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
22467 * The revocation point specific to the commitment transaction which was broadcast. Used to
22468 * derive the witnessScript for this output.
22470 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
22473 * The revocation point specific to the commitment transaction which was broadcast. Used to
22474 * derive the witnessScript for this output.
22476 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
22479 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
22480 * This may be useful in re-deriving keys used in the channel to spend the output.
22482 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
22485 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
22486 * This may be useful in re-deriving keys used in the channel to spend the output.
22488 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22491 * The value of the channel which this output originated from, possibly indirectly.
22493 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
22496 * The value of the channel which this output originated from, possibly indirectly.
22498 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
22501 * Constructs a new DelayedPaymentOutputDescriptor given each field
22503 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);
22506 * Creates a copy of the DelayedPaymentOutputDescriptor
22508 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
22511 * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
22512 * This ignores pointers and is_owned flags and looks at the values in fields.
22513 * Two objects with NULL inner values will be considered "equal" here.
22515 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
22518 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
22520 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
22523 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
22525 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
22528 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
22530 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
22533 * The outpoint which is spendable.
22535 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
22538 * The outpoint which is spendable.
22540 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
22543 * The output which is referenced by the given outpoint.
22545 * Returns a copy of the field.
22547 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
22550 * The output which is referenced by the given outpoint.
22552 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
22555 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
22556 * This may be useful in re-deriving keys used in the channel to spend the output.
22558 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
22561 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
22562 * This may be useful in re-deriving keys used in the channel to spend the output.
22564 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22567 * The value of the channel which this transactions spends.
22569 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
22572 * The value of the channel which this transactions spends.
22574 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
22577 * Constructs a new StaticPaymentOutputDescriptor given each field
22579 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);
22582 * Creates a copy of the StaticPaymentOutputDescriptor
22584 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
22587 * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
22588 * This ignores pointers and is_owned flags and looks at the values in fields.
22589 * Two objects with NULL inner values will be considered "equal" here.
22591 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
22594 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
22596 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
22599 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
22601 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
22604 * Frees any resources used by the SpendableOutputDescriptor
22606 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
22609 * Creates a copy of the SpendableOutputDescriptor
22611 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
22614 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
22616 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
22619 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
22621 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
22624 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
22626 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
22629 * Checks if two SpendableOutputDescriptors contain equal inner contents.
22630 * This ignores pointers and is_owned flags and looks at the values in fields.
22632 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
22635 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
22637 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
22640 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
22642 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
22645 * Calls the free function if one is set
22647 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
22650 * Calls the free function if one is set
22652 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
22655 * Calls the free function if one is set
22657 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
22660 * Creates a copy of the Recipient
22662 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
22665 * Utility method to constructs a new Node-variant Recipient
22667 enum LDKRecipient Recipient_node(void);
22670 * Utility method to constructs a new PhantomNode-variant Recipient
22672 enum LDKRecipient Recipient_phantom_node(void);
22675 * Calls the free function if one is set
22677 void EntropySource_free(struct LDKEntropySource this_ptr);
22680 * Calls the free function if one is set
22682 void NodeSigner_free(struct LDKNodeSigner this_ptr);
22685 * Calls the free function if one is set
22687 void SignerProvider_free(struct LDKSignerProvider this_ptr);
22690 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
22692 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
22695 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
22696 * holder's anchor output in a commitment transaction, if one is present.
22698 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
22701 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
22702 * holder's anchor output in a commitment transaction, if one is present.
22704 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
22707 * Holder secret key for blinded revocation pubkey.
22709 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
22712 * Holder secret key for blinded revocation pubkey.
22714 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
22717 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
22719 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
22722 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
22724 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
22727 * Holder secret key used in an HTLC transaction.
22729 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
22732 * Holder secret key used in an HTLC transaction.
22734 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
22737 * Holder HTLC secret key used in commitment transaction HTLC outputs.
22739 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
22742 * Holder HTLC secret key used in commitment transaction HTLC outputs.
22744 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
22749 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
22754 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
22757 * Creates a copy of the InMemorySigner
22759 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
22762 * Creates a new [`InMemorySigner`].
22764 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);
22767 * Returns the counterparty's pubkeys.
22769 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
22771 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22774 * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
22775 * transactions, i.e., the amount of time that we have to wait to recover our funds if we
22776 * broadcast a transaction.
22778 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
22780 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22783 * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
22784 * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
22785 * if they broadcast a transaction.
22787 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
22789 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22792 * Returns whether the holder is the initiator.
22794 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
22796 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22801 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
22803 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22806 * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
22807 * building transactions.
22809 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
22811 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22814 * Returns whether anchors should be used.
22816 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
22818 MUST_USE_RES bool InMemorySigner_opt_anchors(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22821 * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
22822 * by `descriptor`, returning the witness stack for the input.
22824 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
22825 * is not spending the outpoint described by [`descriptor.outpoint`],
22826 * or if an output descriptor `script_pubkey` does not match the one we can spend.
22828 * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
22830 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);
22833 * Sign the single input of `spend_tx` at index `input_idx` which spends the output
22834 * described by `descriptor`, returning the witness stack for the input.
22836 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
22837 * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
22838 * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
22839 * `script_pubkey` does not match the one we can spend.
22841 * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
22842 * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
22844 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);
22847 * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
22848 * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
22850 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22853 * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
22854 * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
22856 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22859 * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
22860 * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
22862 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
22865 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
22867 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
22870 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
22872 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser);
22875 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
22877 void KeysManager_free(struct LDKKeysManager this_obj);
22880 * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
22881 * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
22882 * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
22883 * without a doubt, be unique to this instance. ie if you start multiple times with the same
22884 * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
22885 * is to simply use the current time (with very high precision).
22887 * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
22888 * obviously, `starting_time` should be unique every time you reload the library - it is only
22889 * used to generate new ephemeral key data (which will be stored by the individual channel if
22892 * Note that the seed is required to recover certain on-chain funds independent of
22893 * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
22894 * for any channel, and some on-chain during-closing funds.
22896 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
22898 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
22901 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
22903 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
22906 * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
22908 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]);
22911 * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
22912 * output to the given change destination (if sufficient change value remains). The
22913 * transaction will have a feerate, at least, of the given value.
22915 * Returns `Err(())` if the output value is greater than the input value minus required fee,
22916 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
22917 * does not match the one we can spend.
22919 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
22921 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
22922 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
22924 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);
22927 * Constructs a new EntropySource which calls the relevant methods on this_arg.
22928 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
22930 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
22933 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
22934 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
22936 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
22939 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
22940 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
22942 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
22945 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
22947 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
22950 * Constructs a new EntropySource which calls the relevant methods on this_arg.
22951 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
22953 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
22956 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
22957 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
22959 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
22962 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
22963 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
22965 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
22968 * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
22969 * that is shared across all nodes that intend to participate in [phantom node payments]
22972 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
22973 * `starting_time_nanos`.
22975 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
22976 * same across restarts, or else inbound payments may fail.
22978 * [phantom node payments]: PhantomKeysManager
22980 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]);
22983 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
22985 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);
22988 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
22990 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]);
22993 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
22995 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
22998 * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
22999 * last-hop onion data, etc.
23001 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
23004 * Creates a copy of the FailureCode
23006 enum LDKFailureCode FailureCode_clone(const enum LDKFailureCode *NONNULL_PTR orig);
23009 * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
23011 enum LDKFailureCode FailureCode_temporary_node_failure(void);
23014 * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
23016 enum LDKFailureCode FailureCode_required_node_feature_missing(void);
23019 * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
23021 enum LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
23024 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
23026 void ChannelManager_free(struct LDKChannelManager this_obj);
23029 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
23031 void ChainParameters_free(struct LDKChainParameters this_obj);
23034 * The network for determining the `chain_hash` in Lightning messages.
23036 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
23039 * The network for determining the `chain_hash` in Lightning messages.
23041 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
23044 * The hash and height of the latest block successfully connected.
23046 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
23048 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
23051 * The hash and height of the latest block successfully connected.
23053 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
23055 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
23058 * Constructs a new ChainParameters given each field
23060 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
23063 * Creates a copy of the ChainParameters
23065 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
23068 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
23070 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
23073 * Base routing fee in millisatoshis.
23075 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
23078 * Base routing fee in millisatoshis.
23080 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
23083 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
23085 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
23088 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
23090 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
23093 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
23094 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
23095 * `cltv_expiry_delta` for more details.
23097 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
23100 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
23101 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
23102 * `cltv_expiry_delta` for more details.
23104 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
23107 * Constructs a new CounterpartyForwardingInfo given each field
23109 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);
23112 * Creates a copy of the CounterpartyForwardingInfo
23114 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
23117 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
23119 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
23122 * The node_id of our counterparty
23124 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
23127 * The node_id of our counterparty
23129 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23132 * The Features the channel counterparty provided upon last connection.
23133 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
23134 * many routing-relevant features are present in the init context.
23136 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
23139 * The Features the channel counterparty provided upon last connection.
23140 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
23141 * many routing-relevant features are present in the init context.
23143 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
23146 * The value, in satoshis, that must always be held in the channel for our counterparty. This
23147 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
23148 * claiming at least this value on chain.
23150 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
23152 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
23154 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
23157 * The value, in satoshis, that must always be held in the channel for our counterparty. This
23158 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
23159 * claiming at least this value on chain.
23161 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
23163 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
23165 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
23168 * Information on the fees and requirements that the counterparty requires when forwarding
23169 * payments to us through this channel.
23171 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23173 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
23176 * Information on the fees and requirements that the counterparty requires when forwarding
23177 * payments to us through this channel.
23179 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23181 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
23184 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
23185 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
23186 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
23188 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
23191 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
23192 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
23193 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
23195 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23198 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
23200 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
23203 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
23205 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23208 * Constructs a new ChannelCounterparty given each field
23210 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);
23213 * Creates a copy of the ChannelCounterparty
23215 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
23218 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
23220 void ChannelDetails_free(struct LDKChannelDetails this_obj);
23223 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
23224 * thereafter this is the txid of the funding transaction xor the funding transaction output).
23225 * Note that this means this value is *not* persistent - it can change once during the
23226 * lifetime of the channel.
23228 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
23231 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
23232 * thereafter this is the txid of the funding transaction xor the funding transaction output).
23233 * Note that this means this value is *not* persistent - it can change once during the
23234 * lifetime of the channel.
23236 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
23239 * Parameters which apply to our counterparty. See individual fields for more information.
23241 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23244 * Parameters which apply to our counterparty. See individual fields for more information.
23246 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
23249 * The Channel's funding transaction output, if we've negotiated the funding transaction with
23250 * our counterparty already.
23252 * Note that, if this has been set, `channel_id` will be equivalent to
23253 * `funding_txo.unwrap().to_channel_id()`.
23255 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23257 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23260 * The Channel's funding transaction output, if we've negotiated the funding transaction with
23261 * our counterparty already.
23263 * Note that, if this has been set, `channel_id` will be equivalent to
23264 * `funding_txo.unwrap().to_channel_id()`.
23266 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23268 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
23271 * The features which this channel operates with. See individual features for more info.
23273 * `None` until negotiation completes and the channel type is finalized.
23275 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23277 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23280 * The features which this channel operates with. See individual features for more info.
23282 * `None` until negotiation completes and the channel type is finalized.
23284 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23286 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
23289 * The position of the funding transaction in the chain. None if the funding transaction has
23290 * not yet been confirmed and the channel fully opened.
23292 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
23293 * payments instead of this. See [`get_inbound_payment_scid`].
23295 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
23296 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
23298 * [`inbound_scid_alias`]: Self::inbound_scid_alias
23299 * [`outbound_scid_alias`]: Self::outbound_scid_alias
23300 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
23301 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
23302 * [`confirmations_required`]: Self::confirmations_required
23304 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23307 * The position of the funding transaction in the chain. None if the funding transaction has
23308 * not yet been confirmed and the channel fully opened.
23310 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
23311 * payments instead of this. See [`get_inbound_payment_scid`].
23313 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
23314 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
23316 * [`inbound_scid_alias`]: Self::inbound_scid_alias
23317 * [`outbound_scid_alias`]: Self::outbound_scid_alias
23318 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
23319 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
23320 * [`confirmations_required`]: Self::confirmations_required
23322 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23325 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
23326 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
23327 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
23330 * This will be `None` as long as the channel is not available for routing outbound payments.
23332 * [`short_channel_id`]: Self::short_channel_id
23333 * [`confirmations_required`]: Self::confirmations_required
23335 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23338 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
23339 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
23340 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
23343 * This will be `None` as long as the channel is not available for routing outbound payments.
23345 * [`short_channel_id`]: Self::short_channel_id
23346 * [`confirmations_required`]: Self::confirmations_required
23348 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23351 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
23352 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
23353 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
23354 * when they see a payment to be routed to us.
23356 * Our counterparty may choose to rotate this value at any time, though will always recognize
23357 * previous values for inbound payment forwarding.
23359 * [`short_channel_id`]: Self::short_channel_id
23361 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23364 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
23365 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
23366 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
23367 * when they see a payment to be routed to us.
23369 * Our counterparty may choose to rotate this value at any time, though will always recognize
23370 * previous values for inbound payment forwarding.
23372 * [`short_channel_id`]: Self::short_channel_id
23374 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23377 * The value, in satoshis, of this channel as appears in the funding output
23379 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23382 * The value, in satoshis, of this channel as appears in the funding output
23384 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
23387 * The value, in satoshis, that must always be held in the channel for us. This value ensures
23388 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
23389 * this value on chain.
23391 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
23393 * This value will be `None` for outbound channels until the counterparty accepts the channel.
23395 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
23397 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23400 * The value, in satoshis, that must always be held in the channel for us. This value ensures
23401 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
23402 * this value on chain.
23404 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
23406 * This value will be `None` for outbound channels until the counterparty accepts the channel.
23408 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
23410 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23413 * The `user_channel_id` passed in to create_channel, or a random value if the channel was
23414 * inbound. This may be zero for inbound channels serialized with LDK versions prior to
23417 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23420 * The `user_channel_id` passed in to create_channel, or a random value if the channel was
23421 * inbound. This may be zero for inbound channels serialized with LDK versions prior to
23424 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
23427 * Our total balance. This is the amount we would get if we close the channel.
23428 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
23429 * amount is not likely to be recoverable on close.
23431 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
23432 * balance is not available for inclusion in new outbound HTLCs). This further does not include
23433 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
23434 * This does not consider any on-chain fees.
23436 * See also [`ChannelDetails::outbound_capacity_msat`]
23438 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23441 * Our total balance. This is the amount we would get if we close the channel.
23442 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
23443 * amount is not likely to be recoverable on close.
23445 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
23446 * balance is not available for inclusion in new outbound HTLCs). This further does not include
23447 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
23448 * This does not consider any on-chain fees.
23450 * See also [`ChannelDetails::outbound_capacity_msat`]
23452 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
23455 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
23456 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
23457 * available for inclusion in new outbound HTLCs). This further does not include any pending
23458 * outgoing HTLCs which are awaiting some other resolution to be sent.
23460 * See also [`ChannelDetails::balance_msat`]
23462 * This value is not exact. Due to various in-flight changes, feerate changes, and our
23463 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
23464 * should be able to spend nearly this amount.
23466 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23469 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
23470 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
23471 * available for inclusion in new outbound HTLCs). This further does not include any pending
23472 * outgoing HTLCs which are awaiting some other resolution to be sent.
23474 * See also [`ChannelDetails::balance_msat`]
23476 * This value is not exact. Due to various in-flight changes, feerate changes, and our
23477 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
23478 * should be able to spend nearly this amount.
23480 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
23483 * The available outbound capacity for sending a single HTLC to the remote peer. This is
23484 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
23485 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
23486 * to use a limit as close as possible to the HTLC limit we can currently send.
23488 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
23490 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23493 * The available outbound capacity for sending a single HTLC to the remote peer. This is
23494 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
23495 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
23496 * to use a limit as close as possible to the HTLC limit we can currently send.
23498 * See also [`ChannelDetails::balance_msat`] and [`ChannelDetails::outbound_capacity_msat`].
23500 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
23503 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
23504 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
23505 * available for inclusion in new inbound HTLCs).
23506 * Note that there are some corner cases not fully handled here, so the actual available
23507 * inbound capacity may be slightly higher than this.
23509 * This value is not exact. Due to various in-flight changes, feerate changes, and our
23510 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
23511 * However, our counterparty should be able to spend nearly this amount.
23513 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23516 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
23517 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
23518 * available for inclusion in new inbound HTLCs).
23519 * Note that there are some corner cases not fully handled here, so the actual available
23520 * inbound capacity may be slightly higher than this.
23522 * This value is not exact. Due to various in-flight changes, feerate changes, and our
23523 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
23524 * However, our counterparty should be able to spend nearly this amount.
23526 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
23529 * The number of required confirmations on the funding transaction before the funding will be
23530 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
23531 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
23532 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
23533 * [`ChannelHandshakeLimits::max_minimum_depth`].
23535 * This value will be `None` for outbound channels until the counterparty accepts the channel.
23537 * [`is_outbound`]: ChannelDetails::is_outbound
23538 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
23539 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
23541 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23544 * The number of required confirmations on the funding transaction before the funding will be
23545 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
23546 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
23547 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
23548 * [`ChannelHandshakeLimits::max_minimum_depth`].
23550 * This value will be `None` for outbound channels until the counterparty accepts the channel.
23552 * [`is_outbound`]: ChannelDetails::is_outbound
23553 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
23554 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
23556 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
23559 * The current number of confirmations on the funding transaction.
23561 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
23563 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23566 * The current number of confirmations on the funding transaction.
23568 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
23570 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
23573 * The number of blocks (after our commitment transaction confirms) that we will need to wait
23574 * until we can claim our funds after we force-close the channel. During this time our
23575 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
23576 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
23577 * time to claim our non-HTLC-encumbered funds.
23579 * This value will be `None` for outbound channels until the counterparty accepts the channel.
23581 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23584 * The number of blocks (after our commitment transaction confirms) that we will need to wait
23585 * until we can claim our funds after we force-close the channel. During this time our
23586 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
23587 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
23588 * time to claim our non-HTLC-encumbered funds.
23590 * This value will be `None` for outbound channels until the counterparty accepts the channel.
23592 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
23595 * True if the channel was initiated (and thus funded) by us.
23597 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23600 * True if the channel was initiated (and thus funded) by us.
23602 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
23605 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
23606 * channel is not currently being shut down. `channel_ready` message exchange implies the
23607 * required confirmation count has been reached (and we were connected to the peer at some
23608 * point after the funding transaction received enough confirmations). The required
23609 * confirmation count is provided in [`confirmations_required`].
23611 * [`confirmations_required`]: ChannelDetails::confirmations_required
23613 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23616 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
23617 * channel is not currently being shut down. `channel_ready` message exchange implies the
23618 * required confirmation count has been reached (and we were connected to the peer at some
23619 * point after the funding transaction received enough confirmations). The required
23620 * confirmation count is provided in [`confirmations_required`].
23622 * [`confirmations_required`]: ChannelDetails::confirmations_required
23624 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
23627 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
23628 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
23630 * This is a strict superset of `is_channel_ready`.
23632 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23635 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
23636 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
23638 * This is a strict superset of `is_channel_ready`.
23640 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
23643 * True if this channel is (or will be) publicly-announced.
23645 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23648 * True if this channel is (or will be) publicly-announced.
23650 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
23653 * The smallest value HTLC (in msat) we will accept, for this channel. This field
23654 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
23656 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23659 * The smallest value HTLC (in msat) we will accept, for this channel. This field
23660 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
23662 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23665 * The largest value HTLC (in msat) we currently will accept, for this channel.
23667 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23670 * The largest value HTLC (in msat) we currently will accept, for this channel.
23672 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
23675 * Set of configurable parameters that affect channel operation.
23677 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
23679 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
23681 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
23684 * Set of configurable parameters that affect channel operation.
23686 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
23688 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
23690 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
23693 * Constructs a new ChannelDetails given each field
23695 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, 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);
23698 * Creates a copy of the ChannelDetails
23700 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
23703 * Gets the current SCID which should be used to identify this channel for inbound payments.
23704 * This should be used for providing invoice hints or in any other context where our
23705 * counterparty will forward a payment to us.
23707 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
23708 * [`ChannelDetails::short_channel_id`]. See those for more information.
23710 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
23713 * Gets the current SCID which should be used to identify this channel for outbound payments.
23714 * This should be used in [`Route`]s to describe the first hop or in other contexts where
23715 * we're sending or forwarding a payment outbound over this channel.
23717 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
23718 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
23720 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
23723 * Frees any resources used by the RecentPaymentDetails
23725 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
23728 * Creates a copy of the RecentPaymentDetails
23730 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
23733 * Utility method to constructs a new Pending-variant RecentPaymentDetails
23735 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
23738 * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
23740 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_hash);
23743 * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
23745 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_hash);
23748 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
23750 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
23753 * The list of channels to be included in the invoice route hints.
23755 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
23758 * The list of channels to be included in the invoice route hints.
23760 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
23763 * A fake scid used for representing the phantom node's fake channel in generating the invoice
23766 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
23769 * A fake scid used for representing the phantom node's fake channel in generating the invoice
23772 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
23775 * The pubkey of the real backing node that would ultimately receive the payment.
23777 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
23780 * The pubkey of the real backing node that would ultimately receive the payment.
23782 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
23785 * Constructs a new PhantomRouteHints given each field
23787 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
23790 * Creates a copy of the PhantomRouteHints
23792 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
23795 * Constructs a new ChannelManager to hold several channels and route between them.
23797 * This is the main \"logic hub\" for all channel-related actions, and implements
23798 * ChannelMessageHandler.
23800 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
23802 * Users need to notify the new ChannelManager when a new block is connected or
23803 * disconnected using its `block_connected` and `block_disconnected` methods, starting
23804 * from after `params.latest_hash`.
23806 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);
23809 * Gets the current configuration applied to all new channels.
23811 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
23814 * Creates a new outbound channel to the given remote node and with the given value.
23816 * `user_channel_id` will be provided back as in
23817 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
23818 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
23819 * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
23820 * is simply copied to events and otherwise ignored.
23822 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
23823 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
23825 * Note that we do not check if you are currently connected to the given peer. If no
23826 * connection is available, the outbound `open_channel` message may fail to send, resulting in
23827 * the channel eventually being silently forgotten (dropped on reload).
23829 * Returns the new Channel's temporary `channel_id`. This ID will appear as
23830 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
23831 * [`ChannelDetails::channel_id`] until after
23832 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
23833 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
23834 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
23836 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
23837 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
23838 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
23840 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
23842 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);
23845 * Gets the list of open channels, in random order. See ChannelDetail field documentation for
23846 * more information.
23848 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
23851 * Gets the list of usable channels, in random order. Useful as an argument to
23852 * [`Router::find_route`] to ensure non-announced channels are used.
23854 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
23855 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
23858 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
23861 * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
23862 * successful path, or have unresolved HTLCs.
23864 * This can be useful for payments that may have been prepared, but ultimately not sent, as a
23865 * result of a crash. If such a payment exists, is not listed here, and an
23866 * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
23868 * [`Event::PaymentSent`]: events::Event::PaymentSent
23870 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
23873 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
23874 * will be accepted on the given channel, and after additional timeout/the closing of all
23875 * pending HTLCs, the channel will be closed on chain.
23877 * * If we are the channel initiator, we will pay between our [`Background`] and
23878 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
23880 * * If our counterparty is the channel initiator, we will require a channel closing
23881 * transaction feerate of at least our [`Background`] feerate or the feerate which
23882 * would appear on a force-closure transaction, whichever is lower. We will allow our
23883 * counterparty to pay as much fee as they'd like, however.
23885 * May generate a SendShutdown message event on success, which should be relayed.
23887 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
23888 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
23889 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
23891 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);
23894 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
23895 * will be accepted on the given channel, and after additional timeout/the closing of all
23896 * pending HTLCs, the channel will be closed on chain.
23898 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
23899 * the channel being closed or not:
23900 * * If we are the channel initiator, we will pay at least this feerate on the closing
23901 * transaction. The upper-bound is set by
23902 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
23903 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
23904 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
23905 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
23906 * will appear on a force-closure transaction, whichever is lower).
23908 * May generate a SendShutdown message event on success, which should be relayed.
23910 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
23911 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
23912 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
23914 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);
23917 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
23918 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
23919 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
23922 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);
23925 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
23926 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
23927 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
23929 * You can always get the latest local transaction(s) to broadcast from
23930 * [`ChannelMonitor::get_latest_holder_commitment_txn`].
23932 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);
23935 * Force close all channels, immediately broadcasting the latest local commitment transaction
23936 * for each to the chain and rejecting new HTLCs on each.
23938 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
23941 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
23942 * local transaction(s).
23944 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
23947 * Sends a payment along a given route.
23949 * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
23950 * fields for more info.
23952 * May generate SendHTLCs message(s) event on success, which should be relayed (e.g. via
23953 * [`PeerManager::process_events`]).
23955 * # Avoiding Duplicate Payments
23957 * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
23958 * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
23959 * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
23960 * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
23961 * second payment with the same [`PaymentId`].
23963 * Thus, in order to ensure duplicate payments are not sent, you should implement your own
23964 * tracking of payments, including state to indicate once a payment has completed. Because you
23965 * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
23966 * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
23967 * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
23969 * Additionally, in the scenario where we begin the process of sending a payment, but crash
23970 * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
23971 * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
23972 * [`ChannelManager::list_recent_payments`] for more information.
23974 * # Possible Error States on [`PaymentSendFailure`]
23976 * Each path may have a different return value, and PaymentSendValue may return a Vec with
23977 * each entry matching the corresponding-index entry in the route paths, see
23978 * [`PaymentSendFailure`] for more info.
23980 * In general, a path may raise:
23981 * * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
23982 * node public key) is specified.
23983 * * [`APIError::ChannelUnavailable`] if the next-hop channel is not available for updates
23984 * (including due to previous monitor update failure or new permanent monitor update
23986 * * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
23987 * relevant updates.
23989 * Note that depending on the type of the PaymentSendFailure the HTLC may have been
23990 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
23991 * different route unless you intend to pay twice!
23993 * # A caution on `payment_secret`
23995 * `payment_secret` is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
23996 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
23997 * attacks. For newer nodes, it will be provided to you in the invoice. If you do not have one,
23998 * the [`Route`] must not contain multiple paths as multi-path payments require a
23999 * recipient-provided `payment_secret`.
24001 * If a `payment_secret` *is* provided, we assume that the invoice had the payment_secret
24002 * feature bit set (either as required or as available). If multiple paths are present in the
24003 * [`Route`], we assume the invoice had the basic_mpp feature set.
24005 * [`Event::PaymentSent`]: events::Event::PaymentSent
24006 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
24007 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
24008 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
24010 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
24012 MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret, struct LDKThirtyTwoBytes payment_id);
24015 * Similar to [`ChannelManager::send_payment`], but will automatically find a route based on
24016 * `route_params` and retry failed payment paths based on `retry_strategy`.
24018 * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
24020 MUST_USE_RES struct LDKCResult_NoneRetryableSendFailureZ ChannelManager_send_payment_with_retry(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
24023 * Signals that no further retries for the given payment should occur. Useful if you have a
24024 * pending outbound payment with retries remaining, but wish to stop retrying the payment before
24025 * retries are exhausted.
24027 * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
24028 * as there are no remaining pending HTLCs for this payment.
24030 * Note that calling this method does *not* prevent a payment from succeeding. You must still
24031 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
24032 * determine the ultimate status of a payment.
24034 * If an [`Event::PaymentFailed`] event is generated and we restart without this
24035 * [`ChannelManager`] having been persisted, another [`Event::PaymentFailed`] may be generated.
24037 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
24038 * [`Event::PaymentSent`]: events::Event::PaymentSent
24040 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
24043 * Send a spontaneous payment, which is a payment that does not require the recipient to have
24044 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
24045 * the preimage, it must be a cryptographically secure random value that no intermediate node
24046 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
24047 * never reach the recipient.
24049 * See [`send_payment`] documentation for more details on the return value of this function
24050 * and idempotency guarantees provided by the [`PaymentId`] key.
24052 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
24053 * [`send_payment`] for more information about the risks of duplicate preimage usage.
24055 * Note that `route` must have exactly one path.
24057 * [`send_payment`]: Self::send_payment
24059 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
24061 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 LDKThirtyTwoBytes payment_id);
24064 * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
24065 * based on `route_params` and retry failed payment paths based on `retry_strategy`.
24067 * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
24070 * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
24072 * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
24074 MUST_USE_RES struct LDKCResult_PaymentHashRetryableSendFailureZ ChannelManager_send_spontaneous_payment_with_retry(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
24077 * Send a payment that is probing the given route for liquidity. We calculate the
24078 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
24079 * us to easily discern them from real payments.
24081 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ hops);
24084 * Call this upon creation of a funding transaction for the given channel.
24086 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
24087 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
24089 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
24090 * across the p2p network.
24092 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
24093 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
24095 * May panic if the output found in the funding transaction is duplicative with some other
24096 * channel (note that this should be trivially prevented by using unique funding transaction
24097 * keys per-channel).
24099 * Do NOT broadcast the funding transaction yourself. When we have safely received our
24100 * counterparty's signature the funding transaction will automatically be broadcast via the
24101 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
24103 * Note that this includes RBF or similar transaction replacement strategies - lightning does
24104 * not currently support replacing a funding transaction on an existing channel. Instead,
24105 * create a new channel with a conflicting funding transaction.
24107 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
24108 * the wallet software generating the funding transaction to apply anti-fee sniping as
24109 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
24110 * for more details.
24112 * [`Event::FundingGenerationReady`]: crate::util::events::Event::FundingGenerationReady
24113 * [`Event::ChannelClosed`]: crate::util::events::Event::ChannelClosed
24115 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);
24118 * Atomically updates the [`ChannelConfig`] for the given channels.
24120 * Once the updates are applied, each eligible channel (advertised with a known short channel
24121 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
24122 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
24123 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
24125 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
24126 * `counterparty_node_id` is provided.
24128 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
24129 * below [`MIN_CLTV_EXPIRY_DELTA`].
24131 * If an error is returned, none of the updates should be considered applied.
24133 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
24134 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
24135 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
24136 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
24137 * [`ChannelUpdate`]: msgs::ChannelUpdate
24138 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
24139 * [`APIMisuseError`]: APIError::APIMisuseError
24141 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);
24144 * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
24145 * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
24147 * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
24148 * channel to a receiving node if the node lacks sufficient inbound liquidity.
24150 * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
24151 * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
24152 * receiver's invoice route hints. These route hints will signal to LDK to generate an
24153 * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
24154 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
24156 * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
24157 * you from forwarding more than you received.
24159 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
24162 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
24163 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
24165 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);
24168 * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
24169 * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
24171 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
24174 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
24176 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
24179 * Processes HTLCs which are pending waiting on random forward delay.
24181 * Should only really ever be called in response to a PendingHTLCsForwardable event.
24182 * Will likely generate further events.
24184 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
24187 * Performs actions which should happen on startup and roughly once per minute thereafter.
24189 * This currently includes:
24190 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
24191 * * Broadcasting `ChannelUpdate` messages if we've been disconnected from our peer for more
24192 * than a minute, informing the network that they should no longer attempt to route over
24194 * * Expiring a channel's previous `ChannelConfig` if necessary to only allow forwarding HTLCs
24195 * with the current `ChannelConfig`.
24196 * * Removing peers which have disconnected but and no longer have any channels.
24198 * Note that this may cause reentrancy through `chain::Watch::update_channel` calls or feerate
24199 * estimate fetches.
24201 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
24204 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
24205 * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
24206 * along the path (including in our own channel on which we received it).
24208 * Note that in some cases around unclean shutdown, it is possible the payment may have
24209 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
24210 * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
24211 * may have already been failed automatically by LDK if it was nearing its expiration time.
24213 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
24214 * [`ChannelManager::claim_funds`]), you should still monitor for
24215 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
24216 * startup during which time claims that were in-progress at shutdown may be replayed.
24218 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
24221 * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
24222 * reason for the failure.
24224 * See [`FailureCode`] for valid failure codes.
24226 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], enum LDKFailureCode failure_code);
24229 * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
24230 * [`MessageSendEvent`]s needed to claim the payment.
24232 * Note that calling this method does *not* guarantee that the payment has been claimed. You
24233 * *must* wait for an [`Event::PaymentClaimed`] event which upon a successful claim will be
24234 * provided to your [`EventHandler`] when [`process_pending_events`] is next called.
24236 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
24237 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
24238 * event matches your expectation. If you fail to do so and call this method, you may provide
24239 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
24241 * [`Event::PaymentClaimable`]: crate::util::events::Event::PaymentClaimable
24242 * [`Event::PaymentClaimed`]: crate::util::events::Event::PaymentClaimed
24243 * [`process_pending_events`]: EventsProvider::process_pending_events
24244 * [`create_inbound_payment`]: Self::create_inbound_payment
24245 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
24247 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
24250 * Gets the node_id held by this ChannelManager
24252 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
24255 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
24257 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
24258 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
24261 * The `user_channel_id` parameter will be provided back in
24262 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
24263 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
24265 * Note that this method will return an error and reject the channel, if it requires support
24266 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
24267 * used to accept such channels.
24269 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
24270 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
24272 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);
24275 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
24276 * it as confirmed immediately.
24278 * The `user_channel_id` parameter will be provided back in
24279 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
24280 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
24282 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
24283 * and (if the counterparty agrees), enables forwarding of payments immediately.
24285 * This fully trusts that the counterparty has honestly and correctly constructed the funding
24286 * transaction and blindly assumes that it will eventually confirm.
24288 * If it does not confirm before we decide to close the channel, or if the funding transaction
24289 * does not pay to the correct script the correct amount, *you will lose funds*.
24291 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
24292 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
24294 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);
24297 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
24300 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
24301 * [`PaymentHash`] and [`PaymentPreimage`] for you.
24303 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which
24304 * will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with
24305 * its [`PaymentPurpose::InvoicePayment::payment_preimage`] field filled in. That should then be
24306 * passed directly to [`claim_funds`].
24308 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
24310 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
24311 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
24315 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
24316 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
24318 * Errors if `min_value_msat` is greater than total bitcoin supply.
24320 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
24321 * on versions of LDK prior to 0.0.114.
24323 * [`claim_funds`]: Self::claim_funds
24324 * [`PaymentClaimable`]: events::Event::PaymentClaimable
24325 * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
24326 * [`PaymentPurpose::InvoicePayment`]: events::PaymentPurpose::InvoicePayment
24327 * [`PaymentPurpose::InvoicePayment::payment_preimage`]: events::PaymentPurpose::InvoicePayment::payment_preimage
24328 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
24330 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);
24333 * Legacy version of [`create_inbound_payment`]. Use this method if you wish to share
24334 * serialized state with LDK node(s) running 0.0.103 and earlier.
24336 * May panic if `invoice_expiry_delta_secs` is greater than one year.
24339 * This method is deprecated and will be removed soon.
24341 * [`create_inbound_payment`]: Self::create_inbound_payment
24343 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);
24346 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
24347 * stored external to LDK.
24349 * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
24350 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
24351 * the `min_value_msat` provided here, if one is provided.
24353 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
24354 * note that LDK will not stop you from registering duplicate payment hashes for inbound
24357 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
24358 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
24359 * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
24360 * sender \"proof-of-payment\" unless they have paid the required amount.
24362 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
24363 * in excess of the current time. This should roughly match the expiry time set in the invoice.
24364 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
24365 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
24366 * invoices when no timeout is set.
24368 * Note that we use block header time to time-out pending inbound payments (with some margin
24369 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
24370 * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
24371 * If you need exact expiry semantics, you should enforce them upon receipt of
24372 * [`PaymentClaimable`].
24374 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
24375 * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
24377 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
24378 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
24382 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
24383 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
24385 * Errors if `min_value_msat` is greater than total bitcoin supply.
24387 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
24388 * on versions of LDK prior to 0.0.114.
24390 * [`create_inbound_payment`]: Self::create_inbound_payment
24391 * [`PaymentClaimable`]: events::Event::PaymentClaimable
24393 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);
24396 * Legacy version of [`create_inbound_payment_for_hash`]. Use this method if you wish to share
24397 * serialized state with LDK node(s) running 0.0.103 and earlier.
24399 * May panic if `invoice_expiry_delta_secs` is greater than one year.
24402 * This method is deprecated and will be removed soon.
24404 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
24406 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);
24409 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
24410 * previously returned from [`create_inbound_payment`].
24412 * [`create_inbound_payment`]: Self::create_inbound_payment
24414 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);
24417 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
24418 * are used when constructing the phantom invoice's route hints.
24420 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
24422 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
24425 * Gets route hints for use in receiving [phantom node payments].
24427 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
24429 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
24432 * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
24433 * used when constructing the route hints for HTLCs intended to be intercepted. See
24434 * [`ChannelManager::forward_intercepted_htlc`].
24436 * Note that this method is not guaranteed to return unique values, you may need to call it a few
24437 * times to get a unique scid.
24439 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
24442 * Gets inflight HTLC information by processing pending outbound payments that are in
24443 * our channels. May be used during pathfinding to account for in-use channel liquidity.
24445 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
24448 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
24449 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
24451 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
24454 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
24455 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
24457 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
24460 * Constructs a new Listen which calls the relevant methods on this_arg.
24461 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
24463 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
24466 * Constructs a new Confirm which calls the relevant methods on this_arg.
24467 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
24469 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
24472 * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool
24473 * indicating whether persistence is necessary. Only one listener on
24474 * [`await_persistable_update`], [`await_persistable_update_timeout`], or a future returned by
24475 * [`get_persistable_update_future`] is guaranteed to be woken up.
24477 * Note that this method is not available with the `no-std` feature.
24479 * [`await_persistable_update`]: Self::await_persistable_update
24480 * [`await_persistable_update_timeout`]: Self::await_persistable_update_timeout
24481 * [`get_persistable_update_future`]: Self::get_persistable_update_future
24483 MUST_USE_RES bool ChannelManager_await_persistable_update_timeout(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t max_wait);
24486 * Blocks until ChannelManager needs to be persisted. Only one listener on
24487 * [`await_persistable_update`], `await_persistable_update_timeout`, or a future returned by
24488 * [`get_persistable_update_future`] is guaranteed to be woken up.
24490 * [`await_persistable_update`]: Self::await_persistable_update
24491 * [`get_persistable_update_future`]: Self::get_persistable_update_future
24493 void ChannelManager_await_persistable_update(const struct LDKChannelManager *NONNULL_PTR this_arg);
24496 * Gets a [`Future`] that completes when a persistable update is available. Note that
24497 * callbacks registered on the [`Future`] MUST NOT call back into this [`ChannelManager`] and
24498 * should instead register actions to be taken later.
24500 MUST_USE_RES struct LDKFuture ChannelManager_get_persistable_update_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
24503 * Gets the latest best block which was connected either via the [`chain::Listen`] or
24504 * [`chain::Confirm`] interfaces.
24506 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
24509 * Fetches the set of [`NodeFeatures`] flags which are provided by or required by
24510 * [`ChannelManager`].
24512 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
24515 * Fetches the set of [`ChannelFeatures`] flags which are provided by or required by
24516 * [`ChannelManager`].
24518 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
24521 * Fetches the set of [`ChannelTypeFeatures`] flags which are provided by or required by
24522 * [`ChannelManager`].
24524 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
24527 * Fetches the set of [`InitFeatures`] flags which are provided by or required by
24528 * [`ChannelManager`].
24530 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
24533 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
24534 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
24536 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
24539 * Fetches the set of [`InitFeatures`] flags which are provided by or required by
24540 * [`ChannelManager`].
24542 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR _config);
24545 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
24547 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
24550 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
24552 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
24555 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
24557 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
24560 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
24562 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
24565 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
24567 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
24570 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
24572 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
24575 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
24577 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
24580 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
24582 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
24585 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
24587 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
24590 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
24592 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
24595 * A cryptographically secure source of entropy.
24597 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
24600 * A cryptographically secure source of entropy.
24602 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
24605 * A signer that is able to perform node-scoped cryptographic operations.
24607 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
24610 * A signer that is able to perform node-scoped cryptographic operations.
24612 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
24615 * The keys provider which will give us relevant keys. Some keys will be loaded during
24616 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
24619 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
24622 * The keys provider which will give us relevant keys. Some keys will be loaded during
24623 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
24626 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
24629 * The fee_estimator for use in the ChannelManager in the future.
24631 * No calls to the FeeEstimator will be made during deserialization.
24633 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
24636 * The fee_estimator for use in the ChannelManager in the future.
24638 * No calls to the FeeEstimator will be made during deserialization.
24640 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
24643 * The chain::Watch for use in the ChannelManager in the future.
24645 * No calls to the chain::Watch will be made during deserialization. It is assumed that
24646 * you have deserialized ChannelMonitors separately and will add them to your
24647 * chain::Watch after deserializing this ChannelManager.
24649 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
24652 * The chain::Watch for use in the ChannelManager in the future.
24654 * No calls to the chain::Watch will be made during deserialization. It is assumed that
24655 * you have deserialized ChannelMonitors separately and will add them to your
24656 * chain::Watch after deserializing this ChannelManager.
24658 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
24661 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
24662 * used to broadcast the latest local commitment transactions of channels which must be
24663 * force-closed during deserialization.
24665 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
24668 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
24669 * used to broadcast the latest local commitment transactions of channels which must be
24670 * force-closed during deserialization.
24672 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
24675 * The router which will be used in the ChannelManager in the future for finding routes
24676 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
24678 * No calls to the router will be made during deserialization.
24680 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
24683 * The router which will be used in the ChannelManager in the future for finding routes
24684 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
24686 * No calls to the router will be made during deserialization.
24688 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
24691 * The Logger for use in the ChannelManager and which may be used to log information during
24694 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
24697 * The Logger for use in the ChannelManager and which may be used to log information during
24700 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
24703 * Default settings used for new channels. Any existing channels will continue to use the
24704 * runtime settings which were stored when the ChannelManager was serialized.
24706 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
24709 * Default settings used for new channels. Any existing channels will continue to use the
24710 * runtime settings which were stored when the ChannelManager was serialized.
24712 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
24715 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
24716 * HashMap for you. This is primarily useful for C bindings where it is not practical to
24717 * populate a HashMap directly from C.
24719 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);
24722 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
24724 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
24727 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
24729 void ExpandedKey_free(struct LDKExpandedKey this_obj);
24732 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
24734 * It is recommended to cache this value and not regenerate it for each new inbound payment.
24736 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
24739 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
24740 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
24741 * a `ChannelManager`.
24743 * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
24744 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
24745 * regenerate it for each new inbound payment.
24747 * `current_time` is a Unix timestamp representing the current time.
24749 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
24750 * on versions of LDK prior to 0.0.114.
24752 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
24753 * [`NodeSigner::get_inbound_payment_key_material`]: crate::chain::keysinterface::NodeSigner::get_inbound_payment_key_material
24755 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);
24758 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
24759 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
24760 * without a `ChannelManager`.
24762 * See [`create`] for information on the `keys` and `current_time` parameters.
24764 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
24765 * on versions of LDK prior to 0.0.114.
24767 * [phantom node payments]: crate::chain::keysinterface::PhantomKeysManager
24769 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);
24772 * Frees any resources used by the DecodeError
24774 void DecodeError_free(struct LDKDecodeError this_ptr);
24777 * Creates a copy of the DecodeError
24779 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
24782 * Utility method to constructs a new UnknownVersion-variant DecodeError
24784 struct LDKDecodeError DecodeError_unknown_version(void);
24787 * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
24789 struct LDKDecodeError DecodeError_unknown_required_feature(void);
24792 * Utility method to constructs a new InvalidValue-variant DecodeError
24794 struct LDKDecodeError DecodeError_invalid_value(void);
24797 * Utility method to constructs a new ShortRead-variant DecodeError
24799 struct LDKDecodeError DecodeError_short_read(void);
24802 * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
24804 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
24807 * Utility method to constructs a new Io-variant DecodeError
24809 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
24812 * Utility method to constructs a new UnsupportedCompression-variant DecodeError
24814 struct LDKDecodeError DecodeError_unsupported_compression(void);
24817 * Checks if two DecodeErrors contain equal inner contents.
24818 * This ignores pointers and is_owned flags and looks at the values in fields.
24820 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
24823 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
24825 void Init_free(struct LDKInit this_obj);
24828 * The relevant features which the sender supports.
24830 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
24833 * The relevant features which the sender supports.
24835 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
24838 * The receipient's network address.
24840 * This adds the option to report a remote IP address back to a connecting peer using the init
24841 * message. A node can decide to use that information to discover a potential update to its
24842 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
24845 struct LDKCOption_NetAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
24848 * The receipient's network address.
24850 * This adds the option to report a remote IP address back to a connecting peer using the init
24851 * message. A node can decide to use that information to discover a potential update to its
24852 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
24855 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_NetAddressZ val);
24858 * Constructs a new Init given each field
24860 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_NetAddressZ remote_network_address_arg);
24863 * Creates a copy of the Init
24865 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
24868 * Checks if two Inits contain equal inner contents.
24869 * This ignores pointers and is_owned flags and looks at the values in fields.
24870 * Two objects with NULL inner values will be considered "equal" here.
24872 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
24875 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
24877 void ErrorMessage_free(struct LDKErrorMessage this_obj);
24880 * The channel ID involved in the error.
24882 * All-0s indicates a general error unrelated to a specific channel, after which all channels
24883 * with the sending peer should be closed.
24885 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
24888 * The channel ID involved in the error.
24890 * All-0s indicates a general error unrelated to a specific channel, after which all channels
24891 * with the sending peer should be closed.
24893 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24896 * A possibly human-readable error description.
24898 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
24899 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
24900 * the terminal emulator or the logging subsystem.
24902 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
24905 * A possibly human-readable error description.
24907 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
24908 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
24909 * the terminal emulator or the logging subsystem.
24911 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
24914 * Constructs a new ErrorMessage given each field
24916 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
24919 * Creates a copy of the ErrorMessage
24921 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
24924 * Checks if two ErrorMessages contain equal inner contents.
24925 * This ignores pointers and is_owned flags and looks at the values in fields.
24926 * Two objects with NULL inner values will be considered "equal" here.
24928 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
24931 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
24933 void WarningMessage_free(struct LDKWarningMessage this_obj);
24936 * The channel ID involved in the warning.
24938 * All-0s indicates a warning unrelated to a specific channel.
24940 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
24943 * The channel ID involved in the warning.
24945 * All-0s indicates a warning unrelated to a specific channel.
24947 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
24950 * A possibly human-readable warning description.
24952 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
24953 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
24954 * the terminal emulator or the logging subsystem.
24956 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
24959 * A possibly human-readable warning description.
24961 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
24962 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
24963 * the terminal emulator or the logging subsystem.
24965 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
24968 * Constructs a new WarningMessage given each field
24970 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
24973 * Creates a copy of the WarningMessage
24975 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
24978 * Checks if two WarningMessages contain equal inner contents.
24979 * This ignores pointers and is_owned flags and looks at the values in fields.
24980 * Two objects with NULL inner values will be considered "equal" here.
24982 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
24985 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
24987 void Ping_free(struct LDKPing this_obj);
24990 * The desired response length.
24992 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
24995 * The desired response length.
24997 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
25000 * The ping packet size.
25002 * This field is not sent on the wire. byteslen zeros are sent.
25004 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
25007 * The ping packet size.
25009 * This field is not sent on the wire. byteslen zeros are sent.
25011 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
25014 * Constructs a new Ping given each field
25016 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
25019 * Creates a copy of the Ping
25021 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
25024 * Checks if two Pings contain equal inner contents.
25025 * This ignores pointers and is_owned flags and looks at the values in fields.
25026 * Two objects with NULL inner values will be considered "equal" here.
25028 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
25031 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
25033 void Pong_free(struct LDKPong this_obj);
25036 * The pong packet size.
25038 * This field is not sent on the wire. byteslen zeros are sent.
25040 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
25043 * The pong packet size.
25045 * This field is not sent on the wire. byteslen zeros are sent.
25047 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
25050 * Constructs a new Pong given each field
25052 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
25055 * Creates a copy of the Pong
25057 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
25060 * Checks if two Pongs contain equal inner contents.
25061 * This ignores pointers and is_owned flags and looks at the values in fields.
25062 * Two objects with NULL inner values will be considered "equal" here.
25064 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
25067 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
25069 void OpenChannel_free(struct LDKOpenChannel this_obj);
25072 * The genesis hash of the blockchain where the channel is to be opened
25074 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
25077 * The genesis hash of the blockchain where the channel is to be opened
25079 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25082 * A temporary channel ID, until the funding outpoint is announced
25084 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
25087 * A temporary channel ID, until the funding outpoint is announced
25089 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25092 * The channel value
25094 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25097 * The channel value
25099 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
25102 * The amount to push to the counterparty as part of the open, in milli-satoshi
25104 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25107 * The amount to push to the counterparty as part of the open, in milli-satoshi
25109 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
25112 * The threshold below which outputs on transactions broadcast by sender will be omitted
25114 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25117 * The threshold below which outputs on transactions broadcast by sender will be omitted
25119 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
25122 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
25124 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25127 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
25129 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
25132 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
25134 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25137 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
25139 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
25142 * The minimum HTLC size incoming to sender, in milli-satoshi
25144 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25147 * The minimum HTLC size incoming to sender, in milli-satoshi
25149 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
25152 * The feerate per 1000-weight of sender generated transactions, until updated by
25155 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25158 * The feerate per 1000-weight of sender generated transactions, until updated by
25161 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
25164 * The number of blocks which the counterparty will have to wait to claim on-chain funds if
25165 * they broadcast a commitment transaction
25167 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25170 * The number of blocks which the counterparty will have to wait to claim on-chain funds if
25171 * they broadcast a commitment transaction
25173 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
25176 * The maximum number of inbound HTLCs towards sender
25178 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25181 * The maximum number of inbound HTLCs towards sender
25183 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
25186 * The sender's key controlling the funding transaction
25188 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25191 * The sender's key controlling the funding transaction
25193 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25196 * Used to derive a revocation key for transactions broadcast by counterparty
25198 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25201 * Used to derive a revocation key for transactions broadcast by counterparty
25203 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25206 * A payment key to sender for transactions broadcast by counterparty
25208 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25211 * A payment key to sender for transactions broadcast by counterparty
25213 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25216 * Used to derive a payment key to sender for transactions broadcast by sender
25218 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25221 * Used to derive a payment key to sender for transactions broadcast by sender
25223 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25226 * Used to derive an HTLC payment key to sender
25228 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25231 * Used to derive an HTLC payment key to sender
25233 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25236 * The first to-be-broadcast-by-sender transaction's per commitment point
25238 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25241 * The first to-be-broadcast-by-sender transaction's per commitment point
25243 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25246 * The channel flags to be used
25248 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25251 * The channel flags to be used
25253 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
25256 * The channel type that this channel will represent
25258 * If this is `None`, we derive the channel type from the intersection of our
25259 * feature bits with our counterparty's feature bits from the [`Init`] message.
25261 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25263 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
25266 * The channel type that this channel will represent
25268 * If this is `None`, we derive the channel type from the intersection of our
25269 * feature bits with our counterparty's feature bits from the [`Init`] message.
25271 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25273 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
25276 * Creates a copy of the OpenChannel
25278 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
25281 * Checks if two OpenChannels contain equal inner contents.
25282 * This ignores pointers and is_owned flags and looks at the values in fields.
25283 * Two objects with NULL inner values will be considered "equal" here.
25285 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
25288 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
25290 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
25293 * A temporary channel ID, until the funding outpoint is announced
25295 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
25298 * A temporary channel ID, until the funding outpoint is announced
25300 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25303 * The threshold below which outputs on transactions broadcast by sender will be omitted
25305 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25308 * The threshold below which outputs on transactions broadcast by sender will be omitted
25310 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
25313 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
25315 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25318 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
25320 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
25323 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
25325 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25328 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
25330 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
25333 * The minimum HTLC size incoming to sender, in milli-satoshi
25335 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25338 * The minimum HTLC size incoming to sender, in milli-satoshi
25340 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
25343 * Minimum depth of the funding transaction before the channel is considered open
25345 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25348 * Minimum depth of the funding transaction before the channel is considered open
25350 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
25353 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
25355 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25358 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
25360 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
25363 * The maximum number of inbound HTLCs towards sender
25365 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25368 * The maximum number of inbound HTLCs towards sender
25370 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
25373 * The sender's key controlling the funding transaction
25375 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25378 * The sender's key controlling the funding transaction
25380 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25383 * Used to derive a revocation key for transactions broadcast by counterparty
25385 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25388 * Used to derive a revocation key for transactions broadcast by counterparty
25390 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25393 * A payment key to sender for transactions broadcast by counterparty
25395 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25398 * A payment key to sender for transactions broadcast by counterparty
25400 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25403 * Used to derive a payment key to sender for transactions broadcast by sender
25405 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25408 * Used to derive a payment key to sender for transactions broadcast by sender
25410 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25413 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
25415 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25418 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
25420 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25423 * The first to-be-broadcast-by-sender transaction's per commitment point
25425 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25428 * The first to-be-broadcast-by-sender transaction's per commitment point
25430 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25433 * The channel type that this channel will represent.
25435 * If this is `None`, we derive the channel type from the intersection of
25436 * our feature bits with our counterparty's feature bits from the [`Init`] message.
25437 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
25439 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25441 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
25444 * The channel type that this channel will represent.
25446 * If this is `None`, we derive the channel type from the intersection of
25447 * our feature bits with our counterparty's feature bits from the [`Init`] message.
25448 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
25450 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25452 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
25455 * Creates a copy of the AcceptChannel
25457 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
25460 * Checks if two AcceptChannels contain equal inner contents.
25461 * This ignores pointers and is_owned flags and looks at the values in fields.
25462 * Two objects with NULL inner values will be considered "equal" here.
25464 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
25467 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
25469 void FundingCreated_free(struct LDKFundingCreated this_obj);
25472 * A temporary channel ID, until the funding is established
25474 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
25477 * A temporary channel ID, until the funding is established
25479 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25482 * The funding transaction ID
25484 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
25487 * The funding transaction ID
25489 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25492 * The specific output index funding this channel
25494 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
25497 * The specific output index funding this channel
25499 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
25502 * The signature of the channel initiator (funder) on the initial commitment transaction
25504 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
25507 * The signature of the channel initiator (funder) on the initial commitment transaction
25509 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
25512 * Constructs a new FundingCreated given each field
25514 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);
25517 * Creates a copy of the FundingCreated
25519 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
25522 * Checks if two FundingCreateds contain equal inner contents.
25523 * This ignores pointers and is_owned flags and looks at the values in fields.
25524 * Two objects with NULL inner values will be considered "equal" here.
25526 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
25529 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
25531 void FundingSigned_free(struct LDKFundingSigned this_obj);
25536 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
25541 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25544 * The signature of the channel acceptor (fundee) on the initial commitment transaction
25546 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
25549 * The signature of the channel acceptor (fundee) on the initial commitment transaction
25551 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
25554 * Constructs a new FundingSigned given each field
25556 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
25559 * Creates a copy of the FundingSigned
25561 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
25564 * Checks if two FundingSigneds contain equal inner contents.
25565 * This ignores pointers and is_owned flags and looks at the values in fields.
25566 * Two objects with NULL inner values will be considered "equal" here.
25568 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
25571 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
25573 void ChannelReady_free(struct LDKChannelReady this_obj);
25578 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
25583 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25586 * The per-commitment point of the second commitment transaction
25588 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
25591 * The per-commitment point of the second commitment transaction
25593 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25596 * If set, provides a `short_channel_id` alias for this channel.
25598 * The sender will accept payments to be forwarded over this SCID and forward them to this
25599 * messages' recipient.
25601 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
25604 * If set, provides a `short_channel_id` alias for this channel.
25606 * The sender will accept payments to be forwarded over this SCID and forward them to this
25607 * messages' recipient.
25609 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
25612 * Constructs a new ChannelReady given each field
25614 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);
25617 * Creates a copy of the ChannelReady
25619 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
25622 * Checks if two ChannelReadys contain equal inner contents.
25623 * This ignores pointers and is_owned flags and looks at the values in fields.
25624 * Two objects with NULL inner values will be considered "equal" here.
25626 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
25629 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
25631 void Shutdown_free(struct LDKShutdown this_obj);
25636 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
25641 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25644 * The destination of this peer's funds on closing.
25646 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
25648 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
25651 * The destination of this peer's funds on closing.
25653 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
25655 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
25658 * Constructs a new Shutdown given each field
25660 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
25663 * Creates a copy of the Shutdown
25665 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
25668 * Checks if two Shutdowns contain equal inner contents.
25669 * This ignores pointers and is_owned flags and looks at the values in fields.
25670 * Two objects with NULL inner values will be considered "equal" here.
25672 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
25675 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
25677 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
25680 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
25683 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
25686 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
25689 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
25692 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
25695 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
25698 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
25701 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
25704 * Constructs a new ClosingSignedFeeRange given each field
25706 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
25709 * Creates a copy of the ClosingSignedFeeRange
25711 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
25714 * Checks if two ClosingSignedFeeRanges contain equal inner contents.
25715 * This ignores pointers and is_owned flags and looks at the values in fields.
25716 * Two objects with NULL inner values will be considered "equal" here.
25718 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
25721 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
25723 void ClosingSigned_free(struct LDKClosingSigned this_obj);
25728 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
25733 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25736 * The proposed total fee for the closing transaction
25738 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
25741 * The proposed total fee for the closing transaction
25743 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
25746 * A signature on the closing transaction
25748 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
25751 * A signature on the closing transaction
25753 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
25756 * The minimum and maximum fees which the sender is willing to accept, provided only by new
25759 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
25761 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
25764 * The minimum and maximum fees which the sender is willing to accept, provided only by new
25767 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
25769 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
25772 * Constructs a new ClosingSigned given each field
25774 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);
25777 * Creates a copy of the ClosingSigned
25779 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
25782 * Checks if two ClosingSigneds contain equal inner contents.
25783 * This ignores pointers and is_owned flags and looks at the values in fields.
25784 * Two objects with NULL inner values will be considered "equal" here.
25786 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
25789 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
25791 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
25796 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
25801 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25806 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
25811 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
25814 * The HTLC value in milli-satoshi
25816 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
25819 * The HTLC value in milli-satoshi
25821 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
25824 * The payment hash, the pre-image of which controls HTLC redemption
25826 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
25829 * The payment hash, the pre-image of which controls HTLC redemption
25831 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25834 * The expiry height of the HTLC
25836 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
25839 * The expiry height of the HTLC
25841 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
25844 * Creates a copy of the UpdateAddHTLC
25846 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
25849 * Checks if two UpdateAddHTLCs contain equal inner contents.
25850 * This ignores pointers and is_owned flags and looks at the values in fields.
25851 * Two objects with NULL inner values will be considered "equal" here.
25853 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
25856 * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
25858 void OnionMessage_free(struct LDKOnionMessage this_obj);
25861 * Used in decrypting the onion packet's payload.
25863 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
25866 * Used in decrypting the onion packet's payload.
25868 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
25871 * Creates a copy of the OnionMessage
25873 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
25876 * Checks if two OnionMessages contain equal inner contents.
25877 * This ignores pointers and is_owned flags and looks at the values in fields.
25878 * Two objects with NULL inner values will be considered "equal" here.
25880 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
25883 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
25885 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
25890 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
25895 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25900 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
25905 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
25908 * The pre-image of the payment hash, allowing HTLC redemption
25910 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
25913 * The pre-image of the payment hash, allowing HTLC redemption
25915 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25918 * Constructs a new UpdateFulfillHTLC given each field
25920 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
25923 * Creates a copy of the UpdateFulfillHTLC
25925 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
25928 * Checks if two UpdateFulfillHTLCs contain equal inner contents.
25929 * This ignores pointers and is_owned flags and looks at the values in fields.
25930 * Two objects with NULL inner values will be considered "equal" here.
25932 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
25935 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
25937 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
25942 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
25947 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25952 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
25957 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
25960 * Creates a copy of the UpdateFailHTLC
25962 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
25965 * Checks if two UpdateFailHTLCs contain equal inner contents.
25966 * This ignores pointers and is_owned flags and looks at the values in fields.
25967 * Two objects with NULL inner values will be considered "equal" here.
25969 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
25972 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
25974 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
25979 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
25984 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
25989 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
25994 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
25999 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
26004 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
26007 * Creates a copy of the UpdateFailMalformedHTLC
26009 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
26012 * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
26013 * This ignores pointers and is_owned flags and looks at the values in fields.
26014 * Two objects with NULL inner values will be considered "equal" here.
26016 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
26019 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
26021 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
26026 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
26031 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26034 * A signature on the commitment transaction
26036 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
26039 * A signature on the commitment transaction
26041 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
26044 * Signatures on the HTLC transactions
26046 * Returns a copy of the field.
26048 struct LDKCVec_SignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
26051 * Signatures on the HTLC transactions
26053 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
26056 * Constructs a new CommitmentSigned given each field
26058 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
26061 * Creates a copy of the CommitmentSigned
26063 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
26066 * Checks if two CommitmentSigneds 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 CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
26073 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
26075 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
26080 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
26085 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26088 * The secret corresponding to the per-commitment point
26090 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
26093 * The secret corresponding to the per-commitment point
26095 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26098 * The next sender-broadcast commitment transaction's per-commitment point
26100 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
26103 * The next sender-broadcast commitment transaction's per-commitment point
26105 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26108 * Constructs a new RevokeAndACK given each field
26110 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);
26113 * Creates a copy of the RevokeAndACK
26115 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
26118 * Checks if two RevokeAndACKs contain equal inner contents.
26119 * This ignores pointers and is_owned flags and looks at the values in fields.
26120 * Two objects with NULL inner values will be considered "equal" here.
26122 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
26125 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
26127 void UpdateFee_free(struct LDKUpdateFee this_obj);
26132 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
26137 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26140 * Fee rate per 1000-weight of the transaction
26142 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
26145 * Fee rate per 1000-weight of the transaction
26147 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
26150 * Constructs a new UpdateFee given each field
26152 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
26155 * Creates a copy of the UpdateFee
26157 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
26160 * Checks if two UpdateFees contain equal inner contents.
26161 * This ignores pointers and is_owned flags and looks at the values in fields.
26162 * Two objects with NULL inner values will be considered "equal" here.
26164 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
26167 * Frees any resources used by the DataLossProtect, if is_owned is set and inner is non-NULL.
26169 void DataLossProtect_free(struct LDKDataLossProtect this_obj);
26172 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
26173 * belonging to the recipient
26175 const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
26178 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
26179 * belonging to the recipient
26181 void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26184 * The sender's per-commitment point for their current commitment transaction
26186 struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr);
26189 * The sender's per-commitment point for their current commitment transaction
26191 void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val);
26194 * Constructs a new DataLossProtect given each field
26196 MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg);
26199 * Creates a copy of the DataLossProtect
26201 struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
26204 * Checks if two DataLossProtects contain equal inner contents.
26205 * This ignores pointers and is_owned flags and looks at the values in fields.
26206 * Two objects with NULL inner values will be considered "equal" here.
26208 bool DataLossProtect_eq(const struct LDKDataLossProtect *NONNULL_PTR a, const struct LDKDataLossProtect *NONNULL_PTR b);
26211 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
26213 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
26218 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
26223 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26226 * The next commitment number for the sender
26228 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
26231 * The next commitment number for the sender
26233 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
26236 * The next commitment number for the recipient
26238 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
26241 * The next commitment number for the recipient
26243 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
26246 * Creates a copy of the ChannelReestablish
26248 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
26251 * Checks if two ChannelReestablishs contain equal inner contents.
26252 * This ignores pointers and is_owned flags and looks at the values in fields.
26253 * Two objects with NULL inner values will be considered "equal" here.
26255 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
26258 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
26260 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
26265 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
26270 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26273 * The short channel ID
26275 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
26278 * The short channel ID
26280 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
26283 * A signature by the node key
26285 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
26288 * A signature by the node key
26290 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
26293 * A signature by the funding key
26295 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
26298 * A signature by the funding key
26300 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
26303 * Constructs a new AnnouncementSignatures given each field
26305 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);
26308 * Creates a copy of the AnnouncementSignatures
26310 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
26313 * Checks if two AnnouncementSignaturess contain equal inner contents.
26314 * This ignores pointers and is_owned flags and looks at the values in fields.
26315 * Two objects with NULL inner values will be considered "equal" here.
26317 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
26320 * Frees any resources used by the NetAddress
26322 void NetAddress_free(struct LDKNetAddress this_ptr);
26325 * Creates a copy of the NetAddress
26327 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
26330 * Utility method to constructs a new IPv4-variant NetAddress
26332 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
26335 * Utility method to constructs a new IPv6-variant NetAddress
26337 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
26340 * Utility method to constructs a new OnionV2-variant NetAddress
26342 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
26345 * Utility method to constructs a new OnionV3-variant NetAddress
26347 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
26350 * Utility method to constructs a new Hostname-variant NetAddress
26352 struct LDKNetAddress NetAddress_hostname(struct LDKHostname hostname, uint16_t port);
26355 * Checks if two NetAddresss contain equal inner contents.
26356 * This ignores pointers and is_owned flags and looks at the values in fields.
26358 bool NetAddress_eq(const struct LDKNetAddress *NONNULL_PTR a, const struct LDKNetAddress *NONNULL_PTR b);
26361 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
26363 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
26366 * Read a NetAddress from a byte array, created by NetAddress_write
26368 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
26371 * Frees any resources used by the UnsignedGossipMessage
26373 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
26376 * Creates a copy of the UnsignedGossipMessage
26378 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
26381 * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
26383 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
26386 * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
26388 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
26391 * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
26393 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
26396 * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
26398 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
26401 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
26403 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
26406 * The advertised features
26408 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
26411 * The advertised features
26413 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
26416 * A strictly monotonic announcement counter, with gaps allowed
26418 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
26421 * A strictly monotonic announcement counter, with gaps allowed
26423 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
26426 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
26429 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
26432 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
26435 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
26438 * An RGB color for UI purposes
26440 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
26443 * An RGB color for UI purposes
26445 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
26448 * An alias, for UI purposes.
26450 * This should be sanitized before use. There is no guarantee of uniqueness.
26452 const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32];
26455 * An alias, for UI purposes.
26457 * This should be sanitized before use. There is no guarantee of uniqueness.
26459 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26462 * List of addresses on which this node is reachable
26464 * Returns a copy of the field.
26466 struct LDKCVec_NetAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
26469 * List of addresses on which this node is reachable
26471 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
26474 * Creates a copy of the UnsignedNodeAnnouncement
26476 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
26479 * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
26480 * This ignores pointers and is_owned flags and looks at the values in fields.
26481 * Two objects with NULL inner values will be considered "equal" here.
26483 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
26486 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
26488 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
26491 * The signature by the node key
26493 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
26496 * The signature by the node key
26498 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
26501 * The actual content of the announcement
26503 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
26506 * The actual content of the announcement
26508 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
26511 * Constructs a new NodeAnnouncement given each field
26513 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
26516 * Creates a copy of the NodeAnnouncement
26518 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
26521 * Checks if two NodeAnnouncements contain equal inner contents.
26522 * This ignores pointers and is_owned flags and looks at the values in fields.
26523 * Two objects with NULL inner values will be considered "equal" here.
26525 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
26528 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
26530 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
26533 * The advertised channel features
26535 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
26538 * The advertised channel features
26540 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
26543 * The genesis hash of the blockchain where the channel is to be opened
26545 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
26548 * The genesis hash of the blockchain where the channel is to be opened
26550 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26553 * The short channel ID
26555 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
26558 * The short channel ID
26560 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
26563 * One of the two `node_id`s which are endpoints of this channel
26565 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
26568 * One of the two `node_id`s which are endpoints of this channel
26570 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
26573 * The other of the two `node_id`s which are endpoints of this channel
26575 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
26578 * The other of the two `node_id`s which are endpoints of this channel
26580 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
26583 * The funding key for the first node
26585 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
26588 * The funding key for the first node
26590 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
26593 * The funding key for the second node
26595 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
26598 * The funding key for the second node
26600 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
26603 * Creates a copy of the UnsignedChannelAnnouncement
26605 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
26608 * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
26609 * This ignores pointers and is_owned flags and looks at the values in fields.
26610 * Two objects with NULL inner values will be considered "equal" here.
26612 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
26615 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
26617 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
26620 * Authentication of the announcement by the first public node
26622 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
26625 * Authentication of the announcement by the first public node
26627 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
26630 * Authentication of the announcement by the second public node
26632 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
26635 * Authentication of the announcement by the second public node
26637 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
26640 * Proof of funding UTXO ownership by the first public node
26642 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
26645 * Proof of funding UTXO ownership by the first public node
26647 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
26650 * Proof of funding UTXO ownership by the second public node
26652 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
26655 * Proof of funding UTXO ownership by the second public node
26657 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
26660 * The actual announcement
26662 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
26665 * The actual announcement
26667 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
26670 * Constructs a new ChannelAnnouncement given each field
26672 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);
26675 * Creates a copy of the ChannelAnnouncement
26677 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
26680 * Checks if two ChannelAnnouncements contain equal inner contents.
26681 * This ignores pointers and is_owned flags and looks at the values in fields.
26682 * Two objects with NULL inner values will be considered "equal" here.
26684 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
26687 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
26689 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
26692 * The genesis hash of the blockchain where the channel is to be opened
26694 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
26697 * The genesis hash of the blockchain where the channel is to be opened
26699 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26702 * The short channel ID
26704 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
26707 * The short channel ID
26709 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
26712 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
26714 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
26717 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
26719 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
26724 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
26729 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
26732 * The number of blocks such that if:
26733 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
26734 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
26735 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
26736 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
26737 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
26738 * forwarding. Note that the HTLC sender is the one who originally sets this value when
26739 * constructing the route.
26741 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
26744 * The number of blocks such that if:
26745 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
26746 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
26747 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
26748 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
26749 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
26750 * forwarding. Note that the HTLC sender is the one who originally sets this value when
26751 * constructing the route.
26753 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
26756 * The minimum HTLC size incoming to sender, in milli-satoshi
26758 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
26761 * The minimum HTLC size incoming to sender, in milli-satoshi
26763 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
26766 * The maximum HTLC value incoming to sender, in milli-satoshi.
26768 * This used to be optional.
26770 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
26773 * The maximum HTLC value incoming to sender, in milli-satoshi.
26775 * This used to be optional.
26777 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
26780 * The base HTLC fee charged by sender, in milli-satoshi
26782 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
26785 * The base HTLC fee charged by sender, in milli-satoshi
26787 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
26790 * The amount to fee multiplier, in micro-satoshi
26792 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
26795 * The amount to fee multiplier, in micro-satoshi
26797 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
26800 * Excess data which was signed as a part of the message which we do not (yet) understand how
26803 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
26805 * Returns a copy of the field.
26807 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
26810 * Excess data which was signed as a part of the message which we do not (yet) understand how
26813 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
26815 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
26818 * Constructs a new UnsignedChannelUpdate given each field
26820 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);
26823 * Creates a copy of the UnsignedChannelUpdate
26825 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
26828 * Checks if two UnsignedChannelUpdates contain equal inner contents.
26829 * This ignores pointers and is_owned flags and looks at the values in fields.
26830 * Two objects with NULL inner values will be considered "equal" here.
26832 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
26835 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
26837 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
26840 * A signature of the channel update
26842 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
26845 * A signature of the channel update
26847 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
26850 * The actual channel update
26852 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
26855 * The actual channel update
26857 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
26860 * Constructs a new ChannelUpdate given each field
26862 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
26865 * Creates a copy of the ChannelUpdate
26867 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
26870 * Checks if two ChannelUpdates contain equal inner contents.
26871 * This ignores pointers and is_owned flags and looks at the values in fields.
26872 * Two objects with NULL inner values will be considered "equal" here.
26874 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
26877 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
26879 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
26882 * The genesis hash of the blockchain being queried
26884 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
26887 * The genesis hash of the blockchain being queried
26889 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26892 * The height of the first block for the channel UTXOs being queried
26894 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
26897 * The height of the first block for the channel UTXOs being queried
26899 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
26902 * The number of blocks to include in the query results
26904 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
26907 * The number of blocks to include in the query results
26909 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
26912 * Constructs a new QueryChannelRange given each field
26914 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
26917 * Creates a copy of the QueryChannelRange
26919 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
26922 * Checks if two QueryChannelRanges contain equal inner contents.
26923 * This ignores pointers and is_owned flags and looks at the values in fields.
26924 * Two objects with NULL inner values will be considered "equal" here.
26926 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
26929 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
26931 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
26934 * The genesis hash of the blockchain being queried
26936 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
26939 * The genesis hash of the blockchain being queried
26941 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
26944 * The height of the first block in the range of the reply
26946 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
26949 * The height of the first block in the range of the reply
26951 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
26954 * The number of blocks included in the range of the reply
26956 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
26959 * The number of blocks included in the range of the reply
26961 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
26964 * True when this is the final reply for a query
26966 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
26969 * True when this is the final reply for a query
26971 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
26974 * The `short_channel_id`s in the channel range
26976 * Returns a copy of the field.
26978 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
26981 * The `short_channel_id`s in the channel range
26983 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
26986 * Constructs a new ReplyChannelRange given each field
26988 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);
26991 * Creates a copy of the ReplyChannelRange
26993 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
26996 * Checks if two ReplyChannelRanges contain equal inner contents.
26997 * This ignores pointers and is_owned flags and looks at the values in fields.
26998 * Two objects with NULL inner values will be considered "equal" here.
27000 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
27003 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
27005 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
27008 * The genesis hash of the blockchain being queried
27010 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
27013 * The genesis hash of the blockchain being queried
27015 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27018 * The short_channel_ids that are being queried
27020 * Returns a copy of the field.
27022 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
27025 * The short_channel_ids that are being queried
27027 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
27030 * Constructs a new QueryShortChannelIds given each field
27032 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
27035 * Creates a copy of the QueryShortChannelIds
27037 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
27040 * Checks if two QueryShortChannelIdss contain equal inner contents.
27041 * This ignores pointers and is_owned flags and looks at the values in fields.
27042 * Two objects with NULL inner values will be considered "equal" here.
27044 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
27047 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
27049 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
27052 * The genesis hash of the blockchain that was queried
27054 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
27057 * The genesis hash of the blockchain that was queried
27059 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27062 * Indicates if the query recipient maintains up-to-date channel
27063 * information for the `chain_hash`
27065 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
27068 * Indicates if the query recipient maintains up-to-date channel
27069 * information for the `chain_hash`
27071 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
27074 * Constructs a new ReplyShortChannelIdsEnd given each field
27076 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
27079 * Creates a copy of the ReplyShortChannelIdsEnd
27081 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
27084 * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
27085 * This ignores pointers and is_owned flags and looks at the values in fields.
27086 * Two objects with NULL inner values will be considered "equal" here.
27088 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
27091 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
27093 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
27096 * The genesis hash of the blockchain for channel and node information
27098 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
27101 * The genesis hash of the blockchain for channel and node information
27103 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27106 * The starting unix timestamp
27108 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
27111 * The starting unix timestamp
27113 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
27116 * The range of information in seconds
27118 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
27121 * The range of information in seconds
27123 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
27126 * Constructs a new GossipTimestampFilter given each field
27128 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
27131 * Creates a copy of the GossipTimestampFilter
27133 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
27136 * Checks if two GossipTimestampFilters contain equal inner contents.
27137 * This ignores pointers and is_owned flags and looks at the values in fields.
27138 * Two objects with NULL inner values will be considered "equal" here.
27140 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
27143 * Frees any resources used by the ErrorAction
27145 void ErrorAction_free(struct LDKErrorAction this_ptr);
27148 * Creates a copy of the ErrorAction
27150 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
27153 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
27155 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
27158 * Utility method to constructs a new IgnoreError-variant ErrorAction
27160 struct LDKErrorAction ErrorAction_ignore_error(void);
27163 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
27165 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
27168 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
27170 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
27173 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
27175 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
27178 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
27180 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
27183 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
27185 void LightningError_free(struct LDKLightningError this_obj);
27188 * A human-readable message describing the error
27190 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
27193 * A human-readable message describing the error
27195 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
27198 * The action which should be taken against the offending peer.
27200 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
27203 * The action which should be taken against the offending peer.
27205 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
27208 * Constructs a new LightningError given each field
27210 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
27213 * Creates a copy of the LightningError
27215 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
27218 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
27220 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
27223 * `update_add_htlc` messages which should be sent
27225 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
27228 * `update_add_htlc` messages which should be sent
27230 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
27233 * `update_fulfill_htlc` messages which should be sent
27235 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
27238 * `update_fulfill_htlc` messages which should be sent
27240 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
27243 * `update_fail_htlc` messages which should be sent
27245 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
27248 * `update_fail_htlc` messages which should be sent
27250 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
27253 * `update_fail_malformed_htlc` messages which should be sent
27255 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
27258 * `update_fail_malformed_htlc` messages which should be sent
27260 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
27263 * An `update_fee` message which should be sent
27265 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27267 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
27270 * An `update_fee` message which should be sent
27272 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27274 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
27277 * A `commitment_signed` message which should be sent
27279 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
27282 * A `commitment_signed` message which should be sent
27284 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
27287 * Constructs a new CommitmentUpdate given each field
27289 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);
27292 * Creates a copy of the CommitmentUpdate
27294 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
27297 * Checks if two CommitmentUpdates contain equal inner contents.
27298 * This ignores pointers and is_owned flags and looks at the values in fields.
27299 * Two objects with NULL inner values will be considered "equal" here.
27301 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
27304 * Calls the free function if one is set
27306 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
27309 * Calls the free function if one is set
27311 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
27314 * Calls the free function if one is set
27316 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
27319 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
27321 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
27324 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
27326 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
27329 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
27331 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
27334 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
27336 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
27339 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
27341 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
27344 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
27346 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
27349 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
27351 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
27354 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
27356 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
27359 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
27361 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
27364 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
27366 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
27369 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
27371 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
27374 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
27376 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
27379 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
27381 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
27384 * Read a FundingCreated from a byte array, created by FundingCreated_write
27386 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
27389 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
27391 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
27394 * Read a FundingSigned from a byte array, created by FundingSigned_write
27396 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
27399 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
27401 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
27404 * Read a ChannelReady from a byte array, created by ChannelReady_write
27406 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
27409 * Serialize the Init object into a byte array which can be read by Init_read
27411 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
27414 * Read a Init from a byte array, created by Init_write
27416 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
27419 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
27421 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
27424 * Read a OpenChannel from a byte array, created by OpenChannel_write
27426 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
27429 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
27431 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
27434 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
27436 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
27439 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
27441 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
27444 * Read a Shutdown from a byte array, created by Shutdown_write
27446 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
27449 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
27451 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
27454 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
27456 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
27459 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
27461 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
27464 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
27466 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
27469 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
27471 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
27474 * Read a UpdateFee from a byte array, created by UpdateFee_write
27476 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
27479 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
27481 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
27484 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
27486 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
27489 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
27491 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
27494 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
27496 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
27499 * Read a OnionMessage from a byte array, created by OnionMessage_write
27501 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
27504 * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
27506 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
27509 * Serialize the Ping object into a byte array which can be read by Ping_read
27511 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
27514 * Read a Ping from a byte array, created by Ping_write
27516 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
27519 * Serialize the Pong object into a byte array which can be read by Pong_read
27521 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
27524 * Read a Pong from a byte array, created by Pong_write
27526 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
27529 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
27531 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
27534 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
27536 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
27539 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
27541 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
27544 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
27546 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
27549 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
27551 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
27554 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
27556 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
27559 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
27561 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
27564 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
27566 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
27569 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
27571 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
27574 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
27576 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
27579 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
27581 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
27584 * Read a WarningMessage from a byte array, created by WarningMessage_write
27586 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
27589 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
27591 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
27594 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
27596 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
27599 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
27601 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
27604 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
27606 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
27609 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
27611 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
27614 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
27616 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
27619 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
27621 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
27624 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
27626 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
27629 * Calculates the overflow safe ending block height for the query.
27631 * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
27633 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
27636 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
27638 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
27641 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
27643 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
27646 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
27648 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
27651 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
27653 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
27656 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
27658 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
27661 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
27663 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
27666 * Calls the free function if one is set
27668 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
27671 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
27673 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
27676 * Constructs a new IgnoringMessageHandler given each field
27678 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
27681 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
27682 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
27684 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
27687 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
27688 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
27690 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
27693 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
27694 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
27696 struct LDKOnionMessageProvider IgnoringMessageHandler_as_OnionMessageProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
27699 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
27700 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
27702 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
27705 * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
27706 * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
27708 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
27711 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
27712 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
27714 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
27717 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
27718 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
27720 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
27723 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
27725 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
27728 * Constructs a new ErroringMessageHandler
27730 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
27733 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
27734 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
27736 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
27739 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
27740 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
27742 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
27745 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
27747 void MessageHandler_free(struct LDKMessageHandler this_obj);
27750 * A message handler which handles messages specific to channels. Usually this is just a
27751 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
27753 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27755 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
27758 * A message handler which handles messages specific to channels. Usually this is just a
27759 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
27761 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
27763 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
27766 * A message handler which handles messages updating our knowledge of the network channel
27767 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
27769 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
27771 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
27774 * A message handler which handles messages updating our knowledge of the network channel
27775 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
27777 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
27779 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
27782 * A message handler which handles onion messages. For now, this can only be an
27783 * [`IgnoringMessageHandler`].
27785 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
27788 * A message handler which handles onion messages. For now, this can only be an
27789 * [`IgnoringMessageHandler`].
27791 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
27794 * Constructs a new MessageHandler given each field
27796 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg, struct LDKOnionMessageHandler onion_message_handler_arg);
27799 * Creates a copy of a SocketDescriptor
27801 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
27804 * Calls the free function if one is set
27806 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
27809 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
27811 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
27814 * Constructs a new PeerHandleError given each field
27816 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
27819 * Creates a copy of the PeerHandleError
27821 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
27824 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
27826 void PeerManager_free(struct LDKPeerManager this_obj);
27829 * Constructs a new PeerManager with the given message handlers and node_id secret key
27830 * ephemeral_random_data is used to derive per-connection ephemeral keys and must be
27831 * cryptographically secure random bytes.
27833 * `current_time` is used as an always-increasing counter that survives across restarts and is
27834 * incremented irregularly internally. In general it is best to simply use the current UNIX
27835 * timestamp, however if it is not available a persistent counter that increases once per
27836 * minute should suffice.
27838 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);
27841 * Get a list of tuples mapping from node id to network addresses for peers which have
27842 * completed the initial handshake.
27844 * For outbound connections, the [`PublicKey`] will be the same as the `their_node_id` parameter
27845 * passed in to [`Self::new_outbound_connection`], however entries will only appear once the initial
27846 * handshake has completed and we are sure the remote peer has the private key for the given
27849 * The returned `Option`s will only be `Some` if an address had been previously given via
27850 * [`Self::new_outbound_connection`] or [`Self::new_inbound_connection`].
27852 MUST_USE_RES struct LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
27855 * Indicates a new outbound connection has been established to a node with the given `node_id`
27856 * and an optional remote network address.
27858 * The remote network address adds the option to report a remote IP address back to a connecting
27859 * peer using the init message.
27860 * The user should pass the remote network address of the host they are connected to.
27862 * If an `Err` is returned here you must disconnect the connection immediately.
27864 * Returns a small number of bytes to send to the remote node (currently always 50).
27866 * Panics if descriptor is duplicative with some other descriptor which has not yet been
27867 * [`socket_disconnected()`].
27869 * [`socket_disconnected()`]: PeerManager::socket_disconnected
27871 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);
27874 * Indicates a new inbound connection has been established to a node with an optional remote
27877 * The remote network address adds the option to report a remote IP address back to a connecting
27878 * peer using the init message.
27879 * The user should pass the remote network address of the host they are connected to.
27881 * May refuse the connection by returning an Err, but will never write bytes to the remote end
27882 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
27883 * the connection immediately.
27885 * Panics if descriptor is duplicative with some other descriptor which has not yet been
27886 * [`socket_disconnected()`].
27888 * [`socket_disconnected()`]: PeerManager::socket_disconnected
27890 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);
27893 * Indicates that there is room to write data to the given socket descriptor.
27895 * May return an Err to indicate that the connection should be closed.
27897 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
27898 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
27899 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
27900 * ready to call `[write_buffer_space_avail`] again if a write call generated here isn't
27903 * [`send_data`]: SocketDescriptor::send_data
27904 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
27906 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
27909 * Indicates that data was read from the given socket descriptor.
27911 * May return an Err to indicate that the connection should be closed.
27913 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
27914 * Thus, however, you should call [`process_events`] after any `read_event` to generate
27915 * [`send_data`] calls to handle responses.
27917 * If `Ok(true)` is returned, further read_events should not be triggered until a
27918 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
27921 * In order to avoid processing too many messages at once per peer, `data` should be on the
27924 * [`send_data`]: SocketDescriptor::send_data
27925 * [`process_events`]: PeerManager::process_events
27927 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);
27930 * Checks for any events generated by our handlers and processes them. Includes sending most
27931 * response messages as well as messages generated by calls to handler functions directly (eg
27932 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
27934 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
27937 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
27938 * or one of the other clients provided in our language bindings.
27940 * Note that if there are any other calls to this function waiting on lock(s) this may return
27941 * without doing any work. All available events that need handling will be handled before the
27942 * other calls return.
27944 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
27945 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
27946 * [`send_data`]: SocketDescriptor::send_data
27948 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
27951 * Indicates that the given socket descriptor's connection is now closed.
27953 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
27956 * Disconnect a peer given its node id.
27958 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
27959 * peer. Thus, be very careful about reentrancy issues.
27961 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
27963 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
27966 * Disconnects all currently-connected peers. This is useful on platforms where there may be
27967 * an indication that TCP sockets have stalled even if we weren't around to time them out
27968 * using regular ping/pongs.
27970 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
27973 * Send pings to each peer and disconnect those which did not respond to the last round of
27976 * This may be called on any timescale you want, however, roughly once every ten seconds is
27977 * preferred. The call rate determines both how often we send a ping to our peers and how much
27978 * time they have to respond before we disconnect them.
27980 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
27983 * [`send_data`]: SocketDescriptor::send_data
27985 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
27988 * Generates a signed node_announcement from the given arguments, sending it to all connected
27989 * peers. Note that peers will likely ignore this message unless we have at least one public
27990 * channel which has at least six confirmations on-chain.
27992 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
27993 * node to humans. They carry no in-protocol meaning.
27995 * `addresses` represent the set (possibly empty) of socket addresses on which this node
27996 * accepts incoming connections. These will be included in the node_announcement, publicly
27997 * tying these addresses together and to this node. If you wish to preserve user privacy,
27998 * addresses should likely contain only Tor Onion addresses.
28000 * Panics if `addresses` is absurdly large (more than 100).
28002 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
28004 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
28007 * Gets the weight for an HTLC-Success transaction.
28009 uint64_t htlc_success_tx_weight(bool opt_anchors);
28012 * Gets the weight for an HTLC-Timeout transaction.
28014 uint64_t htlc_timeout_tx_weight(bool opt_anchors);
28017 * Creates a copy of the HTLCClaim
28019 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
28022 * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
28024 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
28027 * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
28029 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
28032 * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
28034 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
28037 * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
28039 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
28042 * Utility method to constructs a new Revocation-variant HTLCClaim
28044 enum LDKHTLCClaim HTLCClaim_revocation(void);
28047 * Checks if two HTLCClaims contain equal inner contents.
28048 * This ignores pointers and is_owned flags and looks at the values in fields.
28050 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
28053 * Check if a given input witness attempts to claim a HTLC.
28055 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
28058 * Build the commitment secret from the seed and the commitment number
28060 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
28063 * Build a closing transaction
28065 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);
28068 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
28070 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
28073 * Creates a copy of the CounterpartyCommitmentSecrets
28075 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
28078 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
28080 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
28083 * Returns the minimum index of all stored secrets. Note that indexes start
28084 * at 1 << 48 and get decremented by one for each new secret.
28086 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
28089 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
28090 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
28092 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
28095 * Returns the secret at `idx`.
28096 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
28098 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28100 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
28103 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
28105 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
28108 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
28110 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
28113 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
28114 * from the base secret and the per_commitment_point.
28116 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
28119 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
28120 * from the base point and the per_commitment_key. This is the public equivalent of
28121 * derive_private_key - using only public keys to derive a public key instead of private keys.
28123 struct LDKPublicKey derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
28126 * Derives a per-commitment-transaction revocation key from its constituent parts.
28128 * Only the cheating participant owns a valid witness to propagate a revoked
28129 * commitment transaction, thus per_commitment_secret always come from cheater
28130 * and revocation_base_secret always come from punisher, which is the broadcaster
28131 * of the transaction spending with this key knowledge.
28133 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
28136 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
28137 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
28138 * public key instead of private keys.
28140 * Only the cheating participant owns a valid witness to propagate a revoked
28141 * commitment transaction, thus per_commitment_point always come from cheater
28142 * and revocation_base_point always come from punisher, which is the broadcaster
28143 * of the transaction spending with this key knowledge.
28145 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
28146 * generated (ie our own).
28148 struct LDKPublicKey derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
28151 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
28153 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
28156 * The broadcaster's per-commitment public key which was used to derive the other keys.
28158 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
28161 * The broadcaster's per-commitment public key which was used to derive the other keys.
28163 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28166 * The revocation key which is used to allow the broadcaster of the commitment
28167 * transaction to provide their counterparty the ability to punish them if they broadcast
28170 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
28173 * The revocation key which is used to allow the broadcaster of the commitment
28174 * transaction to provide their counterparty the ability to punish them if they broadcast
28177 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28180 * Broadcaster's HTLC Key
28182 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
28185 * Broadcaster's HTLC Key
28187 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28190 * Countersignatory's HTLC Key
28192 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
28195 * Countersignatory's HTLC Key
28197 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28200 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
28202 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
28205 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
28207 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28210 * Constructs a new TxCreationKeys given each field
28212 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);
28215 * Checks if two TxCreationKeyss contain equal inner contents.
28216 * This ignores pointers and is_owned flags and looks at the values in fields.
28217 * Two objects with NULL inner values will be considered "equal" here.
28219 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
28222 * Creates a copy of the TxCreationKeys
28224 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
28227 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
28229 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
28232 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
28234 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
28237 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
28239 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
28242 * The public key which is used to sign all commitment transactions, as it appears in the
28243 * on-chain channel lock-in 2-of-2 multisig output.
28245 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
28248 * The public key which is used to sign all commitment transactions, as it appears in the
28249 * on-chain channel lock-in 2-of-2 multisig output.
28251 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28254 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
28255 * revocation keys. This is combined with the per-commitment-secret generated by the
28256 * counterparty to create a secret which the counterparty can reveal to revoke previous
28259 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
28262 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
28263 * revocation keys. This is combined with the per-commitment-secret generated by the
28264 * counterparty to create a secret which the counterparty can reveal to revoke previous
28267 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28270 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
28271 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
28272 * static across every commitment transaction.
28274 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
28277 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
28278 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
28279 * static across every commitment transaction.
28281 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28284 * The base point which is used (with derive_public_key) to derive a per-commitment payment
28285 * public key which receives non-HTLC-encumbered funds which are only available for spending
28286 * after some delay (or can be claimed via the revocation path).
28288 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
28291 * The base point which is used (with derive_public_key) to derive a per-commitment payment
28292 * public key which receives non-HTLC-encumbered funds which are only available for spending
28293 * after some delay (or can be claimed via the revocation path).
28295 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28298 * The base point which is used (with derive_public_key) to derive a per-commitment public key
28299 * which is used to encumber HTLC-in-flight outputs.
28301 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
28304 * The base point which is used (with derive_public_key) to derive a per-commitment public key
28305 * which is used to encumber HTLC-in-flight outputs.
28307 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28310 * Constructs a new ChannelPublicKeys given each field
28312 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);
28315 * Creates a copy of the ChannelPublicKeys
28317 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
28320 * Checks if two ChannelPublicKeyss contain equal inner contents.
28321 * This ignores pointers and is_owned flags and looks at the values in fields.
28322 * Two objects with NULL inner values will be considered "equal" here.
28324 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
28327 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
28329 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
28332 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
28334 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
28337 * Create per-state keys from channel base points and the per-commitment point.
28338 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
28340 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);
28343 * Generate per-state keys from channel static keys.
28344 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
28346 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);
28349 * A script either spendable by the revocation
28350 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
28351 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
28353 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
28356 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
28358 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
28361 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
28362 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
28363 * need to compare this value to whether the commitment transaction in question is that of
28364 * the counterparty or our own.
28366 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
28369 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
28370 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
28371 * need to compare this value to whether the commitment transaction in question is that of
28372 * the counterparty or our own.
28374 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
28377 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
28378 * this divided by 1000.
28380 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
28383 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
28384 * this divided by 1000.
28386 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
28389 * The CLTV lock-time at which this HTLC expires.
28391 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
28394 * The CLTV lock-time at which this HTLC expires.
28396 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
28399 * The hash of the preimage which unlocks this HTLC.
28401 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
28404 * The hash of the preimage which unlocks this HTLC.
28406 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
28409 * The position within the commitment transactions' outputs. This may be None if the value is
28410 * below the dust limit (in which case no output appears in the commitment transaction and the
28411 * value is spent to additional transaction fees).
28413 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
28416 * The position within the commitment transactions' outputs. This may be None if the value is
28417 * below the dust limit (in which case no output appears in the commitment transaction and the
28418 * value is spent to additional transaction fees).
28420 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
28423 * Constructs a new HTLCOutputInCommitment given each field
28425 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);
28428 * Creates a copy of the HTLCOutputInCommitment
28430 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
28433 * Checks if two HTLCOutputInCommitments contain equal inner contents.
28434 * This ignores pointers and is_owned flags and looks at the values in fields.
28435 * Two objects with NULL inner values will be considered "equal" here.
28437 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
28440 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
28442 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
28445 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
28447 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
28450 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
28451 * does not need to have its previous_output_index filled.
28453 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, const struct LDKTxCreationKeys *NONNULL_PTR keys);
28456 * Gets the redeemscript for a funding output from the two funding public keys.
28457 * Note that the order of funding public keys does not matter.
28459 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
28462 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
28463 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
28464 * transaction which needs signing, and can be used to construct an HTLC transaction which is
28465 * broadcastable given a counterparty HTLC signature.
28467 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
28468 * commitment transaction).
28470 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);
28473 * Returns the witness required to satisfy and spend a HTLC input.
28475 * Note that preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
28477 struct LDKWitness build_htlc_input_witness(struct LDKSignature local_sig, struct LDKSignature remote_sig, struct LDKThirtyTwoBytes preimage, struct LDKu8slice redeem_script, bool opt_anchors);
28480 * Gets the witnessScript for the to_remote output when anchors are enabled.
28482 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
28485 * Gets the witnessScript for an anchor output from the funding public key.
28486 * The witness in the spending input must be:
28487 * <BIP 143 funding_signature>
28488 * After 16 blocks of confirmation, an alternative satisfying witness could be:
28490 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
28492 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
28495 * Returns the witness required to satisfy and spend an anchor input.
28497 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKSignature funding_sig);
28500 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
28502 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
28505 * Holder public keys
28507 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
28510 * Holder public keys
28512 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
28515 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
28517 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
28520 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
28522 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
28525 * Whether the holder is the initiator of this channel.
28526 * This is an input to the commitment number obscure factor computation.
28528 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
28531 * Whether the holder is the initiator of this channel.
28532 * This is an input to the commitment number obscure factor computation.
28534 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
28537 * The late-bound counterparty channel transaction parameters.
28538 * These parameters are populated at the point in the protocol where the counterparty provides them.
28540 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28542 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
28545 * The late-bound counterparty channel transaction parameters.
28546 * These parameters are populated at the point in the protocol where the counterparty provides them.
28548 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28550 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
28553 * The late-bound funding outpoint
28555 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28557 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
28560 * The late-bound funding outpoint
28562 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28564 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
28567 * Are anchors (zero fee HTLC transaction variant) used for this channel. Boolean is
28568 * serialization backwards-compatible.
28570 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
28573 * Are anchors (zero fee HTLC transaction variant) used for this channel. Boolean is
28574 * serialization backwards-compatible.
28576 void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
28579 * Are non-zero-fee anchors are enabled (used in conjuction with opt_anchors)
28580 * It is intended merely for backwards compatibility with signers that need it.
28581 * There is no support for this feature in LDK channel negotiation.
28583 enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_non_zero_fee_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
28586 * Are non-zero-fee anchors are enabled (used in conjuction with opt_anchors)
28587 * It is intended merely for backwards compatibility with signers that need it.
28588 * There is no support for this feature in LDK channel negotiation.
28590 void ChannelTransactionParameters_set_opt_non_zero_fee_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
28593 * Constructs a new ChannelTransactionParameters given each field
28595 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);
28598 * Creates a copy of the ChannelTransactionParameters
28600 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
28603 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
28605 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
28608 * Counter-party public keys
28610 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
28613 * Counter-party public keys
28615 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
28618 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
28620 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
28623 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
28625 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
28628 * Constructs a new CounterpartyChannelTransactionParameters given each field
28630 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
28633 * Creates a copy of the CounterpartyChannelTransactionParameters
28635 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
28638 * Whether the late bound parameters are populated.
28640 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
28643 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
28644 * given that the holder is the broadcaster.
28646 * self.is_populated() must be true before calling this function.
28648 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
28651 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
28652 * given that the counterparty is the broadcaster.
28654 * self.is_populated() must be true before calling this function.
28656 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
28659 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
28661 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
28664 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
28666 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
28669 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
28671 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
28674 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
28676 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
28679 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
28681 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
28684 * Get the channel pubkeys for the broadcaster
28686 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
28689 * Get the channel pubkeys for the countersignatory
28691 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
28694 * Get the contest delay applicable to the transactions.
28695 * Note that the contest delay was selected by the countersignatory.
28697 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
28700 * Whether the channel is outbound from the broadcaster.
28702 * The boolean representing the side that initiated the channel is
28703 * an input to the commitment number obscure factor computation.
28705 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
28708 * The funding outpoint
28710 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
28713 * Whether to use anchors for this channel
28715 MUST_USE_RES bool DirectedChannelTransactionParameters_opt_anchors(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
28718 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
28720 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
28723 * Our counterparty's signature for the transaction
28725 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
28728 * Our counterparty's signature for the transaction
28730 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
28733 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
28735 * Returns a copy of the field.
28737 struct LDKCVec_SignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
28740 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
28742 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
28745 * Creates a copy of the HolderCommitmentTransaction
28747 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
28750 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
28752 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
28755 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
28757 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
28760 * Create a new holder transaction with the given counterparty signatures.
28761 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
28763 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);
28766 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
28768 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
28771 * The commitment transaction
28773 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
28776 * The commitment transaction
28778 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
28781 * The txid for the commitment transaction.
28783 * This is provided as a performance optimization, instead of calling transaction.txid()
28786 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
28789 * The txid for the commitment transaction.
28791 * This is provided as a performance optimization, instead of calling transaction.txid()
28794 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
28797 * Constructs a new BuiltCommitmentTransaction given each field
28799 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
28802 * Creates a copy of the BuiltCommitmentTransaction
28804 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
28807 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
28809 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
28812 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
28814 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
28817 * Get the SIGHASH_ALL sighash value of the transaction.
28819 * This can be used to verify a signature.
28821 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);
28824 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
28825 * because we are about to broadcast a holder transaction.
28827 MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
28830 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
28832 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
28835 * Creates a copy of the ClosingTransaction
28837 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
28840 * Checks if two ClosingTransactions contain equal inner contents.
28842 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
28845 * Checks if two ClosingTransactions contain equal inner contents.
28846 * This ignores pointers and is_owned flags and looks at the values in fields.
28847 * Two objects with NULL inner values will be considered "equal" here.
28849 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
28852 * Construct an object of the class
28854 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);
28857 * Trust our pre-built transaction.
28859 * Applies a wrapper which allows access to the transaction.
28861 * This should only be used if you fully trust the builder of this object. It should not
28862 * be used by an external signer - instead use the verify function.
28864 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
28867 * Verify our pre-built transaction.
28869 * Applies a wrapper which allows access to the transaction.
28871 * An external validating signer must call this method before signing
28872 * or using the built transaction.
28874 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
28877 * The value to be sent to the holder, or zero if the output will be omitted
28879 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
28882 * The value to be sent to the counterparty, or zero if the output will be omitted
28884 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
28887 * The destination of the holder's output
28889 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
28892 * The destination of the counterparty's output
28894 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
28897 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
28899 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
28902 * The pre-built Bitcoin commitment transaction
28904 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
28907 * Get the SIGHASH_ALL sighash value of the transaction.
28909 * This can be used to verify a signature.
28911 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);
28914 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
28915 * because we are about to broadcast a holder transaction.
28917 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);
28920 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
28922 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
28925 * Creates a copy of the CommitmentTransaction
28927 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
28930 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
28932 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
28935 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
28937 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
28940 * The backwards-counting commitment number
28942 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
28945 * The value to be sent to the broadcaster
28947 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
28950 * The value to be sent to the counterparty
28952 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
28955 * The feerate paid per 1000-weight-unit in this commitment transaction.
28957 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
28960 * Trust our pre-built transaction and derived transaction creation public keys.
28962 * Applies a wrapper which allows access to these fields.
28964 * This should only be used if you fully trust the builder of this object. It should not
28965 * be used by an external signer - instead use the verify function.
28967 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
28970 * Verify our pre-built transaction and derived transaction creation public keys.
28972 * Applies a wrapper which allows access to these fields.
28974 * An external validating signer must call this method before signing
28975 * or using the built transaction.
28977 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);
28980 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
28982 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
28985 * The transaction ID of the built Bitcoin transaction
28987 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
28990 * The pre-built Bitcoin commitment transaction
28992 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
28995 * The pre-calculated transaction creation public keys.
28997 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
29000 * Should anchors be used.
29002 MUST_USE_RES bool TrustedCommitmentTransaction_opt_anchors(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
29005 * Get a signature for each HTLC which was included in the commitment transaction (ie for
29006 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
29008 * The returned Vec has one entry for each HTLC, and in the same order.
29010 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
29012 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);
29015 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
29016 * shared secret first. This prevents on-chain observers from discovering how many commitment
29017 * transactions occurred in a channel before it was closed.
29019 * This function gets the shared secret from relevant channel public keys and can be used to
29020 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
29022 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
29025 * Checks if two InitFeaturess contain equal inner contents.
29026 * This ignores pointers and is_owned flags and looks at the values in fields.
29027 * Two objects with NULL inner values will be considered "equal" here.
29029 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
29032 * Checks if two NodeFeaturess contain equal inner contents.
29033 * This ignores pointers and is_owned flags and looks at the values in fields.
29034 * Two objects with NULL inner values will be considered "equal" here.
29036 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
29039 * Checks if two ChannelFeaturess contain equal inner contents.
29040 * This ignores pointers and is_owned flags and looks at the values in fields.
29041 * Two objects with NULL inner values will be considered "equal" here.
29043 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
29046 * Checks if two InvoiceFeaturess contain equal inner contents.
29047 * This ignores pointers and is_owned flags and looks at the values in fields.
29048 * Two objects with NULL inner values will be considered "equal" here.
29050 bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b);
29053 * Checks if two OfferFeaturess contain equal inner contents.
29054 * This ignores pointers and is_owned flags and looks at the values in fields.
29055 * Two objects with NULL inner values will be considered "equal" here.
29057 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
29060 * Checks if two InvoiceRequestFeaturess contain equal inner contents.
29061 * This ignores pointers and is_owned flags and looks at the values in fields.
29062 * Two objects with NULL inner values will be considered "equal" here.
29064 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
29067 * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
29068 * This ignores pointers and is_owned flags and looks at the values in fields.
29069 * Two objects with NULL inner values will be considered "equal" here.
29071 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
29074 * Checks if two BlindedHopFeaturess contain equal inner contents.
29075 * This ignores pointers and is_owned flags and looks at the values in fields.
29076 * Two objects with NULL inner values will be considered "equal" here.
29078 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
29081 * Checks if two ChannelTypeFeaturess contain equal inner contents.
29082 * This ignores pointers and is_owned flags and looks at the values in fields.
29083 * Two objects with NULL inner values will be considered "equal" here.
29085 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
29088 * Creates a copy of the InitFeatures
29090 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
29093 * Creates a copy of the NodeFeatures
29095 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
29098 * Creates a copy of the ChannelFeatures
29100 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
29103 * Creates a copy of the InvoiceFeatures
29105 struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig);
29108 * Creates a copy of the OfferFeatures
29110 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
29113 * Creates a copy of the InvoiceRequestFeatures
29115 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
29118 * Creates a copy of the Bolt12InvoiceFeatures
29120 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
29123 * Creates a copy of the BlindedHopFeatures
29125 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
29128 * Creates a copy of the ChannelTypeFeatures
29130 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
29133 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
29135 void InitFeatures_free(struct LDKInitFeatures this_obj);
29138 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
29140 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
29143 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
29145 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
29148 * Frees any resources used by the InvoiceFeatures, if is_owned is set and inner is non-NULL.
29150 void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj);
29153 * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
29155 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
29158 * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
29160 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
29163 * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
29165 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
29168 * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
29170 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
29173 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
29175 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
29178 * Create a blank Features with no features set
29180 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
29183 * Returns true if this `Features` object contains unknown feature flags which are set as
29186 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29189 * Create a blank Features with no features set
29191 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
29194 * Returns true if this `Features` object contains unknown feature flags which are set as
29197 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29200 * Create a blank Features with no features set
29202 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
29205 * Returns true if this `Features` object contains unknown feature flags which are set as
29208 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
29211 * Create a blank Features with no features set
29213 MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
29216 * Returns true if this `Features` object contains unknown feature flags which are set as
29219 MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
29222 * Create a blank Features with no features set
29224 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
29227 * Returns true if this `Features` object contains unknown feature flags which are set as
29230 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
29233 * Create a blank Features with no features set
29235 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
29238 * Returns true if this `Features` object contains unknown feature flags which are set as
29241 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
29244 * Create a blank Features with no features set
29246 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
29249 * Returns true if this `Features` object contains unknown feature flags which are set as
29252 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
29255 * Create a blank Features with no features set
29257 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
29260 * Returns true if this `Features` object contains unknown feature flags which are set as
29263 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
29266 * Create a blank Features with no features set
29268 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
29271 * Returns true if this `Features` object contains unknown feature flags which are set as
29274 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29277 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
29279 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
29282 * Read a InitFeatures from a byte array, created by InitFeatures_write
29284 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
29287 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
29289 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
29292 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
29294 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
29297 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
29299 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
29302 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
29304 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
29307 * Serialize the InvoiceFeatures object into a byte array which can be read by InvoiceFeatures_read
29309 struct LDKCVec_u8Z InvoiceFeatures_write(const struct LDKInvoiceFeatures *NONNULL_PTR obj);
29312 * Read a InvoiceFeatures from a byte array, created by InvoiceFeatures_write
29314 struct LDKCResult_InvoiceFeaturesDecodeErrorZ InvoiceFeatures_read(struct LDKu8slice ser);
29317 * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
29319 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
29322 * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
29324 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
29327 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
29329 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
29332 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
29334 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
29337 * Set this feature as optional.
29339 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29342 * Set this feature as required.
29344 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29347 * Checks if this feature is supported.
29349 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29352 * Set this feature as optional.
29354 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29357 * Set this feature as required.
29359 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29362 * Checks if this feature is supported.
29364 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29367 * Checks if this feature is required.
29369 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29372 * Checks if this feature is required.
29374 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29377 * Set this feature as optional.
29379 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29382 * Set this feature as required.
29384 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29387 * Checks if this feature is supported.
29389 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29392 * Set this feature as optional.
29394 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29397 * Set this feature as required.
29399 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29402 * Checks if this feature is supported.
29404 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29407 * Set this feature as optional.
29409 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29412 * Set this feature as required.
29414 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29417 * Checks if this feature is supported.
29419 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29422 * Checks if this feature is required.
29424 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29427 * Checks if this feature is required.
29429 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29432 * Set this feature as optional.
29434 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29437 * Set this feature as required.
29439 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29442 * Checks if this feature is supported.
29444 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29447 * Set this feature as optional.
29449 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29452 * Set this feature as required.
29454 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29457 * Checks if this feature is supported.
29459 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29462 * Checks if this feature is required.
29464 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29467 * Checks if this feature is required.
29469 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29472 * Set this feature as optional.
29474 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29477 * Set this feature as required.
29479 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29482 * Checks if this feature is supported.
29484 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29487 * Set this feature as optional.
29489 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29492 * Set this feature as required.
29494 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29497 * Checks if this feature is supported.
29499 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29502 * Set this feature as optional.
29504 void InvoiceFeatures_set_variable_length_onion_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
29507 * Set this feature as required.
29509 void InvoiceFeatures_set_variable_length_onion_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
29512 * Checks if this feature is supported.
29514 MUST_USE_RES bool InvoiceFeatures_supports_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
29517 * Checks if this feature is required.
29519 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29522 * Checks if this feature is required.
29524 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29527 * Checks if this feature is required.
29529 MUST_USE_RES bool InvoiceFeatures_requires_variable_length_onion(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
29532 * Set this feature as optional.
29534 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29537 * Set this feature as required.
29539 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29542 * Checks if this feature is supported.
29544 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29547 * Set this feature as optional.
29549 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29552 * Set this feature as required.
29554 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29557 * Checks if this feature is supported.
29559 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29562 * Set this feature as optional.
29564 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29567 * Set this feature as required.
29569 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29572 * Checks if this feature is supported.
29574 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29577 * Checks if this feature is required.
29579 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29582 * Checks if this feature is required.
29584 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29587 * Checks if this feature is required.
29589 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29592 * Set this feature as optional.
29594 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29597 * Set this feature as required.
29599 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29602 * Checks if this feature is supported.
29604 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29607 * Set this feature as optional.
29609 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29612 * Set this feature as required.
29614 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29617 * Checks if this feature is supported.
29619 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29622 * Set this feature as optional.
29624 void InvoiceFeatures_set_payment_secret_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
29627 * Set this feature as required.
29629 void InvoiceFeatures_set_payment_secret_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
29632 * Checks if this feature is supported.
29634 MUST_USE_RES bool InvoiceFeatures_supports_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
29637 * Checks if this feature is required.
29639 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29642 * Checks if this feature is required.
29644 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29647 * Checks if this feature is required.
29649 MUST_USE_RES bool InvoiceFeatures_requires_payment_secret(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
29652 * Set this feature as optional.
29654 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29657 * Set this feature as required.
29659 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29662 * Checks if this feature is supported.
29664 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29667 * Set this feature as optional.
29669 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29672 * Set this feature as required.
29674 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29677 * Checks if this feature is supported.
29679 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29682 * Set this feature as optional.
29684 void InvoiceFeatures_set_basic_mpp_optional(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
29687 * Set this feature as required.
29689 void InvoiceFeatures_set_basic_mpp_required(struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
29692 * Checks if this feature is supported.
29694 MUST_USE_RES bool InvoiceFeatures_supports_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
29697 * Set this feature as optional.
29699 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
29702 * Set this feature as required.
29704 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
29707 * Checks if this feature is supported.
29709 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
29712 * Checks if this feature is required.
29714 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29717 * Checks if this feature is required.
29719 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29722 * Checks if this feature is required.
29724 MUST_USE_RES bool InvoiceFeatures_requires_basic_mpp(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
29727 * Checks if this feature is required.
29729 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
29732 * Set this feature as optional.
29734 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29737 * Set this feature as required.
29739 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29742 * Checks if this feature is supported.
29744 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29747 * Set this feature as optional.
29749 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29752 * Set this feature as required.
29754 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29757 * Checks if this feature is supported.
29759 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29762 * Checks if this feature is required.
29764 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29767 * Checks if this feature is required.
29769 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29772 * Set this feature as optional.
29774 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29777 * Set this feature as required.
29779 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29782 * Checks if this feature is supported.
29784 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29787 * Set this feature as optional.
29789 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29792 * Set this feature as required.
29794 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29797 * Checks if this feature is supported.
29799 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29802 * Set this feature as optional.
29804 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29807 * Set this feature as required.
29809 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29812 * Checks if this feature is supported.
29814 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29817 * Checks if this feature is required.
29819 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29822 * Checks if this feature is required.
29824 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29827 * Checks if this feature is required.
29829 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29832 * Set this feature as optional.
29834 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29837 * Set this feature as required.
29839 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29842 * Checks if this feature is supported.
29844 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29847 * Set this feature as optional.
29849 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29852 * Set this feature as required.
29854 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29857 * Checks if this feature is supported.
29859 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29862 * Checks if this feature is required.
29864 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29867 * Checks if this feature is required.
29869 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29872 * Set this feature as optional.
29874 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29877 * Set this feature as required.
29879 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29882 * Checks if this feature is supported.
29884 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29887 * Set this feature as optional.
29889 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29892 * Set this feature as required.
29894 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29897 * Checks if this feature is supported.
29899 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29902 * Checks if this feature is required.
29904 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29907 * Checks if this feature is required.
29909 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29912 * Set this feature as optional.
29914 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29917 * Set this feature as required.
29919 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29922 * Checks if this feature is supported.
29924 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29927 * Set this feature as optional.
29929 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29932 * Set this feature as required.
29934 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29937 * Checks if this feature is supported.
29939 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29942 * Checks if this feature is required.
29944 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29947 * Checks if this feature is required.
29949 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29952 * Set this feature as optional.
29954 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
29957 * Set this feature as required.
29959 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
29962 * Checks if this feature is supported.
29964 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
29967 * Set this feature as optional.
29969 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29972 * Set this feature as required.
29974 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
29977 * Checks if this feature is supported.
29979 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
29982 * Set this feature as optional.
29984 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29987 * Set this feature as required.
29989 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29992 * Checks if this feature is supported.
29994 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
29997 * Checks if this feature is required.
29999 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30002 * Checks if this feature is required.
30004 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30007 * Checks if this feature is required.
30009 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30012 * Set this feature as optional.
30014 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
30017 * Set this feature as required.
30019 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
30022 * Checks if this feature is supported.
30024 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30027 * Set this feature as optional.
30029 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30032 * Set this feature as required.
30034 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30037 * Checks if this feature is supported.
30039 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30042 * Set this feature as optional.
30044 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30047 * Set this feature as required.
30049 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30052 * Checks if this feature is supported.
30054 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30057 * Checks if this feature is required.
30059 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
30062 * Checks if this feature is required.
30064 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30067 * Checks if this feature is required.
30069 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
30072 * Set this feature as optional.
30074 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30077 * Set this feature as required.
30079 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
30082 * Checks if this feature is supported.
30084 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30087 * Checks if this feature is required.
30089 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
30092 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
30094 void ShutdownScript_free(struct LDKShutdownScript this_obj);
30097 * Creates a copy of the ShutdownScript
30099 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
30102 * Checks if two ShutdownScripts contain equal inner contents.
30103 * This ignores pointers and is_owned flags and looks at the values in fields.
30104 * Two objects with NULL inner values will be considered "equal" here.
30106 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
30109 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
30111 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
30114 * The script that did not meet the requirements from [BOLT #2].
30116 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
30118 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
30121 * The script that did not meet the requirements from [BOLT #2].
30123 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
30125 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
30128 * Constructs a new InvalidShutdownScript given each field
30130 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
30133 * Creates a copy of the InvalidShutdownScript
30135 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
30138 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
30140 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
30143 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
30145 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
30148 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
30150 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
30153 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
30155 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
30158 * Generates a witness script pubkey from the given segwit version and program.
30160 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
30161 * [`ShutdownScript::new_p2wsh`] instead.
30165 * This function may return an error if `program` is invalid for the segwit `version`.
30167 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
30170 * Converts the shutdown script into the underlying [`Script`].
30172 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
30175 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
30177 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30179 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
30182 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
30184 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
30186 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
30189 * Frees any resources used by the Retry
30191 void Retry_free(struct LDKRetry this_ptr);
30194 * Creates a copy of the Retry
30196 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
30199 * Utility method to constructs a new Attempts-variant Retry
30201 struct LDKRetry Retry_attempts(uintptr_t a);
30204 * Utility method to constructs a new Timeout-variant Retry
30206 struct LDKRetry Retry_timeout(uint64_t a);
30209 * Checks if two Retrys contain equal inner contents.
30210 * This ignores pointers and is_owned flags and looks at the values in fields.
30212 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
30215 * Checks if two Retrys contain equal inner contents.
30217 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
30220 * Creates a copy of the RetryableSendFailure
30222 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
30225 * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
30227 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
30230 * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
30232 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
30235 * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
30237 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
30240 * Frees any resources used by the PaymentSendFailure
30242 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
30245 * Creates a copy of the PaymentSendFailure
30247 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
30250 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
30252 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
30255 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
30257 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
30260 * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
30262 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
30265 * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
30267 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
30270 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
30272 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
30275 * Calls the free function if one is set
30277 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
30280 * Calls the free function if one is set
30282 void Type_free(struct LDKType this_ptr);
30285 * Creates a copy of the UtxoLookupError
30287 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
30290 * Utility method to constructs a new UnknownChain-variant UtxoLookupError
30292 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
30295 * Utility method to constructs a new UnknownTx-variant UtxoLookupError
30297 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
30300 * Frees any resources used by the UtxoResult
30302 void UtxoResult_free(struct LDKUtxoResult this_ptr);
30305 * Creates a copy of the UtxoResult
30307 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
30310 * Utility method to constructs a new Sync-variant UtxoResult
30312 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
30315 * Utility method to constructs a new Async-variant UtxoResult
30317 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
30320 * Calls the free function if one is set
30322 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
30325 * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
30327 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
30330 * Creates a copy of the UtxoFuture
30332 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
30335 * Builds a new future for later resolution.
30337 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
30340 * Resolves this future against the given `graph` and with the given `result`.
30342 * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
30343 * forwarding the validated gossip message onwards to peers.
30345 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
30346 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
30349 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
30350 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
30352 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
30355 * Resolves this future against the given `graph` and with the given `result`.
30357 * The given `gossip` is used to broadcast any validated messages onwards to all peers which
30358 * have available buffer space.
30360 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
30361 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
30364 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
30365 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
30367 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);
30370 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
30372 void NodeId_free(struct LDKNodeId this_obj);
30375 * Creates a copy of the NodeId
30377 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
30380 * Create a new NodeId from a public key
30382 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
30385 * Get the public key slice from this NodeId
30387 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
30390 * Checks if two NodeIds contain equal inner contents.
30392 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
30395 * Serialize the NodeId object into a byte array which can be read by NodeId_read
30397 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
30400 * Read a NodeId from a byte array, created by NodeId_write
30402 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
30405 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
30407 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
30410 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
30412 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
30415 * Frees any resources used by the NetworkUpdate
30417 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
30420 * Creates a copy of the NetworkUpdate
30422 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
30425 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
30427 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
30430 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
30432 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
30435 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
30437 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
30440 * Checks if two NetworkUpdates contain equal inner contents.
30441 * This ignores pointers and is_owned flags and looks at the values in fields.
30443 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
30446 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
30448 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
30451 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
30453 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
30456 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
30458 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
30461 * Creates a new tracker of the actual state of the network of channels and nodes,
30462 * assuming an existing Network Graph.
30463 * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
30464 * correct, and the announcement is signed with channel owners' keys.
30466 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
30469 * Adds a provider used to check new announcements. Does not affect
30470 * existing announcements unless they are updated.
30471 * Add, update or remove the provider would replace the current one.
30473 void P2PGossipSync_add_utxo_lookup(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
30476 * Handles any network updates originating from [`Event`]s.
30478 * [`Event`]: crate::util::events::Event
30480 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
30483 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
30484 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
30486 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
30489 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
30490 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
30492 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
30495 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
30497 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
30500 * When the last update to the channel direction was issued.
30501 * Value is opaque, as set in the announcement.
30503 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
30506 * When the last update to the channel direction was issued.
30507 * Value is opaque, as set in the announcement.
30509 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
30512 * Whether the channel can be currently used for payments (in this one direction).
30514 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
30517 * Whether the channel can be currently used for payments (in this one direction).
30519 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
30522 * The difference in CLTV values that you must have when routing through this channel.
30524 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
30527 * The difference in CLTV values that you must have when routing through this channel.
30529 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
30532 * The minimum value, which must be relayed to the next hop via the channel
30534 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
30537 * The minimum value, which must be relayed to the next hop via the channel
30539 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
30542 * The maximum value which may be relayed to the next hop via the channel.
30544 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
30547 * The maximum value which may be relayed to the next hop via the channel.
30549 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
30552 * Fees charged when the channel is used for routing
30554 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
30557 * Fees charged when the channel is used for routing
30559 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
30562 * Most recent update for the channel received from the network
30563 * Mostly redundant with the data we store in fields explicitly.
30564 * Everything else is useful only for sending out for initial routing sync.
30565 * Not stored if contains excess data to prevent DoS.
30567 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30569 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
30572 * Most recent update for the channel received from the network
30573 * Mostly redundant with the data we store in fields explicitly.
30574 * Everything else is useful only for sending out for initial routing sync.
30575 * Not stored if contains excess data to prevent DoS.
30577 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30579 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
30582 * Constructs a new ChannelUpdateInfo given each field
30584 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);
30587 * Creates a copy of the ChannelUpdateInfo
30589 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
30592 * Checks if two ChannelUpdateInfos contain equal inner contents.
30593 * This ignores pointers and is_owned flags and looks at the values in fields.
30594 * Two objects with NULL inner values will be considered "equal" here.
30596 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
30599 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
30601 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
30604 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
30606 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
30609 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
30611 void ChannelInfo_free(struct LDKChannelInfo this_obj);
30614 * Protocol features of a channel communicated during its announcement
30616 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
30619 * Protocol features of a channel communicated during its announcement
30621 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
30624 * Source node of the first direction of a channel
30626 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
30629 * Source node of the first direction of a channel
30631 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
30634 * Details about the first direction of a channel
30636 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30638 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
30641 * Details about the first direction of a channel
30643 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30645 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
30648 * Source node of the second direction of a channel
30650 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
30653 * Source node of the second direction of a channel
30655 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
30658 * Details about the second direction of a channel
30660 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30662 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
30665 * Details about the second direction of a channel
30667 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30669 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
30672 * The channel capacity as seen on-chain, if chain lookup is available.
30674 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
30677 * The channel capacity as seen on-chain, if chain lookup is available.
30679 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30682 * An initial announcement of the channel
30683 * Mostly redundant with the data we store in fields explicitly.
30684 * Everything else is useful only for sending out for initial routing sync.
30685 * Not stored if contains excess data to prevent DoS.
30687 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30689 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
30692 * An initial announcement of the channel
30693 * Mostly redundant with the data we store in fields explicitly.
30694 * Everything else is useful only for sending out for initial routing sync.
30695 * Not stored if contains excess data to prevent DoS.
30697 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30699 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
30702 * Creates a copy of the ChannelInfo
30704 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
30707 * Checks if two ChannelInfos contain equal inner contents.
30708 * This ignores pointers and is_owned flags and looks at the values in fields.
30709 * Two objects with NULL inner values will be considered "equal" here.
30711 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
30714 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
30716 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30718 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
30721 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
30723 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
30726 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
30728 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
30731 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
30733 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
30736 * Creates a copy of the DirectedChannelInfo
30738 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
30741 * Returns information for the channel.
30743 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
30746 * Returns the maximum HTLC amount allowed over the channel in the direction.
30748 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
30751 * Returns the [`EffectiveCapacity`] of the channel in the direction.
30753 * This is either the total capacity from the funding transaction, if known, or the
30754 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
30757 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
30760 * Frees any resources used by the EffectiveCapacity
30762 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
30765 * Creates a copy of the EffectiveCapacity
30767 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
30770 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
30772 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
30775 * Utility method to constructs a new MaximumHTLC-variant EffectiveCapacity
30777 struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat);
30780 * Utility method to constructs a new Total-variant EffectiveCapacity
30782 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
30785 * Utility method to constructs a new Infinite-variant EffectiveCapacity
30787 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
30790 * Utility method to constructs a new Unknown-variant EffectiveCapacity
30792 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
30795 * Returns the effective capacity denominated in millisatoshi.
30797 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
30800 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
30802 void RoutingFees_free(struct LDKRoutingFees this_obj);
30805 * Flat routing fee in millisatoshis.
30807 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
30810 * Flat routing fee in millisatoshis.
30812 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
30815 * Liquidity-based routing fee in millionths of a routed amount.
30816 * In other words, 10000 is 1%.
30818 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
30821 * Liquidity-based routing fee in millionths of a routed amount.
30822 * In other words, 10000 is 1%.
30824 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
30827 * Constructs a new RoutingFees given each field
30829 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
30832 * Checks if two RoutingFeess contain equal inner contents.
30833 * This ignores pointers and is_owned flags and looks at the values in fields.
30834 * Two objects with NULL inner values will be considered "equal" here.
30836 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
30839 * Creates a copy of the RoutingFees
30841 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
30844 * Checks if two RoutingFeess contain equal inner contents.
30846 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
30849 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
30851 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
30854 * Read a RoutingFees from a byte array, created by RoutingFees_write
30856 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
30859 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
30861 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
30864 * Protocol features the node announced support for
30866 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
30869 * Protocol features the node announced support for
30871 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
30874 * When the last known update to the node state was issued.
30875 * Value is opaque, as set in the announcement.
30877 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
30880 * When the last known update to the node state was issued.
30881 * Value is opaque, as set in the announcement.
30883 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
30886 * Color assigned to the node
30888 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
30891 * Color assigned to the node
30893 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
30896 * Moniker assigned to the node.
30897 * May be invalid or malicious (eg control chars),
30898 * should not be exposed to the user.
30900 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
30903 * Moniker assigned to the node.
30904 * May be invalid or malicious (eg control chars),
30905 * should not be exposed to the user.
30907 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
30910 * Internet-level addresses via which one can connect to the node
30912 * Returns a copy of the field.
30914 struct LDKCVec_NetAddressZ NodeAnnouncementInfo_get_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
30917 * Internet-level addresses via which one can connect to the node
30919 void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
30922 * An initial announcement of the node
30923 * Mostly redundant with the data we store in fields explicitly.
30924 * Everything else is useful only for sending out for initial routing sync.
30925 * Not stored if contains excess data to prevent DoS.
30927 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30929 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
30932 * An initial announcement of the node
30933 * Mostly redundant with the data we store in fields explicitly.
30934 * Everything else is useful only for sending out for initial routing sync.
30935 * Not stored if contains excess data to prevent DoS.
30937 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30939 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
30942 * Constructs a new NodeAnnouncementInfo given each field
30944 MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg);
30947 * Creates a copy of the NodeAnnouncementInfo
30949 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
30952 * Checks if two NodeAnnouncementInfos contain equal inner contents.
30953 * This ignores pointers and is_owned flags and looks at the values in fields.
30954 * Two objects with NULL inner values will be considered "equal" here.
30956 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
30959 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
30961 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
30964 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
30966 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
30969 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
30971 void NodeAlias_free(struct LDKNodeAlias this_obj);
30973 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
30975 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
30978 * Constructs a new NodeAlias given each field
30980 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
30983 * Creates a copy of the NodeAlias
30985 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
30988 * Checks if two NodeAliass contain equal inner contents.
30989 * This ignores pointers and is_owned flags and looks at the values in fields.
30990 * Two objects with NULL inner values will be considered "equal" here.
30992 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
30995 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
30997 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
31000 * Read a NodeAlias from a byte array, created by NodeAlias_write
31002 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
31005 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
31007 void NodeInfo_free(struct LDKNodeInfo this_obj);
31010 * All valid channels a node has announced
31012 * Returns a copy of the field.
31014 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
31017 * All valid channels a node has announced
31019 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
31022 * More information about a node from node_announcement.
31023 * Optional because we store a Node entry after learning about it from
31024 * a channel announcement, but before receiving a node announcement.
31026 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31028 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
31031 * More information about a node from node_announcement.
31032 * Optional because we store a Node entry after learning about it from
31033 * a channel announcement, but before receiving a node announcement.
31035 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
31037 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
31040 * Constructs a new NodeInfo given each field
31042 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
31045 * Creates a copy of the NodeInfo
31047 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
31050 * Checks if two NodeInfos contain equal inner contents.
31051 * This ignores pointers and is_owned flags and looks at the values in fields.
31052 * Two objects with NULL inner values will be considered "equal" here.
31054 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
31057 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
31059 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
31062 * Read a NodeInfo from a byte array, created by NodeInfo_write
31064 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
31067 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
31069 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
31072 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
31074 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
31077 * Creates a new, empty, network graph.
31079 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
31082 * Returns a read-only view of the network graph.
31084 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
31087 * The unix timestamp provided by the most recent rapid gossip sync.
31088 * It will be set by the rapid sync process after every sync completion.
31090 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
31093 * Update the unix timestamp provided by the most recent rapid gossip sync.
31094 * This should be done automatically by the rapid sync process after every sync completion.
31096 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
31099 * For an already known node (from channel announcements), update its stored properties from a
31100 * given node announcement.
31102 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
31103 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
31104 * routing messages from a source using a protocol other than the lightning P2P protocol.
31106 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
31109 * For an already known node (from channel announcements), update its stored properties from a
31110 * given node announcement without verifying the associated signatures. Because we aren't
31111 * given the associated signatures here we cannot relay the node announcement to any of our
31114 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);
31117 * Store or update channel info from a channel announcement.
31119 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
31120 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
31121 * routing messages from a source using a protocol other than the lightning P2P protocol.
31123 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
31124 * the corresponding UTXO exists on chain and is correctly-formatted.
31126 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);
31129 * Store or update channel info from a channel announcement without verifying the associated
31130 * signatures. Because we aren't given the associated signatures here we cannot relay the
31131 * channel announcement to any of our peers.
31133 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
31134 * the corresponding UTXO exists on chain and is correctly-formatted.
31136 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);
31139 * Update channel from partial announcement data received via rapid gossip sync
31141 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
31142 * rapid gossip sync server)
31144 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
31146 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);
31149 * Marks a channel in the graph as failed if a corresponding HTLC fail was sent.
31150 * If permanent, removes a channel from the local storage.
31151 * May cause the removal of nodes too, if this was their last channel.
31152 * If not permanent, makes channels unavailable for routing.
31154 void NetworkGraph_channel_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
31157 * Marks a node in the graph as permanently failed, effectively removing it and its channels
31158 * from local storage.
31160 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
31163 * Removes information about channels that we haven't heard any updates about in some time.
31164 * This can be used regularly to prune the network graph of channels that likely no longer
31167 * While there is no formal requirement that nodes regularly re-broadcast their channel
31168 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
31169 * pruning occur for updates which are at least two weeks old, which we implement here.
31171 * Note that for users of the `lightning-background-processor` crate this method may be
31172 * automatically called regularly for you.
31174 * This method will also cause us to stop tracking removed nodes and channels if they have been
31175 * in the map for a while so that these can be resynced from gossip in the future.
31177 * This method is only available with the `std` feature. See
31178 * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
31180 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
31183 * Removes information about channels that we haven't heard any updates about in some time.
31184 * This can be used regularly to prune the network graph of channels that likely no longer
31187 * While there is no formal requirement that nodes regularly re-broadcast their channel
31188 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
31189 * pruning occur for updates which are at least two weeks old, which we implement here.
31191 * This method will also cause us to stop tracking removed nodes and channels if they have been
31192 * in the map for a while so that these can be resynced from gossip in the future.
31194 * This function takes the current unix time as an argument. For users with the `std` feature
31195 * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
31197 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
31200 * For an already known (from announcement) channel, update info about one of the directions
31203 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
31204 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
31205 * routing messages from a source using a protocol other than the lightning P2P protocol.
31207 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
31208 * materially in the future will be rejected.
31210 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
31213 * For an already known (from announcement) channel, update info about one of the directions
31214 * of the channel without verifying the associated signatures. Because we aren't given the
31215 * associated signatures here we cannot relay the channel update to any of our peers.
31217 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
31218 * materially in the future will be rejected.
31220 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
31223 * Returns information on a channel with the given id.
31225 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31227 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
31230 * Returns the list of channels in the graph
31232 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
31235 * Returns information on a node with the given id.
31237 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31239 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
31242 * Returns the list of nodes in the graph
31244 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
31247 * Get network addresses by node id.
31248 * Returns None if the requested node is completely unknown,
31249 * or if node announcement for the node was never received.
31251 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
31254 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
31256 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
31259 * Creates a new router.
31261 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);
31264 * Constructs a new Router which calls the relevant methods on this_arg.
31265 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
31267 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
31270 * Calls the free function if one is set
31272 void Router_free(struct LDKRouter this_ptr);
31275 * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
31277 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
31280 * Initialize a new `ScorerAccountingForInFlightHtlcs`.
31282 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScore scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
31285 * Serialize the ScorerAccountingForInFlightHtlcs object into a byte array which can be read by ScorerAccountingForInFlightHtlcs_read
31287 struct LDKCVec_u8Z ScorerAccountingForInFlightHtlcs_write(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR obj);
31290 * Constructs a new Score which calls the relevant methods on this_arg.
31291 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
31293 struct LDKScore ScorerAccountingForInFlightHtlcs_as_Score(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
31296 * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
31298 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
31301 * Creates a copy of the InFlightHtlcs
31303 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
31306 * Constructs an empty `InFlightHtlcs`.
31308 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
31311 * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
31314 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);
31317 * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
31319 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
31322 * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
31324 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
31327 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
31329 void RouteHop_free(struct LDKRouteHop this_obj);
31332 * The node_id of the node at this hop.
31334 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
31337 * The node_id of the node at this hop.
31339 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31342 * The node_announcement features of the node at this hop. For the last hop, these may be
31343 * amended to match the features present in the invoice this node generated.
31345 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
31348 * The node_announcement features of the node at this hop. For the last hop, these may be
31349 * amended to match the features present in the invoice this node generated.
31351 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
31354 * The channel that should be used from the previous hop to reach this node.
31356 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
31359 * The channel that should be used from the previous hop to reach this node.
31361 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
31364 * The channel_announcement features of the channel that should be used from the previous hop
31365 * to reach this node.
31367 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
31370 * The channel_announcement features of the channel that should be used from the previous hop
31371 * to reach this node.
31373 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
31376 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
31377 * For the last hop, this should be the full value of the payment (might be more than
31378 * requested if we had to match htlc_minimum_msat).
31380 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
31383 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
31384 * For the last hop, this should be the full value of the payment (might be more than
31385 * requested if we had to match htlc_minimum_msat).
31387 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
31390 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
31391 * expected at the destination, in excess of the current block height.
31393 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
31396 * The CLTV delta added for this hop. For the last hop, this should be the full CLTV value
31397 * expected at the destination, in excess of the current block height.
31399 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
31402 * Constructs a new RouteHop given each field
31404 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);
31407 * Creates a copy of the RouteHop
31409 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
31412 * Checks if two RouteHops contain equal inner contents.
31414 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
31417 * Checks if two RouteHops contain equal inner contents.
31418 * This ignores pointers and is_owned flags and looks at the values in fields.
31419 * Two objects with NULL inner values will be considered "equal" here.
31421 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
31424 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
31426 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
31429 * Read a RouteHop from a byte array, created by RouteHop_write
31431 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
31434 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
31436 void Route_free(struct LDKRoute this_obj);
31439 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
31440 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
31441 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
31442 * least length one. While the maximum length of any given path is variable, keeping the length
31443 * of any path less or equal to 19 should currently ensure it is viable.
31445 struct LDKCVec_CVec_RouteHopZZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
31448 * The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
31449 * last RouteHop in each path must be the same. Each entry represents a list of hops, NOT
31450 * INCLUDING our own, where the last hop is the destination. Thus, this must always be at
31451 * least length one. While the maximum length of any given path is variable, keeping the length
31452 * of any path less or equal to 19 should currently ensure it is viable.
31454 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val);
31457 * The `payment_params` parameter passed to [`find_route`].
31458 * This is used by `ChannelManager` to track information which may be required for retries,
31459 * provided back to you via [`Event::PaymentPathFailed`].
31461 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
31463 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31465 struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr);
31468 * The `payment_params` parameter passed to [`find_route`].
31469 * This is used by `ChannelManager` to track information which may be required for retries,
31470 * provided back to you via [`Event::PaymentPathFailed`].
31472 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
31474 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
31476 void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
31479 * Constructs a new Route given each field
31481 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg, struct LDKPaymentParameters payment_params_arg);
31484 * Creates a copy of the Route
31486 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
31489 * Checks if two Routes contain equal inner contents.
31491 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
31494 * Checks if two Routes contain equal inner contents.
31495 * This ignores pointers and is_owned flags and looks at the values in fields.
31496 * Two objects with NULL inner values will be considered "equal" here.
31498 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
31501 * Returns the total amount of fees paid on this [`Route`].
31503 * This doesn't include any extra payment made to the recipient, which can happen in excess of
31504 * the amount passed to [`find_route`]'s `params.final_value_msat`.
31506 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
31509 * Returns the total amount paid on this [`Route`], excluding the fees.
31511 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
31514 * Serialize the Route object into a byte array which can be read by Route_read
31516 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
31519 * Read a Route from a byte array, created by Route_write
31521 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
31524 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
31526 void RouteParameters_free(struct LDKRouteParameters this_obj);
31529 * The parameters of the failed payment path.
31531 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
31534 * The parameters of the failed payment path.
31536 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
31539 * The amount in msats sent on the failed payment path.
31541 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
31544 * The amount in msats sent on the failed payment path.
31546 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
31549 * Constructs a new RouteParameters given each field
31551 MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPaymentParameters payment_params_arg, uint64_t final_value_msat_arg);
31554 * Creates a copy of the RouteParameters
31556 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
31559 * Checks if two RouteParameterss contain equal inner contents.
31560 * This ignores pointers and is_owned flags and looks at the values in fields.
31561 * Two objects with NULL inner values will be considered "equal" here.
31563 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
31566 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
31568 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
31571 * Read a RouteParameters from a byte array, created by RouteParameters_write
31573 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
31576 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
31578 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
31581 * The node id of the payee.
31583 struct LDKPublicKey PaymentParameters_get_payee_pubkey(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
31586 * The node id of the payee.
31588 void PaymentParameters_set_payee_pubkey(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31591 * Features supported by the payee.
31593 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
31594 * does not contain any features.
31596 * [`for_keysend`]: Self::for_keysend
31598 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31600 struct LDKInvoiceFeatures PaymentParameters_get_features(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
31603 * Features supported by the payee.
31605 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
31606 * does not contain any features.
31608 * [`for_keysend`]: Self::for_keysend
31610 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
31612 void PaymentParameters_set_features(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKInvoiceFeatures val);
31615 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
31617 struct LDKCVec_RouteHintZ PaymentParameters_get_route_hints(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
31620 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
31622 void PaymentParameters_set_route_hints(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintZ val);
31625 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
31627 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
31630 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
31632 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
31635 * The maximum total CLTV delta we accept for the route.
31636 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
31638 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
31641 * The maximum total CLTV delta we accept for the route.
31642 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
31644 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
31647 * The maximum number of paths that may be used by (MPP) payments.
31648 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
31650 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
31653 * The maximum number of paths that may be used by (MPP) payments.
31654 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
31656 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
31659 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
31660 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
31661 * a lower value prefers to send larger MPP parts, potentially saturating channels and
31662 * increasing failure probability for those paths.
31664 * Note that this restriction will be relaxed during pathfinding after paths which meet this
31665 * restriction have been found. While paths which meet this criteria will be searched for, it
31666 * is ultimately up to the scorer to select them over other paths.
31668 * A value of 0 will allow payments up to and including a channel's total announced usable
31669 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
31673 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
31676 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
31677 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
31678 * a lower value prefers to send larger MPP parts, potentially saturating channels and
31679 * increasing failure probability for those paths.
31681 * Note that this restriction will be relaxed during pathfinding after paths which meet this
31682 * restriction have been found. While paths which meet this criteria will be searched for, it
31683 * is ultimately up to the scorer to select them over other paths.
31685 * A value of 0 will allow payments up to and including a channel's total announced usable
31686 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
31690 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
31693 * A list of SCIDs which this payment was previously attempted over and which caused the
31694 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
31697 * Returns a copy of the field.
31699 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
31702 * A list of SCIDs which this payment was previously attempted over and which caused the
31703 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
31706 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
31709 * The minimum CLTV delta at the end of the route. This value must not be zero.
31711 uint32_t PaymentParameters_get_final_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
31714 * The minimum CLTV delta at the end of the route. This value must not be zero.
31716 void PaymentParameters_set_final_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
31719 * Constructs a new PaymentParameters given each field
31721 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPublicKey payee_pubkey_arg, struct LDKInvoiceFeatures features_arg, struct LDKCVec_RouteHintZ route_hints_arg, struct LDKCOption_u64Z expiry_time_arg, uint32_t max_total_cltv_expiry_delta_arg, uint8_t max_path_count_arg, uint8_t max_channel_saturation_power_of_half_arg, struct LDKCVec_u64Z previously_failed_channels_arg, uint32_t final_cltv_expiry_delta_arg);
31724 * Creates a copy of the PaymentParameters
31726 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
31729 * Checks if two PaymentParameterss contain equal inner contents.
31731 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
31734 * Checks if two PaymentParameterss contain equal inner contents.
31735 * This ignores pointers and is_owned flags and looks at the values in fields.
31736 * Two objects with NULL inner values will be considered "equal" here.
31738 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
31741 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
31743 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
31746 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
31748 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
31751 * Creates a payee with the node id of the given `pubkey`.
31753 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
31756 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
31759 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
31761 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
31764 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
31767 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
31769 void RouteHint_free(struct LDKRouteHint this_obj);
31771 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
31773 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
31776 * Constructs a new RouteHint given each field
31778 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
31781 * Creates a copy of the RouteHint
31783 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
31786 * Checks if two RouteHints contain equal inner contents.
31788 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
31791 * Checks if two RouteHints contain equal inner contents.
31792 * This ignores pointers and is_owned flags and looks at the values in fields.
31793 * Two objects with NULL inner values will be considered "equal" here.
31795 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
31798 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
31800 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
31803 * Read a RouteHint from a byte array, created by RouteHint_write
31805 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
31808 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
31810 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
31813 * The node_id of the non-target end of the route
31815 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
31818 * The node_id of the non-target end of the route
31820 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31823 * The short_channel_id of this channel
31825 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
31828 * The short_channel_id of this channel
31830 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
31833 * The fees which must be paid to use this channel
31835 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
31838 * The fees which must be paid to use this channel
31840 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
31843 * The difference in CLTV values between this node and the next node.
31845 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
31848 * The difference in CLTV values between this node and the next node.
31850 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
31853 * The minimum value, in msat, which must be relayed to the next hop.
31855 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
31858 * The minimum value, in msat, which must be relayed to the next hop.
31860 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
31863 * The maximum value in msat available for routing with a single HTLC.
31865 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
31868 * The maximum value in msat available for routing with a single HTLC.
31870 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
31873 * Constructs a new RouteHintHop given each field
31875 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);
31878 * Creates a copy of the RouteHintHop
31880 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
31883 * Checks if two RouteHintHops contain equal inner contents.
31885 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
31888 * Checks if two RouteHintHops contain equal inner contents.
31889 * This ignores pointers and is_owned flags and looks at the values in fields.
31890 * Two objects with NULL inner values will be considered "equal" here.
31892 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
31895 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
31897 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
31900 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
31902 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
31905 * Finds a route from us (payer) to the given target node (payee).
31907 * If the payee provided features in their invoice, they should be provided via `params.payee`.
31908 * Without this, MPP will only be used if the payee's features are available in the network graph.
31910 * Private routing paths between a public node and the target may be included in `params.payee`.
31912 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
31913 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
31914 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
31916 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
31917 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
31918 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
31922 * May be used to re-compute a [`Route`] when handling a [`Event::PaymentPathFailed`]. Any
31923 * adjustments to the [`NetworkGraph`] and channel scores should be made prior to calling this
31928 * Panics if first_hops contains channels without short_channel_ids;
31929 * [`ChannelManager::list_usable_channels`] will never include such channels.
31931 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
31932 * [`Event::PaymentPathFailed`]: crate::util::events::Event::PaymentPathFailed
31933 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
31935 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
31937 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]);
31940 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
31941 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
31943 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
31945 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]);
31948 * Calls the free function if one is set
31950 void Score_free(struct LDKScore this_ptr);
31953 * Calls the free function if one is set
31955 void LockableScore_free(struct LDKLockableScore this_ptr);
31958 * Calls the free function if one is set
31960 void WriteableScore_free(struct LDKWriteableScore this_ptr);
31963 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
31965 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
31968 * Frees any resources used by the MultiThreadedScoreLock, if is_owned is set and inner is non-NULL.
31970 void MultiThreadedScoreLock_free(struct LDKMultiThreadedScoreLock this_obj);
31973 * Constructs a new Score which calls the relevant methods on this_arg.
31974 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
31976 struct LDKScore MultiThreadedScoreLock_as_Score(const struct LDKMultiThreadedScoreLock *NONNULL_PTR this_arg);
31979 * Serialize the MultiThreadedScoreLock object into a byte array which can be read by MultiThreadedScoreLock_read
31981 struct LDKCVec_u8Z MultiThreadedScoreLock_write(const struct LDKMultiThreadedScoreLock *NONNULL_PTR obj);
31984 * Constructs a new LockableScore which calls the relevant methods on this_arg.
31985 * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
31987 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
31990 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
31992 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
31995 * Constructs a new WriteableScore which calls the relevant methods on this_arg.
31996 * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
31998 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
32001 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
32003 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
32006 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
32008 void ChannelUsage_free(struct LDKChannelUsage this_obj);
32011 * The amount to send through the channel, denominated in millisatoshis.
32013 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
32016 * The amount to send through the channel, denominated in millisatoshis.
32018 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
32021 * Total amount, denominated in millisatoshis, already allocated to send through the channel
32022 * as part of a multi-path payment.
32024 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
32027 * Total amount, denominated in millisatoshis, already allocated to send through the channel
32028 * as part of a multi-path payment.
32030 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
32033 * The effective capacity of the channel.
32035 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
32038 * The effective capacity of the channel.
32040 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
32043 * Constructs a new ChannelUsage given each field
32045 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
32048 * Creates a copy of the ChannelUsage
32050 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
32053 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
32055 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
32058 * Creates a copy of the FixedPenaltyScorer
32060 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
32063 * Creates a new scorer using `penalty_msat`.
32065 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
32068 * Constructs a new Score which calls the relevant methods on this_arg.
32069 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
32071 struct LDKScore FixedPenaltyScorer_as_Score(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
32074 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
32076 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
32079 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
32081 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
32084 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
32086 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
32089 * Frees any resources used by the ProbabilisticScoringParameters, if is_owned is set and inner is non-NULL.
32091 void ProbabilisticScoringParameters_free(struct LDKProbabilisticScoringParameters this_obj);
32094 * A fixed penalty in msats to apply to each channel.
32096 * Default value: 500 msat
32098 uint64_t ProbabilisticScoringParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
32101 * A fixed penalty in msats to apply to each channel.
32103 * Default value: 500 msat
32105 void ProbabilisticScoringParameters_set_base_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
32108 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
32109 * channel, in excess of the [`base_penalty_msat`].
32111 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
32112 * fees plus penalty) for large payments. The penalty is computed as the product of this
32113 * multiplier and `2^30`ths of the payment amount.
32115 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
32117 * Default value: 8,192 msat
32119 * [`base_penalty_msat`]: Self::base_penalty_msat
32121 uint64_t ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
32124 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
32125 * channel, in excess of the [`base_penalty_msat`].
32127 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
32128 * fees plus penalty) for large payments. The penalty is computed as the product of this
32129 * multiplier and `2^30`ths of the payment amount.
32131 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
32133 * Default value: 8,192 msat
32135 * [`base_penalty_msat`]: Self::base_penalty_msat
32137 void ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
32140 * A multiplier used in conjunction with the negative `log10` of the channel's success
32141 * probability for a payment, as determined by our latest estimates of the channel's
32142 * liquidity, to determine the liquidity penalty.
32144 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
32145 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
32146 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
32147 * lower bounding the success probability to `0.01`) when the amount falls within the
32148 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
32149 * result in a `u64::max_value` penalty, however.
32151 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
32153 * Default value: 30,000 msat
32155 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
32157 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
32160 * A multiplier used in conjunction with the negative `log10` of the channel's success
32161 * probability for a payment, as determined by our latest estimates of the channel's
32162 * liquidity, to determine the liquidity penalty.
32164 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
32165 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
32166 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
32167 * lower bounding the success probability to `0.01`) when the amount falls within the
32168 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
32169 * result in a `u64::max_value` penalty, however.
32171 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
32173 * Default value: 30,000 msat
32175 * [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
32177 void ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
32180 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
32181 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
32182 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
32185 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
32186 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
32187 * struct documentation for more info on the way the liquidity bounds are used.
32189 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
32190 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
32191 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
32193 * Default value: 6 hours
32197 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
32198 * liquidity knowledge will never decay except when the bounds cross.
32200 uint64_t ProbabilisticScoringParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
32203 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
32204 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
32205 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
32208 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
32209 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
32210 * struct documentation for more info on the way the liquidity bounds are used.
32212 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
32213 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
32214 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
32216 * Default value: 6 hours
32220 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
32221 * liquidity knowledge will never decay except when the bounds cross.
32223 void ProbabilisticScoringParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
32226 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
32227 * channel's success probability for the payment, as determined by our latest estimates of the
32228 * channel's liquidity, to determine the amount penalty.
32230 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
32231 * fees plus penalty) for large payments. The penalty is computed as the product of this
32232 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
32233 * success probability.
32235 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
32237 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
32238 * the amount will result in a penalty of the multiplier. And, as the success probability
32239 * decreases, the negative `log10` weighting will increase dramatically. For higher success
32240 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
32243 * Default value: 192 msat
32245 uint64_t ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
32248 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
32249 * channel's success probability for the payment, as determined by our latest estimates of the
32250 * channel's liquidity, to determine the amount penalty.
32252 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
32253 * fees plus penalty) for large payments. The penalty is computed as the product of this
32254 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
32255 * success probability.
32257 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
32259 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
32260 * the amount will result in a penalty of the multiplier. And, as the success probability
32261 * decreases, the negative `log10` weighting will increase dramatically. For higher success
32262 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
32265 * Default value: 192 msat
32267 void ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
32270 * A multiplier used in conjunction with the negative `log10` of the channel's success
32271 * probability for the payment, as determined based on the history of our estimates of the
32272 * channel's available liquidity, to determine a penalty.
32274 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
32275 * only our latest estimate for the current liquidity available in the channel, it estimates
32276 * success probability based on the estimated liquidity available in the channel through
32277 * history. Specifically, every time we update our liquidity bounds on a given channel, we
32278 * track which of several buckets those bounds fall into, exponentially decaying the
32279 * probability of each bucket as new samples are added.
32281 * Default value: 10,000 msat
32283 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
32285 uint64_t ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
32288 * A multiplier used in conjunction with the negative `log10` of the channel's success
32289 * probability for the payment, as determined based on the history of our estimates of the
32290 * channel's available liquidity, to determine a penalty.
32292 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
32293 * only our latest estimate for the current liquidity available in the channel, it estimates
32294 * success probability based on the estimated liquidity available in the channel through
32295 * history. Specifically, every time we update our liquidity bounds on a given channel, we
32296 * track which of several buckets those bounds fall into, exponentially decaying the
32297 * probability of each bucket as new samples are added.
32299 * Default value: 10,000 msat
32301 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
32303 void ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
32306 * A multiplier used in conjunction with the payment amount and the negative `log10` of the
32307 * channel's success probability for the payment, as determined based on the history of our
32308 * estimates of the channel's available liquidity, to determine a penalty.
32310 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
32311 * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths
32312 * of the payment amount, weighted by the negative `log10` of the success probability.
32314 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
32315 * of using only our latest estimate for the current liquidity available in the channel, it
32316 * estimates success probability based on the estimated liquidity available in the channel
32317 * through history. Specifically, every time we update our liquidity bounds on a given
32318 * channel, we track which of several buckets those bounds fall into, exponentially decaying
32319 * the probability of each bucket as new samples are added.
32321 * Default value: 64 msat
32323 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
32325 uint64_t ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
32328 * A multiplier used in conjunction with the payment amount and the negative `log10` of the
32329 * channel's success probability for the payment, as determined based on the history of our
32330 * estimates of the channel's available liquidity, to determine a penalty.
32332 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
32333 * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths
32334 * of the payment amount, weighted by the negative `log10` of the success probability.
32336 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
32337 * of using only our latest estimate for the current liquidity available in the channel, it
32338 * estimates success probability based on the estimated liquidity available in the channel
32339 * through history. Specifically, every time we update our liquidity bounds on a given
32340 * channel, we track which of several buckets those bounds fall into, exponentially decaying
32341 * the probability of each bucket as new samples are added.
32343 * Default value: 64 msat
32345 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
32347 void ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
32350 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
32351 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
32352 * seen a liquidity estimate update for this amount of time, the historical datapoints are
32355 * Note that after 16 or more half lives all historical data will be completely gone.
32357 * Default value: 14 days
32359 uint64_t ProbabilisticScoringParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
32362 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
32363 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
32364 * seen a liquidity estimate update for this amount of time, the historical datapoints are
32367 * Note that after 16 or more half lives all historical data will be completely gone.
32369 * Default value: 14 days
32371 void ProbabilisticScoringParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
32374 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
32375 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
32376 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
32377 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
32379 * Default value: 250 msat
32381 uint64_t ProbabilisticScoringParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
32384 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
32385 * channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
32386 * treat such nodes preferentially as this makes balance discovery attacks harder to execute,
32387 * thereby creating an incentive to restrict `htlc_maximum_msat` and improve privacy.
32389 * Default value: 250 msat
32391 void ProbabilisticScoringParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
32394 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
32395 * current estimate of the channel's available liquidity.
32397 * Note that in this case all other penalties, including the
32398 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
32399 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
32400 * applicable, are still included in the overall penalty.
32402 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
32403 * `u64::max_value()` will guarantee that.
32405 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
32407 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
32408 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
32409 * [`base_penalty_msat`]: Self::base_penalty_msat
32410 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
32412 uint64_t ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
32415 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
32416 * current estimate of the channel's available liquidity.
32418 * Note that in this case all other penalties, including the
32419 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
32420 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
32421 * applicable, are still included in the overall penalty.
32423 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
32424 * `u64::max_value()` will guarantee that.
32426 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
32428 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
32429 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
32430 * [`base_penalty_msat`]: Self::base_penalty_msat
32431 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
32433 void ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
32436 * Creates a copy of the ProbabilisticScoringParameters
32438 struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_clone(const struct LDKProbabilisticScoringParameters *NONNULL_PTR orig);
32441 * Creates a new scorer using the given scoring parameters for sending payments from a node
32442 * through a network graph.
32444 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringParameters params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
32447 * Dump the contents of this scorer into the configured logger.
32449 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
32450 * which may be a substantial amount of log output.
32452 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
32455 * Query the estimated minimum and maximum liquidity available for sending a payment over the
32456 * channel with `scid` towards the given `target` node.
32458 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);
32461 * Query the historical estimated minimum and maximum liquidity available for sending a
32462 * payment over the channel with `scid` towards the given `target` node.
32464 * Returns two sets of 8 buckets. The first set describes the octiles for lower-bound
32465 * liquidity estimates, the second set describes the octiles for upper-bound liquidity
32466 * estimates. Each bucket describes the relative frequency at which we've seen a liquidity
32467 * bound in the octile relative to the channel's total capacity, on an arbitrary scale.
32468 * Because the values are slowly decayed, more recent data points are weighted more heavily
32469 * than older datapoints.
32471 * When scoring, the estimated probability that an upper-/lower-bound lies in a given octile
32472 * relative to the channel's total capacity is calculated by dividing that bucket's value with
32473 * the total of all buckets for the given bound.
32475 * For example, a value of `[0, 0, 0, 0, 0, 0, 32]` indicates that we believe the probability
32476 * of a bound being in the top octile to be 100%, and have never (recently) seen it in any
32477 * other octiles. A value of `[31, 0, 0, 0, 0, 0, 0, 32]` indicates we've seen the bound being
32478 * both in the top and bottom octile, and roughly with similar (recent) frequency.
32480 * Because the datapoints are decayed slowly over time, values will eventually return to
32481 * `Some(([0; 8], [0; 8]))`.
32483 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);
32486 * Marks the node with the given `node_id` as banned, i.e.,
32487 * it will be avoided during path finding.
32489 void ProbabilisticScorer_add_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
32492 * Removes the node with the given `node_id` from the list of nodes to avoid.
32494 void ProbabilisticScorer_remove_banned(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
32497 * Sets a manual penalty for the given node.
32499 void ProbabilisticScorer_set_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
32502 * Removes the node with the given `node_id` from the list of manual penalties.
32504 void ProbabilisticScorer_remove_manual_penalty(struct LDKProbabilisticScorer *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
32507 * Clears the list of manual penalties that are applied during path finding.
32509 void ProbabilisticScorer_clear_manual_penalties(struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
32512 * Marks all nodes in the given list as banned, i.e.,
32513 * they will be avoided during path finding.
32515 void ProbabilisticScoringParameters_add_banned_from_list(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
32518 * Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.
32520 MUST_USE_RES struct LDKProbabilisticScoringParameters ProbabilisticScoringParameters_default(void);
32523 * Constructs a new Score which calls the relevant methods on this_arg.
32524 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
32526 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
32529 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
32531 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
32534 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
32536 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
32539 * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
32541 void BlindedPath_free(struct LDKBlindedPath this_obj);
32544 * Creates a copy of the BlindedPath
32546 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
32549 * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
32551 void BlindedHop_free(struct LDKBlindedHop this_obj);
32554 * Creates a copy of the BlindedHop
32556 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
32559 * Create a blinded path to be forwarded along `node_pks`. The last node pubkey in `node_pks`
32560 * will be the destination node.
32562 * Errors if less than two hops are provided or if `node_pk`(s) are invalid.
32564 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new(struct LDKCVec_PublicKeyZ node_pks, const struct LDKEntropySource *NONNULL_PTR entropy_source);
32567 * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
32569 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
32572 * Read a BlindedPath from a byte array, created by BlindedPath_write
32574 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
32577 * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
32579 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
32582 * Read a BlindedHop from a byte array, created by BlindedHop_write
32584 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
32587 * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
32589 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
32592 * Frees any resources used by the Destination
32594 void Destination_free(struct LDKDestination this_ptr);
32597 * Creates a copy of the Destination
32599 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
32602 * Utility method to constructs a new Node-variant Destination
32604 struct LDKDestination Destination_node(struct LDKPublicKey a);
32607 * Utility method to constructs a new BlindedPath-variant Destination
32609 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
32612 * Frees any resources used by the SendError
32614 void SendError_free(struct LDKSendError this_ptr);
32617 * Creates a copy of the SendError
32619 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
32622 * Utility method to constructs a new Secp256k1-variant SendError
32624 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
32627 * Utility method to constructs a new TooBigPacket-variant SendError
32629 struct LDKSendError SendError_too_big_packet(void);
32632 * Utility method to constructs a new TooFewBlindedHops-variant SendError
32634 struct LDKSendError SendError_too_few_blinded_hops(void);
32637 * Utility method to constructs a new InvalidFirstHop-variant SendError
32639 struct LDKSendError SendError_invalid_first_hop(void);
32642 * Utility method to constructs a new InvalidMessage-variant SendError
32644 struct LDKSendError SendError_invalid_message(void);
32647 * Utility method to constructs a new BufferFull-variant SendError
32649 struct LDKSendError SendError_buffer_full(void);
32652 * Utility method to constructs a new GetNodeIdFailed-variant SendError
32654 struct LDKSendError SendError_get_node_id_failed(void);
32657 * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
32659 struct LDKSendError SendError_blinded_path_advance_failed(void);
32662 * Checks if two SendErrors contain equal inner contents.
32663 * This ignores pointers and is_owned flags and looks at the values in fields.
32665 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
32668 * Calls the free function if one is set
32670 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
32673 * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
32674 * their respective handlers.
32676 MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
32679 * Send an onion message with contents `message` to `destination`, routing it through `intermediate_nodes`.
32680 * See [`OnionMessenger`] for example usage.
32682 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
32684 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);
32687 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
32688 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
32690 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
32693 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
32694 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
32696 struct LDKOnionMessageProvider OnionMessenger_as_OnionMessageProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
32699 * Frees any resources used by the OnionMessageContents
32701 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
32704 * Utility method to constructs a new Custom-variant OnionMessageContents
32706 struct LDKOnionMessageContents OnionMessageContents_custom(struct LDKCustomOnionMessageContents a);
32709 * Calls the free function if one is set
32711 void CustomOnionMessageContents_free(struct LDKCustomOnionMessageContents this_ptr);
32714 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
32716 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
32719 * Initialize a new FilesystemPersister and set the path to the individual channels'
32722 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
32725 * Get the directory which was provided when this persister was initialized.
32727 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
32730 * Read `ChannelMonitor`s from disk.
32732 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);
32735 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
32737 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
32740 * Frees any resources used by the GossipSync
32742 void GossipSync_free(struct LDKGossipSync this_ptr);
32745 * Utility method to constructs a new P2P-variant GossipSync
32747 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
32750 * Utility method to constructs a new Rapid-variant GossipSync
32752 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
32755 * Utility method to constructs a new None-variant GossipSync
32757 struct LDKGossipSync GossipSync_none(void);
32760 * Start a background thread that takes care of responsibilities enumerated in the [top-level
32763 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
32764 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
32765 * either [`join`] or [`stop`].
32767 * # Data Persistence
32769 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
32770 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
32771 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
32772 * provided implementation.
32774 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
32775 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
32776 * See the `lightning-persister` crate for LDK's provided implementation.
32778 * Typically, users should either implement [`Persister::persist_manager`] to never return an
32779 * error or call [`join`] and handle any error that may arise. For the latter case,
32780 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
32784 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
32785 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
32786 * functionality implemented by other handlers.
32787 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
32789 * # Rapid Gossip Sync
32791 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
32792 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
32793 * until the [`RapidGossipSync`] instance completes its first sync.
32795 * [top-level documentation]: BackgroundProcessor
32796 * [`join`]: Self::join
32797 * [`stop`]: Self::stop
32798 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
32799 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
32800 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
32801 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
32802 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
32803 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
32805 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);
32808 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
32809 * [`ChannelManager`].
32813 * This function panics if the background thread has panicked such as while persisting or
32816 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
32818 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
32821 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
32822 * [`ChannelManager`].
32826 * This function panics if the background thread has panicked such as while persisting or
32829 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
32831 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
32834 * Frees any resources used by the ParseError
32836 void ParseError_free(struct LDKParseError this_ptr);
32839 * Creates a copy of the ParseError
32841 struct LDKParseError ParseError_clone(const struct LDKParseError *NONNULL_PTR orig);
32844 * Utility method to constructs a new Bech32Error-variant ParseError
32846 struct LDKParseError ParseError_bech32_error(struct LDKBech32Error a);
32849 * Utility method to constructs a new ParseAmountError-variant ParseError
32851 struct LDKParseError ParseError_parse_amount_error(struct LDKError a);
32854 * Utility method to constructs a new MalformedSignature-variant ParseError
32856 struct LDKParseError ParseError_malformed_signature(enum LDKSecp256k1Error a);
32859 * Utility method to constructs a new BadPrefix-variant ParseError
32861 struct LDKParseError ParseError_bad_prefix(void);
32864 * Utility method to constructs a new UnknownCurrency-variant ParseError
32866 struct LDKParseError ParseError_unknown_currency(void);
32869 * Utility method to constructs a new UnknownSiPrefix-variant ParseError
32871 struct LDKParseError ParseError_unknown_si_prefix(void);
32874 * Utility method to constructs a new MalformedHRP-variant ParseError
32876 struct LDKParseError ParseError_malformed_hrp(void);
32879 * Utility method to constructs a new TooShortDataPart-variant ParseError
32881 struct LDKParseError ParseError_too_short_data_part(void);
32884 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant ParseError
32886 struct LDKParseError ParseError_unexpected_end_of_tagged_fields(void);
32889 * Utility method to constructs a new DescriptionDecodeError-variant ParseError
32891 struct LDKParseError ParseError_description_decode_error(struct LDKError a);
32894 * Utility method to constructs a new PaddingError-variant ParseError
32896 struct LDKParseError ParseError_padding_error(void);
32899 * Utility method to constructs a new IntegerOverflowError-variant ParseError
32901 struct LDKParseError ParseError_integer_overflow_error(void);
32904 * Utility method to constructs a new InvalidSegWitProgramLength-variant ParseError
32906 struct LDKParseError ParseError_invalid_seg_wit_program_length(void);
32909 * Utility method to constructs a new InvalidPubKeyHashLength-variant ParseError
32911 struct LDKParseError ParseError_invalid_pub_key_hash_length(void);
32914 * Utility method to constructs a new InvalidScriptHashLength-variant ParseError
32916 struct LDKParseError ParseError_invalid_script_hash_length(void);
32919 * Utility method to constructs a new InvalidRecoveryId-variant ParseError
32921 struct LDKParseError ParseError_invalid_recovery_id(void);
32924 * Utility method to constructs a new InvalidSliceLength-variant ParseError
32926 struct LDKParseError ParseError_invalid_slice_length(struct LDKStr a);
32929 * Utility method to constructs a new Skip-variant ParseError
32931 struct LDKParseError ParseError_skip(void);
32934 * Checks if two ParseErrors contain equal inner contents.
32935 * This ignores pointers and is_owned flags and looks at the values in fields.
32937 bool ParseError_eq(const struct LDKParseError *NONNULL_PTR a, const struct LDKParseError *NONNULL_PTR b);
32940 * Frees any resources used by the ParseOrSemanticError
32942 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
32945 * Creates a copy of the ParseOrSemanticError
32947 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
32950 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
32952 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKParseError a);
32955 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
32957 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKSemanticError a);
32960 * Checks if two ParseOrSemanticErrors contain equal inner contents.
32961 * This ignores pointers and is_owned flags and looks at the values in fields.
32963 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
32966 * Frees any resources used by the Invoice, if is_owned is set and inner is non-NULL.
32968 void Invoice_free(struct LDKInvoice this_obj);
32971 * Checks if two Invoices contain equal inner contents.
32972 * This ignores pointers and is_owned flags and looks at the values in fields.
32973 * Two objects with NULL inner values will be considered "equal" here.
32975 bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
32978 * Creates a copy of the Invoice
32980 struct LDKInvoice Invoice_clone(const struct LDKInvoice *NONNULL_PTR orig);
32983 * Checks if two Invoices contain equal inner contents.
32985 uint64_t Invoice_hash(const struct LDKInvoice *NONNULL_PTR o);
32988 * Frees any resources used by the SignedRawInvoice, if is_owned is set and inner is non-NULL.
32990 void SignedRawInvoice_free(struct LDKSignedRawInvoice this_obj);
32993 * Checks if two SignedRawInvoices contain equal inner contents.
32994 * This ignores pointers and is_owned flags and looks at the values in fields.
32995 * Two objects with NULL inner values will be considered "equal" here.
32997 bool SignedRawInvoice_eq(const struct LDKSignedRawInvoice *NONNULL_PTR a, const struct LDKSignedRawInvoice *NONNULL_PTR b);
33000 * Creates a copy of the SignedRawInvoice
33002 struct LDKSignedRawInvoice SignedRawInvoice_clone(const struct LDKSignedRawInvoice *NONNULL_PTR orig);
33005 * Checks if two SignedRawInvoices contain equal inner contents.
33007 uint64_t SignedRawInvoice_hash(const struct LDKSignedRawInvoice *NONNULL_PTR o);
33010 * Frees any resources used by the RawInvoice, if is_owned is set and inner is non-NULL.
33012 void RawInvoice_free(struct LDKRawInvoice this_obj);
33017 struct LDKRawDataPart RawInvoice_get_data(const struct LDKRawInvoice *NONNULL_PTR this_ptr);
33022 void RawInvoice_set_data(struct LDKRawInvoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
33025 * Checks if two RawInvoices contain equal inner contents.
33026 * This ignores pointers and is_owned flags and looks at the values in fields.
33027 * Two objects with NULL inner values will be considered "equal" here.
33029 bool RawInvoice_eq(const struct LDKRawInvoice *NONNULL_PTR a, const struct LDKRawInvoice *NONNULL_PTR b);
33032 * Creates a copy of the RawInvoice
33034 struct LDKRawInvoice RawInvoice_clone(const struct LDKRawInvoice *NONNULL_PTR orig);
33037 * Checks if two RawInvoices contain equal inner contents.
33039 uint64_t RawInvoice_hash(const struct LDKRawInvoice *NONNULL_PTR o);
33042 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
33044 void RawDataPart_free(struct LDKRawDataPart this_obj);
33047 * generation time of the invoice
33049 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
33052 * generation time of the invoice
33054 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
33057 * Checks if two RawDataParts contain equal inner contents.
33058 * This ignores pointers and is_owned flags and looks at the values in fields.
33059 * Two objects with NULL inner values will be considered "equal" here.
33061 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
33064 * Creates a copy of the RawDataPart
33066 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
33069 * Checks if two RawDataParts contain equal inner contents.
33071 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
33074 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
33076 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
33079 * Checks if two PositiveTimestamps contain equal inner contents.
33080 * This ignores pointers and is_owned flags and looks at the values in fields.
33081 * Two objects with NULL inner values will be considered "equal" here.
33083 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
33086 * Creates a copy of the PositiveTimestamp
33088 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
33091 * Checks if two PositiveTimestamps contain equal inner contents.
33093 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
33096 * Creates a copy of the SiPrefix
33098 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
33101 * Utility method to constructs a new Milli-variant SiPrefix
33103 enum LDKSiPrefix SiPrefix_milli(void);
33106 * Utility method to constructs a new Micro-variant SiPrefix
33108 enum LDKSiPrefix SiPrefix_micro(void);
33111 * Utility method to constructs a new Nano-variant SiPrefix
33113 enum LDKSiPrefix SiPrefix_nano(void);
33116 * Utility method to constructs a new Pico-variant SiPrefix
33118 enum LDKSiPrefix SiPrefix_pico(void);
33121 * Checks if two SiPrefixs contain equal inner contents.
33122 * This ignores pointers and is_owned flags and looks at the values in fields.
33124 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
33127 * Checks if two SiPrefixs contain equal inner contents.
33129 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
33132 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
33133 * This is effectively 10^12 * the prefix multiplier
33135 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
33138 * Creates a copy of the Currency
33140 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
33143 * Utility method to constructs a new Bitcoin-variant Currency
33145 enum LDKCurrency Currency_bitcoin(void);
33148 * Utility method to constructs a new BitcoinTestnet-variant Currency
33150 enum LDKCurrency Currency_bitcoin_testnet(void);
33153 * Utility method to constructs a new Regtest-variant Currency
33155 enum LDKCurrency Currency_regtest(void);
33158 * Utility method to constructs a new Simnet-variant Currency
33160 enum LDKCurrency Currency_simnet(void);
33163 * Utility method to constructs a new Signet-variant Currency
33165 enum LDKCurrency Currency_signet(void);
33168 * Checks if two Currencys contain equal inner contents.
33170 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
33173 * Checks if two Currencys contain equal inner contents.
33174 * This ignores pointers and is_owned flags and looks at the values in fields.
33176 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
33179 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
33181 void Sha256_free(struct LDKSha256 this_obj);
33184 * Creates a copy of the Sha256
33186 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
33189 * Checks if two Sha256s contain equal inner contents.
33191 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
33194 * Checks if two Sha256s contain equal inner contents.
33195 * This ignores pointers and is_owned flags and looks at the values in fields.
33196 * Two objects with NULL inner values will be considered "equal" here.
33198 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
33201 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
33203 void Description_free(struct LDKDescription this_obj);
33206 * Creates a copy of the Description
33208 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
33211 * Checks if two Descriptions contain equal inner contents.
33213 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
33216 * Checks if two Descriptions contain equal inner contents.
33217 * This ignores pointers and is_owned flags and looks at the values in fields.
33218 * Two objects with NULL inner values will be considered "equal" here.
33220 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
33223 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
33225 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
33227 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
33229 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33232 * Constructs a new PayeePubKey given each field
33234 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
33237 * Creates a copy of the PayeePubKey
33239 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
33242 * Checks if two PayeePubKeys contain equal inner contents.
33244 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
33247 * Checks if two PayeePubKeys contain equal inner contents.
33248 * This ignores pointers and is_owned flags and looks at the values in fields.
33249 * Two objects with NULL inner values will be considered "equal" here.
33251 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
33254 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
33256 void ExpiryTime_free(struct LDKExpiryTime this_obj);
33259 * Creates a copy of the ExpiryTime
33261 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
33264 * Checks if two ExpiryTimes contain equal inner contents.
33266 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
33269 * Checks if two ExpiryTimes contain equal inner contents.
33270 * This ignores pointers and is_owned flags and looks at the values in fields.
33271 * Two objects with NULL inner values will be considered "equal" here.
33273 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
33276 * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
33278 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
33280 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
33282 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
33285 * Constructs a new MinFinalCltvExpiryDelta given each field
33287 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
33290 * Creates a copy of the MinFinalCltvExpiryDelta
33292 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
33295 * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
33297 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
33300 * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
33301 * This ignores pointers and is_owned flags and looks at the values in fields.
33302 * Two objects with NULL inner values will be considered "equal" here.
33304 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
33307 * Frees any resources used by the Fallback
33309 void Fallback_free(struct LDKFallback this_ptr);
33312 * Creates a copy of the Fallback
33314 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
33317 * Utility method to constructs a new SegWitProgram-variant Fallback
33319 struct LDKFallback Fallback_seg_wit_program(struct LDKU5 version, struct LDKCVec_u8Z program);
33322 * Utility method to constructs a new PubKeyHash-variant Fallback
33324 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
33327 * Utility method to constructs a new ScriptHash-variant Fallback
33329 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
33332 * Checks if two Fallbacks contain equal inner contents.
33334 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
33337 * Checks if two Fallbacks contain equal inner contents.
33338 * This ignores pointers and is_owned flags and looks at the values in fields.
33340 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
33343 * Frees any resources used by the InvoiceSignature, if is_owned is set and inner is non-NULL.
33345 void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
33348 * Creates a copy of the InvoiceSignature
33350 struct LDKInvoiceSignature InvoiceSignature_clone(const struct LDKInvoiceSignature *NONNULL_PTR orig);
33353 * Checks if two InvoiceSignatures contain equal inner contents.
33355 uint64_t InvoiceSignature_hash(const struct LDKInvoiceSignature *NONNULL_PTR o);
33358 * Checks if two InvoiceSignatures contain equal inner contents.
33359 * This ignores pointers and is_owned flags and looks at the values in fields.
33360 * Two objects with NULL inner values will be considered "equal" here.
33362 bool InvoiceSignature_eq(const struct LDKInvoiceSignature *NONNULL_PTR a, const struct LDKInvoiceSignature *NONNULL_PTR b);
33365 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
33367 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
33370 * Creates a copy of the PrivateRoute
33372 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
33375 * Checks if two PrivateRoutes contain equal inner contents.
33377 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
33380 * Checks if two PrivateRoutes contain equal inner contents.
33381 * This ignores pointers and is_owned flags and looks at the values in fields.
33382 * Two objects with NULL inner values will be considered "equal" here.
33384 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
33387 * Disassembles the `SignedRawInvoice` into its three parts:
33389 * 2. hash of the raw invoice
33392 MUST_USE_RES struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ SignedRawInvoice_into_parts(struct LDKSignedRawInvoice this_arg);
33395 * The `RawInvoice` which was signed.
33397 MUST_USE_RES struct LDKRawInvoice SignedRawInvoice_raw_invoice(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
33400 * The hash of the `RawInvoice` that was signed.
33402 MUST_USE_RES const uint8_t (*SignedRawInvoice_signable_hash(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg))[32];
33405 * InvoiceSignature for the invoice.
33407 MUST_USE_RES struct LDKInvoiceSignature SignedRawInvoice_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
33410 * Recovers the public key used for signing the invoice from the recoverable signature.
33412 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawInvoice_recover_payee_pub_key(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
33415 * Checks if the signature is valid for the included payee public key or if none exists if it's
33416 * valid for the recovered signature (which should always be true?).
33418 MUST_USE_RES bool SignedRawInvoice_check_signature(const struct LDKSignedRawInvoice *NONNULL_PTR this_arg);
33421 * Calculate the hash of the encoded `RawInvoice` which should be signed.
33423 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_signable_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
33427 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33429 MUST_USE_RES struct LDKSha256 RawInvoice_payment_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
33433 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33435 MUST_USE_RES struct LDKDescription RawInvoice_description(const struct LDKRawInvoice *NONNULL_PTR this_arg);
33439 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33441 MUST_USE_RES struct LDKPayeePubKey RawInvoice_payee_pub_key(const struct LDKRawInvoice *NONNULL_PTR this_arg);
33445 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33447 MUST_USE_RES struct LDKSha256 RawInvoice_description_hash(const struct LDKRawInvoice *NONNULL_PTR this_arg);
33451 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33453 MUST_USE_RES struct LDKExpiryTime RawInvoice_expiry_time(const struct LDKRawInvoice *NONNULL_PTR this_arg);
33457 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33459 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawInvoice_min_final_cltv_expiry_delta(const struct LDKRawInvoice *NONNULL_PTR this_arg);
33463 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33465 MUST_USE_RES struct LDKThirtyTwoBytes RawInvoice_payment_secret(const struct LDKRawInvoice *NONNULL_PTR this_arg);
33469 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33471 MUST_USE_RES struct LDKInvoiceFeatures RawInvoice_features(const struct LDKRawInvoice *NONNULL_PTR this_arg);
33473 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawInvoice_private_routes(const struct LDKRawInvoice *NONNULL_PTR this_arg);
33475 MUST_USE_RES struct LDKCOption_u64Z RawInvoice_amount_pico_btc(const struct LDKRawInvoice *NONNULL_PTR this_arg);
33477 MUST_USE_RES enum LDKCurrency RawInvoice_currency(const struct LDKRawInvoice *NONNULL_PTR this_arg);
33480 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
33482 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
33484 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
33487 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
33488 * the range `0..=MAX_TIMESTAMP`.
33490 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
33492 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
33494 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
33497 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
33498 * `0..=MAX_TIMESTAMP`.
33500 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
33502 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
33504 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
33507 * Returns the Unix timestamp representing the stored time
33509 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
33512 * Returns the duration of the stored time since the Unix epoch
33514 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
33517 * Returns the [`SystemTime`] representing the stored time
33519 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
33522 * Transform the `Invoice` into it's unchecked version
33524 MUST_USE_RES struct LDKSignedRawInvoice Invoice_into_signed_raw(struct LDKInvoice this_arg);
33527 * Check that the invoice is signed correctly and that key recovery works
33529 MUST_USE_RES struct LDKCResult_NoneSemanticErrorZ Invoice_check_signature(const struct LDKInvoice *NONNULL_PTR this_arg);
33532 * Constructs an `Invoice` from a `SignedRawInvoice` by checking all its invariants.
33534 * use lightning_invoice::*;
33536 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
33537 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
33538 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
33539 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
33540 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
33541 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
33542 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
33543 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
33544 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
33545 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
33546 * j5r6drg6k6zcqj0fcwg\";
33548 * let signed = invoice.parse::<SignedRawInvoice>().unwrap();
33550 * assert!(Invoice::from_signed(signed).is_ok());
33553 MUST_USE_RES struct LDKCResult_InvoiceSemanticErrorZ Invoice_from_signed(struct LDKSignedRawInvoice signed_invoice);
33556 * Returns the `Invoice`'s timestamp (should equal its creation time)
33558 MUST_USE_RES uint64_t Invoice_timestamp(const struct LDKInvoice *NONNULL_PTR this_arg);
33561 * Returns the `Invoice`'s timestamp as a duration since the Unix epoch
33563 MUST_USE_RES uint64_t Invoice_duration_since_epoch(const struct LDKInvoice *NONNULL_PTR this_arg);
33566 * Returns the hash to which we will receive the preimage on completion of the payment
33568 MUST_USE_RES const uint8_t (*Invoice_payment_hash(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
33571 * Get the payee's public key if one was included in the invoice
33573 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33575 MUST_USE_RES struct LDKPublicKey Invoice_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
33578 * Get the payment secret if one was included in the invoice
33580 MUST_USE_RES const uint8_t (*Invoice_payment_secret(const struct LDKInvoice *NONNULL_PTR this_arg))[32];
33583 * Get the invoice features if they were included in the invoice
33585 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33587 MUST_USE_RES struct LDKInvoiceFeatures Invoice_features(const struct LDKInvoice *NONNULL_PTR this_arg);
33590 * Recover the payee's public key (only to be used if none was included in the invoice)
33592 MUST_USE_RES struct LDKPublicKey Invoice_recover_payee_pub_key(const struct LDKInvoice *NONNULL_PTR this_arg);
33595 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
33597 MUST_USE_RES uint64_t Invoice_expiry_time(const struct LDKInvoice *NONNULL_PTR this_arg);
33600 * Returns whether the invoice has expired.
33602 MUST_USE_RES bool Invoice_is_expired(const struct LDKInvoice *NONNULL_PTR this_arg);
33605 * Returns whether the expiry time would pass at the given point in time.
33606 * `at_time` is the timestamp as a duration since the Unix epoch.
33608 MUST_USE_RES bool Invoice_would_expire(const struct LDKInvoice *NONNULL_PTR this_arg, uint64_t at_time);
33611 * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
33612 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
33614 MUST_USE_RES uint64_t Invoice_min_final_cltv_expiry_delta(const struct LDKInvoice *NONNULL_PTR this_arg);
33617 * Returns a list of all routes included in the invoice
33619 MUST_USE_RES struct LDKCVec_PrivateRouteZ Invoice_private_routes(const struct LDKInvoice *NONNULL_PTR this_arg);
33622 * Returns a list of all routes included in the invoice as the underlying hints
33624 MUST_USE_RES struct LDKCVec_RouteHintZ Invoice_route_hints(const struct LDKInvoice *NONNULL_PTR this_arg);
33627 * Returns the currency for which the invoice was issued
33629 MUST_USE_RES enum LDKCurrency Invoice_currency(const struct LDKInvoice *NONNULL_PTR this_arg);
33632 * Returns the amount if specified in the invoice as millisatoshis.
33634 MUST_USE_RES struct LDKCOption_u64Z Invoice_amount_milli_satoshis(const struct LDKInvoice *NONNULL_PTR this_arg);
33637 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
33638 * returns `CreationError::DescriptionTooLong` otherwise
33640 * Please note that single characters may use more than one byte due to UTF8 encoding.
33642 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
33645 * Returns the underlying description `String`
33647 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
33650 * Construct an `ExpiryTime` from seconds.
33652 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
33655 * Construct an `ExpiryTime` from a `Duration`, dropping the sub-second part.
33657 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
33660 * Returns the expiry time in seconds
33662 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
33665 * Returns a reference to the underlying `Duration` (=expiry time)
33667 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
33670 * Creates a new (partial) route from a list of hops
33672 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
33675 * Returns the underlying list of hops
33677 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
33680 * Creates a copy of the CreationError
33682 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
33685 * Utility method to constructs a new DescriptionTooLong-variant CreationError
33687 enum LDKCreationError CreationError_description_too_long(void);
33690 * Utility method to constructs a new RouteTooLong-variant CreationError
33692 enum LDKCreationError CreationError_route_too_long(void);
33695 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
33697 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
33700 * Utility method to constructs a new InvalidAmount-variant CreationError
33702 enum LDKCreationError CreationError_invalid_amount(void);
33705 * Utility method to constructs a new MissingRouteHints-variant CreationError
33707 enum LDKCreationError CreationError_missing_route_hints(void);
33710 * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
33712 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
33715 * Checks if two CreationErrors contain equal inner contents.
33716 * This ignores pointers and is_owned flags and looks at the values in fields.
33718 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
33721 * Get the string representation of a CreationError object
33723 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
33726 * Creates a copy of the SemanticError
33728 enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
33731 * Utility method to constructs a new NoPaymentHash-variant SemanticError
33733 enum LDKSemanticError SemanticError_no_payment_hash(void);
33736 * Utility method to constructs a new MultiplePaymentHashes-variant SemanticError
33738 enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
33741 * Utility method to constructs a new NoDescription-variant SemanticError
33743 enum LDKSemanticError SemanticError_no_description(void);
33746 * Utility method to constructs a new MultipleDescriptions-variant SemanticError
33748 enum LDKSemanticError SemanticError_multiple_descriptions(void);
33751 * Utility method to constructs a new NoPaymentSecret-variant SemanticError
33753 enum LDKSemanticError SemanticError_no_payment_secret(void);
33756 * Utility method to constructs a new MultiplePaymentSecrets-variant SemanticError
33758 enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
33761 * Utility method to constructs a new InvalidFeatures-variant SemanticError
33763 enum LDKSemanticError SemanticError_invalid_features(void);
33766 * Utility method to constructs a new InvalidRecoveryId-variant SemanticError
33768 enum LDKSemanticError SemanticError_invalid_recovery_id(void);
33771 * Utility method to constructs a new InvalidSignature-variant SemanticError
33773 enum LDKSemanticError SemanticError_invalid_signature(void);
33776 * Utility method to constructs a new ImpreciseAmount-variant SemanticError
33778 enum LDKSemanticError SemanticError_imprecise_amount(void);
33781 * Checks if two SemanticErrors contain equal inner contents.
33782 * This ignores pointers and is_owned flags and looks at the values in fields.
33784 bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
33787 * Get the string representation of a SemanticError object
33789 struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
33792 * Frees any resources used by the SignOrCreationError
33794 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
33797 * Creates a copy of the SignOrCreationError
33799 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
33802 * Utility method to constructs a new SignError-variant SignOrCreationError
33804 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
33807 * Utility method to constructs a new CreationError-variant SignOrCreationError
33809 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
33812 * Checks if two SignOrCreationErrors contain equal inner contents.
33813 * This ignores pointers and is_owned flags and looks at the values in fields.
33815 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
33818 * Get the string representation of a SignOrCreationError object
33820 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
33823 * Pays the given [`Invoice`], retrying if needed based on [`Retry`].
33825 * [`Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
33826 * as the payment is still pending. Once the payment completes or fails, you must ensure that
33827 * a second payment with the same [`PaymentHash`] is never sent.
33829 * If you wish to use a different payment idempotency token, see [`pay_invoice_with_id`].
33831 struct LDKCResult_PaymentIdPaymentErrorZ pay_invoice(const struct LDKInvoice *NONNULL_PTR invoice, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
33834 * Pays the given [`Invoice`] with a custom idempotency key, retrying if needed based on [`Retry`].
33836 * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
33837 * payment completes or fails, no idempotency guarantees are made.
33839 * You should ensure that the [`Invoice::payment_hash`] is unique and the same [`PaymentHash`]
33840 * has never been paid before.
33842 * See [`pay_invoice`] for a variant which uses the [`PaymentHash`] for the idempotency token.
33844 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);
33847 * Pays the given zero-value [`Invoice`] using the given amount, retrying if needed based on
33850 * [`Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
33851 * as the payment is still pending. Once the payment completes or fails, you must ensure that
33852 * a second payment with the same [`PaymentHash`] is never sent.
33854 * If you wish to use a different payment idempotency token, see
33855 * [`pay_zero_value_invoice_with_id`].
33857 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);
33860 * Pays the given zero-value [`Invoice`] using the given amount and custom idempotency key,
33861 * , retrying if needed based on [`Retry`].
33863 * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
33864 * payment completes or fails, no idempotency guarantees are made.
33866 * You should ensure that the [`Invoice::payment_hash`] is unique and the same [`PaymentHash`]
33867 * has never been paid before.
33869 * See [`pay_zero_value_invoice`] for a variant which uses the [`PaymentHash`] for the
33870 * idempotency token.
33872 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);
33875 * Frees any resources used by the PaymentError
33877 void PaymentError_free(struct LDKPaymentError this_ptr);
33880 * Creates a copy of the PaymentError
33882 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
33885 * Utility method to constructs a new Invoice-variant PaymentError
33887 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
33890 * Utility method to constructs a new Sending-variant PaymentError
33892 struct LDKPaymentError PaymentError_sending(enum LDKRetryableSendFailure a);
33895 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
33896 * See [`PhantomKeysManager`] for more information on phantom node payments.
33898 * `phantom_route_hints` parameter:
33899 * * Contains channel info for all nodes participating in the phantom invoice
33900 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
33901 * participating node
33902 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
33903 * updated when a channel becomes disabled or closes
33904 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
33905 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
33908 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
33909 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
33910 * If `None` is provided for `payment_hash`, then one will be created.
33912 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
33913 * in excess of the current time.
33915 * `duration_since_epoch` is the current time since epoch in seconds.
33917 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
33918 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
33919 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
33920 * confirmations during routing.
33922 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
33923 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
33926 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
33927 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
33928 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
33929 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
33930 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
33931 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
33933 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
33934 * available and the current time is supplied by the caller.
33936 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
33938 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);
33941 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
33942 * See [`PhantomKeysManager`] for more information on phantom node payments.
33944 * `phantom_route_hints` parameter:
33945 * * Contains channel info for all nodes participating in the phantom invoice
33946 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
33947 * participating node
33948 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
33949 * updated when a channel becomes disabled or closes
33950 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
33951 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
33954 * `description_hash` is a SHA-256 hash of the description text
33956 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
33957 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
33958 * If `None` is provided for `payment_hash`, then one will be created.
33960 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
33961 * in excess of the current time.
33963 * `duration_since_epoch` is the current time since epoch in seconds.
33965 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
33966 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
33969 * [`PhantomKeysManager`]: lightning::chain::keysinterface::PhantomKeysManager
33970 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
33971 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
33972 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
33973 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
33975 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
33976 * available and the current time is supplied by the caller.
33978 * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
33980 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);
33983 * Utility to construct an invoice. Generally, unless you want to do something like a custom
33984 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
33985 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
33986 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
33987 * that the payment secret is valid when the invoice is paid.
33989 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
33990 * in excess of the current time.
33992 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
33993 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
33994 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
33995 * confirmations during routing.
33997 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
33999 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);
34002 * Utility to construct an invoice. Generally, unless you want to do something like a custom
34003 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
34004 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
34005 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
34006 * that the payment secret is valid when the invoice is paid.
34007 * Use this variant if you want to pass the `description_hash` to the invoice.
34009 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
34010 * in excess of the current time.
34012 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
34013 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
34014 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
34015 * confirmations during routing.
34017 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
34019 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);
34022 * See [`create_invoice_from_channelmanager_with_description_hash`]
34023 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
34024 * available and the current time is supplied by the caller.
34026 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);
34029 * See [`create_invoice_from_channelmanager`]
34030 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
34031 * available and the current time is supplied by the caller.
34033 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);
34036 * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
34037 * This version allows for providing a custom [`PaymentHash`] for the invoice.
34038 * This may be useful if you're building an on-chain swap or involving another protocol where
34039 * the payment hash is also involved outside the scope of lightning.
34041 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);
34044 * Read a SiPrefix object from a string
34046 struct LDKCResult_SiPrefixParseErrorZ SiPrefix_from_str(struct LDKStr s);
34049 * Read a Invoice object from a string
34051 struct LDKCResult_InvoiceParseOrSemanticErrorZ Invoice_from_str(struct LDKStr s);
34054 * Read a SignedRawInvoice object from a string
34056 struct LDKCResult_SignedRawInvoiceParseErrorZ SignedRawInvoice_from_str(struct LDKStr s);
34059 * Get the string representation of a ParseError object
34061 struct LDKStr ParseError_to_str(const struct LDKParseError *NONNULL_PTR o);
34064 * Get the string representation of a ParseOrSemanticError object
34066 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
34069 * Get the string representation of a Invoice object
34071 struct LDKStr Invoice_to_str(const struct LDKInvoice *NONNULL_PTR o);
34074 * Get the string representation of a SignedRawInvoice object
34076 struct LDKStr SignedRawInvoice_to_str(const struct LDKSignedRawInvoice *NONNULL_PTR o);
34079 * Get the string representation of a Currency object
34081 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
34084 * Get the string representation of a SiPrefix object
34086 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
34089 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
34091 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
34094 * Instantiate a new [`RapidGossipSync`] instance.
34096 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
34099 * Update network graph from binary data.
34100 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
34102 * `update_data`: `&[u8]` binary stream that comprises the update data
34104 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
34107 * Update network graph from binary data.
34108 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
34110 * `update_data`: `&[u8]` binary stream that comprises the update data
34111 * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
34113 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);
34116 * Returns whether a rapid gossip sync has completed at least once.
34118 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
34121 * Frees any resources used by the GraphSyncError
34123 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
34126 * Creates a copy of the GraphSyncError
34128 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
34131 * Utility method to constructs a new DecodeError-variant GraphSyncError
34133 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
34136 * Utility method to constructs a new LightningError-variant GraphSyncError
34138 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
34140 #endif /* LDK_C_BINDINGS_H */
34142 #include "ldk_ver.h"