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 * Errors that may occur when converting a [`RawBolt11Invoice`] to a [`Bolt11Invoice`]. They relate to
15 * the requirements sections in BOLT #11
17 typedef enum LDKBolt11SemanticError {
19 * The invoice is missing the mandatory payment hash
21 LDKBolt11SemanticError_NoPaymentHash,
23 * The invoice has multiple payment hashes which isn't allowed
25 LDKBolt11SemanticError_MultiplePaymentHashes,
27 * No description or description hash are part of the invoice
29 LDKBolt11SemanticError_NoDescription,
31 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
33 LDKBolt11SemanticError_MultipleDescriptions,
35 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
38 LDKBolt11SemanticError_NoPaymentSecret,
40 * The invoice contains multiple payment secrets
42 LDKBolt11SemanticError_MultiplePaymentSecrets,
44 * The invoice's features are invalid
46 LDKBolt11SemanticError_InvalidFeatures,
48 * The recovery id doesn't fit the signature/pub key
50 LDKBolt11SemanticError_InvalidRecoveryId,
52 * The invoice's signature is invalid
54 LDKBolt11SemanticError_InvalidSignature,
56 * The invoice's amount was not a whole number of millisatoshis
58 LDKBolt11SemanticError_ImpreciseAmount,
60 * Must be last for serialization purposes
62 LDKBolt11SemanticError_Sentinel,
63 } LDKBolt11SemanticError;
66 * Error when interpreting a TLV stream as a specific type.
68 typedef enum LDKBolt12SemanticError {
70 * The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
72 LDKBolt12SemanticError_AlreadyExpired,
74 * The provided chain hash does not correspond to a supported chain.
76 LDKBolt12SemanticError_UnsupportedChain,
78 * A chain was provided but was not expected.
80 LDKBolt12SemanticError_UnexpectedChain,
82 * An amount was expected but was missing.
84 LDKBolt12SemanticError_MissingAmount,
86 * The amount exceeded the total bitcoin supply.
88 LDKBolt12SemanticError_InvalidAmount,
90 * An amount was provided but was not sufficient in value.
92 LDKBolt12SemanticError_InsufficientAmount,
94 * An amount was provided but was not expected.
96 LDKBolt12SemanticError_UnexpectedAmount,
98 * A currency was provided that is not supported.
100 LDKBolt12SemanticError_UnsupportedCurrency,
102 * A feature was required but is unknown.
104 LDKBolt12SemanticError_UnknownRequiredFeatures,
106 * Features were provided but were not expected.
108 LDKBolt12SemanticError_UnexpectedFeatures,
110 * A required description was not provided.
112 LDKBolt12SemanticError_MissingDescription,
114 * A signing pubkey was not provided.
116 LDKBolt12SemanticError_MissingSigningPubkey,
118 * A signing pubkey was provided but a different one was expected.
120 LDKBolt12SemanticError_InvalidSigningPubkey,
122 * A signing pubkey was provided but was not expected.
124 LDKBolt12SemanticError_UnexpectedSigningPubkey,
126 * A quantity was expected but was missing.
128 LDKBolt12SemanticError_MissingQuantity,
130 * An unsupported quantity was provided.
132 LDKBolt12SemanticError_InvalidQuantity,
134 * A quantity or quantity bounds was provided but was not expected.
136 LDKBolt12SemanticError_UnexpectedQuantity,
138 * Metadata could not be used to verify the offers message.
140 LDKBolt12SemanticError_InvalidMetadata,
142 * Metadata was provided but was not expected.
144 LDKBolt12SemanticError_UnexpectedMetadata,
146 * Payer metadata was expected but was missing.
148 LDKBolt12SemanticError_MissingPayerMetadata,
150 * A payer id was expected but was missing.
152 LDKBolt12SemanticError_MissingPayerId,
154 * Blinded paths were expected but were missing.
156 LDKBolt12SemanticError_MissingPaths,
158 * The blinded payinfo given does not match the number of blinded path hops.
160 LDKBolt12SemanticError_InvalidPayInfo,
162 * An invoice creation time was expected but was missing.
164 LDKBolt12SemanticError_MissingCreationTime,
166 * An invoice payment hash was expected but was missing.
168 LDKBolt12SemanticError_MissingPaymentHash,
170 * A signature was expected but was missing.
172 LDKBolt12SemanticError_MissingSignature,
174 * Must be last for serialization purposes
176 LDKBolt12SemanticError_Sentinel,
177 } LDKBolt12SemanticError;
180 * An enum which can either contain a or not
182 typedef enum LDKCOption_NoneZ {
184 * When we're in this state, this COption_NoneZ contains a
186 LDKCOption_NoneZ_Some,
188 * When we're in this state, this COption_NoneZ contains nothing
190 LDKCOption_NoneZ_None,
192 * Must be last for serialization purposes
194 LDKCOption_NoneZ_Sentinel,
198 * An enum representing the status of a channel monitor update persistence.
200 typedef enum LDKChannelMonitorUpdateStatus {
202 * The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
205 * This includes performing any `fsync()` calls required to ensure the update is guaranteed to
206 * be available on restart even if the application crashes.
208 LDKChannelMonitorUpdateStatus_Completed,
210 * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
211 * our state failed, but is expected to succeed at some point in the future).
213 * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
214 * submitting new commitment transactions to the counterparty. Once the update(s) which failed
215 * have been successfully applied, a [`MonitorEvent::Completed`] can be used to restore the
216 * channel to an operational state.
218 * Note that a given [`ChannelManager`] will *never* re-generate a [`ChannelMonitorUpdate`].
219 * If you return this error you must ensure that it is written to disk safely before writing
220 * the latest [`ChannelManager`] state, or you should return [`PermanentFailure`] instead.
222 * Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
223 * occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
224 * attempting to claim it on this channel) and those updates must still be persisted.
226 * No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
227 * until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
228 * monitor update for the same channel.
230 * For deployments where a copy of ChannelMonitors and other local state are backed up in a
231 * remote location (with local copies persisted immediately), it is anticipated that all
232 * updates will return [`InProgress`] until the remote copies could be updated.
234 * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
235 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
236 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
238 LDKChannelMonitorUpdateStatus_InProgress,
240 * Used to indicate no further channel monitor updates will be allowed (likely a disk failure
241 * or a remote copy of this [`ChannelMonitor`] is no longer reachable and thus not updatable).
243 * When this is returned, [`ChannelManager`] will force-close the channel but *not* broadcast
244 * our current commitment transaction. This avoids a dangerous case where a local disk failure
245 * (e.g. the Linux-default remounting of the disk as read-only) causes [`PermanentFailure`]s
246 * for all monitor updates. If we were to broadcast our latest commitment transaction and then
247 * restart, we could end up reading a previous [`ChannelMonitor`] and [`ChannelManager`],
248 * revoking our now-broadcasted state before seeing it confirm and losing all our funds.
250 * Note that this is somewhat of a tradeoff - if the disk is really gone and we may have lost
251 * the data permanently, we really should broadcast immediately. If the data can be recovered
252 * with manual intervention, we'd rather close the channel, rejecting future updates to it,
253 * and broadcast the latest state only if we have HTLCs to claim which are timing out (which
254 * we do as long as blocks are connected).
256 * In order to broadcast the latest local commitment transaction, you'll need to call
257 * [`ChannelMonitor::get_latest_holder_commitment_txn`] and broadcast the resulting
258 * transactions once you've safely ensured no further channel updates can be generated by your
259 * [`ChannelManager`].
261 * Note that at least one final [`ChannelMonitorUpdate`] may still be provided, which must
262 * still be processed by a running [`ChannelMonitor`]. This final update will mark the
263 * [`ChannelMonitor`] as finalized, ensuring no further updates (e.g. revocation of the latest
264 * commitment transaction) are allowed.
266 * Note that even if you return a [`PermanentFailure`] due to unavailability of secondary
267 * [`ChannelMonitor`] copies, you should still make an attempt to store the update where
268 * possible to ensure you can claim HTLC outputs on the latest commitment transaction
271 * In case of distributed watchtowers deployment, the new version must be written to disk, as
272 * state may have been stored but rejected due to a block forcing a commitment broadcast. This
273 * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
274 * lagging behind on block processing.
276 * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
277 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
279 LDKChannelMonitorUpdateStatus_PermanentFailure,
281 * Must be last for serialization purposes
283 LDKChannelMonitorUpdateStatus_Sentinel,
284 } LDKChannelMonitorUpdateStatus;
287 * Further information on the details of the channel shutdown.
288 * Upon channels being forced closed (i.e. commitment transaction confirmation detected
289 * by `ChainMonitor`), ChannelShutdownState will be set to `ShutdownComplete` or
290 * the channel will be removed shortly.
291 * Also note, that in normal operation, peers could disconnect at any of these states
292 * and require peer re-connection before making progress onto other states
294 typedef enum LDKChannelShutdownState {
296 * Channel has not sent or received a shutdown message.
298 LDKChannelShutdownState_NotShuttingDown,
300 * Local node has sent a shutdown message for this channel.
302 LDKChannelShutdownState_ShutdownInitiated,
304 * Shutdown message exchanges have concluded and the channels are in the midst of
305 * resolving all existing open HTLCs before closing can continue.
307 LDKChannelShutdownState_ResolvingHTLCs,
309 * All HTLCs have been resolved, nodes are currently negotiating channel close onchain fee rates.
311 LDKChannelShutdownState_NegotiatingClosingFee,
313 * We've successfully negotiated a closing_signed dance. At this point `ChannelManager` is about
314 * to drop the channel.
316 LDKChannelShutdownState_ShutdownComplete,
318 * Must be last for serialization purposes
320 LDKChannelShutdownState_Sentinel,
321 } LDKChannelShutdownState;
324 * An enum that represents the priority at which we want a transaction to confirm used for feerate
327 typedef enum LDKConfirmationTarget {
329 * We'd like a transaction to confirm in the future, but don't want to commit most of the fees
330 * required to do so yet. The remaining fees will come via a Child-Pays-For-Parent (CPFP) fee
331 * bump of the transaction.
333 * The feerate returned should be the absolute minimum feerate required to enter most node
334 * mempools across the network. Note that if you are not able to obtain this feerate estimate,
335 * you should likely use the furthest-out estimate allowed by your fee estimator.
337 LDKConfirmationTarget_MempoolMinimum,
339 * We are happy with a transaction confirming slowly, at least within a day or so worth of
342 LDKConfirmationTarget_Background,
344 * We'd like a transaction to confirm without major delayed, i.e., within the next 12-24 blocks.
346 LDKConfirmationTarget_Normal,
348 * We'd like a transaction to confirm in the next few blocks.
350 LDKConfirmationTarget_HighPriority,
352 * Must be last for serialization purposes
354 LDKConfirmationTarget_Sentinel,
355 } LDKConfirmationTarget;
358 * Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`]
360 typedef enum LDKCreationError {
362 * The supplied description string was longer than 639 __bytes__ (see [`Description::new`])
364 LDKCreationError_DescriptionTooLong,
366 * The specified route has too many hops and can't be encoded
368 LDKCreationError_RouteTooLong,
370 * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
372 LDKCreationError_TimestampOutOfBounds,
374 * The supplied millisatoshi amount was greater than the total bitcoin supply.
376 LDKCreationError_InvalidAmount,
378 * Route hints were required for this invoice and were missing. Applies to
379 * [phantom invoices].
381 * [phantom invoices]: crate::utils::create_phantom_invoice
383 LDKCreationError_MissingRouteHints,
385 * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
387 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
389 LDKCreationError_MinFinalCltvExpiryDeltaTooShort,
391 * Must be last for serialization purposes
393 LDKCreationError_Sentinel,
397 * Enum representing the crypto currencies (or networks) supported by this library
399 typedef enum LDKCurrency {
407 LDKCurrency_BitcoinTestnet,
421 * Must be last for serialization purposes
423 LDKCurrency_Sentinel,
427 * This enum is used to specify which error data to send to peers when failing back an HTLC
428 * using [`ChannelManager::fail_htlc_backwards_with_reason`].
430 * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
432 typedef enum LDKFailureCode {
434 * We had a temporary error processing the payment. Useful if no other error codes fit
435 * and you want to indicate that the payer may want to retry.
437 LDKFailureCode_TemporaryNodeFailure,
439 * We have a required feature which was not in this onion. For example, you may require
440 * some additional metadata that was not provided with this payment.
442 LDKFailureCode_RequiredNodeFeatureMissing,
444 * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
445 * the HTLC is too close to the current block height for safe handling.
446 * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
447 * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
449 LDKFailureCode_IncorrectOrUnknownPaymentDetails,
451 * Must be last for serialization purposes
453 LDKFailureCode_Sentinel,
457 * Describes the type of HTLC claim as determined by analyzing the witness.
459 typedef enum LDKHTLCClaim {
461 * Claims an offered output on a commitment transaction through the timeout path.
463 LDKHTLCClaim_OfferedTimeout,
465 * Claims an offered output on a commitment transaction through the success path.
467 LDKHTLCClaim_OfferedPreimage,
469 * Claims an accepted output on a commitment transaction through the timeout path.
471 LDKHTLCClaim_AcceptedTimeout,
473 * Claims an accepted output on a commitment transaction through the success path.
475 LDKHTLCClaim_AcceptedPreimage,
477 * Claims an offered/accepted output on a commitment transaction through the revocation path.
479 LDKHTLCClaim_Revocation,
481 * Must be last for serialization purposes
483 LDKHTLCClaim_Sentinel,
487 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
489 typedef enum LDKIOError {
491 LDKIOError_PermissionDenied,
492 LDKIOError_ConnectionRefused,
493 LDKIOError_ConnectionReset,
494 LDKIOError_ConnectionAborted,
495 LDKIOError_NotConnected,
496 LDKIOError_AddrInUse,
497 LDKIOError_AddrNotAvailable,
498 LDKIOError_BrokenPipe,
499 LDKIOError_AlreadyExists,
500 LDKIOError_WouldBlock,
501 LDKIOError_InvalidInput,
502 LDKIOError_InvalidData,
504 LDKIOError_WriteZero,
505 LDKIOError_Interrupted,
507 LDKIOError_UnexpectedEof,
509 * Must be last for serialization purposes
515 * An enum representing the available verbosity levels of the logger.
517 typedef enum LDKLevel {
519 * Designates extremely verbose information, including gossip-induced messages
523 * Designates very low priority, often extremely verbose, information
527 * Designates lower priority information
531 * Designates useful information
535 * Designates hazardous situations
539 * Designates very serious errors
543 * Must be last for serialization purposes
549 * An enum representing the possible Bitcoin or test networks which we can run on
551 typedef enum LDKNetwork {
553 * The main Bitcoin blockchain.
557 * The testnet3 blockchain.
561 * A local test blockchain.
565 * A blockchain on which blocks are signed instead of mined.
569 * Must be last for serialization purposes
575 * The reason the payment failed. Used in [`Event::PaymentFailed`].
577 typedef enum LDKPaymentFailureReason {
579 * The intended recipient rejected our payment.
581 LDKPaymentFailureReason_RecipientRejected,
583 * The user chose to abandon this payment by calling [`ChannelManager::abandon_payment`].
585 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
587 LDKPaymentFailureReason_UserAbandoned,
589 * We exhausted all of our retry attempts while trying to send the payment, or we
590 * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry
591 * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will
592 * have come before this.
594 * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout
596 LDKPaymentFailureReason_RetriesExhausted,
598 * The payment expired while retrying, based on the provided
599 * [`PaymentParameters::expiry_time`].
601 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
603 LDKPaymentFailureReason_PaymentExpired,
605 * We failed to find a route while retrying the payment.
607 LDKPaymentFailureReason_RouteNotFound,
609 * This error should generally never happen. This likely means that there is a problem with
612 LDKPaymentFailureReason_UnexpectedError,
614 * Must be last for serialization purposes
616 LDKPaymentFailureReason_Sentinel,
617 } LDKPaymentFailureReason;
620 * Specifies the recipient of an invoice.
622 * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign
625 typedef enum LDKRecipient {
627 * The invoice should be signed with the local node secret key.
631 * The invoice should be signed with the phantom node secret key. This secret key must be the
632 * same for all nodes participating in the [phantom node payment].
634 * [phantom node payment]: PhantomKeysManager
636 LDKRecipient_PhantomNode,
638 * Must be last for serialization purposes
640 LDKRecipient_Sentinel,
644 * Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be
645 * surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
647 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
648 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
649 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
651 typedef enum LDKRetryableSendFailure {
653 * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
654 * that this error is *not* caused by [`Retry::Timeout`].
656 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
658 LDKRetryableSendFailure_PaymentExpired,
660 * We were unable to find a route to the destination.
662 LDKRetryableSendFailure_RouteNotFound,
664 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
665 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
667 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
668 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
669 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
671 LDKRetryableSendFailure_DuplicatePayment,
673 * Must be last for serialization purposes
675 LDKRetryableSendFailure_Sentinel,
676 } LDKRetryableSendFailure;
679 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
681 typedef enum LDKSecp256k1Error {
683 * Signature failed verification
685 LDKSecp256k1Error_IncorrectSignature,
687 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
689 LDKSecp256k1Error_InvalidMessage,
693 LDKSecp256k1Error_InvalidPublicKey,
697 LDKSecp256k1Error_InvalidSignature,
701 LDKSecp256k1Error_InvalidSecretKey,
705 LDKSecp256k1Error_InvalidSharedSecret,
709 LDKSecp256k1Error_InvalidRecoveryId,
711 * Invalid tweak for add_assign or mul_assign
713 LDKSecp256k1Error_InvalidTweak,
715 * Didn't pass enough memory to context creation with preallocated memory
717 LDKSecp256k1Error_NotEnoughMemory,
719 * Bad set of public keys.
721 LDKSecp256k1Error_InvalidPublicKeySum,
723 * The only valid parity values are 0 or 1.
725 LDKSecp256k1Error_InvalidParityValue,
727 * Must be last for serialization purposes
729 LDKSecp256k1Error_Sentinel,
733 * SI prefixes for the human readable part
735 typedef enum LDKSiPrefix {
753 * Must be last for serialization purposes
755 LDKSiPrefix_Sentinel,
759 * An error when accessing the chain via [`UtxoLookup`].
761 typedef enum LDKUtxoLookupError {
763 * The requested chain is unknown.
765 LDKUtxoLookupError_UnknownChain,
767 * The requested transaction doesn't exist or hasn't confirmed.
769 LDKUtxoLookupError_UnknownTx,
771 * Must be last for serialization purposes
773 LDKUtxoLookupError_Sentinel,
774 } LDKUtxoLookupError;
777 * A Rust str object, ie a reference to a UTF8-valid string.
778 * This is *not* null-terminated so cannot be used directly as a C string!
780 typedef struct LDKStr {
782 * A pointer to the string's bytes, in UTF8 encoding
784 const uint8_t *chars;
786 * The number of bytes (not characters!) pointed to by `chars`
790 * Whether the data pointed to by `chars` should be freed or not.
796 * A 16-byte byte array.
798 typedef struct LDKSixteenBytes {
806 * Unsigned, 128-bit integer.
808 * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
809 * See https://github.com/rust-lang/rust/issues/54341 for more details.
811 typedef struct LDKU128 {
813 * The 128-bit integer, as 16 little-endian bytes
815 uint8_t le_bytes[16];
819 * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
821 typedef struct LDKBigEndianScalar {
823 * The bytes of the scalar value.
825 uint8_t big_endian_bytes[32];
826 } LDKBigEndianScalar;
829 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
830 * look up the corresponding function in rust-lightning's docs.
832 typedef struct LDKThirtyTwoBytes {
834 * The thirty-two bytes
840 * Represents an error returned from the bech32 library during validation of some bech32 data
842 typedef enum LDKBech32Error_Tag {
844 * String does not contain the separator character
846 LDKBech32Error_MissingSeparator,
848 * The checksum does not match the rest of the data
850 LDKBech32Error_InvalidChecksum,
852 * The data or human-readable part is too long or too short
854 LDKBech32Error_InvalidLength,
856 * Some part of the string contains an invalid character
858 LDKBech32Error_InvalidChar,
860 * Some part of the data has an invalid value
862 LDKBech32Error_InvalidData,
864 * The bit conversion failed due to a padding issue
866 LDKBech32Error_InvalidPadding,
868 * The whole string must be of one case
870 LDKBech32Error_MixedCase,
872 * Must be last for serialization purposes
874 LDKBech32Error_Sentinel,
875 } LDKBech32Error_Tag;
877 typedef struct LDKBech32Error {
878 LDKBech32Error_Tag tag;
881 uint32_t invalid_char;
884 uint8_t invalid_data;
890 * A serialized transaction, in (pointer, length) form.
892 * This type optionally owns its own memory, and thus the semantics around access change based on
893 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
894 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
895 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
896 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
897 * you would be invalid.
899 * Note that, while it may change in the future, because transactions on the Rust side are stored
900 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
901 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
902 * `data_is_owned` either set or unset at your discretion.
904 typedef struct LDKTransaction {
906 * The serialized transaction data.
908 * This is non-const for your convenience, an object passed to Rust is never written to.
912 * The length of the serialized transaction
916 * Whether the data pointed to by `data` should be freed or not.
922 * A serialized witness.
924 typedef struct LDKWitness {
926 * The serialized transaction data.
928 * This is non-const for your convenience, an object passed to Rust is never written to.
932 * The length of the serialized transaction
936 * Whether the data pointed to by `data` should be freed or not.
942 * A dynamically-allocated array of u8s of arbitrary size.
943 * This corresponds to std::vector in C++
945 typedef struct LDKCVec_u8Z {
947 * The elements in the array.
948 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
952 * The number of elements pointed to by `data`.
958 * An input to a transaction.
960 * This contains the witness, the scriptSig and the previous outpoint and represents a single
961 * input to a transaction
963 typedef struct LDKTxIn {
965 * The witness which includes any signatures required to spend a segwit output.
967 struct LDKWitness witness;
969 * The script_sig which includes signatures requires to spend a pre-segwit output (or a
970 * P2SH-wrapped segwit output).
972 struct LDKCVec_u8Z script_sig;
974 * The sequence number of the transaction input
978 * The txid of the transaction being spent.
980 struct LDKThirtyTwoBytes previous_txid;
982 * The output index of the transaction being spent.
984 uint32_t previous_vout;
988 * A transaction output including a scriptPubKey and value.
989 * This type *does* own its own memory, so must be free'd appropriately.
991 typedef struct LDKTxOut {
993 * The script_pubkey in this output
995 struct LDKCVec_u8Z script_pubkey;
997 * The value, in satoshis, of this output
1003 * An enum which can either contain a u64 or not
1005 typedef enum LDKCOption_DurationZ_Tag {
1007 * When we're in this state, this COption_DurationZ contains a u64
1009 LDKCOption_DurationZ_Some,
1011 * When we're in this state, this COption_DurationZ contains nothing
1013 LDKCOption_DurationZ_None,
1015 * Must be last for serialization purposes
1017 LDKCOption_DurationZ_Sentinel,
1018 } LDKCOption_DurationZ_Tag;
1020 typedef struct LDKCOption_DurationZ {
1021 LDKCOption_DurationZ_Tag tag;
1027 } LDKCOption_DurationZ;
1032 * Onion messages and payments can be sent and received to blinded paths, which serve to hide the
1033 * identity of the recipient.
1035 typedef struct MUST_USE_STRUCT LDKBlindedPath {
1037 * A pointer to the opaque Rust object.
1038 * Nearly everywhere, inner must be non-null, however in places where
1039 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1041 LDKnativeBlindedPath *inner;
1043 * Indicates that this is the only struct which contains the same pointer.
1044 * Rust functions which take ownership of an object provided via an argument require
1045 * this to be true and invalidate the object pointed to by inner.
1051 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedPaths of arbitrary size.
1052 * This corresponds to std::vector in C++
1054 typedef struct LDKCVec_BlindedPathZ {
1056 * The elements in the array.
1057 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1059 struct LDKBlindedPath *data;
1061 * The number of elements pointed to by `data`.
1064 } LDKCVec_BlindedPathZ;
1067 * An enum which can either contain a u64 or not
1069 typedef enum LDKCOption_u64Z_Tag {
1071 * When we're in this state, this COption_u64Z contains a u64
1073 LDKCOption_u64Z_Some,
1075 * When we're in this state, this COption_u64Z contains nothing
1077 LDKCOption_u64Z_None,
1079 * Must be last for serialization purposes
1081 LDKCOption_u64Z_Sentinel,
1082 } LDKCOption_u64Z_Tag;
1084 typedef struct LDKCOption_u64Z {
1085 LDKCOption_u64Z_Tag tag;
1096 * A `Refund` is a request to send an [`Bolt12Invoice`] without a preceding [`Offer`].
1098 * Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to
1099 * recoup their funds. A refund may be used more generally as an \"offer for money\", such as with a
1102 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1103 * [`Offer`]: crate::offers::offer::Offer
1105 typedef struct MUST_USE_STRUCT LDKRefund {
1107 * A pointer to the opaque Rust object.
1108 * Nearly everywhere, inner must be non-null, however in places where
1109 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1111 LDKnativeRefund *inner;
1113 * Indicates that this is the only struct which contains the same pointer.
1114 * Rust functions which take ownership of an object provided via an argument require
1115 * this to be true and invalidate the object pointed to by inner.
1123 * Error when parsing a bech32 encoded message using [`str::parse`].
1125 typedef struct MUST_USE_STRUCT LDKBolt12ParseError {
1127 * A pointer to the opaque Rust object.
1128 * Nearly everywhere, inner must be non-null, however in places where
1129 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1131 LDKnativeBolt12ParseError *inner;
1133 * Indicates that this is the only struct which contains the same pointer.
1134 * Rust functions which take ownership of an object provided via an argument require
1135 * this to be true and invalidate the object pointed to by inner.
1138 } LDKBolt12ParseError;
1141 * The contents of CResult_RefundBolt12ParseErrorZ
1143 typedef union LDKCResult_RefundBolt12ParseErrorZPtr {
1145 * A pointer to the contents in the success state.
1146 * Reading from this pointer when `result_ok` is not set is undefined.
1148 struct LDKRefund *result;
1150 * A pointer to the contents in the error state.
1151 * Reading from this pointer when `result_ok` is set is undefined.
1153 struct LDKBolt12ParseError *err;
1154 } LDKCResult_RefundBolt12ParseErrorZPtr;
1157 * A CResult_RefundBolt12ParseErrorZ represents the result of a fallible operation,
1158 * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
1159 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1161 typedef struct LDKCResult_RefundBolt12ParseErrorZ {
1163 * The contents of this CResult_RefundBolt12ParseErrorZ, accessible via either
1164 * `err` or `result` depending on the state of `result_ok`.
1166 union LDKCResult_RefundBolt12ParseErrorZPtr contents;
1168 * Whether this CResult_RefundBolt12ParseErrorZ represents a success state.
1171 } LDKCResult_RefundBolt12ParseErrorZ;
1176 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1178 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1180 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1182 * A pointer to the opaque Rust object.
1183 * Nearly everywhere, inner must be non-null, however in places where
1184 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1186 LDKnativeShutdownScript *inner;
1188 * Indicates that this is the only struct which contains the same pointer.
1189 * Rust functions which take ownership of an object provided via an argument require
1190 * this to be true and invalidate the object pointed to by inner.
1193 } LDKShutdownScript;
1196 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
1199 typedef enum LDKAPIError_Tag {
1201 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
1202 * are documented, but generally indicates some precondition of a function was violated.
1204 LDKAPIError_APIMisuseError,
1206 * Due to a high feerate, we were unable to complete the request.
1207 * For example, this may be returned if the feerate implies we cannot open a channel at the
1208 * requested value, but opening a larger channel would succeed.
1210 LDKAPIError_FeeRateTooHigh,
1212 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
1213 * too-many-hops, etc).
1215 LDKAPIError_InvalidRoute,
1217 * We were unable to complete the request as the Channel required to do so is unable to
1218 * complete the request (or was not found). This can take many forms, including disconnected
1219 * peer, channel at capacity, channel shutting down, etc.
1221 LDKAPIError_ChannelUnavailable,
1223 * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
1224 * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
1225 * monitor update is awaiting async resolution. Once it resolves the attempted action should
1226 * complete automatically.
1228 * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
1229 * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
1230 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
1232 LDKAPIError_MonitorUpdateInProgress,
1234 * [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
1235 * with the channel counterparty as negotiated in [`InitFeatures`].
1237 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
1238 * a channel or cooperatively close one with this peer (and will have to force-close instead).
1240 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
1241 * [`InitFeatures`]: crate::ln::features::InitFeatures
1243 LDKAPIError_IncompatibleShutdownScript,
1245 * Must be last for serialization purposes
1247 LDKAPIError_Sentinel,
1250 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
1252 * A human-readable error message
1255 } LDKAPIError_LDKAPIMisuseError_Body;
1257 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
1259 * A human-readable error message
1263 * The feerate which was too high.
1266 } LDKAPIError_LDKFeeRateTooHigh_Body;
1268 typedef struct LDKAPIError_LDKInvalidRoute_Body {
1270 * A human-readable error message
1273 } LDKAPIError_LDKInvalidRoute_Body;
1275 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
1277 * A human-readable error message
1280 } LDKAPIError_LDKChannelUnavailable_Body;
1282 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
1284 * The incompatible shutdown script.
1286 struct LDKShutdownScript script;
1287 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
1289 typedef struct MUST_USE_STRUCT LDKAPIError {
1290 LDKAPIError_Tag tag;
1292 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
1293 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
1294 LDKAPIError_LDKInvalidRoute_Body invalid_route;
1295 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
1296 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
1301 * The contents of CResult_NoneAPIErrorZ
1303 typedef union LDKCResult_NoneAPIErrorZPtr {
1305 * Note that this value is always NULL, as there are no contents in the OK variant
1309 * A pointer to the contents in the error state.
1310 * Reading from this pointer when `result_ok` is set is undefined.
1312 struct LDKAPIError *err;
1313 } LDKCResult_NoneAPIErrorZPtr;
1316 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
1317 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
1318 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1320 typedef struct LDKCResult_NoneAPIErrorZ {
1322 * The contents of this CResult_NoneAPIErrorZ, accessible via either
1323 * `err` or `result` depending on the state of `result_ok`.
1325 union LDKCResult_NoneAPIErrorZPtr contents;
1327 * Whether this CResult_NoneAPIErrorZ represents a success state.
1330 } LDKCResult_NoneAPIErrorZ;
1333 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
1334 * This corresponds to std::vector in C++
1336 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
1338 * The elements in the array.
1339 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1341 struct LDKCResult_NoneAPIErrorZ *data;
1343 * The number of elements pointed to by `data`.
1346 } LDKCVec_CResult_NoneAPIErrorZZ;
1349 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
1350 * This corresponds to std::vector in C++
1352 typedef struct LDKCVec_APIErrorZ {
1354 * The elements in the array.
1355 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1357 struct LDKAPIError *data;
1359 * The number of elements pointed to by `data`.
1362 } LDKCVec_APIErrorZ;
1365 * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
1367 typedef enum LDKCOption_PaymentSecretZ_Tag {
1369 * When we're in this state, this COption_PaymentSecretZ contains a crate::c_types::ThirtyTwoBytes
1371 LDKCOption_PaymentSecretZ_Some,
1373 * When we're in this state, this COption_PaymentSecretZ contains nothing
1375 LDKCOption_PaymentSecretZ_None,
1377 * Must be last for serialization purposes
1379 LDKCOption_PaymentSecretZ_Sentinel,
1380 } LDKCOption_PaymentSecretZ_Tag;
1382 typedef struct LDKCOption_PaymentSecretZ {
1383 LDKCOption_PaymentSecretZ_Tag tag;
1386 struct LDKThirtyTwoBytes some;
1389 } LDKCOption_PaymentSecretZ;
1392 * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
1394 typedef enum LDKCOption_CVec_u8ZZ_Tag {
1396 * When we're in this state, this COption_CVec_u8ZZ contains a crate::c_types::derived::CVec_u8Z
1398 LDKCOption_CVec_u8ZZ_Some,
1400 * When we're in this state, this COption_CVec_u8ZZ contains nothing
1402 LDKCOption_CVec_u8ZZ_None,
1404 * Must be last for serialization purposes
1406 LDKCOption_CVec_u8ZZ_Sentinel,
1407 } LDKCOption_CVec_u8ZZ_Tag;
1409 typedef struct LDKCOption_CVec_u8ZZ {
1410 LDKCOption_CVec_u8ZZ_Tag tag;
1413 struct LDKCVec_u8Z some;
1416 } LDKCOption_CVec_u8ZZ;
1421 * Information which is provided, encrypted, to the payment recipient when sending HTLCs.
1423 * This should generally be constructed with data communicated to us from the recipient (via a
1424 * BOLT11 or BOLT12 invoice).
1426 typedef struct MUST_USE_STRUCT LDKRecipientOnionFields {
1428 * A pointer to the opaque Rust object.
1429 * Nearly everywhere, inner must be non-null, however in places where
1430 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1432 LDKnativeRecipientOnionFields *inner;
1434 * Indicates that this is the only struct which contains the same pointer.
1435 * Rust functions which take ownership of an object provided via an argument require
1436 * this to be true and invalidate the object pointed to by inner.
1439 } LDKRecipientOnionFields;
1442 * An error in decoding a message or struct.
1444 typedef enum LDKDecodeError_Tag {
1446 * A version byte specified something we don't know how to handle.
1448 * Includes unknown realm byte in an onion hop data packet.
1450 LDKDecodeError_UnknownVersion,
1452 * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
1454 LDKDecodeError_UnknownRequiredFeature,
1456 * Value was invalid.
1458 * For example, a byte which was supposed to be a bool was something other than a 0
1459 * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
1460 * syntactically incorrect, etc.
1462 LDKDecodeError_InvalidValue,
1464 * The buffer to be read was too short.
1466 LDKDecodeError_ShortRead,
1468 * A length descriptor in the packet didn't describe the later data correctly.
1470 LDKDecodeError_BadLengthDescriptor,
1472 * Error from [`std::io`].
1476 * The message included zlib-compressed values, which we don't support.
1478 LDKDecodeError_UnsupportedCompression,
1480 * Must be last for serialization purposes
1482 LDKDecodeError_Sentinel,
1483 } LDKDecodeError_Tag;
1485 typedef struct MUST_USE_STRUCT LDKDecodeError {
1486 LDKDecodeError_Tag tag;
1495 * The contents of CResult_RecipientOnionFieldsDecodeErrorZ
1497 typedef union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr {
1499 * A pointer to the contents in the success state.
1500 * Reading from this pointer when `result_ok` is not set is undefined.
1502 struct LDKRecipientOnionFields *result;
1504 * A pointer to the contents in the error state.
1505 * Reading from this pointer when `result_ok` is set is undefined.
1507 struct LDKDecodeError *err;
1508 } LDKCResult_RecipientOnionFieldsDecodeErrorZPtr;
1511 * A CResult_RecipientOnionFieldsDecodeErrorZ represents the result of a fallible operation,
1512 * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
1513 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1515 typedef struct LDKCResult_RecipientOnionFieldsDecodeErrorZ {
1517 * The contents of this CResult_RecipientOnionFieldsDecodeErrorZ, accessible via either
1518 * `err` or `result` depending on the state of `result_ok`.
1520 union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr contents;
1522 * Whether this CResult_RecipientOnionFieldsDecodeErrorZ represents a success state.
1525 } LDKCResult_RecipientOnionFieldsDecodeErrorZ;
1530 * Information needed to route a payment across a [`BlindedPath`].
1532 typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
1534 * A pointer to the opaque Rust object.
1535 * Nearly everywhere, inner must be non-null, however in places where
1536 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1538 LDKnativeBlindedPayInfo *inner;
1540 * Indicates that this is the only struct which contains the same pointer.
1541 * Rust functions which take ownership of an object provided via an argument require
1542 * this to be true and invalidate the object pointed to by inner.
1545 } LDKBlindedPayInfo;
1548 * The contents of CResult_BlindedPayInfoDecodeErrorZ
1550 typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
1552 * A pointer to the contents in the success state.
1553 * Reading from this pointer when `result_ok` is not set is undefined.
1555 struct LDKBlindedPayInfo *result;
1557 * A pointer to the contents in the error state.
1558 * Reading from this pointer when `result_ok` is set is undefined.
1560 struct LDKDecodeError *err;
1561 } LDKCResult_BlindedPayInfoDecodeErrorZPtr;
1564 * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
1565 * containing a crate::lightning::offers::invoice::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
1566 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1568 typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
1570 * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
1571 * `err` or `result` depending on the state of `result_ok`.
1573 union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
1575 * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
1578 } LDKCResult_BlindedPayInfoDecodeErrorZ;
1583 * Information about a spendable output to a P2WSH script.
1585 * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
1587 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1589 * A pointer to the opaque Rust object.
1590 * Nearly everywhere, inner must be non-null, however in places where
1591 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1593 LDKnativeDelayedPaymentOutputDescriptor *inner;
1595 * Indicates that this is the only struct which contains the same pointer.
1596 * Rust functions which take ownership of an object provided via an argument require
1597 * this to be true and invalidate the object pointed to by inner.
1600 } LDKDelayedPaymentOutputDescriptor;
1603 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
1605 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
1607 * A pointer to the contents in the success state.
1608 * Reading from this pointer when `result_ok` is not set is undefined.
1610 struct LDKDelayedPaymentOutputDescriptor *result;
1612 * A pointer to the contents in the error state.
1613 * Reading from this pointer when `result_ok` is set is undefined.
1615 struct LDKDecodeError *err;
1616 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
1619 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1620 * containing a crate::lightning::sign::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1621 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1623 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
1625 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
1626 * `err` or `result` depending on the state of `result_ok`.
1628 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
1630 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
1633 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
1638 * Information about a spendable output to our \"payment key\".
1640 * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
1642 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1644 * A pointer to the opaque Rust object.
1645 * Nearly everywhere, inner must be non-null, however in places where
1646 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1648 LDKnativeStaticPaymentOutputDescriptor *inner;
1650 * Indicates that this is the only struct which contains the same pointer.
1651 * Rust functions which take ownership of an object provided via an argument require
1652 * this to be true and invalidate the object pointed to by inner.
1655 } LDKStaticPaymentOutputDescriptor;
1658 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
1660 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
1662 * A pointer to the contents in the success state.
1663 * Reading from this pointer when `result_ok` is not set is undefined.
1665 struct LDKStaticPaymentOutputDescriptor *result;
1667 * A pointer to the contents in the error state.
1668 * Reading from this pointer when `result_ok` is set is undefined.
1670 struct LDKDecodeError *err;
1671 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
1674 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1675 * containing a crate::lightning::sign::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1676 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1678 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
1680 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
1681 * `err` or `result` depending on the state of `result_ok`.
1683 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
1685 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
1688 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
1693 * A reference to a transaction output.
1695 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
1696 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
1698 typedef struct MUST_USE_STRUCT LDKOutPoint {
1700 * A pointer to the opaque Rust object.
1701 * Nearly everywhere, inner must be non-null, however in places where
1702 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1704 LDKnativeOutPoint *inner;
1706 * Indicates that this is the only struct which contains the same pointer.
1707 * Rust functions which take ownership of an object provided via an argument require
1708 * this to be true and invalidate the object pointed to by inner.
1714 * Describes the necessary information to spend a spendable output.
1716 * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
1717 * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
1718 * to spend on-chain. The information needed to do this is provided in this enum, including the
1719 * outpoint describing which `txid` and output `index` is available, the full output which exists
1720 * at that `txid`/`index`, and any keys or other information required to sign.
1722 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
1724 typedef enum LDKSpendableOutputDescriptor_Tag {
1726 * An output to a script which was provided via [`SignerProvider`] directly, either from
1727 * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
1728 * know how to spend it. No secret keys are provided as LDK was never given any key.
1729 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
1730 * on-chain using the payment preimage or after it has timed out.
1732 * [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
1733 * [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
1735 LDKSpendableOutputDescriptor_StaticOutput,
1737 * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
1740 * The witness in the spending input should be:
1742 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
1745 * Note that the `nSequence` field in the spending input must be set to
1746 * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
1747 * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
1748 * the outpoint confirms, see [BIP
1749 * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
1750 * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
1753 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
1754 * it is an output from an old state which we broadcast (which should never happen).
1756 * To derive the delayed payment key which is used to sign this input, you must pass the
1757 * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
1758 * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
1759 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The public key can be
1760 * generated without the secret key using [`chan_utils::derive_public_key`] and only the
1761 * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
1763 * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
1764 * used in the witness script generation), you must pass the counterparty
1765 * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
1766 * [`ChannelSigner::provide_channel_parameters`]) and the provided
1767 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
1768 * [`chan_utils::derive_public_revocation_key`].
1770 * The witness script which is hashed and included in the output `script_pubkey` may be
1771 * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
1772 * as explained above), our delayed payment pubkey (derived as explained above), and the
1773 * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
1774 * [`chan_utils::get_revokeable_redeemscript`].
1776 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
1778 * An output to a P2WPKH, spendable exclusively by our payment key (i.e., the private key
1779 * which corresponds to the `payment_point` in [`ChannelSigner::pubkeys`]). The witness
1780 * in the spending input is, thus, simply:
1782 * <BIP 143 signature> <payment key>
1785 * These are generally the result of our counterparty having broadcast the current state,
1786 * allowing us to claim the non-HTLC-encumbered outputs immediately.
1788 LDKSpendableOutputDescriptor_StaticPaymentOutput,
1790 * Must be last for serialization purposes
1792 LDKSpendableOutputDescriptor_Sentinel,
1793 } LDKSpendableOutputDescriptor_Tag;
1795 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
1797 * The outpoint which is spendable.
1799 struct LDKOutPoint outpoint;
1801 * The output which is referenced by the given outpoint.
1803 struct LDKTxOut output;
1804 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
1806 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
1807 LDKSpendableOutputDescriptor_Tag tag;
1809 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
1811 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
1814 struct LDKStaticPaymentOutputDescriptor static_payment_output;
1817 } LDKSpendableOutputDescriptor;
1820 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
1822 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
1824 * A pointer to the contents in the success state.
1825 * Reading from this pointer when `result_ok` is not set is undefined.
1827 struct LDKSpendableOutputDescriptor *result;
1829 * A pointer to the contents in the error state.
1830 * Reading from this pointer when `result_ok` is set is undefined.
1832 struct LDKDecodeError *err;
1833 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
1836 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1837 * containing a crate::lightning::sign::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1838 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1840 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
1842 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
1843 * `err` or `result` depending on the state of `result_ok`.
1845 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
1847 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
1850 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
1853 * A dynamically-allocated array of crate::lightning::sign::SpendableOutputDescriptors of arbitrary size.
1854 * This corresponds to std::vector in C++
1856 typedef struct LDKCVec_SpendableOutputDescriptorZ {
1858 * The elements in the array.
1859 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1861 struct LDKSpendableOutputDescriptor *data;
1863 * The number of elements pointed to by `data`.
1866 } LDKCVec_SpendableOutputDescriptorZ;
1869 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
1870 * This corresponds to std::vector in C++
1872 typedef struct LDKCVec_TxOutZ {
1874 * The elements in the array.
1875 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1877 struct LDKTxOut *data;
1879 * The number of elements pointed to by `data`.
1885 * An enum which can either contain a u32 or not
1887 typedef enum LDKCOption_PackedLockTimeZ_Tag {
1889 * When we're in this state, this COption_PackedLockTimeZ contains a u32
1891 LDKCOption_PackedLockTimeZ_Some,
1893 * When we're in this state, this COption_PackedLockTimeZ contains nothing
1895 LDKCOption_PackedLockTimeZ_None,
1897 * Must be last for serialization purposes
1899 LDKCOption_PackedLockTimeZ_Sentinel,
1900 } LDKCOption_PackedLockTimeZ_Tag;
1902 typedef struct LDKCOption_PackedLockTimeZ {
1903 LDKCOption_PackedLockTimeZ_Tag tag;
1909 } LDKCOption_PackedLockTimeZ;
1912 * A tuple of 2 elements. See the individual fields for the types contained.
1914 typedef struct LDKC2Tuple_PartiallySignedTransactionusizeZ {
1916 * The element at position 0
1918 struct LDKCVec_u8Z a;
1920 * The element at position 1
1923 } LDKC2Tuple_PartiallySignedTransactionusizeZ;
1926 * The contents of CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ
1928 typedef union LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZPtr {
1930 * A pointer to the contents in the success state.
1931 * Reading from this pointer when `result_ok` is not set is undefined.
1933 struct LDKC2Tuple_PartiallySignedTransactionusizeZ *result;
1935 * Note that this value is always NULL, as there are no contents in the Err variant
1938 } LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZPtr;
1941 * A CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ represents the result of a fallible operation,
1942 * containing a crate::c_types::derived::C2Tuple_PartiallySignedTransactionusizeZ on success and a () on failure.
1943 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1945 typedef struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ {
1947 * The contents of this CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ, accessible via either
1948 * `err` or `result` depending on the state of `result_ok`.
1950 union LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZPtr contents;
1952 * Whether this CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ represents a success state.
1955 } LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ;
1958 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1959 * This corresponds to std::vector in C++
1961 typedef struct LDKCVec_PaymentPreimageZ {
1963 * The elements in the array.
1964 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1966 struct LDKThirtyTwoBytes *data;
1968 * The number of elements pointed to by `data`.
1971 } LDKCVec_PaymentPreimageZ;
1974 * The contents of CResult_NoneNoneZ
1976 typedef union LDKCResult_NoneNoneZPtr {
1978 * Note that this value is always NULL, as there are no contents in the OK variant
1982 * Note that this value is always NULL, as there are no contents in the Err variant
1985 } LDKCResult_NoneNoneZPtr;
1988 * A CResult_NoneNoneZ represents the result of a fallible operation,
1989 * containing a () on success and a () on failure.
1990 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1992 typedef struct LDKCResult_NoneNoneZ {
1994 * The contents of this CResult_NoneNoneZ, accessible via either
1995 * `err` or `result` depending on the state of `result_ok`.
1997 union LDKCResult_NoneNoneZPtr contents;
1999 * Whether this CResult_NoneNoneZ represents a success state.
2002 } LDKCResult_NoneNoneZ;
2005 * Represents a secp256k1 signature serialized as two 32-byte numbers
2007 typedef struct LDKSignature {
2009 * The bytes of the signature in "compact" form
2011 uint8_t compact_form[64];
2015 * A dynamically-allocated array of crate::c_types::Signatures of arbitrary size.
2016 * This corresponds to std::vector in C++
2018 typedef struct LDKCVec_SignatureZ {
2020 * The elements in the array.
2021 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2023 struct LDKSignature *data;
2025 * The number of elements pointed to by `data`.
2028 } LDKCVec_SignatureZ;
2031 * A tuple of 2 elements. See the individual fields for the types contained.
2033 typedef struct LDKC2Tuple_SignatureCVec_SignatureZZ {
2035 * The element at position 0
2037 struct LDKSignature a;
2039 * The element at position 1
2041 struct LDKCVec_SignatureZ b;
2042 } LDKC2Tuple_SignatureCVec_SignatureZZ;
2045 * The contents of CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ
2047 typedef union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr {
2049 * A pointer to the contents in the success state.
2050 * Reading from this pointer when `result_ok` is not set is undefined.
2052 struct LDKC2Tuple_SignatureCVec_SignatureZZ *result;
2054 * Note that this value is always NULL, as there are no contents in the Err variant
2057 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr;
2060 * A CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents the result of a fallible operation,
2061 * containing a crate::c_types::derived::C2Tuple_SignatureCVec_SignatureZZ on success and a () on failure.
2062 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2064 typedef struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ {
2066 * The contents of this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, accessible via either
2067 * `err` or `result` depending on the state of `result_ok`.
2069 union LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZPtr contents;
2071 * Whether this CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ represents a success state.
2074 } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ;
2077 * The contents of CResult_SignatureNoneZ
2079 typedef union LDKCResult_SignatureNoneZPtr {
2081 * A pointer to the contents in the success state.
2082 * Reading from this pointer when `result_ok` is not set is undefined.
2084 struct LDKSignature *result;
2086 * Note that this value is always NULL, as there are no contents in the Err variant
2089 } LDKCResult_SignatureNoneZPtr;
2092 * A CResult_SignatureNoneZ represents the result of a fallible operation,
2093 * containing a crate::c_types::Signature on success and a () on failure.
2094 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2096 typedef struct LDKCResult_SignatureNoneZ {
2098 * The contents of this CResult_SignatureNoneZ, accessible via either
2099 * `err` or `result` depending on the state of `result_ok`.
2101 union LDKCResult_SignatureNoneZPtr contents;
2103 * Whether this CResult_SignatureNoneZ represents a success state.
2106 } LDKCResult_SignatureNoneZ;
2109 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
2111 typedef struct LDKPublicKey {
2113 * The bytes of the public key
2115 uint8_t compressed_form[33];
2119 * The contents of CResult_PublicKeyNoneZ
2121 typedef union LDKCResult_PublicKeyNoneZPtr {
2123 * A pointer to the contents in the success state.
2124 * Reading from this pointer when `result_ok` is not set is undefined.
2126 struct LDKPublicKey *result;
2128 * Note that this value is always NULL, as there are no contents in the Err variant
2131 } LDKCResult_PublicKeyNoneZPtr;
2134 * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
2135 * containing a crate::c_types::PublicKey on success and a () on failure.
2136 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2138 typedef struct LDKCResult_PublicKeyNoneZ {
2140 * The contents of this CResult_PublicKeyNoneZ, accessible via either
2141 * `err` or `result` depending on the state of `result_ok`.
2143 union LDKCResult_PublicKeyNoneZPtr contents;
2145 * Whether this CResult_PublicKeyNoneZ represents a success state.
2148 } LDKCResult_PublicKeyNoneZ;
2151 * An enum which can either contain a crate::c_types::BigEndianScalar or not
2153 typedef enum LDKCOption_ScalarZ_Tag {
2155 * When we're in this state, this COption_ScalarZ contains a crate::c_types::BigEndianScalar
2157 LDKCOption_ScalarZ_Some,
2159 * When we're in this state, this COption_ScalarZ contains nothing
2161 LDKCOption_ScalarZ_None,
2163 * Must be last for serialization purposes
2165 LDKCOption_ScalarZ_Sentinel,
2166 } LDKCOption_ScalarZ_Tag;
2168 typedef struct LDKCOption_ScalarZ {
2169 LDKCOption_ScalarZ_Tag tag;
2172 struct LDKBigEndianScalar some;
2175 } LDKCOption_ScalarZ;
2178 * The contents of CResult_SharedSecretNoneZ
2180 typedef union LDKCResult_SharedSecretNoneZPtr {
2182 * A pointer to the contents in the success state.
2183 * Reading from this pointer when `result_ok` is not set is undefined.
2185 struct LDKThirtyTwoBytes *result;
2187 * Note that this value is always NULL, as there are no contents in the Err variant
2190 } LDKCResult_SharedSecretNoneZPtr;
2193 * A CResult_SharedSecretNoneZ represents the result of a fallible operation,
2194 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
2195 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2197 typedef struct LDKCResult_SharedSecretNoneZ {
2199 * The contents of this CResult_SharedSecretNoneZ, accessible via either
2200 * `err` or `result` depending on the state of `result_ok`.
2202 union LDKCResult_SharedSecretNoneZPtr contents;
2204 * Whether this CResult_SharedSecretNoneZ represents a success state.
2207 } LDKCResult_SharedSecretNoneZ;
2210 * Integer in the range `0..32`
2212 typedef struct LDKU5 {
2217 * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
2218 * This corresponds to std::vector in C++
2220 typedef struct LDKCVec_U5Z {
2222 * The elements in the array.
2223 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2227 * The number of elements pointed to by `data`.
2233 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
2234 * allows recovering the exact public key which created the signature given the message.
2236 typedef struct LDKRecoverableSignature {
2238 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
2241 uint8_t serialized_form[68];
2242 } LDKRecoverableSignature;
2245 * The contents of CResult_RecoverableSignatureNoneZ
2247 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
2249 * A pointer to the contents in the success state.
2250 * Reading from this pointer when `result_ok` is not set is undefined.
2252 struct LDKRecoverableSignature *result;
2254 * Note that this value is always NULL, as there are no contents in the Err variant
2257 } LDKCResult_RecoverableSignatureNoneZPtr;
2260 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
2261 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
2262 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2264 typedef struct LDKCResult_RecoverableSignatureNoneZ {
2266 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
2267 * `err` or `result` depending on the state of `result_ok`.
2269 union LDKCResult_RecoverableSignatureNoneZPtr contents;
2271 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
2274 } LDKCResult_RecoverableSignatureNoneZ;
2279 * This class tracks the per-transaction information needed to build a commitment transaction and will
2280 * actually build it and sign. It is used for holder transactions that we sign only when needed
2281 * and for transactions we sign for the counterparty.
2283 * This class can be used inside a signer implementation to generate a signature given the relevant
2286 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
2288 * A pointer to the opaque Rust object.
2289 * Nearly everywhere, inner must be non-null, however in places where
2290 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2292 LDKnativeCommitmentTransaction *inner;
2294 * Indicates that this is the only struct which contains the same pointer.
2295 * Rust functions which take ownership of an object provided via an argument require
2296 * this to be true and invalidate the object pointed to by inner.
2299 } LDKCommitmentTransaction;
2304 * Information needed to build and sign a holder's commitment transaction.
2306 * The transaction is only signed once we are ready to broadcast.
2308 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
2310 * A pointer to the opaque Rust object.
2311 * Nearly everywhere, inner must be non-null, however in places where
2312 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2314 LDKnativeHolderCommitmentTransaction *inner;
2316 * Indicates that this is the only struct which contains the same pointer.
2317 * Rust functions which take ownership of an object provided via an argument require
2318 * this to be true and invalidate the object pointed to by inner.
2321 } LDKHolderCommitmentTransaction;
2326 * Information about an HTLC as it appears in a commitment transaction
2328 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
2330 * A pointer to the opaque Rust object.
2331 * Nearly everywhere, inner must be non-null, however in places where
2332 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2334 LDKnativeHTLCOutputInCommitment *inner;
2336 * Indicates that this is the only struct which contains the same pointer.
2337 * Rust functions which take ownership of an object provided via an argument require
2338 * this to be true and invalidate the object pointed to by inner.
2341 } LDKHTLCOutputInCommitment;
2346 * A descriptor used to sign for a commitment transaction's HTLC output.
2348 typedef struct MUST_USE_STRUCT LDKHTLCDescriptor {
2350 * A pointer to the opaque Rust object.
2351 * Nearly everywhere, inner must be non-null, however in places where
2352 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2354 LDKnativeHTLCDescriptor *inner;
2356 * Indicates that this is the only struct which contains the same pointer.
2357 * Rust functions which take ownership of an object provided via an argument require
2358 * this to be true and invalidate the object pointed to by inner.
2361 } LDKHTLCDescriptor;
2366 * This class tracks the per-transaction information needed to build a closing transaction and will
2367 * actually build it and sign.
2369 * This class can be used inside a signer implementation to generate a signature given the relevant
2372 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
2374 * A pointer to the opaque Rust object.
2375 * Nearly everywhere, inner must be non-null, however in places where
2376 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2378 LDKnativeClosingTransaction *inner;
2380 * Indicates that this is the only struct which contains the same pointer.
2381 * Rust functions which take ownership of an object provided via an argument require
2382 * this to be true and invalidate the object pointed to by inner.
2385 } LDKClosingTransaction;
2390 * The unsigned part of a [`channel_announcement`] message.
2392 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
2394 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2396 * A pointer to the opaque Rust object.
2397 * Nearly everywhere, inner must be non-null, however in places where
2398 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2400 LDKnativeUnsignedChannelAnnouncement *inner;
2402 * Indicates that this is the only struct which contains the same pointer.
2403 * Rust functions which take ownership of an object provided via an argument require
2404 * this to be true and invalidate the object pointed to by inner.
2407 } LDKUnsignedChannelAnnouncement;
2412 * One counterparty's public keys which do not change over the life of a channel.
2414 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
2416 * A pointer to the opaque Rust object.
2417 * Nearly everywhere, inner must be non-null, however in places where
2418 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2420 LDKnativeChannelPublicKeys *inner;
2422 * Indicates that this is the only struct which contains the same pointer.
2423 * Rust functions which take ownership of an object provided via an argument require
2424 * this to be true and invalidate the object pointed to by inner.
2427 } LDKChannelPublicKeys;
2432 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
2433 * The fields are organized by holder/counterparty.
2435 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
2436 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
2438 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
2440 * A pointer to the opaque Rust object.
2441 * Nearly everywhere, inner must be non-null, however in places where
2442 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2444 LDKnativeChannelTransactionParameters *inner;
2446 * Indicates that this is the only struct which contains the same pointer.
2447 * Rust functions which take ownership of an object provided via an argument require
2448 * this to be true and invalidate the object pointed to by inner.
2451 } LDKChannelTransactionParameters;
2454 * A trait to handle Lightning channel key material without concretizing the channel type or
2455 * the signature mechanism.
2457 typedef struct LDKChannelSigner {
2459 * An opaque pointer which is passed to your function implementations as an argument.
2460 * This has no meaning in the LDK, and can be NULL or any other value.
2464 * Gets the per-commitment point for a specific commitment number
2466 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2468 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2470 * Gets the commitment secret for a specific commitment number as part of the revocation process
2472 * An external signer implementation should error here if the commitment was already signed
2473 * and should refuse to sign it in the future.
2475 * May be called more than once for the same index.
2477 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2479 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2481 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
2483 * This is required in order for the signer to make sure that releasing a commitment
2484 * secret won't leave us without a broadcastable holder transaction.
2485 * Policy checks should be implemented in this function, including checking the amount
2486 * sent to us and checking the HTLCs.
2488 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
2489 * A validating signer should ensure that an HTLC output is removed only when the matching
2490 * preimage is provided, or when the value to holder is restored.
2492 * Note that all the relevant preimages will be provided, but there may also be additional
2493 * irrelevant or duplicate preimages.
2495 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_PaymentPreimageZ preimages);
2497 * Returns the holder's channel public keys and basepoints.
2499 struct LDKChannelPublicKeys pubkeys;
2501 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2502 * Note that this takes a pointer to this object, not the this_ptr like other methods do
2503 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2505 void (*set_pubkeys)(const struct LDKChannelSigner*NONNULL_PTR );
2507 * Returns an arbitrary identifier describing the set of keys which are provided back to you in
2508 * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
2509 * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys.
2511 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2513 * Set the counterparty static channel data, including basepoints,
2514 * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
2516 * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
2517 * instance, LDK will call this method exactly once - either immediately after construction
2518 * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
2519 * information has been generated.
2521 * channel_parameters.is_populated() MUST be true.
2523 void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2525 * Frees any resources associated with this object given its this_arg pointer.
2526 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2528 void (*free)(void *this_arg);
2532 * A trait to sign Lightning channel transactions as described in
2533 * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
2535 * Signing services could be implemented on a hardware wallet and should implement signing
2536 * policies in order to be secure. Please refer to the [VLS Policy
2537 * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
2538 * for an example of such policies.
2540 typedef struct LDKEcdsaChannelSigner {
2542 * An opaque pointer which is passed to your function implementations as an argument.
2543 * This has no meaning in the LDK, and can be NULL or any other value.
2547 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2549 * Note that if signing fails or is rejected, the channel will be force-closed.
2551 * Policy checks should be implemented in this function, including checking the amount
2552 * sent to us and checking the HTLCs.
2554 * The preimages of outgoing HTLCs that were fulfilled since the last commitment are provided.
2555 * A validating signer should ensure that an HTLC output is removed only when the matching
2556 * preimage is provided, or when the value to holder is restored.
2558 * Note that all the relevant preimages will be provided, but there may also be additional
2559 * irrelevant or duplicate preimages.
2561 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_PaymentPreimageZ preimages);
2563 * Validate the counterparty's revocation.
2565 * This is required in order for the signer to make sure that the state has moved
2566 * forward and it is safe to sign the next counterparty commitment.
2568 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
2570 * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions.
2572 * This will be called
2573 * - with a non-revoked `commitment_tx`.
2574 * - with the latest `commitment_tx` when we initiate a force-close.
2575 * - with the previous `commitment_tx`, just to get claiming HTLC
2576 * signatures, if we are reacting to a [`ChannelMonitor`]
2577 * [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
2578 * that decided to broadcast before it had been updated to the latest `commitment_tx`.
2580 * This may be called multiple times for the same transaction.
2582 * An external signer implementation should check that the commitment has not been revoked.
2584 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
2586 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_holder_commitment_and_htlcs)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2588 * Create a signature for the given input in a transaction spending an HTLC transaction output
2589 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
2591 * A justice transaction may claim multiple outputs at the same time if timelocks are
2592 * similar, but only a signature for the input at index `input` should be signed for here.
2593 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2594 * to an upcoming timelock expiration.
2596 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2598 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2599 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2600 * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
2603 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]);
2605 * Create a signature for the given input in a transaction spending a commitment transaction
2606 * HTLC output when our counterparty broadcasts an old state.
2608 * A justice transaction may claim multiple outputs at the same time if timelocks are
2609 * similar, but only a signature for the input at index `input` should be signed for here.
2610 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2611 * to an upcoming timelock expiration.
2613 * `amount` is the value of the output spent by this input, committed to in the BIP 143
2616 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2617 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2618 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
2621 * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
2622 * (which is committed to in the BIP 143 signatures).
2624 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);
2626 * Computes the signature for a commitment transaction's HTLC output used as an input within
2627 * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
2628 * must be be computed using [`EcdsaSighashType::All`]. Note that this should only be used to
2629 * sign HTLC transactions from channels supporting anchor outputs after all additional
2630 * inputs/outputs have been added to the transaction.
2632 * [`EcdsaSighashType::All`]: bitcoin::blockdata::transaction::EcdsaSighashType::All
2634 struct LDKCResult_SignatureNoneZ (*sign_holder_htlc_transaction)(const void *this_arg, struct LDKTransaction htlc_tx, uintptr_t input, const struct LDKHTLCDescriptor *NONNULL_PTR htlc_descriptor);
2636 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
2637 * transaction, either offered or received.
2639 * Such a transaction may claim multiples offered outputs at same time if we know the
2640 * preimage for each when we create it, but only the input at index `input` should be
2641 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
2642 * needed with regards to an upcoming timelock expiration.
2644 * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
2647 * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
2649 * `per_commitment_point` is the dynamic point corresponding to the channel state
2650 * detected onchain. It has been generated by our counterparty and is used to derive
2651 * channel state keys, which are then included in the witness script and committed to in the
2652 * BIP 143 signature.
2654 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);
2656 * Create a signature for a (proposed) closing transaction.
2658 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
2659 * chosen to forgo their output as dust.
2661 struct LDKCResult_SignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
2663 * Computes the signature for a commitment transaction's anchor output used as an
2664 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
2666 struct LDKCResult_SignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
2668 * Signs a channel announcement message with our funding key proving it comes from one of the
2669 * channel participants.
2671 * Channel announcements also require a signature from each node's network key. Our node
2672 * signature is computed through [`NodeSigner::sign_gossip_message`].
2674 * Note that if this fails or is rejected, the channel will not be publicly announced and
2675 * our counterparty may (though likely will not) close the channel on us for violating the
2678 struct LDKCResult_SignatureNoneZ (*sign_channel_announcement_with_funding_key)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
2680 * Implementation of ChannelSigner for this object.
2682 struct LDKChannelSigner ChannelSigner;
2684 * Frees any resources associated with this object given its this_arg pointer.
2685 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2687 void (*free)(void *this_arg);
2688 } LDKEcdsaChannelSigner;
2691 * A writeable signer.
2693 * There will always be two instances of a signer per channel, one occupied by the
2694 * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
2696 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
2697 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
2699 typedef struct LDKWriteableEcdsaChannelSigner {
2701 * An opaque pointer which is passed to your function implementations as an argument.
2702 * This has no meaning in the LDK, and can be NULL or any other value.
2706 * Implementation of EcdsaChannelSigner for this object.
2708 struct LDKEcdsaChannelSigner EcdsaChannelSigner;
2710 * Serialize the object into a byte array
2712 struct LDKCVec_u8Z (*write)(const void *this_arg);
2714 * Frees any resources associated with this object given its this_arg pointer.
2715 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2717 void (*free)(void *this_arg);
2718 } LDKWriteableEcdsaChannelSigner;
2721 * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
2723 typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
2725 * A pointer to the contents in the success state.
2726 * Reading from this pointer when `result_ok` is not set is undefined.
2728 struct LDKWriteableEcdsaChannelSigner *result;
2730 * A pointer to the contents in the error state.
2731 * Reading from this pointer when `result_ok` is set is undefined.
2733 struct LDKDecodeError *err;
2734 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr;
2737 * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
2738 * containing a crate::lightning::sign::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
2739 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2741 typedef struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ {
2743 * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
2744 * `err` or `result` depending on the state of `result_ok`.
2746 union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
2748 * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
2751 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
2754 * The contents of CResult_ScriptNoneZ
2756 typedef union LDKCResult_ScriptNoneZPtr {
2758 * A pointer to the contents in the success state.
2759 * Reading from this pointer when `result_ok` is not set is undefined.
2761 struct LDKCVec_u8Z *result;
2763 * Note that this value is always NULL, as there are no contents in the Err variant
2766 } LDKCResult_ScriptNoneZPtr;
2769 * A CResult_ScriptNoneZ represents the result of a fallible operation,
2770 * containing a crate::c_types::derived::CVec_u8Z on success and a () on failure.
2771 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2773 typedef struct LDKCResult_ScriptNoneZ {
2775 * The contents of this CResult_ScriptNoneZ, accessible via either
2776 * `err` or `result` depending on the state of `result_ok`.
2778 union LDKCResult_ScriptNoneZPtr contents;
2780 * Whether this CResult_ScriptNoneZ represents a success state.
2783 } LDKCResult_ScriptNoneZ;
2786 * The contents of CResult_ShutdownScriptNoneZ
2788 typedef union LDKCResult_ShutdownScriptNoneZPtr {
2790 * A pointer to the contents in the success state.
2791 * Reading from this pointer when `result_ok` is not set is undefined.
2793 struct LDKShutdownScript *result;
2795 * Note that this value is always NULL, as there are no contents in the Err variant
2798 } LDKCResult_ShutdownScriptNoneZPtr;
2801 * A CResult_ShutdownScriptNoneZ represents the result of a fallible operation,
2802 * containing a crate::lightning::ln::script::ShutdownScript on success and a () on failure.
2803 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2805 typedef struct LDKCResult_ShutdownScriptNoneZ {
2807 * The contents of this CResult_ShutdownScriptNoneZ, accessible via either
2808 * `err` or `result` depending on the state of `result_ok`.
2810 union LDKCResult_ShutdownScriptNoneZPtr contents;
2812 * Whether this CResult_ShutdownScriptNoneZ represents a success state.
2815 } LDKCResult_ShutdownScriptNoneZ;
2818 * A dynamically-allocated array of crate::c_types::derived::CVec_u8Zs of arbitrary size.
2819 * This corresponds to std::vector in C++
2821 typedef struct LDKCVec_CVec_u8ZZ {
2823 * The elements in the array.
2824 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2826 struct LDKCVec_u8Z *data;
2828 * The number of elements pointed to by `data`.
2831 } LDKCVec_CVec_u8ZZ;
2834 * The contents of CResult_CVec_CVec_u8ZZNoneZ
2836 typedef union LDKCResult_CVec_CVec_u8ZZNoneZPtr {
2838 * A pointer to the contents in the success state.
2839 * Reading from this pointer when `result_ok` is not set is undefined.
2841 struct LDKCVec_CVec_u8ZZ *result;
2843 * Note that this value is always NULL, as there are no contents in the Err variant
2846 } LDKCResult_CVec_CVec_u8ZZNoneZPtr;
2849 * A CResult_CVec_CVec_u8ZZNoneZ represents the result of a fallible operation,
2850 * containing a crate::c_types::derived::CVec_CVec_u8ZZ on success and a () on failure.
2851 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2853 typedef struct LDKCResult_CVec_CVec_u8ZZNoneZ {
2855 * The contents of this CResult_CVec_CVec_u8ZZNoneZ, accessible via either
2856 * `err` or `result` depending on the state of `result_ok`.
2858 union LDKCResult_CVec_CVec_u8ZZNoneZPtr contents;
2860 * Whether this CResult_CVec_CVec_u8ZZNoneZ represents a success state.
2863 } LDKCResult_CVec_CVec_u8ZZNoneZ;
2868 * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
2870 * This implementation performs no policy checks and is insufficient by itself as
2871 * a secure external signer.
2873 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
2875 * A pointer to the opaque Rust object.
2876 * Nearly everywhere, inner must be non-null, however in places where
2877 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2879 LDKnativeInMemorySigner *inner;
2881 * Indicates that this is the only struct which contains the same pointer.
2882 * Rust functions which take ownership of an object provided via an argument require
2883 * this to be true and invalidate the object pointed to by inner.
2886 } LDKInMemorySigner;
2889 * The contents of CResult_InMemorySignerDecodeErrorZ
2891 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
2893 * A pointer to the contents in the success state.
2894 * Reading from this pointer when `result_ok` is not set is undefined.
2896 struct LDKInMemorySigner *result;
2898 * A pointer to the contents in the error state.
2899 * Reading from this pointer when `result_ok` is set is undefined.
2901 struct LDKDecodeError *err;
2902 } LDKCResult_InMemorySignerDecodeErrorZPtr;
2905 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
2906 * containing a crate::lightning::sign::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
2907 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2909 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
2911 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
2912 * `err` or `result` depending on the state of `result_ok`.
2914 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
2916 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
2919 } LDKCResult_InMemorySignerDecodeErrorZ;
2922 * The contents of CResult_PartiallySignedTransactionNoneZ
2924 typedef union LDKCResult_PartiallySignedTransactionNoneZPtr {
2926 * A pointer to the contents in the success state.
2927 * Reading from this pointer when `result_ok` is not set is undefined.
2929 struct LDKCVec_u8Z *result;
2931 * Note that this value is always NULL, as there are no contents in the Err variant
2934 } LDKCResult_PartiallySignedTransactionNoneZPtr;
2937 * A CResult_PartiallySignedTransactionNoneZ represents the result of a fallible operation,
2938 * containing a crate::c_types::derived::CVec_u8Z on success and a () on failure.
2939 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2941 typedef struct LDKCResult_PartiallySignedTransactionNoneZ {
2943 * The contents of this CResult_PartiallySignedTransactionNoneZ, accessible via either
2944 * `err` or `result` depending on the state of `result_ok`.
2946 union LDKCResult_PartiallySignedTransactionNoneZPtr contents;
2948 * Whether this CResult_PartiallySignedTransactionNoneZ represents a success state.
2951 } LDKCResult_PartiallySignedTransactionNoneZ;
2954 * The contents of CResult_TransactionNoneZ
2956 typedef union LDKCResult_TransactionNoneZPtr {
2958 * A pointer to the contents in the success state.
2959 * Reading from this pointer when `result_ok` is not set is undefined.
2961 struct LDKTransaction *result;
2963 * Note that this value is always NULL, as there are no contents in the Err variant
2966 } LDKCResult_TransactionNoneZPtr;
2969 * A CResult_TransactionNoneZ represents the result of a fallible operation,
2970 * containing a crate::c_types::Transaction on success and a () on failure.
2971 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2973 typedef struct LDKCResult_TransactionNoneZ {
2975 * The contents of this CResult_TransactionNoneZ, accessible via either
2976 * `err` or `result` depending on the state of `result_ok`.
2978 union LDKCResult_TransactionNoneZPtr contents;
2980 * Whether this CResult_TransactionNoneZ represents a success state.
2983 } LDKCResult_TransactionNoneZ;
2988 * Represents the compressed public key of a node
2990 typedef struct MUST_USE_STRUCT LDKNodeId {
2992 * A pointer to the opaque Rust object.
2993 * Nearly everywhere, inner must be non-null, however in places where
2994 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2996 LDKnativeNodeId *inner;
2998 * Indicates that this is the only struct which contains the same pointer.
2999 * Rust functions which take ownership of an object provided via an argument require
3000 * this to be true and invalidate the object pointed to by inner.
3008 * Proposed use of a channel passed as a parameter to [`Score::channel_penalty_msat`].
3010 typedef struct MUST_USE_STRUCT LDKChannelUsage {
3012 * A pointer to the opaque Rust object.
3013 * Nearly everywhere, inner must be non-null, however in places where
3014 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3016 LDKnativeChannelUsage *inner;
3018 * Indicates that this is the only struct which contains the same pointer.
3019 * Rust functions which take ownership of an object provided via an argument require
3020 * this to be true and invalidate the object pointed to by inner.
3028 * Parameters for configuring [`ProbabilisticScorer`].
3030 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
3031 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
3033 * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
3036 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringFeeParameters {
3038 * A pointer to the opaque Rust object.
3039 * Nearly everywhere, inner must be non-null, however in places where
3040 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3042 LDKnativeProbabilisticScoringFeeParameters *inner;
3044 * Indicates that this is the only struct which contains the same pointer.
3045 * Rust functions which take ownership of an object provided via an argument require
3046 * this to be true and invalidate the object pointed to by inner.
3049 } LDKProbabilisticScoringFeeParameters;
3054 * A path in a [`Route`] to the payment recipient. Must always be at least length one.
3055 * If no [`Path::blinded_tail`] is present, then [`Path::hops`] length may be up to 19.
3057 typedef struct MUST_USE_STRUCT LDKPath {
3059 * A pointer to the opaque Rust object.
3060 * Nearly everywhere, inner must be non-null, however in places where
3061 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3063 LDKnativePath *inner;
3065 * Indicates that this is the only struct which contains the same pointer.
3066 * Rust functions which take ownership of an object provided via an argument require
3067 * this to be true and invalidate the object pointed to by inner.
3073 * An interface used to score payment channels for path finding.
3075 *\tScoring is in terms of fees willing to be paid in order to avoid routing through a channel.
3077 typedef struct LDKScore {
3079 * An opaque pointer which is passed to your function implementations as an argument.
3080 * This has no meaning in the LDK, and can be NULL or any other value.
3084 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
3085 * given channel in the direction from `source` to `target`.
3087 * The channel's capacity (less any other MPP parts that are also being considered for use in
3088 * the same payment) is given by `capacity_msat`. It may be determined from various sources
3089 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
3090 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
3091 * Thus, implementations should be overflow-safe.
3093 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, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params);
3095 * Handles updating channel penalties after failing to route through a channel.
3097 void (*payment_path_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id);
3099 * Handles updating channel penalties after successfully routing along a path.
3101 void (*payment_path_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path);
3103 * Handles updating channel penalties after a probe over the given path failed.
3105 void (*probe_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id);
3107 * Handles updating channel penalties after a probe over the given path succeeded.
3109 void (*probe_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path);
3111 * Serialize the object into a byte array
3113 struct LDKCVec_u8Z (*write)(const void *this_arg);
3115 * Frees any resources associated with this object given its this_arg pointer.
3116 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3118 void (*free)(void *this_arg);
3122 * A scorer that is accessed under a lock.
3124 * Needed so that calls to [`Score::channel_penalty_msat`] in [`find_route`] can be made while
3125 * having shared ownership of a scorer but without requiring internal locking in [`Score`]
3126 * implementations. Internal locking would be detrimental to route finding performance and could
3127 * result in [`Score::channel_penalty_msat`] returning a different value for the same channel.
3129 * [`find_route`]: crate::routing::router::find_route
3131 typedef struct LDKLockableScore {
3133 * An opaque pointer which is passed to your function implementations as an argument.
3134 * This has no meaning in the LDK, and can be NULL or any other value.
3138 * Returns the locked scorer.
3140 struct LDKScore (*lock)(const void *this_arg);
3142 * Frees any resources associated with this object given its this_arg pointer.
3143 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3145 void (*free)(void *this_arg);
3149 * Refers to a scorer that is accessible under lock and also writeable to disk
3151 * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
3152 * use the Persister to persist it.
3154 typedef struct LDKWriteableScore {
3156 * An opaque pointer which is passed to your function implementations as an argument.
3157 * This has no meaning in the LDK, and can be NULL or any other value.
3161 * Implementation of LockableScore for this object.
3163 struct LDKLockableScore LockableScore;
3165 * Serialize the object into a byte array
3167 struct LDKCVec_u8Z (*write)(const void *this_arg);
3169 * Frees any resources associated with this object given its this_arg pointer.
3170 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3172 void (*free)(void *this_arg);
3173 } LDKWriteableScore;
3176 * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
3178 typedef enum LDKCOption_WriteableScoreZ_Tag {
3180 * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
3182 LDKCOption_WriteableScoreZ_Some,
3184 * When we're in this state, this COption_WriteableScoreZ contains nothing
3186 LDKCOption_WriteableScoreZ_None,
3188 * Must be last for serialization purposes
3190 LDKCOption_WriteableScoreZ_Sentinel,
3191 } LDKCOption_WriteableScoreZ_Tag;
3193 typedef struct LDKCOption_WriteableScoreZ {
3194 LDKCOption_WriteableScoreZ_Tag tag;
3197 struct LDKWriteableScore some;
3200 } LDKCOption_WriteableScoreZ;
3203 * The contents of CResult_NoneErrorZ
3205 typedef union LDKCResult_NoneErrorZPtr {
3207 * Note that this value is always NULL, as there are no contents in the OK variant
3211 * A pointer to the contents in the error state.
3212 * Reading from this pointer when `result_ok` is set is undefined.
3214 enum LDKIOError *err;
3215 } LDKCResult_NoneErrorZPtr;
3218 * A CResult_NoneErrorZ represents the result of a fallible operation,
3219 * containing a () on success and a crate::c_types::IOError on failure.
3220 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3222 typedef struct LDKCResult_NoneErrorZ {
3224 * The contents of this CResult_NoneErrorZ, accessible via either
3225 * `err` or `result` depending on the state of `result_ok`.
3227 union LDKCResult_NoneErrorZPtr contents;
3229 * Whether this CResult_NoneErrorZ represents a success state.
3232 } LDKCResult_NoneErrorZ;
3237 * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
3239 typedef struct MUST_USE_STRUCT LDKChannelDetails {
3241 * A pointer to the opaque Rust object.
3242 * Nearly everywhere, inner must be non-null, however in places where
3243 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3245 LDKnativeChannelDetails *inner;
3247 * Indicates that this is the only struct which contains the same pointer.
3248 * Rust functions which take ownership of an object provided via an argument require
3249 * this to be true and invalidate the object pointed to by inner.
3252 } LDKChannelDetails;
3255 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
3256 * This corresponds to std::vector in C++
3258 typedef struct LDKCVec_ChannelDetailsZ {
3260 * The elements in the array.
3261 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3263 struct LDKChannelDetails *data;
3265 * The number of elements pointed to by `data`.
3268 } LDKCVec_ChannelDetailsZ;
3273 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
3274 * it can take multiple paths. Each path is composed of one or more hops through the network.
3276 typedef struct MUST_USE_STRUCT LDKRoute {
3278 * A pointer to the opaque Rust object.
3279 * Nearly everywhere, inner must be non-null, however in places where
3280 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3282 LDKnativeRoute *inner;
3284 * Indicates that this is the only struct which contains the same pointer.
3285 * Rust functions which take ownership of an object provided via an argument require
3286 * this to be true and invalidate the object pointed to by inner.
3294 * An Err type for failure to process messages.
3296 typedef struct MUST_USE_STRUCT LDKLightningError {
3298 * A pointer to the opaque Rust object.
3299 * Nearly everywhere, inner must be non-null, however in places where
3300 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3302 LDKnativeLightningError *inner;
3304 * Indicates that this is the only struct which contains the same pointer.
3305 * Rust functions which take ownership of an object provided via an argument require
3306 * this to be true and invalidate the object pointed to by inner.
3309 } LDKLightningError;
3312 * The contents of CResult_RouteLightningErrorZ
3314 typedef union LDKCResult_RouteLightningErrorZPtr {
3316 * A pointer to the contents in the success state.
3317 * Reading from this pointer when `result_ok` is not set is undefined.
3319 struct LDKRoute *result;
3321 * A pointer to the contents in the error state.
3322 * Reading from this pointer when `result_ok` is set is undefined.
3324 struct LDKLightningError *err;
3325 } LDKCResult_RouteLightningErrorZPtr;
3328 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
3329 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
3330 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3332 typedef struct LDKCResult_RouteLightningErrorZ {
3334 * The contents of this CResult_RouteLightningErrorZ, accessible via either
3335 * `err` or `result` depending on the state of `result_ok`.
3337 union LDKCResult_RouteLightningErrorZPtr contents;
3339 * Whether this CResult_RouteLightningErrorZ represents a success state.
3342 } LDKCResult_RouteLightningErrorZ;
3347 * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
3348 * in-use channel liquidity.
3350 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
3352 * A pointer to the opaque Rust object.
3353 * Nearly everywhere, inner must be non-null, however in places where
3354 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3356 LDKnativeInFlightHtlcs *inner;
3358 * Indicates that this is the only struct which contains the same pointer.
3359 * Rust functions which take ownership of an object provided via an argument require
3360 * this to be true and invalidate the object pointed to by inner.
3366 * The contents of CResult_InFlightHtlcsDecodeErrorZ
3368 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
3370 * A pointer to the contents in the success state.
3371 * Reading from this pointer when `result_ok` is not set is undefined.
3373 struct LDKInFlightHtlcs *result;
3375 * A pointer to the contents in the error state.
3376 * Reading from this pointer when `result_ok` is set is undefined.
3378 struct LDKDecodeError *err;
3379 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
3382 * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
3383 * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
3384 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3386 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
3388 * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
3389 * `err` or `result` depending on the state of `result_ok`.
3391 union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
3393 * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
3396 } LDKCResult_InFlightHtlcsDecodeErrorZ;
3401 * A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel
3404 typedef struct MUST_USE_STRUCT LDKRouteHop {
3406 * A pointer to the opaque Rust object.
3407 * Nearly everywhere, inner must be non-null, however in places where
3408 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3410 LDKnativeRouteHop *inner;
3412 * Indicates that this is the only struct which contains the same pointer.
3413 * Rust functions which take ownership of an object provided via an argument require
3414 * this to be true and invalidate the object pointed to by inner.
3420 * The contents of CResult_RouteHopDecodeErrorZ
3422 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
3424 * A pointer to the contents in the success state.
3425 * Reading from this pointer when `result_ok` is not set is undefined.
3427 struct LDKRouteHop *result;
3429 * A pointer to the contents in the error state.
3430 * Reading from this pointer when `result_ok` is set is undefined.
3432 struct LDKDecodeError *err;
3433 } LDKCResult_RouteHopDecodeErrorZPtr;
3436 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
3437 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
3438 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3440 typedef struct LDKCResult_RouteHopDecodeErrorZ {
3442 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
3443 * `err` or `result` depending on the state of `result_ok`.
3445 union LDKCResult_RouteHopDecodeErrorZPtr contents;
3447 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
3450 } LDKCResult_RouteHopDecodeErrorZ;
3455 * Used to construct the blinded hops portion of a blinded path. These hops cannot be identified
3456 * by outside observers and thus can be used to hide the identity of the recipient.
3458 typedef struct MUST_USE_STRUCT LDKBlindedHop {
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 LDKnativeBlindedHop *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.
3474 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedHops of arbitrary size.
3475 * This corresponds to std::vector in C++
3477 typedef struct LDKCVec_BlindedHopZ {
3479 * The elements in the array.
3480 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3482 struct LDKBlindedHop *data;
3484 * The number of elements pointed to by `data`.
3487 } LDKCVec_BlindedHopZ;
3492 * The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in
3493 * their [`Bolt12Invoice`].
3495 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
3497 typedef struct MUST_USE_STRUCT LDKBlindedTail {
3499 * A pointer to the opaque Rust object.
3500 * Nearly everywhere, inner must be non-null, however in places where
3501 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3503 LDKnativeBlindedTail *inner;
3505 * Indicates that this is the only struct which contains the same pointer.
3506 * Rust functions which take ownership of an object provided via an argument require
3507 * this to be true and invalidate the object pointed to by inner.
3513 * The contents of CResult_BlindedTailDecodeErrorZ
3515 typedef union LDKCResult_BlindedTailDecodeErrorZPtr {
3517 * A pointer to the contents in the success state.
3518 * Reading from this pointer when `result_ok` is not set is undefined.
3520 struct LDKBlindedTail *result;
3522 * A pointer to the contents in the error state.
3523 * Reading from this pointer when `result_ok` is set is undefined.
3525 struct LDKDecodeError *err;
3526 } LDKCResult_BlindedTailDecodeErrorZPtr;
3529 * A CResult_BlindedTailDecodeErrorZ represents the result of a fallible operation,
3530 * containing a crate::lightning::routing::router::BlindedTail on success and a crate::lightning::ln::msgs::DecodeError on failure.
3531 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3533 typedef struct LDKCResult_BlindedTailDecodeErrorZ {
3535 * The contents of this CResult_BlindedTailDecodeErrorZ, accessible via either
3536 * `err` or `result` depending on the state of `result_ok`.
3538 union LDKCResult_BlindedTailDecodeErrorZPtr contents;
3540 * Whether this CResult_BlindedTailDecodeErrorZ represents a success state.
3543 } LDKCResult_BlindedTailDecodeErrorZ;
3546 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
3547 * This corresponds to std::vector in C++
3549 typedef struct LDKCVec_RouteHopZ {
3551 * The elements in the array.
3552 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3554 struct LDKRouteHop *data;
3556 * The number of elements pointed to by `data`.
3559 } LDKCVec_RouteHopZ;
3562 * An enum which can either contain a u32 or not
3564 typedef enum LDKCOption_u32Z_Tag {
3566 * When we're in this state, this COption_u32Z contains a u32
3568 LDKCOption_u32Z_Some,
3570 * When we're in this state, this COption_u32Z contains nothing
3572 LDKCOption_u32Z_None,
3574 * Must be last for serialization purposes
3576 LDKCOption_u32Z_Sentinel,
3577 } LDKCOption_u32Z_Tag;
3579 typedef struct LDKCOption_u32Z {
3580 LDKCOption_u32Z_Tag tag;
3589 * A dynamically-allocated array of crate::lightning::routing::router::Paths of arbitrary size.
3590 * This corresponds to std::vector in C++
3592 typedef struct LDKCVec_PathZ {
3594 * The elements in the array.
3595 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3597 struct LDKPath *data;
3599 * The number of elements pointed to by `data`.
3605 * The contents of CResult_RouteDecodeErrorZ
3607 typedef union LDKCResult_RouteDecodeErrorZPtr {
3609 * A pointer to the contents in the success state.
3610 * Reading from this pointer when `result_ok` is not set is undefined.
3612 struct LDKRoute *result;
3614 * A pointer to the contents in the error state.
3615 * Reading from this pointer when `result_ok` is set is undefined.
3617 struct LDKDecodeError *err;
3618 } LDKCResult_RouteDecodeErrorZPtr;
3621 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
3622 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
3623 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3625 typedef struct LDKCResult_RouteDecodeErrorZ {
3627 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
3628 * `err` or `result` depending on the state of `result_ok`.
3630 union LDKCResult_RouteDecodeErrorZPtr contents;
3632 * Whether this CResult_RouteDecodeErrorZ represents a success state.
3635 } LDKCResult_RouteDecodeErrorZ;
3640 * Parameters needed to find a [`Route`].
3642 * Passed to [`find_route`] and [`build_route_from_hops`].
3644 typedef struct MUST_USE_STRUCT LDKRouteParameters {
3646 * A pointer to the opaque Rust object.
3647 * Nearly everywhere, inner must be non-null, however in places where
3648 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3650 LDKnativeRouteParameters *inner;
3652 * Indicates that this is the only struct which contains the same pointer.
3653 * Rust functions which take ownership of an object provided via an argument require
3654 * this to be true and invalidate the object pointed to by inner.
3657 } LDKRouteParameters;
3660 * The contents of CResult_RouteParametersDecodeErrorZ
3662 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
3664 * A pointer to the contents in the success state.
3665 * Reading from this pointer when `result_ok` is not set is undefined.
3667 struct LDKRouteParameters *result;
3669 * A pointer to the contents in the error state.
3670 * Reading from this pointer when `result_ok` is set is undefined.
3672 struct LDKDecodeError *err;
3673 } LDKCResult_RouteParametersDecodeErrorZPtr;
3676 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
3677 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
3678 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3680 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
3682 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
3683 * `err` or `result` depending on the state of `result_ok`.
3685 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
3687 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
3690 } LDKCResult_RouteParametersDecodeErrorZ;
3693 * A dynamically-allocated array of u64s of arbitrary size.
3694 * This corresponds to std::vector in C++
3696 typedef struct LDKCVec_u64Z {
3698 * The elements in the array.
3699 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3703 * The number of elements pointed to by `data`.
3711 * Information used to route a payment.
3713 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
3715 * A pointer to the opaque Rust object.
3716 * Nearly everywhere, inner must be non-null, however in places where
3717 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3719 LDKnativePaymentParameters *inner;
3721 * Indicates that this is the only struct which contains the same pointer.
3722 * Rust functions which take ownership of an object provided via an argument require
3723 * this to be true and invalidate the object pointed to by inner.
3726 } LDKPaymentParameters;
3729 * The contents of CResult_PaymentParametersDecodeErrorZ
3731 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
3733 * A pointer to the contents in the success state.
3734 * Reading from this pointer when `result_ok` is not set is undefined.
3736 struct LDKPaymentParameters *result;
3738 * A pointer to the contents in the error state.
3739 * Reading from this pointer when `result_ok` is set is undefined.
3741 struct LDKDecodeError *err;
3742 } LDKCResult_PaymentParametersDecodeErrorZPtr;
3745 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
3746 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
3747 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3749 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
3751 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
3752 * `err` or `result` depending on the state of `result_ok`.
3754 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
3756 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
3759 } LDKCResult_PaymentParametersDecodeErrorZ;
3762 * A tuple of 2 elements. See the individual fields for the types contained.
3764 typedef struct LDKC2Tuple_BlindedPayInfoBlindedPathZ {
3766 * The element at position 0
3768 struct LDKBlindedPayInfo a;
3770 * The element at position 1
3772 struct LDKBlindedPath b;
3773 } LDKC2Tuple_BlindedPayInfoBlindedPathZ;
3776 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZs of arbitrary size.
3777 * This corresponds to std::vector in C++
3779 typedef struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ {
3781 * The elements in the array.
3782 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3784 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *data;
3786 * The number of elements pointed to by `data`.
3789 } LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ;
3794 * A list of hops along a payment path terminating with a channel to the recipient.
3796 typedef struct MUST_USE_STRUCT LDKRouteHint {
3798 * A pointer to the opaque Rust object.
3799 * Nearly everywhere, inner must be non-null, however in places where
3800 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3802 LDKnativeRouteHint *inner;
3804 * Indicates that this is the only struct which contains the same pointer.
3805 * Rust functions which take ownership of an object provided via an argument require
3806 * this to be true and invalidate the object pointed to by inner.
3812 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
3813 * This corresponds to std::vector in C++
3815 typedef struct LDKCVec_RouteHintZ {
3817 * The elements in the array.
3818 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3820 struct LDKRouteHint *data;
3822 * The number of elements pointed to by `data`.
3825 } LDKCVec_RouteHintZ;
3830 * A channel descriptor for a hop along a payment path.
3832 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
3834 * A pointer to the opaque Rust object.
3835 * Nearly everywhere, inner must be non-null, however in places where
3836 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3838 LDKnativeRouteHintHop *inner;
3840 * Indicates that this is the only struct which contains the same pointer.
3841 * Rust functions which take ownership of an object provided via an argument require
3842 * this to be true and invalidate the object pointed to by inner.
3848 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
3849 * This corresponds to std::vector in C++
3851 typedef struct LDKCVec_RouteHintHopZ {
3853 * The elements in the array.
3854 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3856 struct LDKRouteHintHop *data;
3858 * The number of elements pointed to by `data`.
3861 } LDKCVec_RouteHintHopZ;
3864 * The contents of CResult_RouteHintDecodeErrorZ
3866 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
3868 * A pointer to the contents in the success state.
3869 * Reading from this pointer when `result_ok` is not set is undefined.
3871 struct LDKRouteHint *result;
3873 * A pointer to the contents in the error state.
3874 * Reading from this pointer when `result_ok` is set is undefined.
3876 struct LDKDecodeError *err;
3877 } LDKCResult_RouteHintDecodeErrorZPtr;
3880 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
3881 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
3882 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3884 typedef struct LDKCResult_RouteHintDecodeErrorZ {
3886 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
3887 * `err` or `result` depending on the state of `result_ok`.
3889 union LDKCResult_RouteHintDecodeErrorZPtr contents;
3891 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
3894 } LDKCResult_RouteHintDecodeErrorZ;
3897 * The contents of CResult_RouteHintHopDecodeErrorZ
3899 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
3901 * A pointer to the contents in the success state.
3902 * Reading from this pointer when `result_ok` is not set is undefined.
3904 struct LDKRouteHintHop *result;
3906 * A pointer to the contents in the error state.
3907 * Reading from this pointer when `result_ok` is set is undefined.
3909 struct LDKDecodeError *err;
3910 } LDKCResult_RouteHintHopDecodeErrorZPtr;
3913 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
3914 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
3915 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3917 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
3919 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
3920 * `err` or `result` depending on the state of `result_ok`.
3922 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
3924 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
3927 } LDKCResult_RouteHintHopDecodeErrorZ;
3930 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
3931 * This corresponds to std::vector in C++
3933 typedef struct LDKCVec_PublicKeyZ {
3935 * The elements in the array.
3936 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3938 struct LDKPublicKey *data;
3940 * The number of elements pointed to by `data`.
3943 } LDKCVec_PublicKeyZ;
3948 * [`Score`] implementation that uses a fixed penalty.
3950 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
3952 * A pointer to the opaque Rust object.
3953 * Nearly everywhere, inner must be non-null, however in places where
3954 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3956 LDKnativeFixedPenaltyScorer *inner;
3958 * Indicates that this is the only struct which contains the same pointer.
3959 * Rust functions which take ownership of an object provided via an argument require
3960 * this to be true and invalidate the object pointed to by inner.
3963 } LDKFixedPenaltyScorer;
3966 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
3968 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
3970 * A pointer to the contents in the success state.
3971 * Reading from this pointer when `result_ok` is not set is undefined.
3973 struct LDKFixedPenaltyScorer *result;
3975 * A pointer to the contents in the error state.
3976 * Reading from this pointer when `result_ok` is set is undefined.
3978 struct LDKDecodeError *err;
3979 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
3982 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
3983 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
3984 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3986 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
3988 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
3989 * `err` or `result` depending on the state of `result_ok`.
3991 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
3993 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
3996 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
3999 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
4000 * This corresponds to std::vector in C++
4002 typedef struct LDKCVec_NodeIdZ {
4004 * The elements in the array.
4005 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4007 struct LDKNodeId *data;
4009 * The number of elements pointed to by `data`.
4015 * A tuple of 2 elements. See the individual fields for the types contained.
4017 typedef struct LDKC2Tuple_u64u64Z {
4019 * The element at position 0
4023 * The element at position 1
4026 } LDKC2Tuple_u64u64Z;
4029 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
4031 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
4033 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
4035 LDKCOption_C2Tuple_u64u64ZZ_Some,
4037 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
4039 LDKCOption_C2Tuple_u64u64ZZ_None,
4041 * Must be last for serialization purposes
4043 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
4044 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
4046 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
4047 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
4050 struct LDKC2Tuple_u64u64Z some;
4053 } LDKCOption_C2Tuple_u64u64ZZ;
4058 typedef struct LDKEightU16s {
4060 * The eight 16-bit integers
4066 * A tuple of 2 elements. See the individual fields for the types contained.
4068 typedef struct LDKC2Tuple_Z {
4070 * The element at position 0
4072 struct LDKEightU16s a;
4074 * The element at position 1
4076 struct LDKEightU16s b;
4080 * A tuple of 2 elements. See the individual fields for the types contained.
4082 typedef struct LDKC2Tuple__u168_u168Z {
4084 * The element at position 0
4086 struct LDKEightU16s a;
4088 * The element at position 1
4090 struct LDKEightU16s b;
4091 } LDKC2Tuple__u168_u168Z;
4094 * An enum which can either contain a crate::c_types::derived::C2Tuple__u168_u168Z or not
4096 typedef enum LDKCOption_C2Tuple_EightU16sEightU16sZZ_Tag {
4098 * When we're in this state, this COption_C2Tuple_EightU16sEightU16sZZ contains a crate::c_types::derived::C2Tuple__u168_u168Z
4100 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Some,
4102 * When we're in this state, this COption_C2Tuple_EightU16sEightU16sZZ contains nothing
4104 LDKCOption_C2Tuple_EightU16sEightU16sZZ_None,
4106 * Must be last for serialization purposes
4108 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Sentinel,
4109 } LDKCOption_C2Tuple_EightU16sEightU16sZZ_Tag;
4111 typedef struct LDKCOption_C2Tuple_EightU16sEightU16sZZ {
4112 LDKCOption_C2Tuple_EightU16sEightU16sZZ_Tag tag;
4115 struct LDKC2Tuple__u168_u168Z some;
4118 } LDKCOption_C2Tuple_EightU16sEightU16sZZ;
4123 * A Record, unit of logging output with Metadata to enable filtering
4124 * Module_path, file, line to inform on log's source
4126 typedef struct MUST_USE_STRUCT LDKRecord {
4128 * A pointer to the opaque Rust object.
4129 * Nearly everywhere, inner must be non-null, however in places where
4130 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4132 LDKnativeRecord *inner;
4134 * Indicates that this is the only struct which contains the same pointer.
4135 * Rust functions which take ownership of an object provided via an argument require
4136 * this to be true and invalidate the object pointed to by inner.
4142 * A trait encapsulating the operations required of a logger
4144 typedef struct LDKLogger {
4146 * An opaque pointer which is passed to your function implementations as an argument.
4147 * This has no meaning in the LDK, and can be NULL or any other value.
4153 void (*log)(const void *this_arg, const struct LDKRecord *NONNULL_PTR record);
4155 * Frees any resources associated with this object given its this_arg pointer.
4156 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4158 void (*free)(void *this_arg);
4164 * Represents the network as nodes and channels between them
4166 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4168 * A pointer to the opaque Rust object.
4169 * Nearly everywhere, inner must be non-null, however in places where
4170 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4172 LDKnativeNetworkGraph *inner;
4174 * Indicates that this is the only struct which contains the same pointer.
4175 * Rust functions which take ownership of an object provided via an argument require
4176 * this to be true and invalidate the object pointed to by inner.
4184 * [`Score`] implementation using channel success probability distributions.
4186 * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
4187 * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
4188 * When a payment is forwarded through a channel (but fails later in the route), we learn the
4189 * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
4191 * These bounds are then used to determine a success probability using the formula from
4192 * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4193 * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
4195 * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
4196 * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
4197 * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
4198 * terms of the entire path's success probability. This allows the router to directly compare
4199 * penalties for different paths. See the documentation of those parameters for the exact formulas.
4201 * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
4203 * Further, we track the history of our upper and lower liquidity bounds for each channel,
4204 * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
4205 * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
4206 * formula, but using the history of a channel rather than our latest estimates for the liquidity
4211 * Mixing the `no-std` feature between serialization and deserialization results in undefined
4214 * [1]: https://arxiv.org/abs/2107.05322
4215 * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_multiplier_msat
4216 * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_amount_multiplier_msat
4217 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
4218 * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_multiplier_msat
4219 * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_amount_multiplier_msat
4221 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4223 * A pointer to the opaque Rust object.
4224 * Nearly everywhere, inner must be non-null, however in places where
4225 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4227 LDKnativeProbabilisticScorer *inner;
4229 * Indicates that this is the only struct which contains the same pointer.
4230 * Rust functions which take ownership of an object provided via an argument require
4231 * this to be true and invalidate the object pointed to by inner.
4234 } LDKProbabilisticScorer;
4237 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4239 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4241 * A pointer to the contents in the success state.
4242 * Reading from this pointer when `result_ok` is not set is undefined.
4244 struct LDKProbabilisticScorer *result;
4246 * A pointer to the contents in the error state.
4247 * Reading from this pointer when `result_ok` is set is undefined.
4249 struct LDKDecodeError *err;
4250 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4253 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4254 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4255 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4257 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4259 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4260 * `err` or `result` depending on the state of `result_ok`.
4262 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4264 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4267 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4270 * A tuple of 2 elements. See the individual fields for the types contained.
4272 typedef struct LDKC2Tuple_usizeTransactionZ {
4274 * The element at position 0
4278 * The element at position 1
4280 struct LDKTransaction b;
4281 } LDKC2Tuple_usizeTransactionZ;
4284 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4285 * This corresponds to std::vector in C++
4287 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
4289 * The elements in the array.
4290 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4292 struct LDKC2Tuple_usizeTransactionZ *data;
4294 * The number of elements pointed to by `data`.
4297 } LDKCVec_C2Tuple_usizeTransactionZZ;
4300 * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
4302 typedef enum LDKCOption_BlockHashZ_Tag {
4304 * When we're in this state, this COption_BlockHashZ contains a crate::c_types::ThirtyTwoBytes
4306 LDKCOption_BlockHashZ_Some,
4308 * When we're in this state, this COption_BlockHashZ contains nothing
4310 LDKCOption_BlockHashZ_None,
4312 * Must be last for serialization purposes
4314 LDKCOption_BlockHashZ_Sentinel,
4315 } LDKCOption_BlockHashZ_Tag;
4317 typedef struct LDKCOption_BlockHashZ {
4318 LDKCOption_BlockHashZ_Tag tag;
4321 struct LDKThirtyTwoBytes some;
4324 } LDKCOption_BlockHashZ;
4327 * A tuple of 2 elements. See the individual fields for the types contained.
4329 typedef struct LDKC2Tuple_TxidCOption_BlockHashZZ {
4331 * The element at position 0
4333 struct LDKThirtyTwoBytes a;
4335 * The element at position 1
4337 struct LDKCOption_BlockHashZ b;
4338 } LDKC2Tuple_TxidCOption_BlockHashZZ;
4341 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCOption_BlockHashZZs of arbitrary size.
4342 * This corresponds to std::vector in C++
4344 typedef struct LDKCVec_C2Tuple_TxidCOption_BlockHashZZZ {
4346 * The elements in the array.
4347 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4349 struct LDKC2Tuple_TxidCOption_BlockHashZZ *data;
4351 * The number of elements pointed to by `data`.
4354 } LDKCVec_C2Tuple_TxidCOption_BlockHashZZZ;
4359 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
4360 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
4361 * preimage claim backward will lead to loss of funds.
4363 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
4365 * A pointer to the opaque Rust object.
4366 * Nearly everywhere, inner must be non-null, however in places where
4367 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4369 LDKnativeHTLCUpdate *inner;
4371 * Indicates that this is the only struct which contains the same pointer.
4372 * Rust functions which take ownership of an object provided via an argument require
4373 * this to be true and invalidate the object pointed to by inner.
4379 * An event to be processed by the ChannelManager.
4381 typedef enum LDKMonitorEvent_Tag {
4383 * A monitor event containing an HTLCUpdate.
4385 LDKMonitorEvent_HTLCEvent,
4387 * A monitor event that the Channel's commitment transaction was confirmed.
4389 LDKMonitorEvent_CommitmentTxConfirmed,
4391 * Indicates a [`ChannelMonitor`] update has completed. See
4392 * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
4394 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
4396 LDKMonitorEvent_Completed,
4398 * Indicates a [`ChannelMonitor`] update has failed. See
4399 * [`ChannelMonitorUpdateStatus::PermanentFailure`] for more information on how this is used.
4401 * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
4403 LDKMonitorEvent_UpdateFailed,
4405 * Must be last for serialization purposes
4407 LDKMonitorEvent_Sentinel,
4408 } LDKMonitorEvent_Tag;
4410 typedef struct LDKMonitorEvent_LDKCompleted_Body {
4412 * The funding outpoint of the [`ChannelMonitor`] that was updated
4414 struct LDKOutPoint funding_txo;
4416 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
4417 * [`ChannelMonitor::get_latest_update_id`].
4419 * Note that this should only be set to a given update's ID if all previous updates for the
4420 * same [`ChannelMonitor`] have been applied and persisted.
4422 uint64_t monitor_update_id;
4423 } LDKMonitorEvent_LDKCompleted_Body;
4425 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
4426 LDKMonitorEvent_Tag tag;
4429 struct LDKHTLCUpdate htlc_event;
4432 struct LDKOutPoint commitment_tx_confirmed;
4434 LDKMonitorEvent_LDKCompleted_Body completed;
4436 struct LDKOutPoint update_failed;
4442 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
4443 * This corresponds to std::vector in C++
4445 typedef struct LDKCVec_MonitorEventZ {
4447 * The elements in the array.
4448 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4450 struct LDKMonitorEvent *data;
4452 * The number of elements pointed to by `data`.
4455 } LDKCVec_MonitorEventZ;
4458 * A tuple of 3 elements. See the individual fields for the types contained.
4460 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
4462 * The element at position 0
4464 struct LDKOutPoint a;
4466 * The element at position 1
4468 struct LDKCVec_MonitorEventZ b;
4470 * The element at position 2
4472 struct LDKPublicKey c;
4473 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
4476 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
4477 * This corresponds to std::vector in C++
4479 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
4481 * The elements in the array.
4482 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4484 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
4486 * The number of elements pointed to by `data`.
4489 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
4494 * Features used within an `init` message.
4496 typedef struct MUST_USE_STRUCT LDKInitFeatures {
4498 * A pointer to the opaque Rust object.
4499 * Nearly everywhere, inner must be non-null, however in places where
4500 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4502 LDKnativeInitFeatures *inner;
4504 * Indicates that this is the only struct which contains the same pointer.
4505 * Rust functions which take ownership of an object provided via an argument require
4506 * this to be true and invalidate the object pointed to by inner.
4512 * The contents of CResult_InitFeaturesDecodeErrorZ
4514 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
4516 * A pointer to the contents in the success state.
4517 * Reading from this pointer when `result_ok` is not set is undefined.
4519 struct LDKInitFeatures *result;
4521 * A pointer to the contents in the error state.
4522 * Reading from this pointer when `result_ok` is set is undefined.
4524 struct LDKDecodeError *err;
4525 } LDKCResult_InitFeaturesDecodeErrorZPtr;
4528 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
4529 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4530 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4532 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
4534 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
4535 * `err` or `result` depending on the state of `result_ok`.
4537 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
4539 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
4542 } LDKCResult_InitFeaturesDecodeErrorZ;
4547 * Features used within a `channel_announcement` message.
4549 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
4551 * A pointer to the opaque Rust object.
4552 * Nearly everywhere, inner must be non-null, however in places where
4553 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4555 LDKnativeChannelFeatures *inner;
4557 * Indicates that this is the only struct which contains the same pointer.
4558 * Rust functions which take ownership of an object provided via an argument require
4559 * this to be true and invalidate the object pointed to by inner.
4562 } LDKChannelFeatures;
4565 * The contents of CResult_ChannelFeaturesDecodeErrorZ
4567 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
4569 * A pointer to the contents in the success state.
4570 * Reading from this pointer when `result_ok` is not set is undefined.
4572 struct LDKChannelFeatures *result;
4574 * A pointer to the contents in the error state.
4575 * Reading from this pointer when `result_ok` is set is undefined.
4577 struct LDKDecodeError *err;
4578 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
4581 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
4582 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4583 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4585 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
4587 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
4588 * `err` or `result` depending on the state of `result_ok`.
4590 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
4592 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
4595 } LDKCResult_ChannelFeaturesDecodeErrorZ;
4600 * Features used within a `node_announcement` message.
4602 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
4604 * A pointer to the opaque Rust object.
4605 * Nearly everywhere, inner must be non-null, however in places where
4606 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4608 LDKnativeNodeFeatures *inner;
4610 * Indicates that this is the only struct which contains the same pointer.
4611 * Rust functions which take ownership of an object provided via an argument require
4612 * this to be true and invalidate the object pointed to by inner.
4618 * The contents of CResult_NodeFeaturesDecodeErrorZ
4620 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
4622 * A pointer to the contents in the success state.
4623 * Reading from this pointer when `result_ok` is not set is undefined.
4625 struct LDKNodeFeatures *result;
4627 * A pointer to the contents in the error state.
4628 * Reading from this pointer when `result_ok` is set is undefined.
4630 struct LDKDecodeError *err;
4631 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
4634 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
4635 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4636 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4638 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
4640 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
4641 * `err` or `result` depending on the state of `result_ok`.
4643 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
4645 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
4648 } LDKCResult_NodeFeaturesDecodeErrorZ;
4653 * Features used within an invoice.
4655 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceFeatures {
4657 * A pointer to the opaque Rust object.
4658 * Nearly everywhere, inner must be non-null, however in places where
4659 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4661 LDKnativeBolt11InvoiceFeatures *inner;
4663 * Indicates that this is the only struct which contains the same pointer.
4664 * Rust functions which take ownership of an object provided via an argument require
4665 * this to be true and invalidate the object pointed to by inner.
4668 } LDKBolt11InvoiceFeatures;
4671 * The contents of CResult_Bolt11InvoiceFeaturesDecodeErrorZ
4673 typedef union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr {
4675 * A pointer to the contents in the success state.
4676 * Reading from this pointer when `result_ok` is not set is undefined.
4678 struct LDKBolt11InvoiceFeatures *result;
4680 * A pointer to the contents in the error state.
4681 * Reading from this pointer when `result_ok` is set is undefined.
4683 struct LDKDecodeError *err;
4684 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr;
4687 * A CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4688 * containing a crate::lightning::ln::features::Bolt11InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4689 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4691 typedef struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ {
4693 * The contents of this CResult_Bolt11InvoiceFeaturesDecodeErrorZ, accessible via either
4694 * `err` or `result` depending on the state of `result_ok`.
4696 union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr contents;
4698 * Whether this CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents a success state.
4701 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ;
4706 * Features used within an `invoice`.
4708 typedef struct MUST_USE_STRUCT LDKBolt12InvoiceFeatures {
4710 * A pointer to the opaque Rust object.
4711 * Nearly everywhere, inner must be non-null, however in places where
4712 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4714 LDKnativeBolt12InvoiceFeatures *inner;
4716 * Indicates that this is the only struct which contains the same pointer.
4717 * Rust functions which take ownership of an object provided via an argument require
4718 * this to be true and invalidate the object pointed to by inner.
4721 } LDKBolt12InvoiceFeatures;
4724 * The contents of CResult_Bolt12InvoiceFeaturesDecodeErrorZ
4726 typedef union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr {
4728 * A pointer to the contents in the success state.
4729 * Reading from this pointer when `result_ok` is not set is undefined.
4731 struct LDKBolt12InvoiceFeatures *result;
4733 * A pointer to the contents in the error state.
4734 * Reading from this pointer when `result_ok` is set is undefined.
4736 struct LDKDecodeError *err;
4737 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr;
4740 * A CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
4741 * containing a crate::lightning::ln::features::Bolt12InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4742 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4744 typedef struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ {
4746 * The contents of this CResult_Bolt12InvoiceFeaturesDecodeErrorZ, accessible via either
4747 * `err` or `result` depending on the state of `result_ok`.
4749 union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr contents;
4751 * Whether this CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents a success state.
4754 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ;
4759 * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
4761 typedef struct MUST_USE_STRUCT LDKBlindedHopFeatures {
4763 * A pointer to the opaque Rust object.
4764 * Nearly everywhere, inner must be non-null, however in places where
4765 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4767 LDKnativeBlindedHopFeatures *inner;
4769 * Indicates that this is the only struct which contains the same pointer.
4770 * Rust functions which take ownership of an object provided via an argument require
4771 * this to be true and invalidate the object pointed to by inner.
4774 } LDKBlindedHopFeatures;
4777 * The contents of CResult_BlindedHopFeaturesDecodeErrorZ
4779 typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
4781 * A pointer to the contents in the success state.
4782 * Reading from this pointer when `result_ok` is not set is undefined.
4784 struct LDKBlindedHopFeatures *result;
4786 * A pointer to the contents in the error state.
4787 * Reading from this pointer when `result_ok` is set is undefined.
4789 struct LDKDecodeError *err;
4790 } LDKCResult_BlindedHopFeaturesDecodeErrorZPtr;
4793 * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
4794 * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4795 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4797 typedef struct LDKCResult_BlindedHopFeaturesDecodeErrorZ {
4799 * The contents of this CResult_BlindedHopFeaturesDecodeErrorZ, accessible via either
4800 * `err` or `result` depending on the state of `result_ok`.
4802 union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr contents;
4804 * Whether this CResult_BlindedHopFeaturesDecodeErrorZ represents a success state.
4807 } LDKCResult_BlindedHopFeaturesDecodeErrorZ;
4812 * Features used within the channel_type field in an OpenChannel message.
4814 * A channel is always of some known \"type\", describing the transaction formats used and the exact
4815 * semantics of our interaction with our peer.
4817 * Note that because a channel is a specific type which is proposed by the opener and accepted by
4818 * the counterparty, only required features are allowed here.
4820 * This is serialized differently from other feature types - it is not prefixed by a length, and
4821 * thus must only appear inside a TLV where its length is known in advance.
4823 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
4825 * A pointer to the opaque Rust object.
4826 * Nearly everywhere, inner must be non-null, however in places where
4827 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4829 LDKnativeChannelTypeFeatures *inner;
4831 * Indicates that this is the only struct which contains the same pointer.
4832 * Rust functions which take ownership of an object provided via an argument require
4833 * this to be true and invalidate the object pointed to by inner.
4836 } LDKChannelTypeFeatures;
4839 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
4841 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
4843 * A pointer to the contents in the success state.
4844 * Reading from this pointer when `result_ok` is not set is undefined.
4846 struct LDKChannelTypeFeatures *result;
4848 * A pointer to the contents in the error state.
4849 * Reading from this pointer when `result_ok` is set is undefined.
4851 struct LDKDecodeError *err;
4852 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
4855 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
4856 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
4857 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4859 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
4861 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
4862 * `err` or `result` depending on the state of `result_ok`.
4864 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
4866 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
4869 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
4872 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
4873 * This corresponds to std::vector in C++
4875 typedef struct LDKCVec_ChainHashZ {
4877 * The elements in the array.
4878 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4880 struct LDKThirtyTwoBytes *data;
4882 * The number of elements pointed to by `data`.
4885 } LDKCVec_ChainHashZ;
4890 * An `Offer` is a potentially long-lived proposal for payment of a good or service.
4892 * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a
4893 * customer may request an [`Bolt12Invoice`] for a specific quantity and using an amount sufficient
4894 * to cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`].
4896 * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
4899 * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
4901 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
4902 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
4904 typedef struct MUST_USE_STRUCT LDKOffer {
4906 * A pointer to the opaque Rust object.
4907 * Nearly everywhere, inner must be non-null, however in places where
4908 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4910 LDKnativeOffer *inner;
4912 * Indicates that this is the only struct which contains the same pointer.
4913 * Rust functions which take ownership of an object provided via an argument require
4914 * this to be true and invalidate the object pointed to by inner.
4920 * The contents of CResult_OfferBolt12ParseErrorZ
4922 typedef union LDKCResult_OfferBolt12ParseErrorZPtr {
4924 * A pointer to the contents in the success state.
4925 * Reading from this pointer when `result_ok` is not set is undefined.
4927 struct LDKOffer *result;
4929 * A pointer to the contents in the error state.
4930 * Reading from this pointer when `result_ok` is set is undefined.
4932 struct LDKBolt12ParseError *err;
4933 } LDKCResult_OfferBolt12ParseErrorZPtr;
4936 * A CResult_OfferBolt12ParseErrorZ represents the result of a fallible operation,
4937 * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
4938 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4940 typedef struct LDKCResult_OfferBolt12ParseErrorZ {
4942 * The contents of this CResult_OfferBolt12ParseErrorZ, accessible via either
4943 * `err` or `result` depending on the state of `result_ok`.
4945 union LDKCResult_OfferBolt12ParseErrorZPtr contents;
4947 * Whether this CResult_OfferBolt12ParseErrorZ represents a success state.
4950 } LDKCResult_OfferBolt12ParseErrorZ;
4953 * The contents of CResult_PublicKeyErrorZ
4955 typedef union LDKCResult_PublicKeyErrorZPtr {
4957 * A pointer to the contents in the success state.
4958 * Reading from this pointer when `result_ok` is not set is undefined.
4960 struct LDKPublicKey *result;
4962 * A pointer to the contents in the error state.
4963 * Reading from this pointer when `result_ok` is set is undefined.
4965 enum LDKSecp256k1Error *err;
4966 } LDKCResult_PublicKeyErrorZPtr;
4969 * A CResult_PublicKeyErrorZ represents the result of a fallible operation,
4970 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
4971 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4973 typedef struct LDKCResult_PublicKeyErrorZ {
4975 * The contents of this CResult_PublicKeyErrorZ, accessible via either
4976 * `err` or `result` depending on the state of `result_ok`.
4978 union LDKCResult_PublicKeyErrorZPtr contents;
4980 * Whether this CResult_PublicKeyErrorZ represents a success state.
4983 } LDKCResult_PublicKeyErrorZ;
4986 * The contents of CResult_NodeIdDecodeErrorZ
4988 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
4990 * A pointer to the contents in the success state.
4991 * Reading from this pointer when `result_ok` is not set is undefined.
4993 struct LDKNodeId *result;
4995 * A pointer to the contents in the error state.
4996 * Reading from this pointer when `result_ok` is set is undefined.
4998 struct LDKDecodeError *err;
4999 } LDKCResult_NodeIdDecodeErrorZPtr;
5002 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
5003 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
5004 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5006 typedef struct LDKCResult_NodeIdDecodeErrorZ {
5008 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
5009 * `err` or `result` depending on the state of `result_ok`.
5011 union LDKCResult_NodeIdDecodeErrorZPtr contents;
5013 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
5016 } LDKCResult_NodeIdDecodeErrorZ;
5021 * A [`channel_update`] message to be sent to or received from a peer.
5023 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
5025 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
5027 * A pointer to the opaque Rust object.
5028 * Nearly everywhere, inner must be non-null, however in places where
5029 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5031 LDKnativeChannelUpdate *inner;
5033 * Indicates that this is the only struct which contains the same pointer.
5034 * Rust functions which take ownership of an object provided via an argument require
5035 * this to be true and invalidate the object pointed to by inner.
5041 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
5042 * return packet by a node along the route. See [BOLT #4] for details.
5044 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
5046 typedef enum LDKNetworkUpdate_Tag {
5048 * An error indicating a `channel_update` messages should be applied via
5049 * [`NetworkGraph::update_channel`].
5051 LDKNetworkUpdate_ChannelUpdateMessage,
5053 * An error indicating that a channel failed to route a payment, which should be applied via
5054 * [`NetworkGraph::channel_failed_permanent`] if permanent.
5056 LDKNetworkUpdate_ChannelFailure,
5058 * An error indicating that a node failed to route a payment, which should be applied via
5059 * [`NetworkGraph::node_failed_permanent`] if permanent.
5061 LDKNetworkUpdate_NodeFailure,
5063 * Must be last for serialization purposes
5065 LDKNetworkUpdate_Sentinel,
5066 } LDKNetworkUpdate_Tag;
5068 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
5070 * The update to apply via [`NetworkGraph::update_channel`].
5072 struct LDKChannelUpdate msg;
5073 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
5075 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
5077 * The short channel id of the closed channel.
5079 uint64_t short_channel_id;
5081 * Whether the channel should be permanently removed or temporarily disabled until a new
5082 * `channel_update` message is received.
5085 } LDKNetworkUpdate_LDKChannelFailure_Body;
5087 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
5089 * The node id of the failed node.
5091 struct LDKPublicKey node_id;
5093 * Whether the node should be permanently removed from consideration or can be restored
5094 * when a new `channel_update` message is received.
5097 } LDKNetworkUpdate_LDKNodeFailure_Body;
5099 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
5100 LDKNetworkUpdate_Tag tag;
5102 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
5103 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
5104 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
5109 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
5111 typedef enum LDKCOption_NetworkUpdateZ_Tag {
5113 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
5115 LDKCOption_NetworkUpdateZ_Some,
5117 * When we're in this state, this COption_NetworkUpdateZ contains nothing
5119 LDKCOption_NetworkUpdateZ_None,
5121 * Must be last for serialization purposes
5123 LDKCOption_NetworkUpdateZ_Sentinel,
5124 } LDKCOption_NetworkUpdateZ_Tag;
5126 typedef struct LDKCOption_NetworkUpdateZ {
5127 LDKCOption_NetworkUpdateZ_Tag tag;
5130 struct LDKNetworkUpdate some;
5133 } LDKCOption_NetworkUpdateZ;
5136 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
5138 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
5140 * A pointer to the contents in the success state.
5141 * Reading from this pointer when `result_ok` is not set is undefined.
5143 struct LDKCOption_NetworkUpdateZ *result;
5145 * A pointer to the contents in the error state.
5146 * Reading from this pointer when `result_ok` is set is undefined.
5148 struct LDKDecodeError *err;
5149 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
5152 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
5153 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5154 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5156 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
5158 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
5159 * `err` or `result` depending on the state of `result_ok`.
5161 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
5163 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
5166 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
5169 * The contents of CResult_TxOutUtxoLookupErrorZ
5171 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
5173 * A pointer to the contents in the success state.
5174 * Reading from this pointer when `result_ok` is not set is undefined.
5176 struct LDKTxOut *result;
5178 * A pointer to the contents in the error state.
5179 * Reading from this pointer when `result_ok` is set is undefined.
5181 enum LDKUtxoLookupError *err;
5182 } LDKCResult_TxOutUtxoLookupErrorZPtr;
5185 * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
5186 * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
5187 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5189 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
5191 * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
5192 * `err` or `result` depending on the state of `result_ok`.
5194 union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
5196 * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
5199 } LDKCResult_TxOutUtxoLookupErrorZ;
5204 * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
5206 * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
5208 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
5210 * A pointer to the opaque Rust object.
5211 * Nearly everywhere, inner must be non-null, however in places where
5212 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5214 LDKnativeUtxoFuture *inner;
5216 * Indicates that this is the only struct which contains the same pointer.
5217 * Rust functions which take ownership of an object provided via an argument require
5218 * this to be true and invalidate the object pointed to by inner.
5224 * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
5225 * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
5228 typedef enum LDKUtxoResult_Tag {
5230 * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
5231 * requested or a [`UtxoLookupError`].
5235 * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
5236 * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
5238 * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
5239 * but only fairly loosely. Because a pending checks block all message processing, leaving
5240 * checks pending for an extended time may cause DoS of other functions. It is recommended you
5241 * keep a tight timeout on lookups, on the order of a few seconds.
5243 LDKUtxoResult_Async,
5245 * Must be last for serialization purposes
5247 LDKUtxoResult_Sentinel,
5248 } LDKUtxoResult_Tag;
5250 typedef struct MUST_USE_STRUCT LDKUtxoResult {
5251 LDKUtxoResult_Tag tag;
5254 struct LDKCResult_TxOutUtxoLookupErrorZ sync;
5257 struct LDKUtxoFuture async;
5263 * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
5265 typedef struct LDKUtxoLookup {
5267 * An opaque pointer which is passed to your function implementations as an argument.
5268 * This has no meaning in the LDK, and can be NULL or any other value.
5272 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
5273 * Returns an error if `genesis_hash` is for a different chain or if such a transaction output
5276 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
5278 struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id);
5280 * Frees any resources associated with this object given its this_arg pointer.
5281 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5283 void (*free)(void *this_arg);
5287 * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
5289 typedef enum LDKCOption_UtxoLookupZ_Tag {
5291 * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
5293 LDKCOption_UtxoLookupZ_Some,
5295 * When we're in this state, this COption_UtxoLookupZ contains nothing
5297 LDKCOption_UtxoLookupZ_None,
5299 * Must be last for serialization purposes
5301 LDKCOption_UtxoLookupZ_Sentinel,
5302 } LDKCOption_UtxoLookupZ_Tag;
5304 typedef struct LDKCOption_UtxoLookupZ {
5305 LDKCOption_UtxoLookupZ_Tag tag;
5308 struct LDKUtxoLookup some;
5311 } LDKCOption_UtxoLookupZ;
5314 * The contents of CResult_NoneLightningErrorZ
5316 typedef union LDKCResult_NoneLightningErrorZPtr {
5318 * Note that this value is always NULL, as there are no contents in the OK variant
5322 * A pointer to the contents in the error state.
5323 * Reading from this pointer when `result_ok` is set is undefined.
5325 struct LDKLightningError *err;
5326 } LDKCResult_NoneLightningErrorZPtr;
5329 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
5330 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
5331 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5333 typedef struct LDKCResult_NoneLightningErrorZ {
5335 * The contents of this CResult_NoneLightningErrorZ, accessible via either
5336 * `err` or `result` depending on the state of `result_ok`.
5338 union LDKCResult_NoneLightningErrorZPtr contents;
5340 * Whether this CResult_NoneLightningErrorZ represents a success state.
5343 } LDKCResult_NoneLightningErrorZ;
5346 * The contents of CResult_boolLightningErrorZ
5348 typedef union LDKCResult_boolLightningErrorZPtr {
5350 * A pointer to the contents in the success state.
5351 * Reading from this pointer when `result_ok` is not set is undefined.
5355 * A pointer to the contents in the error state.
5356 * Reading from this pointer when `result_ok` is set is undefined.
5358 struct LDKLightningError *err;
5359 } LDKCResult_boolLightningErrorZPtr;
5362 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
5363 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
5364 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5366 typedef struct LDKCResult_boolLightningErrorZ {
5368 * The contents of this CResult_boolLightningErrorZ, accessible via either
5369 * `err` or `result` depending on the state of `result_ok`.
5371 union LDKCResult_boolLightningErrorZPtr contents;
5373 * Whether this CResult_boolLightningErrorZ represents a success state.
5376 } LDKCResult_boolLightningErrorZ;
5381 * A [`channel_announcement`] message to be sent to or received from a peer.
5383 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
5385 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
5387 * A pointer to the opaque Rust object.
5388 * Nearly everywhere, inner must be non-null, however in places where
5389 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5391 LDKnativeChannelAnnouncement *inner;
5393 * Indicates that this is the only struct which contains the same pointer.
5394 * Rust functions which take ownership of an object provided via an argument require
5395 * this to be true and invalidate the object pointed to by inner.
5398 } LDKChannelAnnouncement;
5401 * A tuple of 3 elements. See the individual fields for the types contained.
5403 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
5405 * The element at position 0
5407 struct LDKChannelAnnouncement a;
5409 * The element at position 1
5411 struct LDKChannelUpdate b;
5413 * The element at position 2
5415 struct LDKChannelUpdate c;
5416 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
5419 * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
5421 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
5423 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
5425 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
5427 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
5429 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
5431 * Must be last for serialization purposes
5433 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
5434 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
5436 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
5437 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
5440 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
5443 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
5448 * An [`accept_channel`] message to be sent to or received from a peer.
5450 * Used in V1 channel establishment
5452 * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
5454 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
5456 * A pointer to the opaque Rust object.
5457 * Nearly everywhere, inner must be non-null, however in places where
5458 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5460 LDKnativeAcceptChannel *inner;
5462 * Indicates that this is the only struct which contains the same pointer.
5463 * Rust functions which take ownership of an object provided via an argument require
5464 * this to be true and invalidate the object pointed to by inner.
5472 * An accept_channel2 message to be sent by or received from the channel accepter.
5474 * Used in V2 channel establishment
5477 typedef struct MUST_USE_STRUCT LDKAcceptChannelV2 {
5479 * A pointer to the opaque Rust object.
5480 * Nearly everywhere, inner must be non-null, however in places where
5481 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5483 LDKnativeAcceptChannelV2 *inner;
5485 * Indicates that this is the only struct which contains the same pointer.
5486 * Rust functions which take ownership of an object provided via an argument require
5487 * this to be true and invalidate the object pointed to by inner.
5490 } LDKAcceptChannelV2;
5495 * An [`open_channel`] message to be sent to or received from a peer.
5497 * Used in V1 channel establishment
5499 * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
5501 typedef struct MUST_USE_STRUCT LDKOpenChannel {
5503 * A pointer to the opaque Rust object.
5504 * Nearly everywhere, inner must be non-null, however in places where
5505 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5507 LDKnativeOpenChannel *inner;
5509 * Indicates that this is the only struct which contains the same pointer.
5510 * Rust functions which take ownership of an object provided via an argument require
5511 * this to be true and invalidate the object pointed to by inner.
5519 * An open_channel2 message to be sent by or received from the channel initiator.
5521 * Used in V2 channel establishment
5524 typedef struct MUST_USE_STRUCT LDKOpenChannelV2 {
5526 * A pointer to the opaque Rust object.
5527 * Nearly everywhere, inner must be non-null, however in places where
5528 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5530 LDKnativeOpenChannelV2 *inner;
5532 * Indicates that this is the only struct which contains the same pointer.
5533 * Rust functions which take ownership of an object provided via an argument require
5534 * this to be true and invalidate the object pointed to by inner.
5542 * A [`funding_created`] message to be sent to or received from a peer.
5544 * Used in V1 channel establishment
5546 * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
5548 typedef struct MUST_USE_STRUCT LDKFundingCreated {
5550 * A pointer to the opaque Rust object.
5551 * Nearly everywhere, inner must be non-null, however in places where
5552 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5554 LDKnativeFundingCreated *inner;
5556 * Indicates that this is the only struct which contains the same pointer.
5557 * Rust functions which take ownership of an object provided via an argument require
5558 * this to be true and invalidate the object pointed to by inner.
5561 } LDKFundingCreated;
5566 * A [`funding_signed`] message to be sent to or received from a peer.
5568 * Used in V1 channel establishment
5570 * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
5572 typedef struct MUST_USE_STRUCT LDKFundingSigned {
5574 * A pointer to the opaque Rust object.
5575 * Nearly everywhere, inner must be non-null, however in places where
5576 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5578 LDKnativeFundingSigned *inner;
5580 * Indicates that this is the only struct which contains the same pointer.
5581 * Rust functions which take ownership of an object provided via an argument require
5582 * this to be true and invalidate the object pointed to by inner.
5590 * A tx_add_input message for adding an input during interactive transaction construction
5593 typedef struct MUST_USE_STRUCT LDKTxAddInput {
5595 * A pointer to the opaque Rust object.
5596 * Nearly everywhere, inner must be non-null, however in places where
5597 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5599 LDKnativeTxAddInput *inner;
5601 * Indicates that this is the only struct which contains the same pointer.
5602 * Rust functions which take ownership of an object provided via an argument require
5603 * this to be true and invalidate the object pointed to by inner.
5611 * A tx_add_output message for adding an output during interactive transaction construction.
5614 typedef struct MUST_USE_STRUCT LDKTxAddOutput {
5616 * A pointer to the opaque Rust object.
5617 * Nearly everywhere, inner must be non-null, however in places where
5618 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5620 LDKnativeTxAddOutput *inner;
5622 * Indicates that this is the only struct which contains the same pointer.
5623 * Rust functions which take ownership of an object provided via an argument require
5624 * this to be true and invalidate the object pointed to by inner.
5632 * A tx_remove_input message for removing an input during interactive transaction construction.
5635 typedef struct MUST_USE_STRUCT LDKTxRemoveInput {
5637 * A pointer to the opaque Rust object.
5638 * Nearly everywhere, inner must be non-null, however in places where
5639 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5641 LDKnativeTxRemoveInput *inner;
5643 * Indicates that this is the only struct which contains the same pointer.
5644 * Rust functions which take ownership of an object provided via an argument require
5645 * this to be true and invalidate the object pointed to by inner.
5653 * A tx_remove_output message for removing an output during interactive transaction construction.
5656 typedef struct MUST_USE_STRUCT LDKTxRemoveOutput {
5658 * A pointer to the opaque Rust object.
5659 * Nearly everywhere, inner must be non-null, however in places where
5660 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5662 LDKnativeTxRemoveOutput *inner;
5664 * Indicates that this is the only struct which contains the same pointer.
5665 * Rust functions which take ownership of an object provided via an argument require
5666 * this to be true and invalidate the object pointed to by inner.
5669 } LDKTxRemoveOutput;
5674 * A tx_complete message signalling the conclusion of a peer's transaction contributions during
5675 * interactive transaction construction.
5678 typedef struct MUST_USE_STRUCT LDKTxComplete {
5680 * A pointer to the opaque Rust object.
5681 * Nearly everywhere, inner must be non-null, however in places where
5682 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5684 LDKnativeTxComplete *inner;
5686 * Indicates that this is the only struct which contains the same pointer.
5687 * Rust functions which take ownership of an object provided via an argument require
5688 * this to be true and invalidate the object pointed to by inner.
5696 * A tx_signatures message containing the sender's signatures for a transaction constructed with
5697 * interactive transaction construction.
5700 typedef struct MUST_USE_STRUCT LDKTxSignatures {
5702 * A pointer to the opaque Rust object.
5703 * Nearly everywhere, inner must be non-null, however in places where
5704 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5706 LDKnativeTxSignatures *inner;
5708 * Indicates that this is the only struct which contains the same pointer.
5709 * Rust functions which take ownership of an object provided via an argument require
5710 * this to be true and invalidate the object pointed to by inner.
5718 * A tx_init_rbf message which initiates a replacement of the transaction after it's been
5722 typedef struct MUST_USE_STRUCT LDKTxInitRbf {
5724 * A pointer to the opaque Rust object.
5725 * Nearly everywhere, inner must be non-null, however in places where
5726 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5728 LDKnativeTxInitRbf *inner;
5730 * Indicates that this is the only struct which contains the same pointer.
5731 * Rust functions which take ownership of an object provided via an argument require
5732 * this to be true and invalidate the object pointed to by inner.
5740 * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been
5744 typedef struct MUST_USE_STRUCT LDKTxAckRbf {
5746 * A pointer to the opaque Rust object.
5747 * Nearly everywhere, inner must be non-null, however in places where
5748 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5750 LDKnativeTxAckRbf *inner;
5752 * Indicates that this is the only struct which contains the same pointer.
5753 * Rust functions which take ownership of an object provided via an argument require
5754 * this to be true and invalidate the object pointed to by inner.
5762 * A [`channel_ready`] message to be sent to or received from a peer.
5764 * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
5766 typedef struct MUST_USE_STRUCT LDKChannelReady {
5768 * A pointer to the opaque Rust object.
5769 * Nearly everywhere, inner must be non-null, however in places where
5770 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5772 LDKnativeChannelReady *inner;
5774 * Indicates that this is the only struct which contains the same pointer.
5775 * Rust functions which take ownership of an object provided via an argument require
5776 * this to be true and invalidate the object pointed to by inner.
5784 * An [`announcement_signatures`] message to be sent to or received from a peer.
5786 * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
5788 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
5790 * A pointer to the opaque Rust object.
5791 * Nearly everywhere, inner must be non-null, however in places where
5792 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5794 LDKnativeAnnouncementSignatures *inner;
5796 * Indicates that this is the only struct which contains the same pointer.
5797 * Rust functions which take ownership of an object provided via an argument require
5798 * this to be true and invalidate the object pointed to by inner.
5801 } LDKAnnouncementSignatures;
5806 * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
5807 * transaction updates if they were pending.
5809 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
5811 * A pointer to the opaque Rust object.
5812 * Nearly everywhere, inner must be non-null, however in places where
5813 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5815 LDKnativeCommitmentUpdate *inner;
5817 * Indicates that this is the only struct which contains the same pointer.
5818 * Rust functions which take ownership of an object provided via an argument require
5819 * this to be true and invalidate the object pointed to by inner.
5822 } LDKCommitmentUpdate;
5827 * A [`revoke_and_ack`] message to be sent to or received from a peer.
5829 * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
5831 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
5833 * A pointer to the opaque Rust object.
5834 * Nearly everywhere, inner must be non-null, however in places where
5835 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5837 LDKnativeRevokeAndACK *inner;
5839 * Indicates that this is the only struct which contains the same pointer.
5840 * Rust functions which take ownership of an object provided via an argument require
5841 * this to be true and invalidate the object pointed to by inner.
5849 * A [`closing_signed`] message to be sent to or received from a peer.
5851 * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
5853 typedef struct MUST_USE_STRUCT LDKClosingSigned {
5855 * A pointer to the opaque Rust object.
5856 * Nearly everywhere, inner must be non-null, however in places where
5857 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5859 LDKnativeClosingSigned *inner;
5861 * Indicates that this is the only struct which contains the same pointer.
5862 * Rust functions which take ownership of an object provided via an argument require
5863 * this to be true and invalidate the object pointed to by inner.
5871 * A [`shutdown`] message to be sent to or received from a peer.
5873 * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
5875 typedef struct MUST_USE_STRUCT LDKShutdown {
5877 * A pointer to the opaque Rust object.
5878 * Nearly everywhere, inner must be non-null, however in places where
5879 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5881 LDKnativeShutdown *inner;
5883 * Indicates that this is the only struct which contains the same pointer.
5884 * Rust functions which take ownership of an object provided via an argument require
5885 * this to be true and invalidate the object pointed to by inner.
5893 * A [`channel_reestablish`] message to be sent to or received from a peer.
5895 * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
5897 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
5899 * A pointer to the opaque Rust object.
5900 * Nearly everywhere, inner must be non-null, however in places where
5901 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5903 LDKnativeChannelReestablish *inner;
5905 * Indicates that this is the only struct which contains the same pointer.
5906 * Rust functions which take ownership of an object provided via an argument require
5907 * this to be true and invalidate the object pointed to by inner.
5910 } LDKChannelReestablish;
5915 * A [`node_announcement`] message to be sent to or received from a peer.
5917 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
5919 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
5921 * A pointer to the opaque Rust object.
5922 * Nearly everywhere, inner must be non-null, however in places where
5923 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5925 LDKnativeNodeAnnouncement *inner;
5927 * Indicates that this is the only struct which contains the same pointer.
5928 * Rust functions which take ownership of an object provided via an argument require
5929 * this to be true and invalidate the object pointed to by inner.
5932 } LDKNodeAnnouncement;
5937 * An [`error`] message to be sent to or received from a peer.
5939 * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
5941 typedef struct MUST_USE_STRUCT LDKErrorMessage {
5943 * A pointer to the opaque Rust object.
5944 * Nearly everywhere, inner must be non-null, however in places where
5945 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5947 LDKnativeErrorMessage *inner;
5949 * Indicates that this is the only struct which contains the same pointer.
5950 * Rust functions which take ownership of an object provided via an argument require
5951 * this to be true and invalidate the object pointed to by inner.
5959 * A [`warning`] message to be sent to or received from a peer.
5961 * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
5963 typedef struct MUST_USE_STRUCT LDKWarningMessage {
5965 * A pointer to the opaque Rust object.
5966 * Nearly everywhere, inner must be non-null, however in places where
5967 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5969 LDKnativeWarningMessage *inner;
5971 * Indicates that this is the only struct which contains the same pointer.
5972 * Rust functions which take ownership of an object provided via an argument require
5973 * this to be true and invalidate the object pointed to by inner.
5976 } LDKWarningMessage;
5979 * Used to put an error message in a [`LightningError`].
5981 typedef enum LDKErrorAction_Tag {
5983 * The peer took some action which made us think they were useless. Disconnect them.
5985 LDKErrorAction_DisconnectPeer,
5987 * The peer did something incorrect. Tell them without closing any channels and disconnect them.
5989 LDKErrorAction_DisconnectPeerWithWarning,
5991 * The peer did something harmless that we weren't able to process, just log and ignore
5993 LDKErrorAction_IgnoreError,
5995 * The peer did something harmless that we weren't able to meaningfully process.
5996 * If the error is logged, log it at the given level.
5998 LDKErrorAction_IgnoreAndLog,
6000 * The peer provided us with a gossip message which we'd already seen. In most cases this
6001 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
6002 * our own channel announcements.
6004 LDKErrorAction_IgnoreDuplicateGossip,
6006 * The peer did something incorrect. Tell them.
6008 LDKErrorAction_SendErrorMessage,
6010 * The peer did something incorrect. Tell them without closing any channels.
6012 LDKErrorAction_SendWarningMessage,
6014 * Must be last for serialization purposes
6016 LDKErrorAction_Sentinel,
6017 } LDKErrorAction_Tag;
6019 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
6021 * An error message which we should make an effort to send before we disconnect.
6023 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6025 struct LDKErrorMessage msg;
6026 } LDKErrorAction_LDKDisconnectPeer_Body;
6028 typedef struct LDKErrorAction_LDKDisconnectPeerWithWarning_Body {
6030 * A warning message which we should make an effort to send before we disconnect.
6032 struct LDKWarningMessage msg;
6033 } LDKErrorAction_LDKDisconnectPeerWithWarning_Body;
6035 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
6037 * The message to send.
6039 struct LDKErrorMessage msg;
6040 } LDKErrorAction_LDKSendErrorMessage_Body;
6042 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
6044 * The message to send.
6046 struct LDKWarningMessage msg;
6048 * The peer may have done something harmless that we weren't able to meaningfully process,
6049 * though we should still tell them about it.
6050 * If this event is logged, log it at the given level.
6052 enum LDKLevel log_level;
6053 } LDKErrorAction_LDKSendWarningMessage_Body;
6055 typedef struct MUST_USE_STRUCT LDKErrorAction {
6056 LDKErrorAction_Tag tag;
6058 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
6059 LDKErrorAction_LDKDisconnectPeerWithWarning_Body disconnect_peer_with_warning;
6061 enum LDKLevel ignore_and_log;
6063 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
6064 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
6071 * A [`query_channel_range`] message is used to query a peer for channel
6072 * UTXOs in a range of blocks. The recipient of a query makes a best
6073 * effort to reply to the query using one or more [`ReplyChannelRange`]
6076 * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6078 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
6080 * A pointer to the opaque Rust object.
6081 * Nearly everywhere, inner must be non-null, however in places where
6082 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6084 LDKnativeQueryChannelRange *inner;
6086 * Indicates that this is the only struct which contains the same pointer.
6087 * Rust functions which take ownership of an object provided via an argument require
6088 * this to be true and invalidate the object pointed to by inner.
6091 } LDKQueryChannelRange;
6096 * A [`query_short_channel_ids`] message is used to query a peer for
6097 * routing gossip messages related to one or more `short_channel_id`s.
6099 * The query recipient will reply with the latest, if available,
6100 * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
6101 * it maintains for the requested `short_channel_id`s followed by a
6102 * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
6103 * this query are encoded. We only support `encoding_type=0` uncompressed
6104 * serialization and do not support `encoding_type=1` zlib serialization.
6106 * [`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
6108 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
6110 * A pointer to the opaque Rust object.
6111 * Nearly everywhere, inner must be non-null, however in places where
6112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6114 LDKnativeQueryShortChannelIds *inner;
6116 * Indicates that this is the only struct which contains the same pointer.
6117 * Rust functions which take ownership of an object provided via an argument require
6118 * this to be true and invalidate the object pointed to by inner.
6121 } LDKQueryShortChannelIds;
6126 * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
6129 * Multiple `reply_channel_range` messages can be sent in reply
6130 * to a single [`QueryChannelRange`] message. The query recipient makes a
6131 * best effort to respond based on their local network view which may
6132 * not be a perfect view of the network. The `short_channel_id`s in the
6133 * reply are encoded. We only support `encoding_type=0` uncompressed
6134 * serialization and do not support `encoding_type=1` zlib serialization.
6136 * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6138 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
6140 * A pointer to the opaque Rust object.
6141 * Nearly everywhere, inner must be non-null, however in places where
6142 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6144 LDKnativeReplyChannelRange *inner;
6146 * Indicates that this is the only struct which contains the same pointer.
6147 * Rust functions which take ownership of an object provided via an argument require
6148 * this to be true and invalidate the object pointed to by inner.
6151 } LDKReplyChannelRange;
6156 * A [`gossip_timestamp_filter`] message is used by a node to request
6157 * gossip relay for messages in the requested time range when the
6158 * `gossip_queries` feature has been negotiated.
6160 * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
6162 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
6164 * A pointer to the opaque Rust object.
6165 * Nearly everywhere, inner must be non-null, however in places where
6166 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6168 LDKnativeGossipTimestampFilter *inner;
6170 * Indicates that this is the only struct which contains the same pointer.
6171 * Rust functions which take ownership of an object provided via an argument require
6172 * this to be true and invalidate the object pointed to by inner.
6175 } LDKGossipTimestampFilter;
6178 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
6179 * broadcast to most peers).
6180 * These events are handled by PeerManager::process_events if you are using a PeerManager.
6182 typedef enum LDKMessageSendEvent_Tag {
6184 * Used to indicate that we've accepted a channel open and should send the accept_channel
6185 * message provided to the given peer.
6187 LDKMessageSendEvent_SendAcceptChannel,
6189 * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
6190 * message provided to the given peer.
6192 LDKMessageSendEvent_SendAcceptChannelV2,
6194 * Used to indicate that we've initiated a channel open and should send the open_channel
6195 * message provided to the given peer.
6197 LDKMessageSendEvent_SendOpenChannel,
6199 * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
6200 * message provided to the given peer.
6202 LDKMessageSendEvent_SendOpenChannelV2,
6204 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
6206 LDKMessageSendEvent_SendFundingCreated,
6208 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
6210 LDKMessageSendEvent_SendFundingSigned,
6212 * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
6214 LDKMessageSendEvent_SendTxAddInput,
6216 * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
6218 LDKMessageSendEvent_SendTxAddOutput,
6220 * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
6222 LDKMessageSendEvent_SendTxRemoveInput,
6224 * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
6226 LDKMessageSendEvent_SendTxRemoveOutput,
6228 * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
6230 LDKMessageSendEvent_SendTxComplete,
6232 * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
6234 LDKMessageSendEvent_SendTxSignatures,
6236 * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
6238 LDKMessageSendEvent_SendTxInitRbf,
6240 * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
6242 LDKMessageSendEvent_SendTxAckRbf,
6244 * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
6246 LDKMessageSendEvent_SendTxAbort,
6248 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
6250 LDKMessageSendEvent_SendChannelReady,
6252 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
6254 LDKMessageSendEvent_SendAnnouncementSignatures,
6256 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
6257 * message should be sent to the peer with the given node_id.
6259 LDKMessageSendEvent_UpdateHTLCs,
6261 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
6263 LDKMessageSendEvent_SendRevokeAndACK,
6265 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
6267 LDKMessageSendEvent_SendClosingSigned,
6269 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
6271 LDKMessageSendEvent_SendShutdown,
6273 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
6275 LDKMessageSendEvent_SendChannelReestablish,
6277 * Used to send a channel_announcement and channel_update to a specific peer, likely on
6278 * initial connection to ensure our peers know about our channels.
6280 LDKMessageSendEvent_SendChannelAnnouncement,
6282 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
6283 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
6285 * Note that after doing so, you very likely (unless you did so very recently) want to
6286 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
6287 * ensures that any nodes which see our channel_announcement also have a relevant
6288 * node_announcement, including relevant feature flags which may be important for routing
6291 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
6293 LDKMessageSendEvent_BroadcastChannelAnnouncement,
6295 * Used to indicate that a channel_update should be broadcast to all peers.
6297 LDKMessageSendEvent_BroadcastChannelUpdate,
6299 * Used to indicate that a node_announcement should be broadcast to all peers.
6301 LDKMessageSendEvent_BroadcastNodeAnnouncement,
6303 * Used to indicate that a channel_update should be sent to a single peer.
6304 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
6305 * private channel and we shouldn't be informing all of our peers of channel parameters.
6307 LDKMessageSendEvent_SendChannelUpdate,
6309 * Broadcast an error downstream to be handled
6311 LDKMessageSendEvent_HandleError,
6313 * Query a peer for channels with funding transaction UTXOs in a block range.
6315 LDKMessageSendEvent_SendChannelRangeQuery,
6317 * Request routing gossip messages from a peer for a list of channels identified by
6318 * their short_channel_ids.
6320 LDKMessageSendEvent_SendShortIdsQuery,
6322 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
6323 * emitted during processing of the query.
6325 LDKMessageSendEvent_SendReplyChannelRange,
6327 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
6328 * enable receiving gossip messages from the peer.
6330 LDKMessageSendEvent_SendGossipTimestampFilter,
6332 * Must be last for serialization purposes
6334 LDKMessageSendEvent_Sentinel,
6335 } LDKMessageSendEvent_Tag;
6337 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
6339 * The node_id of the node which should receive this message
6341 struct LDKPublicKey node_id;
6343 * The message which should be sent.
6345 struct LDKAcceptChannel msg;
6346 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
6348 typedef struct LDKMessageSendEvent_LDKSendAcceptChannelV2_Body {
6350 * The node_id of the node which should receive this message
6352 struct LDKPublicKey node_id;
6354 * The message which should be sent.
6356 struct LDKAcceptChannelV2 msg;
6357 } LDKMessageSendEvent_LDKSendAcceptChannelV2_Body;
6359 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
6361 * The node_id of the node which should receive this message
6363 struct LDKPublicKey node_id;
6365 * The message which should be sent.
6367 struct LDKOpenChannel msg;
6368 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
6370 typedef struct LDKMessageSendEvent_LDKSendOpenChannelV2_Body {
6372 * The node_id of the node which should receive this message
6374 struct LDKPublicKey node_id;
6376 * The message which should be sent.
6378 struct LDKOpenChannelV2 msg;
6379 } LDKMessageSendEvent_LDKSendOpenChannelV2_Body;
6381 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
6383 * The node_id of the node which should receive this message
6385 struct LDKPublicKey node_id;
6387 * The message which should be sent.
6389 struct LDKFundingCreated msg;
6390 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
6392 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
6394 * The node_id of the node which should receive this message
6396 struct LDKPublicKey node_id;
6398 * The message which should be sent.
6400 struct LDKFundingSigned msg;
6401 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
6403 typedef struct LDKMessageSendEvent_LDKSendTxAddInput_Body {
6405 * The node_id of the node which should receive this message
6407 struct LDKPublicKey node_id;
6409 * The message which should be sent.
6411 struct LDKTxAddInput msg;
6412 } LDKMessageSendEvent_LDKSendTxAddInput_Body;
6414 typedef struct LDKMessageSendEvent_LDKSendTxAddOutput_Body {
6416 * The node_id of the node which should receive this message
6418 struct LDKPublicKey node_id;
6420 * The message which should be sent.
6422 struct LDKTxAddOutput msg;
6423 } LDKMessageSendEvent_LDKSendTxAddOutput_Body;
6425 typedef struct LDKMessageSendEvent_LDKSendTxRemoveInput_Body {
6427 * The node_id of the node which should receive this message
6429 struct LDKPublicKey node_id;
6431 * The message which should be sent.
6433 struct LDKTxRemoveInput msg;
6434 } LDKMessageSendEvent_LDKSendTxRemoveInput_Body;
6436 typedef struct LDKMessageSendEvent_LDKSendTxRemoveOutput_Body {
6438 * The node_id of the node which should receive this message
6440 struct LDKPublicKey node_id;
6442 * The message which should be sent.
6444 struct LDKTxRemoveOutput msg;
6445 } LDKMessageSendEvent_LDKSendTxRemoveOutput_Body;
6447 typedef struct LDKMessageSendEvent_LDKSendTxComplete_Body {
6449 * The node_id of the node which should receive this message
6451 struct LDKPublicKey node_id;
6453 * The message which should be sent.
6455 struct LDKTxComplete msg;
6456 } LDKMessageSendEvent_LDKSendTxComplete_Body;
6458 typedef struct LDKMessageSendEvent_LDKSendTxSignatures_Body {
6460 * The node_id of the node which should receive this message
6462 struct LDKPublicKey node_id;
6464 * The message which should be sent.
6466 struct LDKTxSignatures msg;
6467 } LDKMessageSendEvent_LDKSendTxSignatures_Body;
6469 typedef struct LDKMessageSendEvent_LDKSendTxInitRbf_Body {
6471 * The node_id of the node which should receive this message
6473 struct LDKPublicKey node_id;
6475 * The message which should be sent.
6477 struct LDKTxInitRbf msg;
6478 } LDKMessageSendEvent_LDKSendTxInitRbf_Body;
6480 typedef struct LDKMessageSendEvent_LDKSendTxAckRbf_Body {
6482 * The node_id of the node which should receive this message
6484 struct LDKPublicKey node_id;
6486 * The message which should be sent.
6488 struct LDKTxAckRbf msg;
6489 } LDKMessageSendEvent_LDKSendTxAckRbf_Body;
6491 typedef struct LDKMessageSendEvent_LDKSendTxAbort_Body {
6493 * The node_id of the node which should receive this message
6495 struct LDKPublicKey node_id;
6497 * The message which should be sent.
6499 struct LDKTxAddInput msg;
6500 } LDKMessageSendEvent_LDKSendTxAbort_Body;
6502 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
6504 * The node_id of the node which should receive these message(s)
6506 struct LDKPublicKey node_id;
6508 * The channel_ready message which should be sent.
6510 struct LDKChannelReady msg;
6511 } LDKMessageSendEvent_LDKSendChannelReady_Body;
6513 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
6515 * The node_id of the node which should receive these message(s)
6517 struct LDKPublicKey node_id;
6519 * The announcement_signatures message which should be sent.
6521 struct LDKAnnouncementSignatures msg;
6522 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
6524 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
6526 * The node_id of the node which should receive these message(s)
6528 struct LDKPublicKey node_id;
6530 * The update messages which should be sent. ALL messages in the struct should be sent!
6532 struct LDKCommitmentUpdate updates;
6533 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
6535 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
6537 * The node_id of the node which should receive this message
6539 struct LDKPublicKey node_id;
6541 * The message which should be sent.
6543 struct LDKRevokeAndACK msg;
6544 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
6546 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
6548 * The node_id of the node which should receive this message
6550 struct LDKPublicKey node_id;
6552 * The message which should be sent.
6554 struct LDKClosingSigned msg;
6555 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
6557 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
6559 * The node_id of the node which should receive this message
6561 struct LDKPublicKey node_id;
6563 * The message which should be sent.
6565 struct LDKShutdown msg;
6566 } LDKMessageSendEvent_LDKSendShutdown_Body;
6568 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
6570 * The node_id of the node which should receive this message
6572 struct LDKPublicKey node_id;
6574 * The message which should be sent.
6576 struct LDKChannelReestablish msg;
6577 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
6579 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
6581 * The node_id of the node which should receive this message
6583 struct LDKPublicKey node_id;
6585 * The channel_announcement which should be sent.
6587 struct LDKChannelAnnouncement msg;
6589 * The followup channel_update which should be sent.
6591 struct LDKChannelUpdate update_msg;
6592 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
6594 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
6596 * The channel_announcement which should be sent.
6598 struct LDKChannelAnnouncement msg;
6600 * The followup channel_update which should be sent.
6602 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6604 struct LDKChannelUpdate update_msg;
6605 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
6607 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
6609 * The channel_update which should be sent.
6611 struct LDKChannelUpdate msg;
6612 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
6614 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
6616 * The node_announcement which should be sent.
6618 struct LDKNodeAnnouncement msg;
6619 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
6621 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
6623 * The node_id of the node which should receive this message
6625 struct LDKPublicKey node_id;
6627 * The channel_update which should be sent.
6629 struct LDKChannelUpdate msg;
6630 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
6632 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
6634 * The node_id of the node which should receive this message
6636 struct LDKPublicKey node_id;
6638 * The action which should be taken.
6640 struct LDKErrorAction action;
6641 } LDKMessageSendEvent_LDKHandleError_Body;
6643 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
6645 * The node_id of this message recipient
6647 struct LDKPublicKey node_id;
6649 * The query_channel_range which should be sent.
6651 struct LDKQueryChannelRange msg;
6652 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
6654 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
6656 * The node_id of this message recipient
6658 struct LDKPublicKey node_id;
6660 * The query_short_channel_ids which should be sent.
6662 struct LDKQueryShortChannelIds msg;
6663 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
6665 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
6667 * The node_id of this message recipient
6669 struct LDKPublicKey node_id;
6671 * The reply_channel_range which should be sent.
6673 struct LDKReplyChannelRange msg;
6674 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
6676 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
6678 * The node_id of this message recipient
6680 struct LDKPublicKey node_id;
6682 * The gossip_timestamp_filter which should be sent.
6684 struct LDKGossipTimestampFilter msg;
6685 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
6687 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
6688 LDKMessageSendEvent_Tag tag;
6690 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
6691 LDKMessageSendEvent_LDKSendAcceptChannelV2_Body send_accept_channel_v2;
6692 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
6693 LDKMessageSendEvent_LDKSendOpenChannelV2_Body send_open_channel_v2;
6694 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
6695 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
6696 LDKMessageSendEvent_LDKSendTxAddInput_Body send_tx_add_input;
6697 LDKMessageSendEvent_LDKSendTxAddOutput_Body send_tx_add_output;
6698 LDKMessageSendEvent_LDKSendTxRemoveInput_Body send_tx_remove_input;
6699 LDKMessageSendEvent_LDKSendTxRemoveOutput_Body send_tx_remove_output;
6700 LDKMessageSendEvent_LDKSendTxComplete_Body send_tx_complete;
6701 LDKMessageSendEvent_LDKSendTxSignatures_Body send_tx_signatures;
6702 LDKMessageSendEvent_LDKSendTxInitRbf_Body send_tx_init_rbf;
6703 LDKMessageSendEvent_LDKSendTxAckRbf_Body send_tx_ack_rbf;
6704 LDKMessageSendEvent_LDKSendTxAbort_Body send_tx_abort;
6705 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
6706 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
6707 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
6708 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
6709 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
6710 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
6711 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
6712 LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
6713 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
6714 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
6715 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
6716 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
6717 LDKMessageSendEvent_LDKHandleError_Body handle_error;
6718 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
6719 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
6720 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
6721 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
6723 } LDKMessageSendEvent;
6726 * A dynamically-allocated array of crate::lightning::events::MessageSendEvents of arbitrary size.
6727 * This corresponds to std::vector in C++
6729 typedef struct LDKCVec_MessageSendEventZ {
6731 * The elements in the array.
6732 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
6734 struct LDKMessageSendEvent *data;
6736 * The number of elements pointed to by `data`.
6739 } LDKCVec_MessageSendEventZ;
6744 * Details about one direction of a channel as received within a [`ChannelUpdate`].
6746 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
6748 * A pointer to the opaque Rust object.
6749 * Nearly everywhere, inner must be non-null, however in places where
6750 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6752 LDKnativeChannelUpdateInfo *inner;
6754 * Indicates that this is the only struct which contains the same pointer.
6755 * Rust functions which take ownership of an object provided via an argument require
6756 * this to be true and invalidate the object pointed to by inner.
6759 } LDKChannelUpdateInfo;
6762 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
6764 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
6766 * A pointer to the contents in the success state.
6767 * Reading from this pointer when `result_ok` is not set is undefined.
6769 struct LDKChannelUpdateInfo *result;
6771 * A pointer to the contents in the error state.
6772 * Reading from this pointer when `result_ok` is set is undefined.
6774 struct LDKDecodeError *err;
6775 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
6778 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
6779 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6780 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6782 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
6784 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
6785 * `err` or `result` depending on the state of `result_ok`.
6787 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
6789 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
6792 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
6797 * Details about a channel (both directions).
6798 * Received within a channel announcement.
6800 typedef struct MUST_USE_STRUCT LDKChannelInfo {
6802 * A pointer to the opaque Rust object.
6803 * Nearly everywhere, inner must be non-null, however in places where
6804 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6806 LDKnativeChannelInfo *inner;
6808 * Indicates that this is the only struct which contains the same pointer.
6809 * Rust functions which take ownership of an object provided via an argument require
6810 * this to be true and invalidate the object pointed to by inner.
6816 * The contents of CResult_ChannelInfoDecodeErrorZ
6818 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
6820 * A pointer to the contents in the success state.
6821 * Reading from this pointer when `result_ok` is not set is undefined.
6823 struct LDKChannelInfo *result;
6825 * A pointer to the contents in the error state.
6826 * Reading from this pointer when `result_ok` is set is undefined.
6828 struct LDKDecodeError *err;
6829 } LDKCResult_ChannelInfoDecodeErrorZPtr;
6832 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
6833 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
6834 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6836 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
6838 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
6839 * `err` or `result` depending on the state of `result_ok`.
6841 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
6843 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
6846 } LDKCResult_ChannelInfoDecodeErrorZ;
6851 * Fees for routing via a given channel or a node
6853 typedef struct MUST_USE_STRUCT LDKRoutingFees {
6855 * A pointer to the opaque Rust object.
6856 * Nearly everywhere, inner must be non-null, however in places where
6857 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6859 LDKnativeRoutingFees *inner;
6861 * Indicates that this is the only struct which contains the same pointer.
6862 * Rust functions which take ownership of an object provided via an argument require
6863 * this to be true and invalidate the object pointed to by inner.
6869 * The contents of CResult_RoutingFeesDecodeErrorZ
6871 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
6873 * A pointer to the contents in the success state.
6874 * Reading from this pointer when `result_ok` is not set is undefined.
6876 struct LDKRoutingFees *result;
6878 * A pointer to the contents in the error state.
6879 * Reading from this pointer when `result_ok` is set is undefined.
6881 struct LDKDecodeError *err;
6882 } LDKCResult_RoutingFeesDecodeErrorZPtr;
6885 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
6886 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
6887 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6889 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
6891 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
6892 * `err` or `result` depending on the state of `result_ok`.
6894 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
6896 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
6899 } LDKCResult_RoutingFeesDecodeErrorZ;
6902 * A 4-byte byte array.
6904 typedef struct LDKFourBytes {
6912 * A 12-byte byte array.
6914 typedef struct LDKTwelveBytes {
6924 * Represents a hostname for serialization purposes.
6925 * Only the character set and length will be validated.
6926 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
6927 * Its length is guaranteed to be representable by a single byte.
6928 * This serialization is used by [`BOLT 7`] hostnames.
6930 * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
6932 typedef struct MUST_USE_STRUCT LDKHostname {
6934 * A pointer to the opaque Rust object.
6935 * Nearly everywhere, inner must be non-null, however in places where
6936 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6938 LDKnativeHostname *inner;
6940 * Indicates that this is the only struct which contains the same pointer.
6941 * Rust functions which take ownership of an object provided via an argument require
6942 * this to be true and invalidate the object pointed to by inner.
6948 * An address which can be used to connect to a remote peer.
6950 typedef enum LDKNetAddress_Tag {
6952 * An IPv4 address/port on which the peer is listening.
6956 * An IPv6 address/port on which the peer is listening.
6960 * An old-style Tor onion address/port on which the peer is listening.
6962 * This field is deprecated and the Tor network generally no longer supports V2 Onion
6963 * addresses. Thus, the details are not parsed here.
6965 LDKNetAddress_OnionV2,
6967 * A new-style Tor onion address/port on which the peer is listening.
6969 * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
6970 * wrap as base32 and append \".onion\".
6972 LDKNetAddress_OnionV3,
6974 * A hostname/port on which the peer is listening.
6976 LDKNetAddress_Hostname,
6978 * Must be last for serialization purposes
6980 LDKNetAddress_Sentinel,
6981 } LDKNetAddress_Tag;
6983 typedef struct LDKNetAddress_LDKIPv4_Body {
6985 * The 4-byte IPv4 address
6987 struct LDKFourBytes addr;
6989 * The port on which the node is listening
6992 } LDKNetAddress_LDKIPv4_Body;
6994 typedef struct LDKNetAddress_LDKIPv6_Body {
6996 * The 16-byte IPv6 address
6998 struct LDKSixteenBytes addr;
7000 * The port on which the node is listening
7003 } LDKNetAddress_LDKIPv6_Body;
7005 typedef struct LDKNetAddress_LDKOnionV3_Body {
7007 * The ed25519 long-term public key of the peer
7009 struct LDKThirtyTwoBytes ed25519_pubkey;
7011 * The checksum of the pubkey and version, as included in the onion address
7015 * The version byte, as defined by the Tor Onion v3 spec.
7019 * The port on which the node is listening
7022 } LDKNetAddress_LDKOnionV3_Body;
7024 typedef struct LDKNetAddress_LDKHostname_Body {
7026 * The hostname on which the node is listening.
7028 struct LDKHostname hostname;
7030 * The port on which the node is listening.
7033 } LDKNetAddress_LDKHostname_Body;
7035 typedef struct MUST_USE_STRUCT LDKNetAddress {
7036 LDKNetAddress_Tag tag;
7038 LDKNetAddress_LDKIPv4_Body i_pv4;
7039 LDKNetAddress_LDKIPv6_Body i_pv6;
7041 struct LDKTwelveBytes onion_v2;
7043 LDKNetAddress_LDKOnionV3_Body onion_v3;
7044 LDKNetAddress_LDKHostname_Body hostname;
7049 * A dynamically-allocated array of crate::lightning::ln::msgs::NetAddresss of arbitrary size.
7050 * This corresponds to std::vector in C++
7052 typedef struct LDKCVec_NetAddressZ {
7054 * The elements in the array.
7055 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7057 struct LDKNetAddress *data;
7059 * The number of elements pointed to by `data`.
7062 } LDKCVec_NetAddressZ;
7067 * Information received in the latest node_announcement from this node.
7069 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
7071 * A pointer to the opaque Rust object.
7072 * Nearly everywhere, inner must be non-null, however in places where
7073 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7075 LDKnativeNodeAnnouncementInfo *inner;
7077 * Indicates that this is the only struct which contains the same pointer.
7078 * Rust functions which take ownership of an object provided via an argument require
7079 * this to be true and invalidate the object pointed to by inner.
7082 } LDKNodeAnnouncementInfo;
7085 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
7087 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
7089 * A pointer to the contents in the success state.
7090 * Reading from this pointer when `result_ok` is not set is undefined.
7092 struct LDKNodeAnnouncementInfo *result;
7094 * A pointer to the contents in the error state.
7095 * Reading from this pointer when `result_ok` is set is undefined.
7097 struct LDKDecodeError *err;
7098 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
7101 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
7102 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7103 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7105 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
7107 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
7108 * `err` or `result` depending on the state of `result_ok`.
7110 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
7112 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
7115 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
7120 * A user-defined name for a node, which may be used when displaying the node in a graph.
7122 * Since node aliases are provided by third parties, they are a potential avenue for injection
7123 * attacks. Care must be taken when processing.
7125 typedef struct MUST_USE_STRUCT LDKNodeAlias {
7127 * A pointer to the opaque Rust object.
7128 * Nearly everywhere, inner must be non-null, however in places where
7129 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7131 LDKnativeNodeAlias *inner;
7133 * Indicates that this is the only struct which contains the same pointer.
7134 * Rust functions which take ownership of an object provided via an argument require
7135 * this to be true and invalidate the object pointed to by inner.
7141 * The contents of CResult_NodeAliasDecodeErrorZ
7143 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
7145 * A pointer to the contents in the success state.
7146 * Reading from this pointer when `result_ok` is not set is undefined.
7148 struct LDKNodeAlias *result;
7150 * A pointer to the contents in the error state.
7151 * Reading from this pointer when `result_ok` is set is undefined.
7153 struct LDKDecodeError *err;
7154 } LDKCResult_NodeAliasDecodeErrorZPtr;
7157 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
7158 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
7159 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7161 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
7163 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
7164 * `err` or `result` depending on the state of `result_ok`.
7166 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
7168 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
7171 } LDKCResult_NodeAliasDecodeErrorZ;
7176 * Details about a node in the network, known from the network announcement.
7178 typedef struct MUST_USE_STRUCT LDKNodeInfo {
7180 * A pointer to the opaque Rust object.
7181 * Nearly everywhere, inner must be non-null, however in places where
7182 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7184 LDKnativeNodeInfo *inner;
7186 * Indicates that this is the only struct which contains the same pointer.
7187 * Rust functions which take ownership of an object provided via an argument require
7188 * this to be true and invalidate the object pointed to by inner.
7194 * The contents of CResult_NodeInfoDecodeErrorZ
7196 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
7198 * A pointer to the contents in the success state.
7199 * Reading from this pointer when `result_ok` is not set is undefined.
7201 struct LDKNodeInfo *result;
7203 * A pointer to the contents in the error state.
7204 * Reading from this pointer when `result_ok` is set is undefined.
7206 struct LDKDecodeError *err;
7207 } LDKCResult_NodeInfoDecodeErrorZPtr;
7210 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
7211 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7212 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7214 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
7216 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
7217 * `err` or `result` depending on the state of `result_ok`.
7219 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
7221 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
7224 } LDKCResult_NodeInfoDecodeErrorZ;
7227 * The contents of CResult_NetworkGraphDecodeErrorZ
7229 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
7231 * A pointer to the contents in the success state.
7232 * Reading from this pointer when `result_ok` is not set is undefined.
7234 struct LDKNetworkGraph *result;
7236 * A pointer to the contents in the error state.
7237 * Reading from this pointer when `result_ok` is set is undefined.
7239 struct LDKDecodeError *err;
7240 } LDKCResult_NetworkGraphDecodeErrorZPtr;
7243 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
7244 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
7245 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7247 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
7249 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
7250 * `err` or `result` depending on the state of `result_ok`.
7252 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
7254 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
7257 } LDKCResult_NetworkGraphDecodeErrorZ;
7260 * An enum which can either contain a crate::c_types::derived::CVec_NetAddressZ or not
7262 typedef enum LDKCOption_CVec_NetAddressZZ_Tag {
7264 * When we're in this state, this COption_CVec_NetAddressZZ contains a crate::c_types::derived::CVec_NetAddressZ
7266 LDKCOption_CVec_NetAddressZZ_Some,
7268 * When we're in this state, this COption_CVec_NetAddressZZ contains nothing
7270 LDKCOption_CVec_NetAddressZZ_None,
7272 * Must be last for serialization purposes
7274 LDKCOption_CVec_NetAddressZZ_Sentinel,
7275 } LDKCOption_CVec_NetAddressZZ_Tag;
7277 typedef struct LDKCOption_CVec_NetAddressZZ {
7278 LDKCOption_CVec_NetAddressZZ_Tag tag;
7281 struct LDKCVec_NetAddressZ some;
7284 } LDKCOption_CVec_NetAddressZZ;
7287 * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
7289 typedef enum LDKCOption_PaymentPreimageZ_Tag {
7291 * When we're in this state, this COption_PaymentPreimageZ contains a crate::c_types::ThirtyTwoBytes
7293 LDKCOption_PaymentPreimageZ_Some,
7295 * When we're in this state, this COption_PaymentPreimageZ contains nothing
7297 LDKCOption_PaymentPreimageZ_None,
7299 * Must be last for serialization purposes
7301 LDKCOption_PaymentPreimageZ_Sentinel,
7302 } LDKCOption_PaymentPreimageZ_Tag;
7304 typedef struct LDKCOption_PaymentPreimageZ {
7305 LDKCOption_PaymentPreimageZ_Tag tag;
7308 struct LDKThirtyTwoBytes some;
7311 } LDKCOption_PaymentPreimageZ;
7314 * A dynamically-allocated array of crate::lightning::ln::chan_utils::HTLCOutputInCommitments of arbitrary size.
7315 * This corresponds to std::vector in C++
7317 typedef struct LDKCVec_HTLCOutputInCommitmentZ {
7319 * The elements in the array.
7320 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7322 struct LDKHTLCOutputInCommitment *data;
7324 * The number of elements pointed to by `data`.
7327 } LDKCVec_HTLCOutputInCommitmentZ;
7330 * A dynamically-allocated array of crate::lightning::events::bump_transaction::HTLCDescriptors of arbitrary size.
7331 * This corresponds to std::vector in C++
7333 typedef struct LDKCVec_HTLCDescriptorZ {
7335 * The elements in the array.
7336 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7338 struct LDKHTLCDescriptor *data;
7340 * The number of elements pointed to by `data`.
7343 } LDKCVec_HTLCDescriptorZ;
7348 * An unspent transaction output that is available to spend resulting from a successful
7349 * [`CoinSelection`] attempt.
7351 typedef struct MUST_USE_STRUCT LDKUtxo {
7353 * A pointer to the opaque Rust object.
7354 * Nearly everywhere, inner must be non-null, however in places where
7355 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7357 LDKnativeUtxo *inner;
7359 * Indicates that this is the only struct which contains the same pointer.
7360 * Rust functions which take ownership of an object provided via an argument require
7361 * this to be true and invalidate the object pointed to by inner.
7367 * A dynamically-allocated array of crate::lightning::events::bump_transaction::Utxos of arbitrary size.
7368 * This corresponds to std::vector in C++
7370 typedef struct LDKCVec_UtxoZ {
7372 * The elements in the array.
7373 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7375 struct LDKUtxo *data;
7377 * The number of elements pointed to by `data`.
7383 * An enum which can either contain a crate::c_types::TxOut or not
7385 typedef enum LDKCOption_TxOutZ_Tag {
7387 * When we're in this state, this COption_TxOutZ contains a crate::c_types::TxOut
7389 LDKCOption_TxOutZ_Some,
7391 * When we're in this state, this COption_TxOutZ contains nothing
7393 LDKCOption_TxOutZ_None,
7395 * Must be last for serialization purposes
7397 LDKCOption_TxOutZ_Sentinel,
7398 } LDKCOption_TxOutZ_Tag;
7400 typedef struct LDKCOption_TxOutZ {
7401 LDKCOption_TxOutZ_Tag tag;
7404 struct LDKTxOut some;
7407 } LDKCOption_TxOutZ;
7412 * An input that must be included in a transaction when performing coin selection through
7413 * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it
7414 * must have an empty [`TxIn::script_sig`] when spent.
7416 typedef struct MUST_USE_STRUCT LDKInput {
7418 * A pointer to the opaque Rust object.
7419 * Nearly everywhere, inner must be non-null, however in places where
7420 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7422 LDKnativeInput *inner;
7424 * Indicates that this is the only struct which contains the same pointer.
7425 * Rust functions which take ownership of an object provided via an argument require
7426 * this to be true and invalidate the object pointed to by inner.
7432 * A dynamically-allocated array of crate::lightning::events::bump_transaction::Inputs of arbitrary size.
7433 * This corresponds to std::vector in C++
7435 typedef struct LDKCVec_InputZ {
7437 * The elements in the array.
7438 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7440 struct LDKInput *data;
7442 * The number of elements pointed to by `data`.
7450 * The result of a successful coin selection attempt for a transaction requiring additional UTXOs
7451 * to cover its fees.
7453 typedef struct MUST_USE_STRUCT LDKCoinSelection {
7455 * A pointer to the opaque Rust object.
7456 * Nearly everywhere, inner must be non-null, however in places where
7457 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7459 LDKnativeCoinSelection *inner;
7461 * Indicates that this is the only struct which contains the same pointer.
7462 * Rust functions which take ownership of an object provided via an argument require
7463 * this to be true and invalidate the object pointed to by inner.
7469 * The contents of CResult_CoinSelectionNoneZ
7471 typedef union LDKCResult_CoinSelectionNoneZPtr {
7473 * A pointer to the contents in the success state.
7474 * Reading from this pointer when `result_ok` is not set is undefined.
7476 struct LDKCoinSelection *result;
7478 * Note that this value is always NULL, as there are no contents in the Err variant
7481 } LDKCResult_CoinSelectionNoneZPtr;
7484 * A CResult_CoinSelectionNoneZ represents the result of a fallible operation,
7485 * containing a crate::lightning::events::bump_transaction::CoinSelection on success and a () on failure.
7486 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7488 typedef struct LDKCResult_CoinSelectionNoneZ {
7490 * The contents of this CResult_CoinSelectionNoneZ, accessible via either
7491 * `err` or `result` depending on the state of `result_ok`.
7493 union LDKCResult_CoinSelectionNoneZPtr contents;
7495 * Whether this CResult_CoinSelectionNoneZ represents a success state.
7498 } LDKCResult_CoinSelectionNoneZ;
7501 * The contents of CResult_CVec_UtxoZNoneZ
7503 typedef union LDKCResult_CVec_UtxoZNoneZPtr {
7505 * A pointer to the contents in the success state.
7506 * Reading from this pointer when `result_ok` is not set is undefined.
7508 struct LDKCVec_UtxoZ *result;
7510 * Note that this value is always NULL, as there are no contents in the Err variant
7513 } LDKCResult_CVec_UtxoZNoneZPtr;
7516 * A CResult_CVec_UtxoZNoneZ represents the result of a fallible operation,
7517 * containing a crate::c_types::derived::CVec_UtxoZ on success and a () on failure.
7518 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7520 typedef struct LDKCResult_CVec_UtxoZNoneZ {
7522 * The contents of this CResult_CVec_UtxoZNoneZ, accessible via either
7523 * `err` or `result` depending on the state of `result_ok`.
7525 union LDKCResult_CVec_UtxoZNoneZPtr contents;
7527 * Whether this CResult_CVec_UtxoZNoneZ represents a success state.
7530 } LDKCResult_CVec_UtxoZNoneZ;
7533 * An enum which can either contain a u16 or not
7535 typedef enum LDKCOption_u16Z_Tag {
7537 * When we're in this state, this COption_u16Z contains a u16
7539 LDKCOption_u16Z_Some,
7541 * When we're in this state, this COption_u16Z contains nothing
7543 LDKCOption_u16Z_None,
7545 * Must be last for serialization purposes
7547 LDKCOption_u16Z_Sentinel,
7548 } LDKCOption_u16Z_Tag;
7550 typedef struct LDKCOption_u16Z {
7551 LDKCOption_u16Z_Tag tag;
7560 * An enum which can either contain a crate::lightning::ln::channelmanager::ChannelShutdownState or not
7562 typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
7564 * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channelmanager::ChannelShutdownState
7566 LDKCOption_ChannelShutdownStateZ_Some,
7568 * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
7570 LDKCOption_ChannelShutdownStateZ_None,
7572 * Must be last for serialization purposes
7574 LDKCOption_ChannelShutdownStateZ_Sentinel,
7575 } LDKCOption_ChannelShutdownStateZ_Tag;
7577 typedef struct LDKCOption_ChannelShutdownStateZ {
7578 LDKCOption_ChannelShutdownStateZ_Tag tag;
7581 enum LDKChannelShutdownState some;
7584 } LDKCOption_ChannelShutdownStateZ;
7587 * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
7589 typedef enum LDKCOption_PaymentHashZ_Tag {
7591 * When we're in this state, this COption_PaymentHashZ contains a crate::c_types::ThirtyTwoBytes
7593 LDKCOption_PaymentHashZ_Some,
7595 * When we're in this state, this COption_PaymentHashZ contains nothing
7597 LDKCOption_PaymentHashZ_None,
7599 * Must be last for serialization purposes
7601 LDKCOption_PaymentHashZ_Sentinel,
7602 } LDKCOption_PaymentHashZ_Tag;
7604 typedef struct LDKCOption_PaymentHashZ {
7605 LDKCOption_PaymentHashZ_Tag tag;
7608 struct LDKThirtyTwoBytes some;
7611 } LDKCOption_PaymentHashZ;
7614 * The contents of CResult__u832APIErrorZ
7616 typedef union LDKCResult__u832APIErrorZPtr {
7618 * A pointer to the contents in the success state.
7619 * Reading from this pointer when `result_ok` is not set is undefined.
7621 struct LDKThirtyTwoBytes *result;
7623 * A pointer to the contents in the error state.
7624 * Reading from this pointer when `result_ok` is set is undefined.
7626 struct LDKAPIError *err;
7627 } LDKCResult__u832APIErrorZPtr;
7630 * A CResult__u832APIErrorZ represents the result of a fallible operation,
7631 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
7632 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7634 typedef struct LDKCResult__u832APIErrorZ {
7636 * The contents of this CResult__u832APIErrorZ, accessible via either
7637 * `err` or `result` depending on the state of `result_ok`.
7639 union LDKCResult__u832APIErrorZPtr contents;
7641 * Whether this CResult__u832APIErrorZ represents a success state.
7644 } LDKCResult__u832APIErrorZ;
7647 * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
7648 * These include payments that have yet to find a successful path, or have unresolved HTLCs.
7650 typedef enum LDKRecentPaymentDetails_Tag {
7652 * When a payment is still being sent and awaiting successful delivery.
7654 LDKRecentPaymentDetails_Pending,
7656 * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
7657 * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
7658 * payment is removed from tracking.
7660 LDKRecentPaymentDetails_Fulfilled,
7662 * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
7663 * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
7664 * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
7666 LDKRecentPaymentDetails_Abandoned,
7668 * Must be last for serialization purposes
7670 LDKRecentPaymentDetails_Sentinel,
7671 } LDKRecentPaymentDetails_Tag;
7673 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
7675 * Hash of the payment that is currently being sent but has yet to be fulfilled or
7678 struct LDKThirtyTwoBytes payment_hash;
7680 * Total amount (in msat, excluding fees) across all paths for this payment,
7681 * not just the amount currently inflight.
7683 uint64_t total_msat;
7684 } LDKRecentPaymentDetails_LDKPending_Body;
7686 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
7688 * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
7689 * made before LDK version 0.0.104.
7691 struct LDKCOption_PaymentHashZ payment_hash;
7692 } LDKRecentPaymentDetails_LDKFulfilled_Body;
7694 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
7696 * Hash of the payment that we have given up trying to send.
7698 struct LDKThirtyTwoBytes payment_hash;
7699 } LDKRecentPaymentDetails_LDKAbandoned_Body;
7701 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
7702 LDKRecentPaymentDetails_Tag tag;
7704 LDKRecentPaymentDetails_LDKPending_Body pending;
7705 LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
7706 LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
7708 } LDKRecentPaymentDetails;
7711 * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
7712 * This corresponds to std::vector in C++
7714 typedef struct LDKCVec_RecentPaymentDetailsZ {
7716 * The elements in the array.
7717 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7719 struct LDKRecentPaymentDetails *data;
7721 * The number of elements pointed to by `data`.
7724 } LDKCVec_RecentPaymentDetailsZ;
7727 * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
7728 * of several states. This enum is returned as the Err() type describing which state the payment
7729 * is in, see the description of individual enum states for more.
7731 * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
7733 typedef enum LDKPaymentSendFailure_Tag {
7735 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
7736 * send the payment at all.
7738 * You can freely resend the payment in full (with the parameter error fixed).
7740 * Because the payment failed outright, no payment tracking is done and no
7741 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
7743 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
7744 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
7746 LDKPaymentSendFailure_ParameterError,
7748 * A parameter in a single path which was passed to send_payment was invalid, preventing us
7749 * from attempting to send the payment at all.
7751 * You can freely resend the payment in full (with the parameter error fixed).
7753 * Because the payment failed outright, no payment tracking is done and no
7754 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
7756 * The results here are ordered the same as the paths in the route object which was passed to
7759 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
7760 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
7762 LDKPaymentSendFailure_PathParameterError,
7764 * All paths which were attempted failed to send, with no channel state change taking place.
7765 * You can freely resend the payment in full (though you probably want to do so over different
7766 * paths than the ones selected).
7768 * Because the payment failed outright, no payment tracking is done and no
7769 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
7771 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
7772 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
7774 LDKPaymentSendFailure_AllFailedResendSafe,
7776 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
7777 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
7779 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
7780 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
7781 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
7783 LDKPaymentSendFailure_DuplicatePayment,
7785 * Some paths that were attempted failed to send, though some paths may have succeeded. At least
7786 * some paths have irrevocably committed to the HTLC.
7788 * The results here are ordered the same as the paths in the route object that was passed to
7791 * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
7792 * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
7794 * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
7796 LDKPaymentSendFailure_PartialFailure,
7798 * Must be last for serialization purposes
7800 LDKPaymentSendFailure_Sentinel,
7801 } LDKPaymentSendFailure_Tag;
7803 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
7805 * The errors themselves, in the same order as the paths from the route.
7807 struct LDKCVec_CResult_NoneAPIErrorZZ results;
7809 * If some paths failed without irrevocably committing to the new HTLC(s), this will
7810 * contain a [`RouteParameters`] object for the failing paths.
7812 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
7814 struct LDKRouteParameters failed_paths_retry;
7816 * The payment id for the payment, which is now at least partially pending.
7818 struct LDKThirtyTwoBytes payment_id;
7819 } LDKPaymentSendFailure_LDKPartialFailure_Body;
7821 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
7822 LDKPaymentSendFailure_Tag tag;
7825 struct LDKAPIError parameter_error;
7828 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
7831 struct LDKCVec_APIErrorZ all_failed_resend_safe;
7833 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
7835 } LDKPaymentSendFailure;
7838 * The contents of CResult_NonePaymentSendFailureZ
7840 typedef union LDKCResult_NonePaymentSendFailureZPtr {
7842 * Note that this value is always NULL, as there are no contents in the OK variant
7846 * A pointer to the contents in the error state.
7847 * Reading from this pointer when `result_ok` is set is undefined.
7849 struct LDKPaymentSendFailure *err;
7850 } LDKCResult_NonePaymentSendFailureZPtr;
7853 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
7854 * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
7855 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7857 typedef struct LDKCResult_NonePaymentSendFailureZ {
7859 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
7860 * `err` or `result` depending on the state of `result_ok`.
7862 union LDKCResult_NonePaymentSendFailureZPtr contents;
7864 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
7867 } LDKCResult_NonePaymentSendFailureZ;
7870 * The contents of CResult_NoneRetryableSendFailureZ
7872 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
7874 * Note that this value is always NULL, as there are no contents in the OK variant
7878 * A pointer to the contents in the error state.
7879 * Reading from this pointer when `result_ok` is set is undefined.
7881 enum LDKRetryableSendFailure *err;
7882 } LDKCResult_NoneRetryableSendFailureZPtr;
7885 * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
7886 * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
7887 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7889 typedef struct LDKCResult_NoneRetryableSendFailureZ {
7891 * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
7892 * `err` or `result` depending on the state of `result_ok`.
7894 union LDKCResult_NoneRetryableSendFailureZPtr contents;
7896 * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
7899 } LDKCResult_NoneRetryableSendFailureZ;
7902 * The contents of CResult_PaymentHashPaymentSendFailureZ
7904 typedef union LDKCResult_PaymentHashPaymentSendFailureZPtr {
7906 * A pointer to the contents in the success state.
7907 * Reading from this pointer when `result_ok` is not set is undefined.
7909 struct LDKThirtyTwoBytes *result;
7911 * A pointer to the contents in the error state.
7912 * Reading from this pointer when `result_ok` is set is undefined.
7914 struct LDKPaymentSendFailure *err;
7915 } LDKCResult_PaymentHashPaymentSendFailureZPtr;
7918 * A CResult_PaymentHashPaymentSendFailureZ represents the result of a fallible operation,
7919 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
7920 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7922 typedef struct LDKCResult_PaymentHashPaymentSendFailureZ {
7924 * The contents of this CResult_PaymentHashPaymentSendFailureZ, accessible via either
7925 * `err` or `result` depending on the state of `result_ok`.
7927 union LDKCResult_PaymentHashPaymentSendFailureZPtr contents;
7929 * Whether this CResult_PaymentHashPaymentSendFailureZ represents a success state.
7932 } LDKCResult_PaymentHashPaymentSendFailureZ;
7935 * The contents of CResult_PaymentHashRetryableSendFailureZ
7937 typedef union LDKCResult_PaymentHashRetryableSendFailureZPtr {
7939 * A pointer to the contents in the success state.
7940 * Reading from this pointer when `result_ok` is not set is undefined.
7942 struct LDKThirtyTwoBytes *result;
7944 * A pointer to the contents in the error state.
7945 * Reading from this pointer when `result_ok` is set is undefined.
7947 enum LDKRetryableSendFailure *err;
7948 } LDKCResult_PaymentHashRetryableSendFailureZPtr;
7951 * A CResult_PaymentHashRetryableSendFailureZ represents the result of a fallible operation,
7952 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
7953 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7955 typedef struct LDKCResult_PaymentHashRetryableSendFailureZ {
7957 * The contents of this CResult_PaymentHashRetryableSendFailureZ, accessible via either
7958 * `err` or `result` depending on the state of `result_ok`.
7960 union LDKCResult_PaymentHashRetryableSendFailureZPtr contents;
7962 * Whether this CResult_PaymentHashRetryableSendFailureZ represents a success state.
7965 } LDKCResult_PaymentHashRetryableSendFailureZ;
7968 * A tuple of 2 elements. See the individual fields for the types contained.
7970 typedef struct LDKC2Tuple_PaymentHashPaymentIdZ {
7972 * The element at position 0
7974 struct LDKThirtyTwoBytes a;
7976 * The element at position 1
7978 struct LDKThirtyTwoBytes b;
7979 } LDKC2Tuple_PaymentHashPaymentIdZ;
7982 * The contents of CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ
7984 typedef union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr {
7986 * A pointer to the contents in the success state.
7987 * Reading from this pointer when `result_ok` is not set is undefined.
7989 struct LDKC2Tuple_PaymentHashPaymentIdZ *result;
7991 * A pointer to the contents in the error state.
7992 * Reading from this pointer when `result_ok` is set is undefined.
7994 struct LDKPaymentSendFailure *err;
7995 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr;
7998 * A CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents the result of a fallible operation,
7999 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentIdZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8000 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8002 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ {
8004 * The contents of this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ, accessible via either
8005 * `err` or `result` depending on the state of `result_ok`.
8007 union LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZPtr contents;
8009 * Whether this CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ represents a success state.
8012 } LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ;
8015 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
8016 * This corresponds to std::vector in C++
8018 typedef struct LDKCVec_ThirtyTwoBytesZ {
8020 * The elements in the array.
8021 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8023 struct LDKThirtyTwoBytes *data;
8025 * The number of elements pointed to by `data`.
8028 } LDKCVec_ThirtyTwoBytesZ;
8031 * A tuple of 2 elements. See the individual fields for the types contained.
8033 typedef struct LDKC2Tuple_PaymentHashPaymentSecretZ {
8035 * The element at position 0
8037 struct LDKThirtyTwoBytes a;
8039 * The element at position 1
8041 struct LDKThirtyTwoBytes b;
8042 } LDKC2Tuple_PaymentHashPaymentSecretZ;
8045 * The contents of CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ
8047 typedef union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr {
8049 * A pointer to the contents in the success state.
8050 * Reading from this pointer when `result_ok` is not set is undefined.
8052 struct LDKC2Tuple_PaymentHashPaymentSecretZ *result;
8054 * Note that this value is always NULL, as there are no contents in the Err variant
8057 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr;
8060 * A CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents the result of a fallible operation,
8061 * containing a crate::c_types::derived::C2Tuple_PaymentHashPaymentSecretZ on success and a () on failure.
8062 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8064 typedef struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ {
8066 * The contents of this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ, accessible via either
8067 * `err` or `result` depending on the state of `result_ok`.
8069 union LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZPtr contents;
8071 * Whether this CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ represents a success state.
8074 } LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ;
8077 * The contents of CResult_PaymentSecretNoneZ
8079 typedef union LDKCResult_PaymentSecretNoneZPtr {
8081 * A pointer to the contents in the success state.
8082 * Reading from this pointer when `result_ok` is not set is undefined.
8084 struct LDKThirtyTwoBytes *result;
8086 * Note that this value is always NULL, as there are no contents in the Err variant
8089 } LDKCResult_PaymentSecretNoneZPtr;
8092 * A CResult_PaymentSecretNoneZ represents the result of a fallible operation,
8093 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
8094 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8096 typedef struct LDKCResult_PaymentSecretNoneZ {
8098 * The contents of this CResult_PaymentSecretNoneZ, accessible via either
8099 * `err` or `result` depending on the state of `result_ok`.
8101 union LDKCResult_PaymentSecretNoneZPtr contents;
8103 * Whether this CResult_PaymentSecretNoneZ represents a success state.
8106 } LDKCResult_PaymentSecretNoneZ;
8109 * The contents of CResult_PaymentPreimageAPIErrorZ
8111 typedef union LDKCResult_PaymentPreimageAPIErrorZPtr {
8113 * A pointer to the contents in the success state.
8114 * Reading from this pointer when `result_ok` is not set is undefined.
8116 struct LDKThirtyTwoBytes *result;
8118 * A pointer to the contents in the error state.
8119 * Reading from this pointer when `result_ok` is set is undefined.
8121 struct LDKAPIError *err;
8122 } LDKCResult_PaymentPreimageAPIErrorZPtr;
8125 * A CResult_PaymentPreimageAPIErrorZ represents the result of a fallible operation,
8126 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
8127 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8129 typedef struct LDKCResult_PaymentPreimageAPIErrorZ {
8131 * The contents of this CResult_PaymentPreimageAPIErrorZ, accessible via either
8132 * `err` or `result` depending on the state of `result_ok`.
8134 union LDKCResult_PaymentPreimageAPIErrorZPtr contents;
8136 * Whether this CResult_PaymentPreimageAPIErrorZ represents a success state.
8139 } LDKCResult_PaymentPreimageAPIErrorZ;
8142 * An enum which can either contain a crate::c_types::derived::CVec_ChainHashZ or not
8144 typedef enum LDKCOption_CVec_ChainHashZZ_Tag {
8146 * When we're in this state, this COption_CVec_ChainHashZZ contains a crate::c_types::derived::CVec_ChainHashZ
8148 LDKCOption_CVec_ChainHashZZ_Some,
8150 * When we're in this state, this COption_CVec_ChainHashZZ contains nothing
8152 LDKCOption_CVec_ChainHashZZ_None,
8154 * Must be last for serialization purposes
8156 LDKCOption_CVec_ChainHashZZ_Sentinel,
8157 } LDKCOption_CVec_ChainHashZZ_Tag;
8159 typedef struct LDKCOption_CVec_ChainHashZZ {
8160 LDKCOption_CVec_ChainHashZZ_Tag tag;
8163 struct LDKCVec_ChainHashZ some;
8166 } LDKCOption_CVec_ChainHashZZ;
8171 * Information needed for constructing an invoice route hint for this channel.
8173 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
8175 * A pointer to the opaque Rust object.
8176 * Nearly everywhere, inner must be non-null, however in places where
8177 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8179 LDKnativeCounterpartyForwardingInfo *inner;
8181 * Indicates that this is the only struct which contains the same pointer.
8182 * Rust functions which take ownership of an object provided via an argument require
8183 * this to be true and invalidate the object pointed to by inner.
8186 } LDKCounterpartyForwardingInfo;
8189 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
8191 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
8193 * A pointer to the contents in the success state.
8194 * Reading from this pointer when `result_ok` is not set is undefined.
8196 struct LDKCounterpartyForwardingInfo *result;
8198 * A pointer to the contents in the error state.
8199 * Reading from this pointer when `result_ok` is set is undefined.
8201 struct LDKDecodeError *err;
8202 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
8205 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
8206 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8207 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8209 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
8211 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
8212 * `err` or `result` depending on the state of `result_ok`.
8214 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
8216 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
8219 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
8224 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
8225 * to better separate parameters.
8227 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
8229 * A pointer to the opaque Rust object.
8230 * Nearly everywhere, inner must be non-null, however in places where
8231 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8233 LDKnativeChannelCounterparty *inner;
8235 * Indicates that this is the only struct which contains the same pointer.
8236 * Rust functions which take ownership of an object provided via an argument require
8237 * this to be true and invalidate the object pointed to by inner.
8240 } LDKChannelCounterparty;
8243 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
8245 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
8247 * A pointer to the contents in the success state.
8248 * Reading from this pointer when `result_ok` is not set is undefined.
8250 struct LDKChannelCounterparty *result;
8252 * A pointer to the contents in the error state.
8253 * Reading from this pointer when `result_ok` is set is undefined.
8255 struct LDKDecodeError *err;
8256 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
8259 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
8260 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
8261 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8263 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
8265 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
8266 * `err` or `result` depending on the state of `result_ok`.
8268 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
8270 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
8273 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
8276 * The contents of CResult_ChannelDetailsDecodeErrorZ
8278 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
8280 * A pointer to the contents in the success state.
8281 * Reading from this pointer when `result_ok` is not set is undefined.
8283 struct LDKChannelDetails *result;
8285 * A pointer to the contents in the error state.
8286 * Reading from this pointer when `result_ok` is set is undefined.
8288 struct LDKDecodeError *err;
8289 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
8292 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
8293 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
8294 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8296 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
8298 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
8299 * `err` or `result` depending on the state of `result_ok`.
8301 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
8303 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
8306 } LDKCResult_ChannelDetailsDecodeErrorZ;
8311 * Route hints used in constructing invoices for [phantom node payents].
8313 * [phantom node payments]: crate::sign::PhantomKeysManager
8315 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
8317 * A pointer to the opaque Rust object.
8318 * Nearly everywhere, inner must be non-null, however in places where
8319 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8321 LDKnativePhantomRouteHints *inner;
8323 * Indicates that this is the only struct which contains the same pointer.
8324 * Rust functions which take ownership of an object provided via an argument require
8325 * this to be true and invalidate the object pointed to by inner.
8328 } LDKPhantomRouteHints;
8331 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
8333 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
8335 * A pointer to the contents in the success state.
8336 * Reading from this pointer when `result_ok` is not set is undefined.
8338 struct LDKPhantomRouteHints *result;
8340 * A pointer to the contents in the error state.
8341 * Reading from this pointer when `result_ok` is set is undefined.
8343 struct LDKDecodeError *err;
8344 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
8347 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
8348 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
8349 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8351 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
8353 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
8354 * `err` or `result` depending on the state of `result_ok`.
8356 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
8358 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
8361 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
8364 * The contents of CResult_ChannelShutdownStateDecodeErrorZ
8366 typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
8368 * A pointer to the contents in the success state.
8369 * Reading from this pointer when `result_ok` is not set is undefined.
8371 enum LDKChannelShutdownState *result;
8373 * A pointer to the contents in the error state.
8374 * Reading from this pointer when `result_ok` is set is undefined.
8376 struct LDKDecodeError *err;
8377 } LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
8380 * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
8381 * containing a crate::lightning::ln::channelmanager::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
8382 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8384 typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
8386 * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
8387 * `err` or `result` depending on the state of `result_ok`.
8389 union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
8391 * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
8394 } LDKCResult_ChannelShutdownStateDecodeErrorZ;
8399 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
8400 * on-chain transactions to ensure no loss of funds occurs.
8402 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
8403 * information and are actively monitoring the chain.
8405 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
8406 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
8407 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
8408 * returned block hash and the the current chain and then reconnecting blocks to get to the
8409 * best chain) upon deserializing the object!
8411 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
8413 * A pointer to the opaque Rust object.
8414 * Nearly everywhere, inner must be non-null, however in places where
8415 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8417 LDKnativeChannelMonitor *inner;
8419 * Indicates that this is the only struct which contains the same pointer.
8420 * Rust functions which take ownership of an object provided via an argument require
8421 * this to be true and invalidate the object pointed to by inner.
8424 } LDKChannelMonitor;
8427 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
8428 * This corresponds to std::vector in C++
8430 typedef struct LDKCVec_ChannelMonitorZ {
8432 * The elements in the array.
8433 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8435 struct LDKChannelMonitor *data;
8437 * The number of elements pointed to by `data`.
8440 } LDKCVec_ChannelMonitorZ;
8445 * An update generated by the underlying channel itself which contains some new information the
8446 * [`ChannelMonitor`] should be made aware of.
8448 * Because this represents only a small number of updates to the underlying state, it is generally
8449 * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
8450 * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
8451 * transaction), a single update may reach upwards of 1 MiB in serialized size.
8453 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
8455 * A pointer to the opaque Rust object.
8456 * Nearly everywhere, inner must be non-null, however in places where
8457 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8459 LDKnativeChannelMonitorUpdate *inner;
8461 * Indicates that this is the only struct which contains the same pointer.
8462 * Rust functions which take ownership of an object provided via an argument require
8463 * this to be true and invalidate the object pointed to by inner.
8466 } LDKChannelMonitorUpdate;
8469 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
8470 * blocks are connected and disconnected.
8472 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
8473 * responsible for maintaining a set of monitors such that they can be updated accordingly as
8474 * channel state changes and HTLCs are resolved. See method documentation for specific
8477 * Implementations **must** ensure that updates are successfully applied and persisted upon method
8478 * completion. If an update fails with a [`PermanentFailure`], then it must immediately shut down
8479 * without taking any further action such as persisting the current state.
8481 * If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
8482 * backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
8483 * could result in a revoked transaction being broadcast, allowing the counterparty to claim all
8484 * funds in the channel. See [`ChannelMonitorUpdateStatus`] for more details about how to handle
8485 * multiple instances.
8487 * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
8489 typedef struct LDKWatch {
8491 * An opaque pointer which is passed to your function implementations as an argument.
8492 * This has no meaning in the LDK, and can be NULL or any other value.
8496 * Watches a channel identified by `funding_txo` using `monitor`.
8498 * Implementations are responsible for watching the chain for the funding transaction along
8499 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
8500 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
8502 * Note: this interface MUST error with [`ChannelMonitorUpdateStatus::PermanentFailure`] if
8503 * the given `funding_txo` has previously been registered via `watch_channel`.
8505 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
8506 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
8507 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
8509 enum LDKChannelMonitorUpdateStatus (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
8511 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
8513 * Implementations must call [`update_monitor`] with the given update. See
8514 * [`ChannelMonitorUpdateStatus`] for invariants around returning an error.
8516 * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
8518 enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
8520 * Returns any monitor events since the last call. Subsequent calls must only return new
8523 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
8524 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
8527 * For details on asynchronous [`ChannelMonitor`] updating and returning
8528 * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
8530 struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
8532 * Frees any resources associated with this object given its this_arg pointer.
8533 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8535 void (*free)(void *this_arg);
8539 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
8540 * This corresponds to std::vector in C++
8542 typedef struct LDKCVec_TransactionZ {
8544 * The elements in the array.
8545 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8547 struct LDKTransaction *data;
8549 * The number of elements pointed to by `data`.
8552 } LDKCVec_TransactionZ;
8555 * An interface to send a transaction to the Bitcoin network.
8557 typedef struct LDKBroadcasterInterface {
8559 * An opaque pointer which is passed to your function implementations as an argument.
8560 * This has no meaning in the LDK, and can be NULL or any other value.
8564 * Sends a list of transactions out to (hopefully) be mined.
8565 * This only needs to handle the actual broadcasting of transactions, LDK will automatically
8566 * rebroadcast transactions that haven't made it into a block.
8568 * In some cases LDK may attempt to broadcast a transaction which double-spends another
8569 * and this isn't a bug and can be safely ignored.
8571 * If more than one transaction is given, these transactions should be considered to be a
8572 * package and broadcast together. Some of the transactions may or may not depend on each other,
8573 * be sure to manage both cases correctly.
8575 * Bitcoin transaction packages are defined in BIP 331 and here:
8576 * https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md
8578 void (*broadcast_transactions)(const void *this_arg, struct LDKCVec_TransactionZ txs);
8580 * Frees any resources associated with this object given its this_arg pointer.
8581 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8583 void (*free)(void *this_arg);
8584 } LDKBroadcasterInterface;
8587 * A trait that describes a source of entropy.
8589 typedef struct LDKEntropySource {
8591 * An opaque pointer which is passed to your function implementations as an argument.
8592 * This has no meaning in the LDK, and can be NULL or any other value.
8596 * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
8597 * different value each time it is called.
8599 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
8601 * Frees any resources associated with this object given its this_arg pointer.
8602 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8604 void (*free)(void *this_arg);
8608 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
8609 * own the memory pointed to by data.
8611 typedef struct LDKu8slice {
8613 * A pointer to the byte buffer
8615 const uint8_t *data;
8617 * The number of bytes pointed to by `data`.
8625 * The unsigned part of a [`channel_update`] message.
8627 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
8629 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
8631 * A pointer to the opaque Rust object.
8632 * Nearly everywhere, inner must be non-null, however in places where
8633 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8635 LDKnativeUnsignedChannelUpdate *inner;
8637 * Indicates that this is the only struct which contains the same pointer.
8638 * Rust functions which take ownership of an object provided via an argument require
8639 * this to be true and invalidate the object pointed to by inner.
8642 } LDKUnsignedChannelUpdate;
8647 * The unsigned part of a [`node_announcement`] message.
8649 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
8651 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
8653 * A pointer to the opaque Rust object.
8654 * Nearly everywhere, inner must be non-null, however in places where
8655 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8657 LDKnativeUnsignedNodeAnnouncement *inner;
8659 * Indicates that this is the only struct which contains the same pointer.
8660 * Rust functions which take ownership of an object provided via an argument require
8661 * this to be true and invalidate the object pointed to by inner.
8664 } LDKUnsignedNodeAnnouncement;
8667 * Represents the set of gossip messages that require a signature from a node's identity key.
8669 typedef enum LDKUnsignedGossipMessage_Tag {
8671 * An unsigned channel announcement.
8673 LDKUnsignedGossipMessage_ChannelAnnouncement,
8675 * An unsigned channel update.
8677 LDKUnsignedGossipMessage_ChannelUpdate,
8679 * An unsigned node announcement.
8681 LDKUnsignedGossipMessage_NodeAnnouncement,
8683 * Must be last for serialization purposes
8685 LDKUnsignedGossipMessage_Sentinel,
8686 } LDKUnsignedGossipMessage_Tag;
8688 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
8689 LDKUnsignedGossipMessage_Tag tag;
8692 struct LDKUnsignedChannelAnnouncement channel_announcement;
8695 struct LDKUnsignedChannelUpdate channel_update;
8698 struct LDKUnsignedNodeAnnouncement node_announcement;
8701 } LDKUnsignedGossipMessage;
8704 * A trait that can handle cryptographic operations at the scope level of a node.
8706 typedef struct LDKNodeSigner {
8708 * An opaque pointer which is passed to your function implementations as an argument.
8709 * This has no meaning in the LDK, and can be NULL or any other value.
8713 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
8715 * If the implementor of this trait supports [phantom node payments], then every node that is
8716 * intended to be included in the phantom invoice route hints must return the same value from
8719 * This method must return the same value each time it is called.
8721 * [phantom node payments]: PhantomKeysManager
8723 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
8725 * Get node id based on the provided [`Recipient`].
8727 * This method must return the same value each time it is called with a given [`Recipient`]
8730 * Errors if the [`Recipient`] variant is not supported by the implementation.
8732 struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
8734 * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
8735 * one is provided. Note that this tweak can be applied to `other_key` instead of our node
8736 * secret, though this is less efficient.
8738 * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
8739 * should be resolved to allow LDK to resume forwarding HTLCs.
8741 * Errors if the [`Recipient`] variant is not supported by the implementation.
8743 struct LDKCResult_SharedSecretNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_ScalarZ tweak);
8747 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
8748 * this trait to parse the invoice and make sure they're signing what they expect, rather than
8749 * blindly signing the hash.
8751 * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
8753 * The secret key used to sign the invoice is dependent on the [`Recipient`].
8755 * Errors if the [`Recipient`] variant is not supported by the implementation.
8757 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
8759 * Sign a gossip message.
8761 * Note that if this fails, LDK may panic and the message will not be broadcast to the network
8762 * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
8763 * message to be broadcast, as otherwise it may prevent one from receiving funds over the
8764 * corresponding channel.
8766 struct LDKCResult_SignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
8768 * Frees any resources associated with this object given its this_arg pointer.
8769 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8771 void (*free)(void *this_arg);
8775 * A trait that can return signer instances for individual channels.
8777 typedef struct LDKSignerProvider {
8779 * An opaque pointer which is passed to your function implementations as an argument.
8780 * This has no meaning in the LDK, and can be NULL or any other value.
8784 * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::Signer`] through
8785 * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
8786 * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
8787 * `channel_keys_id`.
8789 * This method must return a different value each time it is called.
8791 struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
8793 * Derives the private key material backing a `Signer`.
8795 * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
8796 * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
8797 * re-derived from its `channel_keys_id`, which can be obtained through its trait method
8798 * [`ChannelSigner::channel_keys_id`].
8800 struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
8802 * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
8803 * This is only called during deserialization of other objects which contain
8804 * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
8805 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
8806 * contain no versioning scheme. You may wish to include your own version prefix and ensure
8807 * you've read all of the provided bytes to ensure no corruption occurred.
8809 * This method is slowly being phased out -- it will only be called when reading objects
8810 * written by LDK versions prior to 0.0.113.
8812 * [`Signer`]: Self::Signer
8813 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
8814 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
8816 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
8818 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
8820 * If this function returns an error, this will result in a channel failing to open.
8822 * This method should return a different value each time it is called, to avoid linking
8823 * on-chain funds across channels as controlled to the same user.
8825 struct LDKCResult_ScriptNoneZ (*get_destination_script)(const void *this_arg);
8827 * Get a script pubkey which we will send funds to when closing a channel.
8829 * If this function returns an error, this will result in a channel failing to open or close.
8830 * In the event of a failure when the counterparty is initiating a close, this can result in a
8831 * channel force close.
8833 * This method should return a different value each time it is called, to avoid linking
8834 * on-chain funds across channels as controlled to the same user.
8836 struct LDKCResult_ShutdownScriptNoneZ (*get_shutdown_scriptpubkey)(const void *this_arg);
8838 * Frees any resources associated with this object given its this_arg pointer.
8839 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8841 void (*free)(void *this_arg);
8842 } LDKSignerProvider;
8845 * A trait which should be implemented to provide feerate information on a number of time
8848 * If access to a local mempool is not feasible, feerate estimates should be fetched from a set of
8849 * third-parties hosting them. Note that this enables them to affect the propagation of your
8850 * pre-signed transactions at any time and therefore endangers the safety of channels funds. It
8851 * should be considered carefully as a deployment.
8853 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
8854 * called from inside the library in response to chain events, P2P events, or timer events).
8856 typedef struct LDKFeeEstimator {
8858 * An opaque pointer which is passed to your function implementations as an argument.
8859 * This has no meaning in the LDK, and can be NULL or any other value.
8863 * Gets estimated satoshis of fee required per 1000 Weight-Units.
8865 * LDK will wrap this method and ensure that the value returned is no smaller than 253
8866 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
8868 * The following unit conversions can be used to convert to sats/KW:
8869 * * satoshis-per-byte * 250
8870 * * satoshis-per-kbyte / 4
8872 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
8874 * Frees any resources associated with this object given its this_arg pointer.
8875 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8877 void (*free)(void *this_arg);
8881 * A trait defining behavior for routing a payment.
8883 typedef struct LDKRouter {
8885 * An opaque pointer which is passed to your function implementations as an argument.
8886 * This has no meaning in the LDK, and can be NULL or any other value.
8890 * Finds a [`Route`] for a payment between the given `payer` and a payee.
8892 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
8893 * and [`RouteParameters::final_value_msat`], respectively.
8895 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
8897 struct LDKCResult_RouteLightningErrorZ (*find_route)(const void *this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs);
8899 * Finds a [`Route`] for a payment between the given `payer` and a payee.
8901 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
8902 * and [`RouteParameters::final_value_msat`], respectively.
8904 * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific
8907 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
8909 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, struct LDKInFlightHtlcs inflight_htlcs, struct LDKThirtyTwoBytes _payment_hash, struct LDKThirtyTwoBytes _payment_id);
8911 * Frees any resources associated with this object given its this_arg pointer.
8912 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
8914 void (*free)(void *this_arg);
8920 * Manager which keeps track of a number of channels and sends messages to the appropriate
8921 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
8923 * Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through
8924 * to individual Channels.
8926 * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
8927 * all peers during write/read (though does not modify this instance, only the instance being
8928 * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
8929 * called [`funding_transaction_generated`] for outbound channels) being closed.
8931 * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
8932 * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST write each monitor update out to disk before
8933 * returning from [`chain::Watch::watch_channel`]/[`update_channel`], with ChannelManagers, writing updates
8934 * happens out-of-band (and will prevent any other `ChannelManager` operations from occurring during
8935 * the serialization process). If the deserialized version is out-of-date compared to the
8936 * [`ChannelMonitor`] passed by reference to [`read`], those channels will be force-closed based on the
8937 * `ChannelMonitor` state and no funds will be lost (mod on-chain transaction fees).
8939 * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
8940 * tells you the last block hash which was connected. You should get the best block tip before using the manager.
8941 * See [`chain::Listen`] and [`chain::Confirm`] for more details.
8943 * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
8944 * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
8945 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
8946 * offline for a full minute. In order to track this, you must call
8947 * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
8949 * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
8950 * inbound channels without confirmed funding transactions. This may result in nodes which we do
8951 * not have a channel with being unable to connect to us or open new channels with us if we have
8952 * many peers with unfunded channels.
8954 * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
8955 * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
8956 * never limited. Please ensure you limit the count of such channels yourself.
8958 * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
8959 * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
8960 * essentially you should default to using a [`SimpleRefChannelManager`], and use a
8961 * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
8962 * you're using lightning-net-tokio.
8964 * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
8965 * [`funding_created`]: msgs::FundingCreated
8966 * [`funding_transaction_generated`]: Self::funding_transaction_generated
8967 * [`BlockHash`]: bitcoin::hash_types::BlockHash
8968 * [`update_channel`]: chain::Watch::update_channel
8969 * [`ChannelUpdate`]: msgs::ChannelUpdate
8970 * [`timer_tick_occurred`]: Self::timer_tick_occurred
8971 * [`read`]: ReadableArgs::read
8973 typedef struct MUST_USE_STRUCT LDKChannelManager {
8975 * A pointer to the opaque Rust object.
8976 * Nearly everywhere, inner must be non-null, however in places where
8977 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8979 LDKnativeChannelManager *inner;
8981 * Indicates that this is the only struct which contains the same pointer.
8982 * Rust functions which take ownership of an object provided via an argument require
8983 * this to be true and invalidate the object pointed to by inner.
8986 } LDKChannelManager;
8989 * A tuple of 2 elements. See the individual fields for the types contained.
8991 typedef struct LDKC2Tuple_BlockHashChannelManagerZ {
8993 * The element at position 0
8995 struct LDKThirtyTwoBytes a;
8997 * The element at position 1
8999 struct LDKChannelManager b;
9000 } LDKC2Tuple_BlockHashChannelManagerZ;
9003 * The contents of CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ
9005 typedef union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr {
9007 * A pointer to the contents in the success state.
9008 * Reading from this pointer when `result_ok` is not set is undefined.
9010 struct LDKC2Tuple_BlockHashChannelManagerZ *result;
9012 * A pointer to the contents in the error state.
9013 * Reading from this pointer when `result_ok` is set is undefined.
9015 struct LDKDecodeError *err;
9016 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr;
9019 * A CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents the result of a fallible operation,
9020 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9021 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9023 typedef struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ {
9025 * The contents of this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ, accessible via either
9026 * `err` or `result` depending on the state of `result_ok`.
9028 union LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZPtr contents;
9030 * Whether this CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ represents a success state.
9033 } LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ;
9036 * Options for how to set the max dust HTLC exposure allowed on a channel. See
9037 * [`ChannelConfig::max_dust_htlc_exposure`] for details.
9039 typedef enum LDKMaxDustHTLCExposure_Tag {
9041 * This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low
9042 * may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this
9043 * limit is very important to prevent stealing of large amounts of dust HTLCs by miners
9044 * through [fee griefing
9045 * attacks](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-May/002714.html).
9047 * Note that if the feerate increases significantly, without a manual increase
9048 * to this maximum the channel may be unable to send/receive HTLCs between the maximum dust
9049 * exposure and the new minimum value for HTLCs to be economically viable to claim.
9051 LDKMaxDustHTLCExposure_FixedLimitMsat,
9053 * This sets a multiplier on the estimated high priority feerate (sats/KW, as obtained from
9054 * [`FeeEstimator`]) to determine the maximum allowed dust exposure. If this variant is used
9055 * then the maximum dust exposure in millisatoshis is calculated as:
9056 * `high_priority_feerate_per_kw * value`. For example, with our default value
9057 * `FeeRateMultiplier(5000)`:
9059 * - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
9060 * defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
9061 * be 253 * 5000 = 1,265,000 msats.
9062 * - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
9063 * 7500 * 5000 = 37,500,000 msats.
9065 * This allows the maximum dust exposure to automatically scale with fee rate changes.
9067 * Note, if you're using a third-party fee estimator, this may leave you more exposed to a
9068 * fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
9069 * causing you to accept more dust HTLCs than you would otherwise.
9071 * This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included
9072 * on HTLC outputs means your channel may be subject to more dust exposure in the event of
9073 * increases in fee rate.
9075 * # Backwards Compatibility
9076 * This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
9077 * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
9079 * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
9081 LDKMaxDustHTLCExposure_FeeRateMultiplier,
9083 * Must be last for serialization purposes
9085 LDKMaxDustHTLCExposure_Sentinel,
9086 } LDKMaxDustHTLCExposure_Tag;
9088 typedef struct MUST_USE_STRUCT LDKMaxDustHTLCExposure {
9089 LDKMaxDustHTLCExposure_Tag tag;
9092 uint64_t fixed_limit_msat;
9095 uint64_t fee_rate_multiplier;
9098 } LDKMaxDustHTLCExposure;
9101 * The contents of CResult_MaxDustHTLCExposureDecodeErrorZ
9103 typedef union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr {
9105 * A pointer to the contents in the success state.
9106 * Reading from this pointer when `result_ok` is not set is undefined.
9108 struct LDKMaxDustHTLCExposure *result;
9110 * A pointer to the contents in the error state.
9111 * Reading from this pointer when `result_ok` is set is undefined.
9113 struct LDKDecodeError *err;
9114 } LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr;
9117 * A CResult_MaxDustHTLCExposureDecodeErrorZ represents the result of a fallible operation,
9118 * containing a crate::lightning::util::config::MaxDustHTLCExposure on success and a crate::lightning::ln::msgs::DecodeError on failure.
9119 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9121 typedef struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ {
9123 * The contents of this CResult_MaxDustHTLCExposureDecodeErrorZ, accessible via either
9124 * `err` or `result` depending on the state of `result_ok`.
9126 union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr contents;
9128 * Whether this CResult_MaxDustHTLCExposureDecodeErrorZ represents a success state.
9131 } LDKCResult_MaxDustHTLCExposureDecodeErrorZ;
9136 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
9137 * with our counterparty.
9139 typedef struct MUST_USE_STRUCT LDKChannelConfig {
9141 * A pointer to the opaque Rust object.
9142 * Nearly everywhere, inner must be non-null, however in places where
9143 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9145 LDKnativeChannelConfig *inner;
9147 * Indicates that this is the only struct which contains the same pointer.
9148 * Rust functions which take ownership of an object provided via an argument require
9149 * this to be true and invalidate the object pointed to by inner.
9155 * The contents of CResult_ChannelConfigDecodeErrorZ
9157 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
9159 * A pointer to the contents in the success state.
9160 * Reading from this pointer when `result_ok` is not set is undefined.
9162 struct LDKChannelConfig *result;
9164 * A pointer to the contents in the error state.
9165 * Reading from this pointer when `result_ok` is set is undefined.
9167 struct LDKDecodeError *err;
9168 } LDKCResult_ChannelConfigDecodeErrorZPtr;
9171 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
9172 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
9173 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9175 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
9177 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
9178 * `err` or `result` depending on the state of `result_ok`.
9180 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
9182 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
9185 } LDKCResult_ChannelConfigDecodeErrorZ;
9188 * An enum which can either contain a crate::lightning::util::config::MaxDustHTLCExposure or not
9190 typedef enum LDKCOption_MaxDustHTLCExposureZ_Tag {
9192 * When we're in this state, this COption_MaxDustHTLCExposureZ contains a crate::lightning::util::config::MaxDustHTLCExposure
9194 LDKCOption_MaxDustHTLCExposureZ_Some,
9196 * When we're in this state, this COption_MaxDustHTLCExposureZ contains nothing
9198 LDKCOption_MaxDustHTLCExposureZ_None,
9200 * Must be last for serialization purposes
9202 LDKCOption_MaxDustHTLCExposureZ_Sentinel,
9203 } LDKCOption_MaxDustHTLCExposureZ_Tag;
9205 typedef struct LDKCOption_MaxDustHTLCExposureZ {
9206 LDKCOption_MaxDustHTLCExposureZ_Tag tag;
9209 struct LDKMaxDustHTLCExposure some;
9212 } LDKCOption_MaxDustHTLCExposureZ;
9215 * An enum which can either contain a crate::lightning::util::errors::APIError or not
9217 typedef enum LDKCOption_APIErrorZ_Tag {
9219 * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
9221 LDKCOption_APIErrorZ_Some,
9223 * When we're in this state, this COption_APIErrorZ contains nothing
9225 LDKCOption_APIErrorZ_None,
9227 * Must be last for serialization purposes
9229 LDKCOption_APIErrorZ_Sentinel,
9230 } LDKCOption_APIErrorZ_Tag;
9232 typedef struct LDKCOption_APIErrorZ {
9233 LDKCOption_APIErrorZ_Tag tag;
9236 struct LDKAPIError some;
9239 } LDKCOption_APIErrorZ;
9242 * The contents of CResult_COption_APIErrorZDecodeErrorZ
9244 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
9246 * A pointer to the contents in the success state.
9247 * Reading from this pointer when `result_ok` is not set is undefined.
9249 struct LDKCOption_APIErrorZ *result;
9251 * A pointer to the contents in the error state.
9252 * Reading from this pointer when `result_ok` is set is undefined.
9254 struct LDKDecodeError *err;
9255 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
9258 * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
9259 * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9260 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9262 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
9264 * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
9265 * `err` or `result` depending on the state of `result_ok`.
9267 union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
9269 * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
9272 } LDKCResult_COption_APIErrorZDecodeErrorZ;
9275 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
9277 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
9279 * A pointer to the contents in the success state.
9280 * Reading from this pointer when `result_ok` is not set is undefined.
9282 struct LDKChannelMonitorUpdate *result;
9284 * A pointer to the contents in the error state.
9285 * Reading from this pointer when `result_ok` is set is undefined.
9287 struct LDKDecodeError *err;
9288 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
9291 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
9292 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9293 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9295 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
9297 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
9298 * `err` or `result` depending on the state of `result_ok`.
9300 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
9302 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
9305 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
9308 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
9310 typedef enum LDKCOption_MonitorEventZ_Tag {
9312 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
9314 LDKCOption_MonitorEventZ_Some,
9316 * When we're in this state, this COption_MonitorEventZ contains nothing
9318 LDKCOption_MonitorEventZ_None,
9320 * Must be last for serialization purposes
9322 LDKCOption_MonitorEventZ_Sentinel,
9323 } LDKCOption_MonitorEventZ_Tag;
9325 typedef struct LDKCOption_MonitorEventZ {
9326 LDKCOption_MonitorEventZ_Tag tag;
9329 struct LDKMonitorEvent some;
9332 } LDKCOption_MonitorEventZ;
9335 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
9337 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
9339 * A pointer to the contents in the success state.
9340 * Reading from this pointer when `result_ok` is not set is undefined.
9342 struct LDKCOption_MonitorEventZ *result;
9344 * A pointer to the contents in the error state.
9345 * Reading from this pointer when `result_ok` is set is undefined.
9347 struct LDKDecodeError *err;
9348 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
9351 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
9352 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9353 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9355 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
9357 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
9358 * `err` or `result` depending on the state of `result_ok`.
9360 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
9362 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
9365 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
9368 * The contents of CResult_HTLCUpdateDecodeErrorZ
9370 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
9372 * A pointer to the contents in the success state.
9373 * Reading from this pointer when `result_ok` is not set is undefined.
9375 struct LDKHTLCUpdate *result;
9377 * A pointer to the contents in the error state.
9378 * Reading from this pointer when `result_ok` is set is undefined.
9380 struct LDKDecodeError *err;
9381 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
9384 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
9385 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
9386 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9388 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
9390 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
9391 * `err` or `result` depending on the state of `result_ok`.
9393 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
9395 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
9398 } LDKCResult_HTLCUpdateDecodeErrorZ;
9401 * A tuple of 2 elements. See the individual fields for the types contained.
9403 typedef struct LDKC2Tuple_OutPointScriptZ {
9405 * The element at position 0
9407 struct LDKOutPoint a;
9409 * The element at position 1
9411 struct LDKCVec_u8Z b;
9412 } LDKC2Tuple_OutPointScriptZ;
9415 * A tuple of 2 elements. See the individual fields for the types contained.
9417 typedef struct LDKC2Tuple_u32ScriptZ {
9419 * The element at position 0
9423 * The element at position 1
9425 struct LDKCVec_u8Z b;
9426 } LDKC2Tuple_u32ScriptZ;
9429 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32ScriptZs of arbitrary size.
9430 * This corresponds to std::vector in C++
9432 typedef struct LDKCVec_C2Tuple_u32ScriptZZ {
9434 * The elements in the array.
9435 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9437 struct LDKC2Tuple_u32ScriptZ *data;
9439 * The number of elements pointed to by `data`.
9442 } LDKCVec_C2Tuple_u32ScriptZZ;
9445 * A tuple of 2 elements. See the individual fields for the types contained.
9447 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ {
9449 * The element at position 0
9451 struct LDKThirtyTwoBytes a;
9453 * The element at position 1
9455 struct LDKCVec_C2Tuple_u32ScriptZZ b;
9456 } LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ;
9459 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZs of arbitrary size.
9460 * This corresponds to std::vector in C++
9462 typedef struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
9464 * The elements in the array.
9465 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9467 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *data;
9469 * The number of elements pointed to by `data`.
9472 } LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ;
9475 * A tuple of 2 elements. See the individual fields for the types contained.
9477 typedef struct LDKC2Tuple_u32TxOutZ {
9479 * The element at position 0
9483 * The element at position 1
9486 } LDKC2Tuple_u32TxOutZ;
9489 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
9490 * This corresponds to std::vector in C++
9492 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
9494 * The elements in the array.
9495 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9497 struct LDKC2Tuple_u32TxOutZ *data;
9499 * The number of elements pointed to by `data`.
9502 } LDKCVec_C2Tuple_u32TxOutZZ;
9505 * A tuple of 2 elements. See the individual fields for the types contained.
9507 typedef struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
9509 * The element at position 0
9511 struct LDKThirtyTwoBytes a;
9513 * The element at position 1
9515 struct LDKCVec_C2Tuple_u32TxOutZZ b;
9516 } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
9519 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
9520 * This corresponds to std::vector in C++
9522 typedef struct LDKCVec_TransactionOutputsZ {
9524 * The elements in the array.
9525 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9527 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *data;
9529 * The number of elements pointed to by `data`.
9532 } LDKCVec_TransactionOutputsZ;
9535 * Details about the balance(s) available for spending once the channel appears on chain.
9537 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
9540 typedef enum LDKBalance_Tag {
9542 * The channel is not yet closed (or the commitment or closing transaction has not yet
9543 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
9546 LDKBalance_ClaimableOnChannelClose,
9548 * The channel has been closed, and the given balance is ours but awaiting confirmations until
9549 * we consider it spendable.
9551 LDKBalance_ClaimableAwaitingConfirmations,
9553 * The channel has been closed, and the given balance should be ours but awaiting spending
9554 * transaction confirmation. If the spending transaction does not confirm in time, it is
9555 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
9557 * Once the spending transaction confirms, before it has reached enough confirmations to be
9558 * considered safe from chain reorganizations, the balance will instead be provided via
9559 * [`Balance::ClaimableAwaitingConfirmations`].
9561 LDKBalance_ContentiousClaimable,
9563 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
9564 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
9565 * likely to be claimed by our counterparty before we do.
9567 LDKBalance_MaybeTimeoutClaimableHTLC,
9569 * HTLCs which we received from our counterparty which are claimable with a preimage which we
9570 * do not currently have. This will only be claimable if we receive the preimage from the node
9571 * to which we forwarded this HTLC before the timeout.
9573 LDKBalance_MaybePreimageClaimableHTLC,
9575 * The channel has been closed, and our counterparty broadcasted a revoked commitment
9578 * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
9581 LDKBalance_CounterpartyRevokedOutputClaimable,
9583 * Must be last for serialization purposes
9585 LDKBalance_Sentinel,
9588 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
9590 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9591 * required to do so.
9593 uint64_t claimable_amount_satoshis;
9594 } LDKBalance_LDKClaimableOnChannelClose_Body;
9596 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
9598 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
9599 * were spent in broadcasting the transaction.
9601 uint64_t claimable_amount_satoshis;
9603 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
9606 uint32_t confirmation_height;
9607 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
9609 typedef struct LDKBalance_LDKContentiousClaimable_Body {
9611 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
9612 * required to do so.
9614 uint64_t claimable_amount_satoshis;
9616 * The height at which the counterparty may be able to claim the balance if we have not
9619 uint32_t timeout_height;
9621 * The payment hash that locks this HTLC.
9623 struct LDKThirtyTwoBytes payment_hash;
9625 * The preimage that can be used to claim this HTLC.
9627 struct LDKThirtyTwoBytes payment_preimage;
9628 } LDKBalance_LDKContentiousClaimable_Body;
9630 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
9632 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
9633 * which will be required to do so.
9635 uint64_t claimable_amount_satoshis;
9637 * The height at which we will be able to claim the balance if our counterparty has not
9640 uint32_t claimable_height;
9642 * The payment hash whose preimage our counterparty needs to claim this HTLC.
9644 struct LDKThirtyTwoBytes payment_hash;
9645 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
9647 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
9649 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
9650 * which will be required to do so.
9652 uint64_t claimable_amount_satoshis;
9654 * The height at which our counterparty will be able to claim the balance if we have not
9655 * yet received the preimage and claimed it ourselves.
9657 uint32_t expiry_height;
9659 * The payment hash whose preimage we need to claim this HTLC.
9661 struct LDKThirtyTwoBytes payment_hash;
9662 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
9664 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
9666 * The amount, in satoshis, of the output which we can claim.
9668 * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
9669 * were already spent.
9671 uint64_t claimable_amount_satoshis;
9672 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
9674 typedef struct MUST_USE_STRUCT LDKBalance {
9677 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
9678 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
9679 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
9680 LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
9681 LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
9682 LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
9687 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
9688 * This corresponds to std::vector in C++
9690 typedef struct LDKCVec_BalanceZ {
9692 * The elements in the array.
9693 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9695 struct LDKBalance *data;
9697 * The number of elements pointed to by `data`.
9703 * A tuple of 2 elements. See the individual fields for the types contained.
9705 typedef struct LDKC2Tuple_BlockHashChannelMonitorZ {
9707 * The element at position 0
9709 struct LDKThirtyTwoBytes a;
9711 * The element at position 1
9713 struct LDKChannelMonitor b;
9714 } LDKC2Tuple_BlockHashChannelMonitorZ;
9717 * The contents of CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ
9719 typedef union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr {
9721 * A pointer to the contents in the success state.
9722 * Reading from this pointer when `result_ok` is not set is undefined.
9724 struct LDKC2Tuple_BlockHashChannelMonitorZ *result;
9726 * A pointer to the contents in the error state.
9727 * Reading from this pointer when `result_ok` is set is undefined.
9729 struct LDKDecodeError *err;
9730 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr;
9733 * A CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
9734 * containing a crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
9735 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9737 typedef struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ {
9739 * The contents of this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ, accessible via either
9740 * `err` or `result` depending on the state of `result_ok`.
9742 union LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZPtr contents;
9744 * Whether this CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ represents a success state.
9747 } LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ;
9750 * Defines a type identifier for sending messages over the wire.
9752 * Messages implementing this trait specify a type and must be [`Writeable`].
9754 typedef struct LDKType {
9756 * An opaque pointer which is passed to your function implementations as an argument.
9757 * This has no meaning in the LDK, and can be NULL or any other value.
9761 * Returns the type identifying the message payload.
9763 uint16_t (*type_id)(const void *this_arg);
9765 * Return a human-readable "debug" string describing this object
9767 struct LDKStr (*debug_str)(const void *this_arg);
9769 * Serialize the object into a byte array
9771 struct LDKCVec_u8Z (*write)(const void *this_arg);
9773 * Frees any resources associated with this object given its this_arg pointer.
9774 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9776 void (*free)(void *this_arg);
9780 * A tuple of 2 elements. See the individual fields for the types contained.
9782 typedef struct LDKC2Tuple_PublicKeyTypeZ {
9784 * The element at position 0
9786 struct LDKPublicKey a;
9788 * The element at position 1
9791 } LDKC2Tuple_PublicKeyTypeZ;
9794 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
9795 * This corresponds to std::vector in C++
9797 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
9799 * The elements in the array.
9800 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9802 struct LDKC2Tuple_PublicKeyTypeZ *data;
9804 * The number of elements pointed to by `data`.
9807 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
9812 * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`].
9814 * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request
9815 * specifies these such that its recipient can send an invoice for payment.
9817 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
9818 * [`Offer`]: crate::offers::offer::Offer
9820 typedef struct MUST_USE_STRUCT LDKInvoiceRequest {
9822 * A pointer to the opaque Rust object.
9823 * Nearly everywhere, inner must be non-null, however in places where
9824 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9826 LDKnativeInvoiceRequest *inner;
9828 * Indicates that this is the only struct which contains the same pointer.
9829 * Rust functions which take ownership of an object provided via an argument require
9830 * this to be true and invalidate the object pointed to by inner.
9833 } LDKInvoiceRequest;
9838 * A `Bolt12Invoice` is a payment request, typically corresponding to an [`Offer`] or a [`Refund`].
9840 * An invoice may be sent in response to an [`InvoiceRequest`] in the case of an offer or sent
9841 * directly after scanning a refund. It includes all the information needed to pay a recipient.
9843 * [`Offer`]: crate::offers::offer::Offer
9844 * [`Refund`]: crate::offers::refund::Refund
9845 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
9847 typedef struct MUST_USE_STRUCT LDKBolt12Invoice {
9849 * A pointer to the opaque Rust object.
9850 * Nearly everywhere, inner must be non-null, however in places where
9851 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9853 LDKnativeBolt12Invoice *inner;
9855 * Indicates that this is the only struct which contains the same pointer.
9856 * Rust functions which take ownership of an object provided via an argument require
9857 * this to be true and invalidate the object pointed to by inner.
9865 * An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
9867 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
9868 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
9870 typedef struct MUST_USE_STRUCT LDKInvoiceError {
9872 * A pointer to the opaque Rust object.
9873 * Nearly everywhere, inner must be non-null, however in places where
9874 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9876 LDKnativeInvoiceError *inner;
9878 * Indicates that this is the only struct which contains the same pointer.
9879 * Rust functions which take ownership of an object provided via an argument require
9880 * this to be true and invalidate the object pointed to by inner.
9886 * Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`].
9888 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
9890 typedef enum LDKOffersMessage_Tag {
9892 * A request for a [`Bolt12Invoice`] for a particular [`Offer`].
9894 * [`Offer`]: crate::offers::offer::Offer
9896 LDKOffersMessage_InvoiceRequest,
9898 * A [`Bolt12Invoice`] sent in response to an [`InvoiceRequest`] or a [`Refund`].
9900 * [`Refund`]: crate::offers::refund::Refund
9902 LDKOffersMessage_Invoice,
9904 * An error from handling an [`OffersMessage`].
9906 LDKOffersMessage_InvoiceError,
9908 * Must be last for serialization purposes
9910 LDKOffersMessage_Sentinel,
9911 } LDKOffersMessage_Tag;
9913 typedef struct MUST_USE_STRUCT LDKOffersMessage {
9914 LDKOffersMessage_Tag tag;
9917 struct LDKInvoiceRequest invoice_request;
9920 struct LDKBolt12Invoice invoice;
9923 struct LDKInvoiceError invoice_error;
9929 * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not
9931 typedef enum LDKCOption_OffersMessageZ_Tag {
9933 * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage
9935 LDKCOption_OffersMessageZ_Some,
9937 * When we're in this state, this COption_OffersMessageZ contains nothing
9939 LDKCOption_OffersMessageZ_None,
9941 * Must be last for serialization purposes
9943 LDKCOption_OffersMessageZ_Sentinel,
9944 } LDKCOption_OffersMessageZ_Tag;
9946 typedef struct LDKCOption_OffersMessageZ {
9947 LDKCOption_OffersMessageZ_Tag tag;
9950 struct LDKOffersMessage some;
9953 } LDKCOption_OffersMessageZ;
9956 * The contents of a custom onion message.
9958 typedef struct LDKCustomOnionMessageContents {
9960 * An opaque pointer which is passed to your function implementations as an argument.
9961 * This has no meaning in the LDK, and can be NULL or any other value.
9965 * Returns the TLV type identifying the message contents. MUST be >= 64.
9967 uint64_t (*tlv_type)(const void *this_arg);
9969 * Serialize the object into a byte array
9971 struct LDKCVec_u8Z (*write)(const void *this_arg);
9973 * Frees any resources associated with this object given its this_arg pointer.
9974 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
9976 void (*free)(void *this_arg);
9977 } LDKCustomOnionMessageContents;
9980 * An enum which can either contain a crate::lightning::onion_message::packet::CustomOnionMessageContents or not
9982 typedef enum LDKCOption_CustomOnionMessageContentsZ_Tag {
9984 * When we're in this state, this COption_CustomOnionMessageContentsZ contains a crate::lightning::onion_message::packet::CustomOnionMessageContents
9986 LDKCOption_CustomOnionMessageContentsZ_Some,
9988 * When we're in this state, this COption_CustomOnionMessageContentsZ contains nothing
9990 LDKCOption_CustomOnionMessageContentsZ_None,
9992 * Must be last for serialization purposes
9994 LDKCOption_CustomOnionMessageContentsZ_Sentinel,
9995 } LDKCOption_CustomOnionMessageContentsZ_Tag;
9997 typedef struct LDKCOption_CustomOnionMessageContentsZ {
9998 LDKCOption_CustomOnionMessageContentsZ_Tag tag;
10001 struct LDKCustomOnionMessageContents some;
10004 } LDKCOption_CustomOnionMessageContentsZ;
10007 * The contents of CResult_COption_CustomOnionMessageContentsZDecodeErrorZ
10009 typedef union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr {
10011 * A pointer to the contents in the success state.
10012 * Reading from this pointer when `result_ok` is not set is undefined.
10014 struct LDKCOption_CustomOnionMessageContentsZ *result;
10016 * A pointer to the contents in the error state.
10017 * Reading from this pointer when `result_ok` is set is undefined.
10019 struct LDKDecodeError *err;
10020 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr;
10023 * A CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
10024 * containing a crate::c_types::derived::COption_CustomOnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10025 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10027 typedef struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ {
10029 * The contents of this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ, accessible via either
10030 * `err` or `result` depending on the state of `result_ok`.
10032 union LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZPtr contents;
10034 * Whether this CResult_COption_CustomOnionMessageContentsZDecodeErrorZ represents a success state.
10037 } LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ;
10040 * An enum which can either contain a crate::lightning::ln::wire::Type or not
10042 typedef enum LDKCOption_TypeZ_Tag {
10044 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
10046 LDKCOption_TypeZ_Some,
10048 * When we're in this state, this COption_TypeZ contains nothing
10050 LDKCOption_TypeZ_None,
10052 * Must be last for serialization purposes
10054 LDKCOption_TypeZ_Sentinel,
10055 } LDKCOption_TypeZ_Tag;
10057 typedef struct LDKCOption_TypeZ {
10058 LDKCOption_TypeZ_Tag tag;
10061 struct LDKType some;
10064 } LDKCOption_TypeZ;
10067 * The contents of CResult_COption_TypeZDecodeErrorZ
10069 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
10071 * A pointer to the contents in the success state.
10072 * Reading from this pointer when `result_ok` is not set is undefined.
10074 struct LDKCOption_TypeZ *result;
10076 * A pointer to the contents in the error state.
10077 * Reading from this pointer when `result_ok` is set is undefined.
10079 struct LDKDecodeError *err;
10080 } LDKCResult_COption_TypeZDecodeErrorZPtr;
10083 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
10084 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10085 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10087 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
10089 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
10090 * `err` or `result` depending on the state of `result_ok`.
10092 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
10094 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
10097 } LDKCResult_COption_TypeZDecodeErrorZ;
10100 * An enum which can either contain a crate::lightning::ln::msgs::NetAddress or not
10102 typedef enum LDKCOption_NetAddressZ_Tag {
10104 * When we're in this state, this COption_NetAddressZ contains a crate::lightning::ln::msgs::NetAddress
10106 LDKCOption_NetAddressZ_Some,
10108 * When we're in this state, this COption_NetAddressZ contains nothing
10110 LDKCOption_NetAddressZ_None,
10112 * Must be last for serialization purposes
10114 LDKCOption_NetAddressZ_Sentinel,
10115 } LDKCOption_NetAddressZ_Tag;
10117 typedef struct LDKCOption_NetAddressZ {
10118 LDKCOption_NetAddressZ_Tag tag;
10121 struct LDKNetAddress some;
10124 } LDKCOption_NetAddressZ;
10127 * A tuple of 2 elements. See the individual fields for the types contained.
10129 typedef struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ {
10131 * The element at position 0
10133 struct LDKPublicKey a;
10135 * The element at position 1
10137 struct LDKCOption_NetAddressZ b;
10138 } LDKC2Tuple_PublicKeyCOption_NetAddressZZ;
10141 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCOption_NetAddressZZs of arbitrary size.
10142 * This corresponds to std::vector in C++
10144 typedef struct LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ {
10146 * The elements in the array.
10147 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10149 struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ *data;
10151 * The number of elements pointed to by `data`.
10154 } LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ;
10159 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
10160 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
10163 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
10165 * A pointer to the opaque Rust object.
10166 * Nearly everywhere, inner must be non-null, however in places where
10167 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10169 LDKnativePeerHandleError *inner;
10171 * Indicates that this is the only struct which contains the same pointer.
10172 * Rust functions which take ownership of an object provided via an argument require
10173 * this to be true and invalidate the object pointed to by inner.
10176 } LDKPeerHandleError;
10179 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
10181 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
10183 * A pointer to the contents in the success state.
10184 * Reading from this pointer when `result_ok` is not set is undefined.
10186 struct LDKCVec_u8Z *result;
10188 * A pointer to the contents in the error state.
10189 * Reading from this pointer when `result_ok` is set is undefined.
10191 struct LDKPeerHandleError *err;
10192 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
10195 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
10196 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10197 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10199 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
10201 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
10202 * `err` or `result` depending on the state of `result_ok`.
10204 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
10206 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
10209 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
10212 * The contents of CResult_NonePeerHandleErrorZ
10214 typedef union LDKCResult_NonePeerHandleErrorZPtr {
10216 * Note that this value is always NULL, as there are no contents in the OK variant
10220 * A pointer to the contents in the error state.
10221 * Reading from this pointer when `result_ok` is set is undefined.
10223 struct LDKPeerHandleError *err;
10224 } LDKCResult_NonePeerHandleErrorZPtr;
10227 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
10228 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10229 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10231 typedef struct LDKCResult_NonePeerHandleErrorZ {
10233 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
10234 * `err` or `result` depending on the state of `result_ok`.
10236 union LDKCResult_NonePeerHandleErrorZPtr contents;
10238 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
10241 } LDKCResult_NonePeerHandleErrorZ;
10244 * The contents of CResult_boolPeerHandleErrorZ
10246 typedef union LDKCResult_boolPeerHandleErrorZPtr {
10248 * A pointer to the contents in the success state.
10249 * Reading from this pointer when `result_ok` is not set is undefined.
10253 * A pointer to the contents in the error state.
10254 * Reading from this pointer when `result_ok` is set is undefined.
10256 struct LDKPeerHandleError *err;
10257 } LDKCResult_boolPeerHandleErrorZPtr;
10260 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
10261 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
10262 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10264 typedef struct LDKCResult_boolPeerHandleErrorZ {
10266 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
10267 * `err` or `result` depending on the state of `result_ok`.
10269 union LDKCResult_boolPeerHandleErrorZPtr contents;
10271 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
10274 } LDKCResult_boolPeerHandleErrorZ;
10277 * All-encompassing standard error type that processing can return
10279 typedef enum LDKGraphSyncError_Tag {
10281 * Error trying to read the update data, typically due to an erroneous data length indication
10282 * that is greater than the actual amount of data provided
10284 LDKGraphSyncError_DecodeError,
10286 * Error applying the patch to the network graph, usually the result of updates that are too
10287 * old or missing prerequisite data to the application of updates out of order
10289 LDKGraphSyncError_LightningError,
10291 * Must be last for serialization purposes
10293 LDKGraphSyncError_Sentinel,
10294 } LDKGraphSyncError_Tag;
10296 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
10297 LDKGraphSyncError_Tag tag;
10300 struct LDKDecodeError decode_error;
10303 struct LDKLightningError lightning_error;
10306 } LDKGraphSyncError;
10309 * The contents of CResult_u32GraphSyncErrorZ
10311 typedef union LDKCResult_u32GraphSyncErrorZPtr {
10313 * A pointer to the contents in the success state.
10314 * Reading from this pointer when `result_ok` is not set is undefined.
10318 * A pointer to the contents in the error state.
10319 * Reading from this pointer when `result_ok` is set is undefined.
10321 struct LDKGraphSyncError *err;
10322 } LDKCResult_u32GraphSyncErrorZPtr;
10325 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
10326 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::error::GraphSyncError on failure.
10327 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10329 typedef struct LDKCResult_u32GraphSyncErrorZ {
10331 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
10332 * `err` or `result` depending on the state of `result_ok`.
10334 union LDKCResult_u32GraphSyncErrorZPtr contents;
10336 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
10339 } LDKCResult_u32GraphSyncErrorZ;
10342 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
10344 typedef struct LDKSecretKey {
10346 * The bytes of the secret key
10352 * An enum which can either contain a crate::c_types::SecretKey or not
10354 typedef enum LDKCOption_KeyPairZ_Tag {
10356 * When we're in this state, this COption_KeyPairZ contains a crate::c_types::SecretKey
10358 LDKCOption_KeyPairZ_Some,
10360 * When we're in this state, this COption_KeyPairZ contains nothing
10362 LDKCOption_KeyPairZ_None,
10364 * Must be last for serialization purposes
10366 LDKCOption_KeyPairZ_Sentinel,
10367 } LDKCOption_KeyPairZ_Tag;
10369 typedef struct LDKCOption_KeyPairZ {
10370 LDKCOption_KeyPairZ_Tag tag;
10373 struct LDKSecretKey some;
10376 } LDKCOption_KeyPairZ;
10379 * The contents of CResult_COption_KeyPairZNoneZ
10381 typedef union LDKCResult_COption_KeyPairZNoneZPtr {
10383 * A pointer to the contents in the success state.
10384 * Reading from this pointer when `result_ok` is not set is undefined.
10386 struct LDKCOption_KeyPairZ *result;
10388 * Note that this value is always NULL, as there are no contents in the Err variant
10391 } LDKCResult_COption_KeyPairZNoneZPtr;
10394 * A CResult_COption_KeyPairZNoneZ represents the result of a fallible operation,
10395 * containing a crate::c_types::derived::COption_KeyPairZ on success and a () on failure.
10396 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10398 typedef struct LDKCResult_COption_KeyPairZNoneZ {
10400 * The contents of this CResult_COption_KeyPairZNoneZ, accessible via either
10401 * `err` or `result` depending on the state of `result_ok`.
10403 union LDKCResult_COption_KeyPairZNoneZPtr contents;
10405 * Whether this CResult_COption_KeyPairZNoneZ represents a success state.
10408 } LDKCResult_COption_KeyPairZNoneZ;
10411 * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
10413 typedef enum LDKCOption_ScriptZ_Tag {
10415 * When we're in this state, this COption_ScriptZ contains a crate::c_types::derived::CVec_u8Z
10417 LDKCOption_ScriptZ_Some,
10419 * When we're in this state, this COption_ScriptZ contains nothing
10421 LDKCOption_ScriptZ_None,
10423 * Must be last for serialization purposes
10425 LDKCOption_ScriptZ_Sentinel,
10426 } LDKCOption_ScriptZ_Tag;
10428 typedef struct LDKCOption_ScriptZ {
10429 LDKCOption_ScriptZ_Tag tag;
10432 struct LDKCVec_u8Z some;
10435 } LDKCOption_ScriptZ;
10438 * A dynamically-allocated array of crate::c_types::Witnesss of arbitrary size.
10439 * This corresponds to std::vector in C++
10441 typedef struct LDKCVec_WitnessZ {
10443 * The elements in the array.
10444 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10446 struct LDKWitness *data;
10448 * The number of elements pointed to by `data`.
10451 } LDKCVec_WitnessZ;
10454 * An enum which can either contain a i64 or not
10456 typedef enum LDKCOption_i64Z_Tag {
10458 * When we're in this state, this COption_i64Z contains a i64
10460 LDKCOption_i64Z_Some,
10462 * When we're in this state, this COption_i64Z contains nothing
10464 LDKCOption_i64Z_None,
10466 * Must be last for serialization purposes
10468 LDKCOption_i64Z_Sentinel,
10469 } LDKCOption_i64Z_Tag;
10471 typedef struct LDKCOption_i64Z {
10472 LDKCOption_i64Z_Tag tag;
10481 * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
10483 typedef enum LDKCOption_TxidZ_Tag {
10485 * When we're in this state, this COption_TxidZ contains a crate::c_types::ThirtyTwoBytes
10487 LDKCOption_TxidZ_Some,
10489 * When we're in this state, this COption_TxidZ contains nothing
10491 LDKCOption_TxidZ_None,
10493 * Must be last for serialization purposes
10495 LDKCOption_TxidZ_Sentinel,
10496 } LDKCOption_TxidZ_Tag;
10498 typedef struct LDKCOption_TxidZ {
10499 LDKCOption_TxidZ_Tag tag;
10502 struct LDKThirtyTwoBytes some;
10505 } LDKCOption_TxidZ;
10508 * The contents of CResult_NetAddressDecodeErrorZ
10510 typedef union LDKCResult_NetAddressDecodeErrorZPtr {
10512 * A pointer to the contents in the success state.
10513 * Reading from this pointer when `result_ok` is not set is undefined.
10515 struct LDKNetAddress *result;
10517 * A pointer to the contents in the error state.
10518 * Reading from this pointer when `result_ok` is set is undefined.
10520 struct LDKDecodeError *err;
10521 } LDKCResult_NetAddressDecodeErrorZPtr;
10524 * A CResult_NetAddressDecodeErrorZ represents the result of a fallible operation,
10525 * containing a crate::lightning::ln::msgs::NetAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
10526 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10528 typedef struct LDKCResult_NetAddressDecodeErrorZ {
10530 * The contents of this CResult_NetAddressDecodeErrorZ, accessible via either
10531 * `err` or `result` depending on the state of `result_ok`.
10533 union LDKCResult_NetAddressDecodeErrorZPtr contents;
10535 * Whether this CResult_NetAddressDecodeErrorZ represents a success state.
10538 } LDKCResult_NetAddressDecodeErrorZ;
10543 * An [`update_add_htlc`] message to be sent to or received from a peer.
10545 * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
10547 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
10549 * A pointer to the opaque Rust object.
10550 * Nearly everywhere, inner must be non-null, however in places where
10551 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10553 LDKnativeUpdateAddHTLC *inner;
10555 * Indicates that this is the only struct which contains the same pointer.
10556 * Rust functions which take ownership of an object provided via an argument require
10557 * this to be true and invalidate the object pointed to by inner.
10560 } LDKUpdateAddHTLC;
10563 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
10564 * This corresponds to std::vector in C++
10566 typedef struct LDKCVec_UpdateAddHTLCZ {
10568 * The elements in the array.
10569 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10571 struct LDKUpdateAddHTLC *data;
10573 * The number of elements pointed to by `data`.
10576 } LDKCVec_UpdateAddHTLCZ;
10581 * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
10583 * [`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
10585 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
10587 * A pointer to the opaque Rust object.
10588 * Nearly everywhere, inner must be non-null, however in places where
10589 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10591 LDKnativeUpdateFulfillHTLC *inner;
10593 * Indicates that this is the only struct which contains the same pointer.
10594 * Rust functions which take ownership of an object provided via an argument require
10595 * this to be true and invalidate the object pointed to by inner.
10598 } LDKUpdateFulfillHTLC;
10601 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
10602 * This corresponds to std::vector in C++
10604 typedef struct LDKCVec_UpdateFulfillHTLCZ {
10606 * The elements in the array.
10607 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10609 struct LDKUpdateFulfillHTLC *data;
10611 * The number of elements pointed to by `data`.
10614 } LDKCVec_UpdateFulfillHTLCZ;
10619 * An [`update_fail_htlc`] message to be sent to or received from a peer.
10621 * [`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
10623 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
10625 * A pointer to the opaque Rust object.
10626 * Nearly everywhere, inner must be non-null, however in places where
10627 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10629 LDKnativeUpdateFailHTLC *inner;
10631 * Indicates that this is the only struct which contains the same pointer.
10632 * Rust functions which take ownership of an object provided via an argument require
10633 * this to be true and invalidate the object pointed to by inner.
10636 } LDKUpdateFailHTLC;
10639 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
10640 * This corresponds to std::vector in C++
10642 typedef struct LDKCVec_UpdateFailHTLCZ {
10644 * The elements in the array.
10645 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10647 struct LDKUpdateFailHTLC *data;
10649 * The number of elements pointed to by `data`.
10652 } LDKCVec_UpdateFailHTLCZ;
10657 * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
10659 * [`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
10661 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
10663 * A pointer to the opaque Rust object.
10664 * Nearly everywhere, inner must be non-null, however in places where
10665 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10667 LDKnativeUpdateFailMalformedHTLC *inner;
10669 * Indicates that this is the only struct which contains the same pointer.
10670 * Rust functions which take ownership of an object provided via an argument require
10671 * this to be true and invalidate the object pointed to by inner.
10674 } LDKUpdateFailMalformedHTLC;
10677 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
10678 * This corresponds to std::vector in C++
10680 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
10682 * The elements in the array.
10683 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10685 struct LDKUpdateFailMalformedHTLC *data;
10687 * The number of elements pointed to by `data`.
10690 } LDKCVec_UpdateFailMalformedHTLCZ;
10693 * The contents of CResult_AcceptChannelDecodeErrorZ
10695 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
10697 * A pointer to the contents in the success state.
10698 * Reading from this pointer when `result_ok` is not set is undefined.
10700 struct LDKAcceptChannel *result;
10702 * A pointer to the contents in the error state.
10703 * Reading from this pointer when `result_ok` is set is undefined.
10705 struct LDKDecodeError *err;
10706 } LDKCResult_AcceptChannelDecodeErrorZPtr;
10709 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
10710 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
10711 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10713 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
10715 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
10716 * `err` or `result` depending on the state of `result_ok`.
10718 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
10720 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
10723 } LDKCResult_AcceptChannelDecodeErrorZ;
10726 * The contents of CResult_AcceptChannelV2DecodeErrorZ
10728 typedef union LDKCResult_AcceptChannelV2DecodeErrorZPtr {
10730 * A pointer to the contents in the success state.
10731 * Reading from this pointer when `result_ok` is not set is undefined.
10733 struct LDKAcceptChannelV2 *result;
10735 * A pointer to the contents in the error state.
10736 * Reading from this pointer when `result_ok` is set is undefined.
10738 struct LDKDecodeError *err;
10739 } LDKCResult_AcceptChannelV2DecodeErrorZPtr;
10742 * A CResult_AcceptChannelV2DecodeErrorZ represents the result of a fallible operation,
10743 * containing a crate::lightning::ln::msgs::AcceptChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
10744 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10746 typedef struct LDKCResult_AcceptChannelV2DecodeErrorZ {
10748 * The contents of this CResult_AcceptChannelV2DecodeErrorZ, accessible via either
10749 * `err` or `result` depending on the state of `result_ok`.
10751 union LDKCResult_AcceptChannelV2DecodeErrorZPtr contents;
10753 * Whether this CResult_AcceptChannelV2DecodeErrorZ represents a success state.
10756 } LDKCResult_AcceptChannelV2DecodeErrorZ;
10759 * The contents of CResult_TxAddInputDecodeErrorZ
10761 typedef union LDKCResult_TxAddInputDecodeErrorZPtr {
10763 * A pointer to the contents in the success state.
10764 * Reading from this pointer when `result_ok` is not set is undefined.
10766 struct LDKTxAddInput *result;
10768 * A pointer to the contents in the error state.
10769 * Reading from this pointer when `result_ok` is set is undefined.
10771 struct LDKDecodeError *err;
10772 } LDKCResult_TxAddInputDecodeErrorZPtr;
10775 * A CResult_TxAddInputDecodeErrorZ represents the result of a fallible operation,
10776 * containing a crate::lightning::ln::msgs::TxAddInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
10777 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10779 typedef struct LDKCResult_TxAddInputDecodeErrorZ {
10781 * The contents of this CResult_TxAddInputDecodeErrorZ, accessible via either
10782 * `err` or `result` depending on the state of `result_ok`.
10784 union LDKCResult_TxAddInputDecodeErrorZPtr contents;
10786 * Whether this CResult_TxAddInputDecodeErrorZ represents a success state.
10789 } LDKCResult_TxAddInputDecodeErrorZ;
10792 * The contents of CResult_TxAddOutputDecodeErrorZ
10794 typedef union LDKCResult_TxAddOutputDecodeErrorZPtr {
10796 * A pointer to the contents in the success state.
10797 * Reading from this pointer when `result_ok` is not set is undefined.
10799 struct LDKTxAddOutput *result;
10801 * A pointer to the contents in the error state.
10802 * Reading from this pointer when `result_ok` is set is undefined.
10804 struct LDKDecodeError *err;
10805 } LDKCResult_TxAddOutputDecodeErrorZPtr;
10808 * A CResult_TxAddOutputDecodeErrorZ represents the result of a fallible operation,
10809 * containing a crate::lightning::ln::msgs::TxAddOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
10810 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10812 typedef struct LDKCResult_TxAddOutputDecodeErrorZ {
10814 * The contents of this CResult_TxAddOutputDecodeErrorZ, accessible via either
10815 * `err` or `result` depending on the state of `result_ok`.
10817 union LDKCResult_TxAddOutputDecodeErrorZPtr contents;
10819 * Whether this CResult_TxAddOutputDecodeErrorZ represents a success state.
10822 } LDKCResult_TxAddOutputDecodeErrorZ;
10825 * The contents of CResult_TxRemoveInputDecodeErrorZ
10827 typedef union LDKCResult_TxRemoveInputDecodeErrorZPtr {
10829 * A pointer to the contents in the success state.
10830 * Reading from this pointer when `result_ok` is not set is undefined.
10832 struct LDKTxRemoveInput *result;
10834 * A pointer to the contents in the error state.
10835 * Reading from this pointer when `result_ok` is set is undefined.
10837 struct LDKDecodeError *err;
10838 } LDKCResult_TxRemoveInputDecodeErrorZPtr;
10841 * A CResult_TxRemoveInputDecodeErrorZ represents the result of a fallible operation,
10842 * containing a crate::lightning::ln::msgs::TxRemoveInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
10843 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10845 typedef struct LDKCResult_TxRemoveInputDecodeErrorZ {
10847 * The contents of this CResult_TxRemoveInputDecodeErrorZ, accessible via either
10848 * `err` or `result` depending on the state of `result_ok`.
10850 union LDKCResult_TxRemoveInputDecodeErrorZPtr contents;
10852 * Whether this CResult_TxRemoveInputDecodeErrorZ represents a success state.
10855 } LDKCResult_TxRemoveInputDecodeErrorZ;
10858 * The contents of CResult_TxRemoveOutputDecodeErrorZ
10860 typedef union LDKCResult_TxRemoveOutputDecodeErrorZPtr {
10862 * A pointer to the contents in the success state.
10863 * Reading from this pointer when `result_ok` is not set is undefined.
10865 struct LDKTxRemoveOutput *result;
10867 * A pointer to the contents in the error state.
10868 * Reading from this pointer when `result_ok` is set is undefined.
10870 struct LDKDecodeError *err;
10871 } LDKCResult_TxRemoveOutputDecodeErrorZPtr;
10874 * A CResult_TxRemoveOutputDecodeErrorZ represents the result of a fallible operation,
10875 * containing a crate::lightning::ln::msgs::TxRemoveOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
10876 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10878 typedef struct LDKCResult_TxRemoveOutputDecodeErrorZ {
10880 * The contents of this CResult_TxRemoveOutputDecodeErrorZ, accessible via either
10881 * `err` or `result` depending on the state of `result_ok`.
10883 union LDKCResult_TxRemoveOutputDecodeErrorZPtr contents;
10885 * Whether this CResult_TxRemoveOutputDecodeErrorZ represents a success state.
10888 } LDKCResult_TxRemoveOutputDecodeErrorZ;
10891 * The contents of CResult_TxCompleteDecodeErrorZ
10893 typedef union LDKCResult_TxCompleteDecodeErrorZPtr {
10895 * A pointer to the contents in the success state.
10896 * Reading from this pointer when `result_ok` is not set is undefined.
10898 struct LDKTxComplete *result;
10900 * A pointer to the contents in the error state.
10901 * Reading from this pointer when `result_ok` is set is undefined.
10903 struct LDKDecodeError *err;
10904 } LDKCResult_TxCompleteDecodeErrorZPtr;
10907 * A CResult_TxCompleteDecodeErrorZ represents the result of a fallible operation,
10908 * containing a crate::lightning::ln::msgs::TxComplete on success and a crate::lightning::ln::msgs::DecodeError on failure.
10909 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10911 typedef struct LDKCResult_TxCompleteDecodeErrorZ {
10913 * The contents of this CResult_TxCompleteDecodeErrorZ, accessible via either
10914 * `err` or `result` depending on the state of `result_ok`.
10916 union LDKCResult_TxCompleteDecodeErrorZPtr contents;
10918 * Whether this CResult_TxCompleteDecodeErrorZ represents a success state.
10921 } LDKCResult_TxCompleteDecodeErrorZ;
10924 * The contents of CResult_TxSignaturesDecodeErrorZ
10926 typedef union LDKCResult_TxSignaturesDecodeErrorZPtr {
10928 * A pointer to the contents in the success state.
10929 * Reading from this pointer when `result_ok` is not set is undefined.
10931 struct LDKTxSignatures *result;
10933 * A pointer to the contents in the error state.
10934 * Reading from this pointer when `result_ok` is set is undefined.
10936 struct LDKDecodeError *err;
10937 } LDKCResult_TxSignaturesDecodeErrorZPtr;
10940 * A CResult_TxSignaturesDecodeErrorZ represents the result of a fallible operation,
10941 * containing a crate::lightning::ln::msgs::TxSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
10942 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10944 typedef struct LDKCResult_TxSignaturesDecodeErrorZ {
10946 * The contents of this CResult_TxSignaturesDecodeErrorZ, accessible via either
10947 * `err` or `result` depending on the state of `result_ok`.
10949 union LDKCResult_TxSignaturesDecodeErrorZPtr contents;
10951 * Whether this CResult_TxSignaturesDecodeErrorZ represents a success state.
10954 } LDKCResult_TxSignaturesDecodeErrorZ;
10957 * The contents of CResult_TxInitRbfDecodeErrorZ
10959 typedef union LDKCResult_TxInitRbfDecodeErrorZPtr {
10961 * A pointer to the contents in the success state.
10962 * Reading from this pointer when `result_ok` is not set is undefined.
10964 struct LDKTxInitRbf *result;
10966 * A pointer to the contents in the error state.
10967 * Reading from this pointer when `result_ok` is set is undefined.
10969 struct LDKDecodeError *err;
10970 } LDKCResult_TxInitRbfDecodeErrorZPtr;
10973 * A CResult_TxInitRbfDecodeErrorZ represents the result of a fallible operation,
10974 * containing a crate::lightning::ln::msgs::TxInitRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
10975 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10977 typedef struct LDKCResult_TxInitRbfDecodeErrorZ {
10979 * The contents of this CResult_TxInitRbfDecodeErrorZ, accessible via either
10980 * `err` or `result` depending on the state of `result_ok`.
10982 union LDKCResult_TxInitRbfDecodeErrorZPtr contents;
10984 * Whether this CResult_TxInitRbfDecodeErrorZ represents a success state.
10987 } LDKCResult_TxInitRbfDecodeErrorZ;
10990 * The contents of CResult_TxAckRbfDecodeErrorZ
10992 typedef union LDKCResult_TxAckRbfDecodeErrorZPtr {
10994 * A pointer to the contents in the success state.
10995 * Reading from this pointer when `result_ok` is not set is undefined.
10997 struct LDKTxAckRbf *result;
10999 * A pointer to the contents in the error state.
11000 * Reading from this pointer when `result_ok` is set is undefined.
11002 struct LDKDecodeError *err;
11003 } LDKCResult_TxAckRbfDecodeErrorZPtr;
11006 * A CResult_TxAckRbfDecodeErrorZ represents the result of a fallible operation,
11007 * containing a crate::lightning::ln::msgs::TxAckRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
11008 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11010 typedef struct LDKCResult_TxAckRbfDecodeErrorZ {
11012 * The contents of this CResult_TxAckRbfDecodeErrorZ, accessible via either
11013 * `err` or `result` depending on the state of `result_ok`.
11015 union LDKCResult_TxAckRbfDecodeErrorZPtr contents;
11017 * Whether this CResult_TxAckRbfDecodeErrorZ represents a success state.
11020 } LDKCResult_TxAckRbfDecodeErrorZ;
11025 * A tx_abort message which signals the cancellation of an in-progress transaction negotiation.
11028 typedef struct MUST_USE_STRUCT LDKTxAbort {
11030 * A pointer to the opaque Rust object.
11031 * Nearly everywhere, inner must be non-null, however in places where
11032 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11034 LDKnativeTxAbort *inner;
11036 * Indicates that this is the only struct which contains the same pointer.
11037 * Rust functions which take ownership of an object provided via an argument require
11038 * this to be true and invalidate the object pointed to by inner.
11044 * The contents of CResult_TxAbortDecodeErrorZ
11046 typedef union LDKCResult_TxAbortDecodeErrorZPtr {
11048 * A pointer to the contents in the success state.
11049 * Reading from this pointer when `result_ok` is not set is undefined.
11051 struct LDKTxAbort *result;
11053 * A pointer to the contents in the error state.
11054 * Reading from this pointer when `result_ok` is set is undefined.
11056 struct LDKDecodeError *err;
11057 } LDKCResult_TxAbortDecodeErrorZPtr;
11060 * A CResult_TxAbortDecodeErrorZ represents the result of a fallible operation,
11061 * containing a crate::lightning::ln::msgs::TxAbort on success and a crate::lightning::ln::msgs::DecodeError on failure.
11062 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11064 typedef struct LDKCResult_TxAbortDecodeErrorZ {
11066 * The contents of this CResult_TxAbortDecodeErrorZ, accessible via either
11067 * `err` or `result` depending on the state of `result_ok`.
11069 union LDKCResult_TxAbortDecodeErrorZPtr contents;
11071 * Whether this CResult_TxAbortDecodeErrorZ represents a success state.
11074 } LDKCResult_TxAbortDecodeErrorZ;
11077 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
11079 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
11081 * A pointer to the contents in the success state.
11082 * Reading from this pointer when `result_ok` is not set is undefined.
11084 struct LDKAnnouncementSignatures *result;
11086 * A pointer to the contents in the error state.
11087 * Reading from this pointer when `result_ok` is set is undefined.
11089 struct LDKDecodeError *err;
11090 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
11093 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
11094 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
11095 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11097 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
11099 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
11100 * `err` or `result` depending on the state of `result_ok`.
11102 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
11104 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
11107 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
11110 * The contents of CResult_ChannelReestablishDecodeErrorZ
11112 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
11114 * A pointer to the contents in the success state.
11115 * Reading from this pointer when `result_ok` is not set is undefined.
11117 struct LDKChannelReestablish *result;
11119 * A pointer to the contents in the error state.
11120 * Reading from this pointer when `result_ok` is set is undefined.
11122 struct LDKDecodeError *err;
11123 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
11126 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
11127 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
11128 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11130 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
11132 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
11133 * `err` or `result` depending on the state of `result_ok`.
11135 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
11137 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
11140 } LDKCResult_ChannelReestablishDecodeErrorZ;
11143 * The contents of CResult_ClosingSignedDecodeErrorZ
11145 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
11147 * A pointer to the contents in the success state.
11148 * Reading from this pointer when `result_ok` is not set is undefined.
11150 struct LDKClosingSigned *result;
11152 * A pointer to the contents in the error state.
11153 * Reading from this pointer when `result_ok` is set is undefined.
11155 struct LDKDecodeError *err;
11156 } LDKCResult_ClosingSignedDecodeErrorZPtr;
11159 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
11160 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11161 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11163 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
11165 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
11166 * `err` or `result` depending on the state of `result_ok`.
11168 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
11170 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
11173 } LDKCResult_ClosingSignedDecodeErrorZ;
11178 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
11180 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
11183 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
11185 * A pointer to the opaque Rust object.
11186 * Nearly everywhere, inner must be non-null, however in places where
11187 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11189 LDKnativeClosingSignedFeeRange *inner;
11191 * Indicates that this is the only struct which contains the same pointer.
11192 * Rust functions which take ownership of an object provided via an argument require
11193 * this to be true and invalidate the object pointed to by inner.
11196 } LDKClosingSignedFeeRange;
11199 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
11201 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
11203 * A pointer to the contents in the success state.
11204 * Reading from this pointer when `result_ok` is not set is undefined.
11206 struct LDKClosingSignedFeeRange *result;
11208 * A pointer to the contents in the error state.
11209 * Reading from this pointer when `result_ok` is set is undefined.
11211 struct LDKDecodeError *err;
11212 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
11215 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
11216 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
11217 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11219 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
11221 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
11222 * `err` or `result` depending on the state of `result_ok`.
11224 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
11226 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
11229 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
11234 * A [`commitment_signed`] message to be sent to or received from a peer.
11236 * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
11238 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
11240 * A pointer to the opaque Rust object.
11241 * Nearly everywhere, inner must be non-null, however in places where
11242 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11244 LDKnativeCommitmentSigned *inner;
11246 * Indicates that this is the only struct which contains the same pointer.
11247 * Rust functions which take ownership of an object provided via an argument require
11248 * this to be true and invalidate the object pointed to by inner.
11251 } LDKCommitmentSigned;
11254 * The contents of CResult_CommitmentSignedDecodeErrorZ
11256 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
11258 * A pointer to the contents in the success state.
11259 * Reading from this pointer when `result_ok` is not set is undefined.
11261 struct LDKCommitmentSigned *result;
11263 * A pointer to the contents in the error state.
11264 * Reading from this pointer when `result_ok` is set is undefined.
11266 struct LDKDecodeError *err;
11267 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
11270 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
11271 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11272 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11274 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
11276 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
11277 * `err` or `result` depending on the state of `result_ok`.
11279 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
11281 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
11284 } LDKCResult_CommitmentSignedDecodeErrorZ;
11287 * The contents of CResult_FundingCreatedDecodeErrorZ
11289 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
11291 * A pointer to the contents in the success state.
11292 * Reading from this pointer when `result_ok` is not set is undefined.
11294 struct LDKFundingCreated *result;
11296 * A pointer to the contents in the error state.
11297 * Reading from this pointer when `result_ok` is set is undefined.
11299 struct LDKDecodeError *err;
11300 } LDKCResult_FundingCreatedDecodeErrorZPtr;
11303 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
11304 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
11305 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11307 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
11309 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
11310 * `err` or `result` depending on the state of `result_ok`.
11312 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
11314 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
11317 } LDKCResult_FundingCreatedDecodeErrorZ;
11320 * The contents of CResult_FundingSignedDecodeErrorZ
11322 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
11324 * A pointer to the contents in the success state.
11325 * Reading from this pointer when `result_ok` is not set is undefined.
11327 struct LDKFundingSigned *result;
11329 * A pointer to the contents in the error state.
11330 * Reading from this pointer when `result_ok` is set is undefined.
11332 struct LDKDecodeError *err;
11333 } LDKCResult_FundingSignedDecodeErrorZPtr;
11336 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
11337 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
11338 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11340 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
11342 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
11343 * `err` or `result` depending on the state of `result_ok`.
11345 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
11347 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
11350 } LDKCResult_FundingSignedDecodeErrorZ;
11353 * The contents of CResult_ChannelReadyDecodeErrorZ
11355 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
11357 * A pointer to the contents in the success state.
11358 * Reading from this pointer when `result_ok` is not set is undefined.
11360 struct LDKChannelReady *result;
11362 * A pointer to the contents in the error state.
11363 * Reading from this pointer when `result_ok` is set is undefined.
11365 struct LDKDecodeError *err;
11366 } LDKCResult_ChannelReadyDecodeErrorZPtr;
11369 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
11370 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
11371 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11373 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
11375 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
11376 * `err` or `result` depending on the state of `result_ok`.
11378 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
11380 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
11383 } LDKCResult_ChannelReadyDecodeErrorZ;
11388 * An [`init`] message to be sent to or received from a peer.
11390 * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
11392 typedef struct MUST_USE_STRUCT LDKInit {
11394 * A pointer to the opaque Rust object.
11395 * Nearly everywhere, inner must be non-null, however in places where
11396 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11398 LDKnativeInit *inner;
11400 * Indicates that this is the only struct which contains the same pointer.
11401 * Rust functions which take ownership of an object provided via an argument require
11402 * this to be true and invalidate the object pointed to by inner.
11408 * The contents of CResult_InitDecodeErrorZ
11410 typedef union LDKCResult_InitDecodeErrorZPtr {
11412 * A pointer to the contents in the success state.
11413 * Reading from this pointer when `result_ok` is not set is undefined.
11415 struct LDKInit *result;
11417 * A pointer to the contents in the error state.
11418 * Reading from this pointer when `result_ok` is set is undefined.
11420 struct LDKDecodeError *err;
11421 } LDKCResult_InitDecodeErrorZPtr;
11424 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
11425 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
11426 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11428 typedef struct LDKCResult_InitDecodeErrorZ {
11430 * The contents of this CResult_InitDecodeErrorZ, accessible via either
11431 * `err` or `result` depending on the state of `result_ok`.
11433 union LDKCResult_InitDecodeErrorZPtr contents;
11435 * Whether this CResult_InitDecodeErrorZ represents a success state.
11438 } LDKCResult_InitDecodeErrorZ;
11441 * The contents of CResult_OpenChannelDecodeErrorZ
11443 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
11445 * A pointer to the contents in the success state.
11446 * Reading from this pointer when `result_ok` is not set is undefined.
11448 struct LDKOpenChannel *result;
11450 * A pointer to the contents in the error state.
11451 * Reading from this pointer when `result_ok` is set is undefined.
11453 struct LDKDecodeError *err;
11454 } LDKCResult_OpenChannelDecodeErrorZPtr;
11457 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
11458 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
11459 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11461 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
11463 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
11464 * `err` or `result` depending on the state of `result_ok`.
11466 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
11468 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
11471 } LDKCResult_OpenChannelDecodeErrorZ;
11474 * The contents of CResult_OpenChannelV2DecodeErrorZ
11476 typedef union LDKCResult_OpenChannelV2DecodeErrorZPtr {
11478 * A pointer to the contents in the success state.
11479 * Reading from this pointer when `result_ok` is not set is undefined.
11481 struct LDKOpenChannelV2 *result;
11483 * A pointer to the contents in the error state.
11484 * Reading from this pointer when `result_ok` is set is undefined.
11486 struct LDKDecodeError *err;
11487 } LDKCResult_OpenChannelV2DecodeErrorZPtr;
11490 * A CResult_OpenChannelV2DecodeErrorZ represents the result of a fallible operation,
11491 * containing a crate::lightning::ln::msgs::OpenChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
11492 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11494 typedef struct LDKCResult_OpenChannelV2DecodeErrorZ {
11496 * The contents of this CResult_OpenChannelV2DecodeErrorZ, accessible via either
11497 * `err` or `result` depending on the state of `result_ok`.
11499 union LDKCResult_OpenChannelV2DecodeErrorZPtr contents;
11501 * Whether this CResult_OpenChannelV2DecodeErrorZ represents a success state.
11504 } LDKCResult_OpenChannelV2DecodeErrorZ;
11507 * The contents of CResult_RevokeAndACKDecodeErrorZ
11509 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
11511 * A pointer to the contents in the success state.
11512 * Reading from this pointer when `result_ok` is not set is undefined.
11514 struct LDKRevokeAndACK *result;
11516 * A pointer to the contents in the error state.
11517 * Reading from this pointer when `result_ok` is set is undefined.
11519 struct LDKDecodeError *err;
11520 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
11523 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
11524 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
11525 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11527 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
11529 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
11530 * `err` or `result` depending on the state of `result_ok`.
11532 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
11534 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
11537 } LDKCResult_RevokeAndACKDecodeErrorZ;
11540 * The contents of CResult_ShutdownDecodeErrorZ
11542 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
11544 * A pointer to the contents in the success state.
11545 * Reading from this pointer when `result_ok` is not set is undefined.
11547 struct LDKShutdown *result;
11549 * A pointer to the contents in the error state.
11550 * Reading from this pointer when `result_ok` is set is undefined.
11552 struct LDKDecodeError *err;
11553 } LDKCResult_ShutdownDecodeErrorZPtr;
11556 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
11557 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
11558 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11560 typedef struct LDKCResult_ShutdownDecodeErrorZ {
11562 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
11563 * `err` or `result` depending on the state of `result_ok`.
11565 union LDKCResult_ShutdownDecodeErrorZPtr contents;
11567 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
11570 } LDKCResult_ShutdownDecodeErrorZ;
11573 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
11575 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
11577 * A pointer to the contents in the success state.
11578 * Reading from this pointer when `result_ok` is not set is undefined.
11580 struct LDKUpdateFailHTLC *result;
11582 * A pointer to the contents in the error state.
11583 * Reading from this pointer when `result_ok` is set is undefined.
11585 struct LDKDecodeError *err;
11586 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
11589 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
11590 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
11591 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11593 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
11595 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
11596 * `err` or `result` depending on the state of `result_ok`.
11598 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
11600 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
11603 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
11606 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
11608 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
11610 * A pointer to the contents in the success state.
11611 * Reading from this pointer when `result_ok` is not set is undefined.
11613 struct LDKUpdateFailMalformedHTLC *result;
11615 * A pointer to the contents in the error state.
11616 * Reading from this pointer when `result_ok` is set is undefined.
11618 struct LDKDecodeError *err;
11619 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
11622 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
11623 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
11624 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11626 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
11628 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
11629 * `err` or `result` depending on the state of `result_ok`.
11631 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
11633 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
11636 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
11641 * An [`update_fee`] message to be sent to or received from a peer
11643 * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
11645 typedef struct MUST_USE_STRUCT LDKUpdateFee {
11647 * A pointer to the opaque Rust object.
11648 * Nearly everywhere, inner must be non-null, however in places where
11649 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11651 LDKnativeUpdateFee *inner;
11653 * Indicates that this is the only struct which contains the same pointer.
11654 * Rust functions which take ownership of an object provided via an argument require
11655 * this to be true and invalidate the object pointed to by inner.
11661 * The contents of CResult_UpdateFeeDecodeErrorZ
11663 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
11665 * A pointer to the contents in the success state.
11666 * Reading from this pointer when `result_ok` is not set is undefined.
11668 struct LDKUpdateFee *result;
11670 * A pointer to the contents in the error state.
11671 * Reading from this pointer when `result_ok` is set is undefined.
11673 struct LDKDecodeError *err;
11674 } LDKCResult_UpdateFeeDecodeErrorZPtr;
11677 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
11678 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
11679 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11681 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
11683 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
11684 * `err` or `result` depending on the state of `result_ok`.
11686 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
11688 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
11691 } LDKCResult_UpdateFeeDecodeErrorZ;
11694 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
11696 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
11698 * A pointer to the contents in the success state.
11699 * Reading from this pointer when `result_ok` is not set is undefined.
11701 struct LDKUpdateFulfillHTLC *result;
11703 * A pointer to the contents in the error state.
11704 * Reading from this pointer when `result_ok` is set is undefined.
11706 struct LDKDecodeError *err;
11707 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
11710 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
11711 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
11712 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11714 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
11716 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
11717 * `err` or `result` depending on the state of `result_ok`.
11719 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
11721 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
11724 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
11727 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
11729 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
11731 * A pointer to the contents in the success state.
11732 * Reading from this pointer when `result_ok` is not set is undefined.
11734 struct LDKUpdateAddHTLC *result;
11736 * A pointer to the contents in the error state.
11737 * Reading from this pointer when `result_ok` is set is undefined.
11739 struct LDKDecodeError *err;
11740 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
11743 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
11744 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
11745 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11747 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
11749 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
11750 * `err` or `result` depending on the state of `result_ok`.
11752 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
11754 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
11757 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
11762 * An onion message to be sent to or received from a peer.
11765 typedef struct MUST_USE_STRUCT LDKOnionMessage {
11767 * A pointer to the opaque Rust object.
11768 * Nearly everywhere, inner must be non-null, however in places where
11769 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11771 LDKnativeOnionMessage *inner;
11773 * Indicates that this is the only struct which contains the same pointer.
11774 * Rust functions which take ownership of an object provided via an argument require
11775 * this to be true and invalidate the object pointed to by inner.
11781 * The contents of CResult_OnionMessageDecodeErrorZ
11783 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
11785 * A pointer to the contents in the success state.
11786 * Reading from this pointer when `result_ok` is not set is undefined.
11788 struct LDKOnionMessage *result;
11790 * A pointer to the contents in the error state.
11791 * Reading from this pointer when `result_ok` is set is undefined.
11793 struct LDKDecodeError *err;
11794 } LDKCResult_OnionMessageDecodeErrorZPtr;
11797 * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
11798 * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
11799 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11801 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
11803 * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
11804 * `err` or `result` depending on the state of `result_ok`.
11806 union LDKCResult_OnionMessageDecodeErrorZPtr contents;
11808 * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
11811 } LDKCResult_OnionMessageDecodeErrorZ;
11816 * A [`ping`] message to be sent to or received from a peer.
11818 * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
11820 typedef struct MUST_USE_STRUCT LDKPing {
11822 * A pointer to the opaque Rust object.
11823 * Nearly everywhere, inner must be non-null, however in places where
11824 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11826 LDKnativePing *inner;
11828 * Indicates that this is the only struct which contains the same pointer.
11829 * Rust functions which take ownership of an object provided via an argument require
11830 * this to be true and invalidate the object pointed to by inner.
11836 * The contents of CResult_PingDecodeErrorZ
11838 typedef union LDKCResult_PingDecodeErrorZPtr {
11840 * A pointer to the contents in the success state.
11841 * Reading from this pointer when `result_ok` is not set is undefined.
11843 struct LDKPing *result;
11845 * A pointer to the contents in the error state.
11846 * Reading from this pointer when `result_ok` is set is undefined.
11848 struct LDKDecodeError *err;
11849 } LDKCResult_PingDecodeErrorZPtr;
11852 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
11853 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
11854 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11856 typedef struct LDKCResult_PingDecodeErrorZ {
11858 * The contents of this CResult_PingDecodeErrorZ, accessible via either
11859 * `err` or `result` depending on the state of `result_ok`.
11861 union LDKCResult_PingDecodeErrorZPtr contents;
11863 * Whether this CResult_PingDecodeErrorZ represents a success state.
11866 } LDKCResult_PingDecodeErrorZ;
11871 * A [`pong`] message to be sent to or received from a peer.
11873 * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
11875 typedef struct MUST_USE_STRUCT LDKPong {
11877 * A pointer to the opaque Rust object.
11878 * Nearly everywhere, inner must be non-null, however in places where
11879 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11881 LDKnativePong *inner;
11883 * Indicates that this is the only struct which contains the same pointer.
11884 * Rust functions which take ownership of an object provided via an argument require
11885 * this to be true and invalidate the object pointed to by inner.
11891 * The contents of CResult_PongDecodeErrorZ
11893 typedef union LDKCResult_PongDecodeErrorZPtr {
11895 * A pointer to the contents in the success state.
11896 * Reading from this pointer when `result_ok` is not set is undefined.
11898 struct LDKPong *result;
11900 * A pointer to the contents in the error state.
11901 * Reading from this pointer when `result_ok` is set is undefined.
11903 struct LDKDecodeError *err;
11904 } LDKCResult_PongDecodeErrorZPtr;
11907 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
11908 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
11909 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11911 typedef struct LDKCResult_PongDecodeErrorZ {
11913 * The contents of this CResult_PongDecodeErrorZ, accessible via either
11914 * `err` or `result` depending on the state of `result_ok`.
11916 union LDKCResult_PongDecodeErrorZPtr contents;
11918 * Whether this CResult_PongDecodeErrorZ represents a success state.
11921 } LDKCResult_PongDecodeErrorZ;
11924 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
11926 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
11928 * A pointer to the contents in the success state.
11929 * Reading from this pointer when `result_ok` is not set is undefined.
11931 struct LDKUnsignedChannelAnnouncement *result;
11933 * A pointer to the contents in the error state.
11934 * Reading from this pointer when `result_ok` is set is undefined.
11936 struct LDKDecodeError *err;
11937 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
11940 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
11941 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11942 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11944 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
11946 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
11947 * `err` or `result` depending on the state of `result_ok`.
11949 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
11951 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
11954 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
11957 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
11959 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
11961 * A pointer to the contents in the success state.
11962 * Reading from this pointer when `result_ok` is not set is undefined.
11964 struct LDKChannelAnnouncement *result;
11966 * A pointer to the contents in the error state.
11967 * Reading from this pointer when `result_ok` is set is undefined.
11969 struct LDKDecodeError *err;
11970 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
11973 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
11974 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
11975 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11977 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
11979 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
11980 * `err` or `result` depending on the state of `result_ok`.
11982 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
11984 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
11987 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
11990 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
11992 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
11994 * A pointer to the contents in the success state.
11995 * Reading from this pointer when `result_ok` is not set is undefined.
11997 struct LDKUnsignedChannelUpdate *result;
11999 * A pointer to the contents in the error state.
12000 * Reading from this pointer when `result_ok` is set is undefined.
12002 struct LDKDecodeError *err;
12003 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
12006 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12007 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12008 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12010 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
12012 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
12013 * `err` or `result` depending on the state of `result_ok`.
12015 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
12017 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
12020 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
12023 * The contents of CResult_ChannelUpdateDecodeErrorZ
12025 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
12027 * A pointer to the contents in the success state.
12028 * Reading from this pointer when `result_ok` is not set is undefined.
12030 struct LDKChannelUpdate *result;
12032 * A pointer to the contents in the error state.
12033 * Reading from this pointer when `result_ok` is set is undefined.
12035 struct LDKDecodeError *err;
12036 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
12039 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
12040 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
12041 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12043 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
12045 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
12046 * `err` or `result` depending on the state of `result_ok`.
12048 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
12050 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
12053 } LDKCResult_ChannelUpdateDecodeErrorZ;
12056 * The contents of CResult_ErrorMessageDecodeErrorZ
12058 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
12060 * A pointer to the contents in the success state.
12061 * Reading from this pointer when `result_ok` is not set is undefined.
12063 struct LDKErrorMessage *result;
12065 * A pointer to the contents in the error state.
12066 * Reading from this pointer when `result_ok` is set is undefined.
12068 struct LDKDecodeError *err;
12069 } LDKCResult_ErrorMessageDecodeErrorZPtr;
12072 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
12073 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12074 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12076 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
12078 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
12079 * `err` or `result` depending on the state of `result_ok`.
12081 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
12083 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
12086 } LDKCResult_ErrorMessageDecodeErrorZ;
12089 * The contents of CResult_WarningMessageDecodeErrorZ
12091 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
12093 * A pointer to the contents in the success state.
12094 * Reading from this pointer when `result_ok` is not set is undefined.
12096 struct LDKWarningMessage *result;
12098 * A pointer to the contents in the error state.
12099 * Reading from this pointer when `result_ok` is set is undefined.
12101 struct LDKDecodeError *err;
12102 } LDKCResult_WarningMessageDecodeErrorZPtr;
12105 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
12106 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12107 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12109 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
12111 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
12112 * `err` or `result` depending on the state of `result_ok`.
12114 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
12116 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
12119 } LDKCResult_WarningMessageDecodeErrorZ;
12122 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
12124 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
12126 * A pointer to the contents in the success state.
12127 * Reading from this pointer when `result_ok` is not set is undefined.
12129 struct LDKUnsignedNodeAnnouncement *result;
12131 * A pointer to the contents in the error state.
12132 * Reading from this pointer when `result_ok` is set is undefined.
12134 struct LDKDecodeError *err;
12135 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
12138 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
12139 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12140 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12142 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
12144 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
12145 * `err` or `result` depending on the state of `result_ok`.
12147 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
12149 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
12152 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
12155 * The contents of CResult_NodeAnnouncementDecodeErrorZ
12157 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
12159 * A pointer to the contents in the success state.
12160 * Reading from this pointer when `result_ok` is not set is undefined.
12162 struct LDKNodeAnnouncement *result;
12164 * A pointer to the contents in the error state.
12165 * Reading from this pointer when `result_ok` is set is undefined.
12167 struct LDKDecodeError *err;
12168 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
12171 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
12172 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
12173 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12175 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
12177 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
12178 * `err` or `result` depending on the state of `result_ok`.
12180 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
12182 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
12185 } LDKCResult_NodeAnnouncementDecodeErrorZ;
12188 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
12190 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
12192 * A pointer to the contents in the success state.
12193 * Reading from this pointer when `result_ok` is not set is undefined.
12195 struct LDKQueryShortChannelIds *result;
12197 * A pointer to the contents in the error state.
12198 * Reading from this pointer when `result_ok` is set is undefined.
12200 struct LDKDecodeError *err;
12201 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
12204 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
12205 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
12206 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12208 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
12210 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
12211 * `err` or `result` depending on the state of `result_ok`.
12213 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
12215 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
12218 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
12223 * A [`reply_short_channel_ids_end`] message is sent as a reply to a
12224 * message. The query recipient makes a best
12225 * effort to respond based on their local network view which may not be
12226 * a perfect view of the network.
12228 * [`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
12230 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
12232 * A pointer to the opaque Rust object.
12233 * Nearly everywhere, inner must be non-null, however in places where
12234 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12236 LDKnativeReplyShortChannelIdsEnd *inner;
12238 * Indicates that this is the only struct which contains the same pointer.
12239 * Rust functions which take ownership of an object provided via an argument require
12240 * this to be true and invalidate the object pointed to by inner.
12243 } LDKReplyShortChannelIdsEnd;
12246 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
12248 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
12250 * A pointer to the contents in the success state.
12251 * Reading from this pointer when `result_ok` is not set is undefined.
12253 struct LDKReplyShortChannelIdsEnd *result;
12255 * A pointer to the contents in the error state.
12256 * Reading from this pointer when `result_ok` is set is undefined.
12258 struct LDKDecodeError *err;
12259 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
12262 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
12263 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
12264 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12266 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
12268 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
12269 * `err` or `result` depending on the state of `result_ok`.
12271 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
12273 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
12276 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
12279 * The contents of CResult_QueryChannelRangeDecodeErrorZ
12281 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
12283 * A pointer to the contents in the success state.
12284 * Reading from this pointer when `result_ok` is not set is undefined.
12286 struct LDKQueryChannelRange *result;
12288 * A pointer to the contents in the error state.
12289 * Reading from this pointer when `result_ok` is set is undefined.
12291 struct LDKDecodeError *err;
12292 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
12295 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
12296 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
12297 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12299 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
12301 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
12302 * `err` or `result` depending on the state of `result_ok`.
12304 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
12306 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
12309 } LDKCResult_QueryChannelRangeDecodeErrorZ;
12312 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
12314 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
12316 * A pointer to the contents in the success state.
12317 * Reading from this pointer when `result_ok` is not set is undefined.
12319 struct LDKReplyChannelRange *result;
12321 * A pointer to the contents in the error state.
12322 * Reading from this pointer when `result_ok` is set is undefined.
12324 struct LDKDecodeError *err;
12325 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
12328 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
12329 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
12330 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12332 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
12334 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
12335 * `err` or `result` depending on the state of `result_ok`.
12337 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
12339 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
12342 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
12345 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
12347 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
12349 * A pointer to the contents in the success state.
12350 * Reading from this pointer when `result_ok` is not set is undefined.
12352 struct LDKGossipTimestampFilter *result;
12354 * A pointer to the contents in the error state.
12355 * Reading from this pointer when `result_ok` is set is undefined.
12357 struct LDKDecodeError *err;
12358 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
12361 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
12362 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
12363 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12365 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
12367 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
12368 * `err` or `result` depending on the state of `result_ok`.
12370 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
12372 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
12375 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
12378 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
12379 * This corresponds to std::vector in C++
12381 typedef struct LDKCVec_PhantomRouteHintsZ {
12383 * The elements in the array.
12384 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12386 struct LDKPhantomRouteHints *data;
12388 * The number of elements pointed to by `data`.
12391 } LDKCVec_PhantomRouteHintsZ;
12396 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
12398 * There are three ways to construct a `Bolt11Invoice`:
12399 * 1. using [`InvoiceBuilder`]
12400 * 2. using [`Bolt11Invoice::from_signed`]
12401 * 3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
12403 * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
12405 typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
12407 * A pointer to the opaque Rust object.
12408 * Nearly everywhere, inner must be non-null, however in places where
12409 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12411 LDKnativeBolt11Invoice *inner;
12413 * Indicates that this is the only struct which contains the same pointer.
12414 * Rust functions which take ownership of an object provided via an argument require
12415 * this to be true and invalidate the object pointed to by inner.
12418 } LDKBolt11Invoice;
12421 * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
12424 typedef enum LDKSignOrCreationError_Tag {
12426 * An error occurred during signing
12428 LDKSignOrCreationError_SignError,
12430 * An error occurred while building the transaction
12432 LDKSignOrCreationError_CreationError,
12434 * Must be last for serialization purposes
12436 LDKSignOrCreationError_Sentinel,
12437 } LDKSignOrCreationError_Tag;
12439 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
12440 LDKSignOrCreationError_Tag tag;
12443 enum LDKCreationError creation_error;
12446 } LDKSignOrCreationError;
12449 * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
12451 typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
12453 * A pointer to the contents in the success state.
12454 * Reading from this pointer when `result_ok` is not set is undefined.
12456 struct LDKBolt11Invoice *result;
12458 * A pointer to the contents in the error state.
12459 * Reading from this pointer when `result_ok` is set is undefined.
12461 struct LDKSignOrCreationError *err;
12462 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
12465 * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
12466 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
12467 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12469 typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
12471 * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
12472 * `err` or `result` depending on the state of `result_ok`.
12474 union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
12476 * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
12479 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
12484 * A simple future which can complete once, and calls some callback(s) when it does so.
12486 * Clones can be made and all futures cloned from the same source will complete at the same time.
12488 typedef struct MUST_USE_STRUCT LDKFuture {
12490 * A pointer to the opaque Rust object.
12491 * Nearly everywhere, inner must be non-null, however in places where
12492 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12494 LDKnativeFuture *inner;
12496 * Indicates that this is the only struct which contains the same pointer.
12497 * Rust functions which take ownership of an object provided via an argument require
12498 * this to be true and invalidate the object pointed to by inner.
12504 * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
12505 * This corresponds to std::vector in C++
12507 typedef struct LDKCVec_FutureZ {
12509 * The elements in the array.
12510 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12512 struct LDKFuture *data;
12514 * The number of elements pointed to by `data`.
12520 * The contents of CResult_OffersMessageDecodeErrorZ
12522 typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
12524 * A pointer to the contents in the success state.
12525 * Reading from this pointer when `result_ok` is not set is undefined.
12527 struct LDKOffersMessage *result;
12529 * A pointer to the contents in the error state.
12530 * Reading from this pointer when `result_ok` is set is undefined.
12532 struct LDKDecodeError *err;
12533 } LDKCResult_OffersMessageDecodeErrorZPtr;
12536 * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
12537 * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
12538 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12540 typedef struct LDKCResult_OffersMessageDecodeErrorZ {
12542 * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
12543 * `err` or `result` depending on the state of `result_ok`.
12545 union LDKCResult_OffersMessageDecodeErrorZPtr contents;
12547 * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
12550 } LDKCResult_OffersMessageDecodeErrorZ;
12553 * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
12555 typedef enum LDKCOption_HTLCClaimZ_Tag {
12557 * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
12559 LDKCOption_HTLCClaimZ_Some,
12561 * When we're in this state, this COption_HTLCClaimZ contains nothing
12563 LDKCOption_HTLCClaimZ_None,
12565 * Must be last for serialization purposes
12567 LDKCOption_HTLCClaimZ_Sentinel,
12568 } LDKCOption_HTLCClaimZ_Tag;
12570 typedef struct LDKCOption_HTLCClaimZ {
12571 LDKCOption_HTLCClaimZ_Tag tag;
12574 enum LDKHTLCClaim some;
12577 } LDKCOption_HTLCClaimZ;
12582 * Implements the per-commitment secret storage scheme from
12583 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
12585 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
12588 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
12590 * A pointer to the opaque Rust object.
12591 * Nearly everywhere, inner must be non-null, however in places where
12592 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12594 LDKnativeCounterpartyCommitmentSecrets *inner;
12596 * Indicates that this is the only struct which contains the same pointer.
12597 * Rust functions which take ownership of an object provided via an argument require
12598 * this to be true and invalidate the object pointed to by inner.
12601 } LDKCounterpartyCommitmentSecrets;
12604 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
12606 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
12608 * A pointer to the contents in the success state.
12609 * Reading from this pointer when `result_ok` is not set is undefined.
12611 struct LDKCounterpartyCommitmentSecrets *result;
12613 * A pointer to the contents in the error state.
12614 * Reading from this pointer when `result_ok` is set is undefined.
12616 struct LDKDecodeError *err;
12617 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
12620 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
12621 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
12622 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12624 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
12626 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
12627 * `err` or `result` depending on the state of `result_ok`.
12629 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
12631 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
12634 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
12639 * The set of public keys which are used in the creation of one commitment transaction.
12640 * These are derived from the channel base keys and per-commitment data.
12642 * A broadcaster key is provided from potential broadcaster of the computed transaction.
12643 * A countersignatory key is coming from a protocol participant unable to broadcast the
12646 * These keys are assumed to be good, either because the code derived them from
12647 * channel basepoints via the new function, or they were obtained via
12648 * CommitmentTransaction.trust().keys() because we trusted the source of the
12649 * pre-calculated keys.
12651 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
12653 * A pointer to the opaque Rust object.
12654 * Nearly everywhere, inner must be non-null, however in places where
12655 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12657 LDKnativeTxCreationKeys *inner;
12659 * Indicates that this is the only struct which contains the same pointer.
12660 * Rust functions which take ownership of an object provided via an argument require
12661 * this to be true and invalidate the object pointed to by inner.
12664 } LDKTxCreationKeys;
12667 * The contents of CResult_TxCreationKeysDecodeErrorZ
12669 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
12671 * A pointer to the contents in the success state.
12672 * Reading from this pointer when `result_ok` is not set is undefined.
12674 struct LDKTxCreationKeys *result;
12676 * A pointer to the contents in the error state.
12677 * Reading from this pointer when `result_ok` is set is undefined.
12679 struct LDKDecodeError *err;
12680 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
12683 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
12684 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
12685 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12687 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
12689 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
12690 * `err` or `result` depending on the state of `result_ok`.
12692 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
12694 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
12697 } LDKCResult_TxCreationKeysDecodeErrorZ;
12700 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
12702 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
12704 * A pointer to the contents in the success state.
12705 * Reading from this pointer when `result_ok` is not set is undefined.
12707 struct LDKChannelPublicKeys *result;
12709 * A pointer to the contents in the error state.
12710 * Reading from this pointer when `result_ok` is set is undefined.
12712 struct LDKDecodeError *err;
12713 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
12716 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
12717 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
12718 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12720 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
12722 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
12723 * `err` or `result` depending on the state of `result_ok`.
12725 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
12727 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
12730 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
12733 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
12735 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
12737 * A pointer to the contents in the success state.
12738 * Reading from this pointer when `result_ok` is not set is undefined.
12740 struct LDKHTLCOutputInCommitment *result;
12742 * A pointer to the contents in the error state.
12743 * Reading from this pointer when `result_ok` is set is undefined.
12745 struct LDKDecodeError *err;
12746 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
12749 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
12750 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
12751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12753 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
12755 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
12756 * `err` or `result` depending on the state of `result_ok`.
12758 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
12760 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
12763 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
12768 * Late-bound per-channel counterparty data used to build transactions.
12770 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
12772 * A pointer to the opaque Rust object.
12773 * Nearly everywhere, inner must be non-null, however in places where
12774 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12776 LDKnativeCounterpartyChannelTransactionParameters *inner;
12778 * Indicates that this is the only struct which contains the same pointer.
12779 * Rust functions which take ownership of an object provided via an argument require
12780 * this to be true and invalidate the object pointed to by inner.
12783 } LDKCounterpartyChannelTransactionParameters;
12786 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
12788 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
12790 * A pointer to the contents in the success state.
12791 * Reading from this pointer when `result_ok` is not set is undefined.
12793 struct LDKCounterpartyChannelTransactionParameters *result;
12795 * A pointer to the contents in the error state.
12796 * Reading from this pointer when `result_ok` is set is undefined.
12798 struct LDKDecodeError *err;
12799 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
12802 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
12803 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
12804 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12806 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
12808 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
12809 * `err` or `result` depending on the state of `result_ok`.
12811 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
12813 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
12816 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
12819 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
12821 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
12823 * A pointer to the contents in the success state.
12824 * Reading from this pointer when `result_ok` is not set is undefined.
12826 struct LDKChannelTransactionParameters *result;
12828 * A pointer to the contents in the error state.
12829 * Reading from this pointer when `result_ok` is set is undefined.
12831 struct LDKDecodeError *err;
12832 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
12835 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
12836 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
12837 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12839 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
12841 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
12842 * `err` or `result` depending on the state of `result_ok`.
12844 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
12846 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
12849 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
12852 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
12854 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
12856 * A pointer to the contents in the success state.
12857 * Reading from this pointer when `result_ok` is not set is undefined.
12859 struct LDKHolderCommitmentTransaction *result;
12861 * A pointer to the contents in the error state.
12862 * Reading from this pointer when `result_ok` is set is undefined.
12864 struct LDKDecodeError *err;
12865 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
12868 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
12869 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
12870 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12872 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
12874 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
12875 * `err` or `result` depending on the state of `result_ok`.
12877 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
12879 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
12882 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
12887 * A pre-built Bitcoin commitment transaction and its txid.
12889 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
12891 * A pointer to the opaque Rust object.
12892 * Nearly everywhere, inner must be non-null, however in places where
12893 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12895 LDKnativeBuiltCommitmentTransaction *inner;
12897 * Indicates that this is the only struct which contains the same pointer.
12898 * Rust functions which take ownership of an object provided via an argument require
12899 * this to be true and invalidate the object pointed to by inner.
12902 } LDKBuiltCommitmentTransaction;
12905 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
12907 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
12909 * A pointer to the contents in the success state.
12910 * Reading from this pointer when `result_ok` is not set is undefined.
12912 struct LDKBuiltCommitmentTransaction *result;
12914 * A pointer to the contents in the error state.
12915 * Reading from this pointer when `result_ok` is set is undefined.
12917 struct LDKDecodeError *err;
12918 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
12921 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
12922 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
12923 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12925 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
12927 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
12928 * `err` or `result` depending on the state of `result_ok`.
12930 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
12932 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
12935 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
12940 * A wrapper on ClosingTransaction indicating that the built bitcoin
12941 * transaction is trusted.
12943 * See trust() and verify() functions on CommitmentTransaction.
12945 * This structure implements Deref.
12947 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
12949 * A pointer to the opaque Rust object.
12950 * Nearly everywhere, inner must be non-null, however in places where
12951 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12953 LDKnativeTrustedClosingTransaction *inner;
12955 * Indicates that this is the only struct which contains the same pointer.
12956 * Rust functions which take ownership of an object provided via an argument require
12957 * this to be true and invalidate the object pointed to by inner.
12960 } LDKTrustedClosingTransaction;
12963 * The contents of CResult_TrustedClosingTransactionNoneZ
12965 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
12967 * A pointer to the contents in the success state.
12968 * Reading from this pointer when `result_ok` is not set is undefined.
12970 struct LDKTrustedClosingTransaction *result;
12972 * Note that this value is always NULL, as there are no contents in the Err variant
12975 } LDKCResult_TrustedClosingTransactionNoneZPtr;
12978 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
12979 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
12980 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12982 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
12984 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
12985 * `err` or `result` depending on the state of `result_ok`.
12987 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
12989 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
12992 } LDKCResult_TrustedClosingTransactionNoneZ;
12995 * The contents of CResult_CommitmentTransactionDecodeErrorZ
12997 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
12999 * A pointer to the contents in the success state.
13000 * Reading from this pointer when `result_ok` is not set is undefined.
13002 struct LDKCommitmentTransaction *result;
13004 * A pointer to the contents in the error state.
13005 * Reading from this pointer when `result_ok` is set is undefined.
13007 struct LDKDecodeError *err;
13008 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
13011 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
13012 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
13013 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13015 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
13017 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
13018 * `err` or `result` depending on the state of `result_ok`.
13020 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
13022 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
13025 } LDKCResult_CommitmentTransactionDecodeErrorZ;
13030 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
13031 * transaction and the transaction creation keys) are trusted.
13033 * See trust() and verify() functions on CommitmentTransaction.
13035 * This structure implements Deref.
13037 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
13039 * A pointer to the opaque Rust object.
13040 * Nearly everywhere, inner must be non-null, however in places where
13041 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13043 LDKnativeTrustedCommitmentTransaction *inner;
13045 * Indicates that this is the only struct which contains the same pointer.
13046 * Rust functions which take ownership of an object provided via an argument require
13047 * this to be true and invalidate the object pointed to by inner.
13050 } LDKTrustedCommitmentTransaction;
13053 * The contents of CResult_TrustedCommitmentTransactionNoneZ
13055 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
13057 * A pointer to the contents in the success state.
13058 * Reading from this pointer when `result_ok` is not set is undefined.
13060 struct LDKTrustedCommitmentTransaction *result;
13062 * Note that this value is always NULL, as there are no contents in the Err variant
13065 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
13068 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
13069 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
13070 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13072 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
13074 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
13075 * `err` or `result` depending on the state of `result_ok`.
13077 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
13079 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
13082 } LDKCResult_TrustedCommitmentTransactionNoneZ;
13085 * The contents of CResult_CVec_SignatureZNoneZ
13087 typedef union LDKCResult_CVec_SignatureZNoneZPtr {
13089 * A pointer to the contents in the success state.
13090 * Reading from this pointer when `result_ok` is not set is undefined.
13092 struct LDKCVec_SignatureZ *result;
13094 * Note that this value is always NULL, as there are no contents in the Err variant
13097 } LDKCResult_CVec_SignatureZNoneZPtr;
13100 * A CResult_CVec_SignatureZNoneZ represents the result of a fallible operation,
13101 * containing a crate::c_types::derived::CVec_SignatureZ on success and a () on failure.
13102 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13104 typedef struct LDKCResult_CVec_SignatureZNoneZ {
13106 * The contents of this CResult_CVec_SignatureZNoneZ, accessible via either
13107 * `err` or `result` depending on the state of `result_ok`.
13109 union LDKCResult_CVec_SignatureZNoneZPtr contents;
13111 * Whether this CResult_CVec_SignatureZNoneZ represents a success state.
13114 } LDKCResult_CVec_SignatureZNoneZ;
13117 * The contents of CResult_ShutdownScriptDecodeErrorZ
13119 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
13121 * A pointer to the contents in the success state.
13122 * Reading from this pointer when `result_ok` is not set is undefined.
13124 struct LDKShutdownScript *result;
13126 * A pointer to the contents in the error state.
13127 * Reading from this pointer when `result_ok` is set is undefined.
13129 struct LDKDecodeError *err;
13130 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
13133 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
13134 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
13135 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13137 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
13139 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
13140 * `err` or `result` depending on the state of `result_ok`.
13142 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
13144 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
13147 } LDKCResult_ShutdownScriptDecodeErrorZ;
13152 * An error occurring when converting from [`Script`] to [`ShutdownScript`].
13154 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
13156 * A pointer to the opaque Rust object.
13157 * Nearly everywhere, inner must be non-null, however in places where
13158 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13160 LDKnativeInvalidShutdownScript *inner;
13162 * Indicates that this is the only struct which contains the same pointer.
13163 * Rust functions which take ownership of an object provided via an argument require
13164 * this to be true and invalidate the object pointed to by inner.
13167 } LDKInvalidShutdownScript;
13170 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
13172 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
13174 * A pointer to the contents in the success state.
13175 * Reading from this pointer when `result_ok` is not set is undefined.
13177 struct LDKShutdownScript *result;
13179 * A pointer to the contents in the error state.
13180 * Reading from this pointer when `result_ok` is set is undefined.
13182 struct LDKInvalidShutdownScript *err;
13183 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
13186 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
13187 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
13188 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13190 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
13192 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
13193 * `err` or `result` depending on the state of `result_ok`.
13195 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
13197 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
13200 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
13203 * Some information provided on receipt of payment depends on whether the payment received is a
13204 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
13206 typedef enum LDKPaymentPurpose_Tag {
13208 * Information for receiving a payment that we generated an invoice for.
13210 LDKPaymentPurpose_InvoicePayment,
13212 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
13213 * (the payee) providing a preimage.
13215 LDKPaymentPurpose_SpontaneousPayment,
13217 * Must be last for serialization purposes
13219 LDKPaymentPurpose_Sentinel,
13220 } LDKPaymentPurpose_Tag;
13222 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
13224 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
13225 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
13226 * [`ChannelManager::claim_funds`].
13228 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
13229 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
13231 struct LDKCOption_PaymentPreimageZ payment_preimage;
13233 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
13234 * number of deanonymization attacks during the routing process.
13235 * It is provided here for your reference, however its accuracy is enforced directly by
13236 * [`ChannelManager`] using the values you previously provided to
13237 * [`ChannelManager::create_inbound_payment`] or
13238 * [`ChannelManager::create_inbound_payment_for_hash`].
13240 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
13241 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
13242 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
13244 struct LDKThirtyTwoBytes payment_secret;
13245 } LDKPaymentPurpose_LDKInvoicePayment_Body;
13247 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
13248 LDKPaymentPurpose_Tag tag;
13250 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
13252 struct LDKThirtyTwoBytes spontaneous_payment;
13255 } LDKPaymentPurpose;
13258 * The contents of CResult_PaymentPurposeDecodeErrorZ
13260 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
13262 * A pointer to the contents in the success state.
13263 * Reading from this pointer when `result_ok` is not set is undefined.
13265 struct LDKPaymentPurpose *result;
13267 * A pointer to the contents in the error state.
13268 * Reading from this pointer when `result_ok` is set is undefined.
13270 struct LDKDecodeError *err;
13271 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
13274 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
13275 * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
13276 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13278 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
13280 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
13281 * `err` or `result` depending on the state of `result_ok`.
13283 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
13285 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
13288 } LDKCResult_PaymentPurposeDecodeErrorZ;
13291 * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
13292 * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
13294 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
13295 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
13297 typedef enum LDKPathFailure_Tag {
13299 * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
13302 LDKPathFailure_InitialSend,
13304 * A hop on the path failed to forward our payment.
13306 LDKPathFailure_OnPath,
13308 * Must be last for serialization purposes
13310 LDKPathFailure_Sentinel,
13311 } LDKPathFailure_Tag;
13313 typedef struct LDKPathFailure_LDKInitialSend_Body {
13315 * The error surfaced from initial send.
13317 struct LDKAPIError err;
13318 } LDKPathFailure_LDKInitialSend_Body;
13320 typedef struct LDKPathFailure_LDKOnPath_Body {
13322 * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
13323 * decisions can take into account the update.
13325 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
13326 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
13328 struct LDKCOption_NetworkUpdateZ network_update;
13329 } LDKPathFailure_LDKOnPath_Body;
13331 typedef struct MUST_USE_STRUCT LDKPathFailure {
13332 LDKPathFailure_Tag tag;
13334 LDKPathFailure_LDKInitialSend_Body initial_send;
13335 LDKPathFailure_LDKOnPath_Body on_path;
13340 * An enum which can either contain a crate::lightning::events::PathFailure or not
13342 typedef enum LDKCOption_PathFailureZ_Tag {
13344 * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
13346 LDKCOption_PathFailureZ_Some,
13348 * When we're in this state, this COption_PathFailureZ contains nothing
13350 LDKCOption_PathFailureZ_None,
13352 * Must be last for serialization purposes
13354 LDKCOption_PathFailureZ_Sentinel,
13355 } LDKCOption_PathFailureZ_Tag;
13357 typedef struct LDKCOption_PathFailureZ {
13358 LDKCOption_PathFailureZ_Tag tag;
13361 struct LDKPathFailure some;
13364 } LDKCOption_PathFailureZ;
13367 * The contents of CResult_COption_PathFailureZDecodeErrorZ
13369 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
13371 * A pointer to the contents in the success state.
13372 * Reading from this pointer when `result_ok` is not set is undefined.
13374 struct LDKCOption_PathFailureZ *result;
13376 * A pointer to the contents in the error state.
13377 * Reading from this pointer when `result_ok` is set is undefined.
13379 struct LDKDecodeError *err;
13380 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
13383 * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
13384 * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13385 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13387 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
13389 * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
13390 * `err` or `result` depending on the state of `result_ok`.
13392 union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
13394 * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
13397 } LDKCResult_COption_PathFailureZDecodeErrorZ;
13402 * Struct to `Display` fields in a safe way using `PrintableString`
13404 typedef struct MUST_USE_STRUCT LDKUntrustedString {
13406 * A pointer to the opaque Rust object.
13407 * Nearly everywhere, inner must be non-null, however in places where
13408 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13410 LDKnativeUntrustedString *inner;
13412 * Indicates that this is the only struct which contains the same pointer.
13413 * Rust functions which take ownership of an object provided via an argument require
13414 * this to be true and invalidate the object pointed to by inner.
13417 } LDKUntrustedString;
13420 * The reason the channel was closed. See individual variants for more details.
13422 typedef enum LDKClosureReason_Tag {
13424 * Closure generated from receiving a peer error message.
13426 * Our counterparty may have broadcasted their latest commitment state, and we have
13429 LDKClosureReason_CounterpartyForceClosed,
13431 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
13433 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
13435 LDKClosureReason_HolderForceClosed,
13437 * The channel was closed after negotiating a cooperative close and we've now broadcasted
13438 * the cooperative close transaction. Note the shutdown may have been initiated by us.
13440 LDKClosureReason_CooperativeClosure,
13442 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
13443 * commitment transaction came from our counterparty, but it may also have come from
13444 * a copy of our own `ChannelMonitor`.
13446 LDKClosureReason_CommitmentTxConfirmed,
13448 * The funding transaction failed to confirm in a timely manner on an inbound channel.
13450 LDKClosureReason_FundingTimedOut,
13452 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
13454 LDKClosureReason_ProcessingError,
13456 * The peer disconnected prior to funding completing. In this case the spec mandates that we
13457 * forget the channel entirely - we can attempt again if the peer reconnects.
13459 * This includes cases where we restarted prior to funding completion, including prior to the
13460 * initial [`ChannelMonitor`] persistence completing.
13462 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
13463 * peer because of mutual incompatibility between us and our channel counterparty.
13465 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
13467 LDKClosureReason_DisconnectedPeer,
13469 * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
13470 * the [`ChannelManager`] deserialized.
13472 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
13473 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
13475 LDKClosureReason_OutdatedChannelManager,
13477 * The counterparty requested a cooperative close of a channel that had not been funded yet.
13478 * The channel has been immediately closed.
13480 LDKClosureReason_CounterpartyCoopClosedUnfundedChannel,
13482 * Must be last for serialization purposes
13484 LDKClosureReason_Sentinel,
13485 } LDKClosureReason_Tag;
13487 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
13489 * The error which the peer sent us.
13491 * Be careful about printing the peer_msg, a well-crafted message could exploit
13492 * a security vulnerability in the terminal emulator or the logging subsystem.
13493 * To be safe, use `Display` on `UntrustedString`
13495 * [`UntrustedString`]: crate::util::string::UntrustedString
13497 struct LDKUntrustedString peer_msg;
13498 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
13500 typedef struct LDKClosureReason_LDKProcessingError_Body {
13502 * A developer-readable error message which we generated.
13505 } LDKClosureReason_LDKProcessingError_Body;
13507 typedef struct MUST_USE_STRUCT LDKClosureReason {
13508 LDKClosureReason_Tag tag;
13510 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
13511 LDKClosureReason_LDKProcessingError_Body processing_error;
13513 } LDKClosureReason;
13516 * An enum which can either contain a crate::lightning::events::ClosureReason or not
13518 typedef enum LDKCOption_ClosureReasonZ_Tag {
13520 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
13522 LDKCOption_ClosureReasonZ_Some,
13524 * When we're in this state, this COption_ClosureReasonZ contains nothing
13526 LDKCOption_ClosureReasonZ_None,
13528 * Must be last for serialization purposes
13530 LDKCOption_ClosureReasonZ_Sentinel,
13531 } LDKCOption_ClosureReasonZ_Tag;
13533 typedef struct LDKCOption_ClosureReasonZ {
13534 LDKCOption_ClosureReasonZ_Tag tag;
13537 struct LDKClosureReason some;
13540 } LDKCOption_ClosureReasonZ;
13543 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
13545 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
13547 * A pointer to the contents in the success state.
13548 * Reading from this pointer when `result_ok` is not set is undefined.
13550 struct LDKCOption_ClosureReasonZ *result;
13552 * A pointer to the contents in the error state.
13553 * Reading from this pointer when `result_ok` is set is undefined.
13555 struct LDKDecodeError *err;
13556 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
13559 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
13560 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13561 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13563 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
13565 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
13566 * `err` or `result` depending on the state of `result_ok`.
13568 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
13570 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
13573 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
13576 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
13578 typedef enum LDKHTLCDestination_Tag {
13580 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
13581 * there is insufficient capacity in our outbound channel.
13583 LDKHTLCDestination_NextHopChannel,
13585 * Scenario where we are unsure of the next node to forward the HTLC to.
13587 LDKHTLCDestination_UnknownNextHop,
13589 * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
13592 LDKHTLCDestination_InvalidForward,
13594 * Failure scenario where an HTLC may have been forwarded to be intended for us,
13595 * but is invalid for some reason, so we reject it.
13597 * Some of the reasons may include:
13599 * * Excess HTLCs for a payment that we have already fully received, over-paying for the
13601 * * The counterparty node modified the HTLC in transit,
13602 * * A probing attack where an intermediary node is trying to detect if we are the ultimate
13603 * recipient for a payment.
13605 LDKHTLCDestination_FailedPayment,
13607 * Must be last for serialization purposes
13609 LDKHTLCDestination_Sentinel,
13610 } LDKHTLCDestination_Tag;
13612 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
13614 * The `node_id` of the next node. For backwards compatibility, this field is
13615 * marked as optional, versions prior to 0.0.110 may not always be able to provide
13616 * counterparty node information.
13618 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
13620 struct LDKPublicKey node_id;
13622 * The outgoing `channel_id` between us and the next node.
13624 struct LDKThirtyTwoBytes channel_id;
13625 } LDKHTLCDestination_LDKNextHopChannel_Body;
13627 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
13629 * Short channel id we are requesting to forward an HTLC to.
13631 uint64_t requested_forward_scid;
13632 } LDKHTLCDestination_LDKUnknownNextHop_Body;
13634 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
13636 * Short channel id we are requesting to forward an HTLC to.
13638 uint64_t requested_forward_scid;
13639 } LDKHTLCDestination_LDKInvalidForward_Body;
13641 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
13643 * The payment hash of the payment we attempted to process.
13645 struct LDKThirtyTwoBytes payment_hash;
13646 } LDKHTLCDestination_LDKFailedPayment_Body;
13648 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
13649 LDKHTLCDestination_Tag tag;
13651 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
13652 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
13653 LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
13654 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
13656 } LDKHTLCDestination;
13659 * An enum which can either contain a crate::lightning::events::HTLCDestination or not
13661 typedef enum LDKCOption_HTLCDestinationZ_Tag {
13663 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
13665 LDKCOption_HTLCDestinationZ_Some,
13667 * When we're in this state, this COption_HTLCDestinationZ contains nothing
13669 LDKCOption_HTLCDestinationZ_None,
13671 * Must be last for serialization purposes
13673 LDKCOption_HTLCDestinationZ_Sentinel,
13674 } LDKCOption_HTLCDestinationZ_Tag;
13676 typedef struct LDKCOption_HTLCDestinationZ {
13677 LDKCOption_HTLCDestinationZ_Tag tag;
13680 struct LDKHTLCDestination some;
13683 } LDKCOption_HTLCDestinationZ;
13686 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
13688 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
13690 * A pointer to the contents in the success state.
13691 * Reading from this pointer when `result_ok` is not set is undefined.
13693 struct LDKCOption_HTLCDestinationZ *result;
13695 * A pointer to the contents in the error state.
13696 * Reading from this pointer when `result_ok` is set is undefined.
13698 struct LDKDecodeError *err;
13699 } LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr;
13702 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
13703 * containing a crate::c_types::derived::COption_HTLCDestinationZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
13704 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13706 typedef struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ {
13708 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
13709 * `err` or `result` depending on the state of `result_ok`.
13711 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
13713 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
13716 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
13719 * The contents of CResult_PaymentFailureReasonDecodeErrorZ
13721 typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
13723 * A pointer to the contents in the success state.
13724 * Reading from this pointer when `result_ok` is not set is undefined.
13726 enum LDKPaymentFailureReason *result;
13728 * A pointer to the contents in the error state.
13729 * Reading from this pointer when `result_ok` is set is undefined.
13731 struct LDKDecodeError *err;
13732 } LDKCResult_PaymentFailureReasonDecodeErrorZPtr;
13735 * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
13736 * containing a crate::lightning::events::PaymentFailureReason on success and a crate::lightning::ln::msgs::DecodeError on failure.
13737 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13739 typedef struct LDKCResult_PaymentFailureReasonDecodeErrorZ {
13741 * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
13742 * `err` or `result` depending on the state of `result_ok`.
13744 union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
13746 * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
13749 } LDKCResult_PaymentFailureReasonDecodeErrorZ;
13752 * An enum which can either contain a crate::c_types::U128 or not
13754 typedef enum LDKCOption_u128Z_Tag {
13756 * When we're in this state, this COption_u128Z contains a crate::c_types::U128
13758 LDKCOption_u128Z_Some,
13760 * When we're in this state, this COption_u128Z contains nothing
13762 LDKCOption_u128Z_None,
13764 * Must be last for serialization purposes
13766 LDKCOption_u128Z_Sentinel,
13767 } LDKCOption_u128Z_Tag;
13769 typedef struct LDKCOption_u128Z {
13770 LDKCOption_u128Z_Tag tag;
13773 struct LDKU128 some;
13776 } LDKCOption_u128Z;
13779 * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
13781 typedef enum LDKCOption_PaymentIdZ_Tag {
13783 * When we're in this state, this COption_PaymentIdZ contains a crate::c_types::ThirtyTwoBytes
13785 LDKCOption_PaymentIdZ_Some,
13787 * When we're in this state, this COption_PaymentIdZ contains nothing
13789 LDKCOption_PaymentIdZ_None,
13791 * Must be last for serialization purposes
13793 LDKCOption_PaymentIdZ_Sentinel,
13794 } LDKCOption_PaymentIdZ_Tag;
13796 typedef struct LDKCOption_PaymentIdZ {
13797 LDKCOption_PaymentIdZ_Tag tag;
13800 struct LDKThirtyTwoBytes some;
13803 } LDKCOption_PaymentIdZ;
13806 * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
13808 typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
13810 * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
13812 LDKCOption_PaymentFailureReasonZ_Some,
13814 * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
13816 LDKCOption_PaymentFailureReasonZ_None,
13818 * Must be last for serialization purposes
13820 LDKCOption_PaymentFailureReasonZ_Sentinel,
13821 } LDKCOption_PaymentFailureReasonZ_Tag;
13823 typedef struct LDKCOption_PaymentFailureReasonZ {
13824 LDKCOption_PaymentFailureReasonZ_Tag tag;
13827 enum LDKPaymentFailureReason some;
13830 } LDKCOption_PaymentFailureReasonZ;
13835 * A descriptor used to sign for a commitment transaction's anchor output.
13837 typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
13839 * A pointer to the opaque Rust object.
13840 * Nearly everywhere, inner must be non-null, however in places where
13841 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13843 LDKnativeAnchorDescriptor *inner;
13845 * Indicates that this is the only struct which contains the same pointer.
13846 * Rust functions which take ownership of an object provided via an argument require
13847 * this to be true and invalidate the object pointed to by inner.
13850 } LDKAnchorDescriptor;
13853 * Represents the different types of transactions, originating from LDK, to be bumped.
13855 typedef enum LDKBumpTransactionEvent_Tag {
13857 * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
13858 * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
13859 * they may need additional fees to be attached through a child transaction using the popular
13860 * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
13861 * child transaction must include the anchor input described within `anchor_descriptor` along
13862 * with additional inputs to meet the target feerate. Failure to meet the target feerate
13863 * decreases the confirmation odds of the transaction package (which includes the commitment
13864 * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
13865 * is constructed, it must be fully signed for and broadcast by the consumer of the event
13866 * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
13867 * broadcast first, as the child anchor transaction depends on it.
13869 * The consumer should be able to sign for any of the additional inputs included within the
13870 * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
13871 * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
13872 * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
13873 * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
13874 * full witness required to spend.
13876 * It is possible to receive more than one instance of this event if a valid child anchor
13877 * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
13878 * be taken by the consumer of the event to ensure any future iterations of the child anchor
13879 * transaction adhere to the [Replace-By-Fee
13880 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
13881 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
13882 * these events is not user-controlled, users may ignore/drop the event if they are no longer
13883 * able to commit external confirmed funds to the child anchor transaction.
13885 * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
13886 * determine whether a significant portion of the channel's funds are allocated to HTLCs,
13887 * enabling users to make their own decisions regarding the importance of the commitment
13888 * transaction's confirmation. Note that this is not required, but simply exists as an option
13889 * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
13890 * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
13893 * [`EcdsaChannelSigner`]: crate::sign::EcdsaChannelSigner
13894 * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::EcdsaChannelSigner::sign_holder_anchor_input
13895 * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
13897 LDKBumpTransactionEvent_ChannelClose,
13899 * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
13900 * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
13901 * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
13902 * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
13903 * for a timely confirmation within the chain. These additional inputs and/or outputs must be
13904 * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
13905 * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
13906 * loss of funds. Once the transaction meets the target feerate, it must be signed for and
13907 * broadcast by the consumer of the event.
13909 * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
13910 * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
13911 * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
13912 * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
13913 * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
13916 * It is possible to receive more than one instance of this event if a valid HTLC transaction
13917 * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
13918 * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
13919 * the [Replace-By-Fee
13920 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
13921 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
13922 * these events is not user-controlled, users may ignore/drop the event if either they are no
13923 * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
13924 * to the HTLC transaction is greater in value than the HTLCs being claimed.
13926 * [`EcdsaChannelSigner`]: crate::sign::EcdsaChannelSigner
13927 * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::EcdsaChannelSigner::sign_holder_htlc_transaction
13928 * [`HTLCDescriptor::tx_input_witness`]: HTLCDescriptor::tx_input_witness
13930 LDKBumpTransactionEvent_HTLCResolution,
13932 * Must be last for serialization purposes
13934 LDKBumpTransactionEvent_Sentinel,
13935 } LDKBumpTransactionEvent_Tag;
13937 typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
13939 * The unique identifier for the claim of the anchor output in the commitment transaction.
13941 * The identifier must map to the set of external UTXOs assigned to the claim, such that
13942 * they can be reused when a new claim with the same identifier needs to be made, resulting
13943 * in a fee-bumping attempt.
13945 struct LDKThirtyTwoBytes claim_id;
13947 * The target feerate that the transaction package, which consists of the commitment
13948 * transaction and the to-be-crafted child anchor transaction, must meet.
13950 uint32_t package_target_feerate_sat_per_1000_weight;
13952 * The channel's commitment transaction to bump the fee of. This transaction should be
13953 * broadcast along with the anchor transaction constructed as a result of consuming this
13956 struct LDKTransaction commitment_tx;
13958 * The absolute fee in satoshis of the commitment transaction. This can be used along the
13959 * with weight of the commitment transaction to determine its feerate.
13961 uint64_t commitment_tx_fee_satoshis;
13963 * The descriptor to sign the anchor input of the anchor transaction constructed as a
13964 * result of consuming this event.
13966 struct LDKAnchorDescriptor anchor_descriptor;
13968 * The set of pending HTLCs on the commitment transaction that need to be resolved once the
13969 * commitment transaction confirms.
13971 struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
13972 } LDKBumpTransactionEvent_LDKChannelClose_Body;
13974 typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
13976 * The unique identifier for the claim of the HTLCs in the confirmed commitment
13979 * The identifier must map to the set of external UTXOs assigned to the claim, such that
13980 * they can be reused when a new claim with the same identifier needs to be made, resulting
13981 * in a fee-bumping attempt.
13983 struct LDKThirtyTwoBytes claim_id;
13985 * The target feerate that the resulting HTLC transaction must meet.
13987 uint32_t target_feerate_sat_per_1000_weight;
13989 * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
13990 * by the same transaction.
13992 struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
13994 * The locktime required for the resulting HTLC transaction.
13996 uint32_t tx_lock_time;
13997 } LDKBumpTransactionEvent_LDKHTLCResolution_Body;
13999 typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
14000 LDKBumpTransactionEvent_Tag tag;
14002 LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
14003 LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
14005 } LDKBumpTransactionEvent;
14008 * An Event which you should probably take some action in response to.
14010 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
14011 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
14012 * written as it makes no sense to respond to it after reconnecting to peers).
14014 typedef enum LDKEvent_Tag {
14016 * Used to indicate that the client should generate a funding transaction with the given
14017 * parameters and then call [`ChannelManager::funding_transaction_generated`].
14018 * Generated in [`ChannelManager`] message handling.
14019 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
14020 * counterparty can steal your funds!
14022 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14023 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
14025 LDKEvent_FundingGenerationReady,
14027 * Indicates that we've been offered a payment and it needs to be claimed via calling
14028 * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
14030 * Note that if the preimage is not known, you should call
14031 * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
14032 * to free up resources for this HTLC and avoid network congestion.
14033 * If you fail to call either [`ChannelManager::claim_funds`], [`ChannelManager::fail_htlc_backwards`],
14034 * or [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will be
14035 * automatically failed.
14038 * LDK will not stop an inbound payment from being paid multiple times, so multiple
14039 * `PaymentClaimable` events may be generated for the same payment. In such a case it is
14040 * polite (and required in the lightning specification) to fail the payment the second time
14041 * and give the sender their money back rather than accepting double payment.
14044 * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
14046 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14047 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
14048 * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
14050 LDKEvent_PaymentClaimable,
14052 * Indicates a payment has been claimed and we've received money!
14054 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
14055 * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
14056 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
14057 * [`Event::PaymentClaimable`] event.
14060 * LDK will not stop an inbound payment from being paid multiple times, so multiple
14061 * `PaymentClaimable` events may be generated for the same payment. If you then call
14062 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
14063 * multiple `PaymentClaimed` events.
14065 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14067 LDKEvent_PaymentClaimed,
14069 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
14070 * and we got back the payment preimage for it).
14072 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
14073 * event. In this situation, you SHOULD treat this payment as having succeeded.
14075 LDKEvent_PaymentSent,
14077 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
14078 * provide failure information for each path attempt in the payment, including retries.
14080 * This event is provided once there are no further pending HTLCs for the payment and the
14081 * payment is no longer retryable, due either to the [`Retry`] provided or
14082 * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
14084 * [`Retry`]: crate::ln::channelmanager::Retry
14085 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
14087 LDKEvent_PaymentFailed,
14089 * Indicates that a path for an outbound payment was successful.
14091 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
14092 * [`Event::PaymentSent`] for obtaining the payment preimage.
14094 LDKEvent_PaymentPathSuccessful,
14096 * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
14099 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
14100 * [`Event::PaymentFailed`].
14102 * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
14105 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
14107 LDKEvent_PaymentPathFailed,
14109 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
14111 LDKEvent_ProbeSuccessful,
14113 * Indicates that a probe payment we sent failed at an intermediary node on the path.
14115 LDKEvent_ProbeFailed,
14117 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
14118 * a time in the future.
14120 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
14122 LDKEvent_PendingHTLCsForwardable,
14124 * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
14125 * you've encoded an intercept scid in the receiver's invoice route hints using
14126 * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
14128 * [`ChannelManager::forward_intercepted_htlc`] or
14129 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
14130 * their docs for more information.
14132 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
14133 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
14134 * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
14135 * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
14137 LDKEvent_HTLCIntercepted,
14139 * Used to indicate that an output which you should know how to spend was confirmed on chain
14140 * and is now spendable.
14141 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
14142 * counterparty spending them due to some kind of timeout. Thus, you need to store them
14143 * somewhere and spend them when you create on-chain transactions.
14145 LDKEvent_SpendableOutputs,
14147 * This event is generated when a payment has been successfully forwarded through us and a
14148 * forwarding fee earned.
14150 LDKEvent_PaymentForwarded,
14152 * Used to indicate that a channel with the given `channel_id` is being opened and pending
14153 * confirmation on-chain.
14155 * This event is emitted when the funding transaction has been signed and is broadcast to the
14156 * network. For 0conf channels it will be immediately followed by the corresponding
14157 * [`Event::ChannelReady`] event.
14159 LDKEvent_ChannelPending,
14161 * Used to indicate that a channel with the given `channel_id` is ready to
14162 * be used. This event is emitted either when the funding transaction has been confirmed
14163 * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
14166 LDKEvent_ChannelReady,
14168 * Used to indicate that a previously opened channel with the given `channel_id` is in the
14169 * process of closure.
14171 LDKEvent_ChannelClosed,
14173 * Used to indicate to the user that they can abandon the funding transaction and recycle the
14174 * inputs for another purpose.
14176 LDKEvent_DiscardFunding,
14178 * Indicates a request to open a new channel by a peer.
14180 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the
14181 * request, call [`ChannelManager::force_close_without_broadcasting_txn`].
14183 * The event is only triggered when a new open channel request is received and the
14184 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
14186 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
14187 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
14188 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
14190 LDKEvent_OpenChannelRequest,
14192 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
14195 * Some scenarios where this event may be sent include:
14196 * * Insufficient capacity in the outbound channel
14197 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
14198 * * When an unknown SCID is requested for forwarding a payment.
14199 * * Expected MPP amount has already been reached
14200 * * The HTLC has timed out
14202 * This event, however, does not get generated if an HTLC fails to meet the forwarding
14203 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
14205 LDKEvent_HTLCHandlingFailed,
14207 * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
14208 * requires confirmed external funds to be readily available to spend.
14210 * LDK does not currently generate this event unless the
14211 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
14212 * It is limited to the scope of channels with anchor outputs.
14214 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
14216 LDKEvent_BumpTransaction,
14218 * Must be last for serialization purposes
14223 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
14225 * The random channel_id we picked which you'll need to pass into
14226 * [`ChannelManager::funding_transaction_generated`].
14228 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
14230 struct LDKThirtyTwoBytes temporary_channel_id;
14232 * The counterparty's node_id, which you'll need to pass back into
14233 * [`ChannelManager::funding_transaction_generated`].
14235 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
14237 struct LDKPublicKey counterparty_node_id;
14239 * The value, in satoshis, that the output should have.
14241 uint64_t channel_value_satoshis;
14243 * The script which should be used in the transaction output.
14245 struct LDKCVec_u8Z output_script;
14247 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or a
14248 * random value for an inbound channel. This may be zero for objects serialized with LDK
14249 * versions prior to 0.0.113.
14251 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
14253 struct LDKU128 user_channel_id;
14254 } LDKEvent_LDKFundingGenerationReady_Body;
14256 typedef struct LDKEvent_LDKPaymentClaimable_Body {
14258 * The node that will receive the payment after it has been claimed.
14259 * This is useful to identify payments received via [phantom nodes].
14260 * This field will always be filled in when the event was generated by LDK versions
14261 * 0.0.113 and above.
14263 * [phantom nodes]: crate::sign::PhantomKeysManager
14265 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14267 struct LDKPublicKey receiver_node_id;
14269 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
14270 * not stop you from registering duplicate payment hashes for inbound payments.
14272 struct LDKThirtyTwoBytes payment_hash;
14274 * The fields in the onion which were received with each HTLC. Only fields which were
14275 * identical in each HTLC involved in the payment will be included here.
14277 * Payments received on LDK versions prior to 0.0.115 will have this field unset.
14279 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14281 struct LDKRecipientOnionFields onion_fields;
14283 * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
14284 * than the invoice amount.
14286 * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
14287 * and the previous hop took an extra fee.
14290 * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
14291 * field, you may lose money!
14293 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
14295 uint64_t amount_msat;
14297 * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
14298 * taken by our channel counterparty.
14300 * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
14302 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
14304 uint64_t counterparty_skimmed_fee_msat;
14306 * Information for claiming this received payment, based on whether the purpose of the
14307 * payment is to pay an invoice or to send a spontaneous payment.
14309 struct LDKPaymentPurpose purpose;
14311 * The `channel_id` indicating over which channel we received the payment.
14313 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14315 struct LDKThirtyTwoBytes via_channel_id;
14317 * The `user_channel_id` indicating over which channel we received the payment.
14319 struct LDKCOption_u128Z via_user_channel_id;
14321 * The block height at which this payment will be failed back and will no longer be
14322 * eligible for claiming.
14324 * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
14325 * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
14327 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
14329 struct LDKCOption_u32Z claim_deadline;
14330 } LDKEvent_LDKPaymentClaimable_Body;
14332 typedef struct LDKEvent_LDKPaymentClaimed_Body {
14334 * The node that received the payment.
14335 * This is useful to identify payments which were received via [phantom nodes].
14336 * This field will always be filled in when the event was generated by LDK versions
14337 * 0.0.113 and above.
14339 * [phantom nodes]: crate::sign::PhantomKeysManager
14341 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14343 struct LDKPublicKey receiver_node_id;
14345 * The payment hash of the claimed payment. Note that LDK will not stop you from
14346 * registering duplicate payment hashes for inbound payments.
14348 struct LDKThirtyTwoBytes payment_hash;
14350 * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
14353 uint64_t amount_msat;
14355 * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
14356 * spontaneous payment.
14358 struct LDKPaymentPurpose purpose;
14359 } LDKEvent_LDKPaymentClaimed_Body;
14361 typedef struct LDKEvent_LDKPaymentSent_Body {
14363 * The `payment_id` passed to [`ChannelManager::send_payment`].
14365 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
14367 struct LDKCOption_PaymentIdZ payment_id;
14369 * The preimage to the hash given to ChannelManager::send_payment.
14370 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
14371 * store it somehow!
14373 struct LDKThirtyTwoBytes payment_preimage;
14375 * The hash that was given to [`ChannelManager::send_payment`].
14377 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
14379 struct LDKThirtyTwoBytes payment_hash;
14381 * The total fee which was spent at intermediate hops in this payment, across all paths.
14383 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
14384 * overpayment to the recipient node.
14386 * If the recipient or an intermediate node misbehaves and gives us free money, this may
14387 * overstate the amount paid, though this is unlikely.
14389 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
14391 struct LDKCOption_u64Z fee_paid_msat;
14392 } LDKEvent_LDKPaymentSent_Body;
14394 typedef struct LDKEvent_LDKPaymentFailed_Body {
14396 * The `payment_id` passed to [`ChannelManager::send_payment`].
14398 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
14400 struct LDKThirtyTwoBytes payment_id;
14402 * The hash that was given to [`ChannelManager::send_payment`].
14404 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
14406 struct LDKThirtyTwoBytes payment_hash;
14408 * The reason the payment failed. This is only `None` for events generated or serialized
14409 * by versions prior to 0.0.115.
14411 struct LDKCOption_PaymentFailureReasonZ reason;
14412 } LDKEvent_LDKPaymentFailed_Body;
14414 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
14416 * The `payment_id` passed to [`ChannelManager::send_payment`].
14418 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
14420 struct LDKThirtyTwoBytes payment_id;
14422 * The hash that was given to [`ChannelManager::send_payment`].
14424 * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
14426 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
14428 struct LDKCOption_PaymentHashZ payment_hash;
14430 * The payment path that was successful.
14432 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
14434 struct LDKPath path;
14435 } LDKEvent_LDKPaymentPathSuccessful_Body;
14437 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
14439 * The `payment_id` passed to [`ChannelManager::send_payment`].
14441 * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
14443 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
14444 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
14446 struct LDKCOption_PaymentIdZ payment_id;
14448 * The hash that was given to [`ChannelManager::send_payment`].
14450 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
14452 struct LDKThirtyTwoBytes payment_hash;
14454 * Indicates the payment was rejected for some reason by the recipient. This implies that
14455 * the payment has failed, not just the route in question. If this is not set, the payment may
14456 * be retried via a different route.
14458 bool payment_failed_permanently;
14460 * Extra error details based on the failure type. May contain an update that needs to be
14461 * applied to the [`NetworkGraph`].
14463 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
14465 struct LDKPathFailure failure;
14467 * The payment path that failed.
14469 struct LDKPath path;
14471 * The channel responsible for the failed payment path.
14473 * Note that for route hints or for the first hop in a path this may be an SCID alias and
14474 * may not refer to a channel in the public network graph. These aliases may also collide
14475 * with channels in the public network graph.
14477 * If this is `Some`, then the corresponding channel should be avoided when the payment is
14478 * retried. May be `None` for older [`Event`] serializations.
14480 struct LDKCOption_u64Z short_channel_id;
14481 } LDKEvent_LDKPaymentPathFailed_Body;
14483 typedef struct LDKEvent_LDKProbeSuccessful_Body {
14485 * The id returned by [`ChannelManager::send_probe`].
14487 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
14489 struct LDKThirtyTwoBytes payment_id;
14491 * The hash generated by [`ChannelManager::send_probe`].
14493 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
14495 struct LDKThirtyTwoBytes payment_hash;
14497 * The payment path that was successful.
14499 struct LDKPath path;
14500 } LDKEvent_LDKProbeSuccessful_Body;
14502 typedef struct LDKEvent_LDKProbeFailed_Body {
14504 * The id returned by [`ChannelManager::send_probe`].
14506 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
14508 struct LDKThirtyTwoBytes payment_id;
14510 * The hash generated by [`ChannelManager::send_probe`].
14512 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
14514 struct LDKThirtyTwoBytes payment_hash;
14516 * The payment path that failed.
14518 struct LDKPath path;
14520 * The channel responsible for the failed probe.
14522 * Note that for route hints or for the first hop in a path this may be an SCID alias and
14523 * may not refer to a channel in the public network graph. These aliases may also collide
14524 * with channels in the public network graph.
14526 struct LDKCOption_u64Z short_channel_id;
14527 } LDKEvent_LDKProbeFailed_Body;
14529 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
14531 * The minimum amount of time that should be waited prior to calling
14532 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
14533 * you should wait a random amount of time in roughly the range (now + time_forwardable,
14534 * now + 5*time_forwardable).
14536 uint64_t time_forwardable;
14537 } LDKEvent_LDKPendingHTLCsForwardable_Body;
14539 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
14541 * An id to help LDK identify which HTLC is being forwarded or failed.
14543 struct LDKThirtyTwoBytes intercept_id;
14545 * The fake scid that was programmed as the next hop's scid, generated using
14546 * [`ChannelManager::get_intercept_scid`].
14548 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
14550 uint64_t requested_next_hop_scid;
14552 * The payment hash used for this HTLC.
14554 struct LDKThirtyTwoBytes payment_hash;
14556 * How many msats were received on the inbound edge of this HTLC.
14558 uint64_t inbound_amount_msat;
14560 * How many msats the payer intended to route to the next node. Depending on the reason you are
14561 * intercepting this payment, you might take a fee by forwarding less than this amount.
14562 * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
14564 * Note that LDK will NOT check that expected fees were factored into this value. You MUST
14565 * check that whatever fee you want has been included here or subtract it as required. Further,
14566 * LDK will not stop you from forwarding more than you received.
14568 uint64_t expected_outbound_amount_msat;
14569 } LDKEvent_LDKHTLCIntercepted_Body;
14571 typedef struct LDKEvent_LDKSpendableOutputs_Body {
14573 * The outputs which you should store as spendable by you.
14575 struct LDKCVec_SpendableOutputDescriptorZ outputs;
14576 } LDKEvent_LDKSpendableOutputs_Body;
14578 typedef struct LDKEvent_LDKPaymentForwarded_Body {
14580 * The incoming channel between the previous node and us. This is only `None` for events
14581 * generated or serialized by versions prior to 0.0.107.
14583 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14585 struct LDKThirtyTwoBytes prev_channel_id;
14587 * The outgoing channel between the next node and us. This is only `None` for events
14588 * generated or serialized by versions prior to 0.0.107.
14590 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14592 struct LDKThirtyTwoBytes next_channel_id;
14594 * The fee, in milli-satoshis, which was earned as a result of the payment.
14596 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
14597 * was pending, the amount the next hop claimed will have been rounded down to the nearest
14598 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
14599 * claimed the full value in millisatoshis from the source. In this case,
14600 * `claim_from_onchain_tx` will be set.
14602 * If the channel which sent us the payment has been force-closed, we will claim the funds
14603 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
14604 * fees which we will spend and will instead set this to `None`. It is possible duplicate
14605 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
14608 struct LDKCOption_u64Z fee_earned_msat;
14610 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
14613 bool claim_from_onchain_tx;
14615 * The final amount forwarded, in milli-satoshis, after the fee is deducted.
14617 * The caveat described above the `fee_earned_msat` field applies here as well.
14619 struct LDKCOption_u64Z outbound_amount_forwarded_msat;
14620 } LDKEvent_LDKPaymentForwarded_Body;
14622 typedef struct LDKEvent_LDKChannelPending_Body {
14624 * The `channel_id` of the channel that is pending confirmation.
14626 struct LDKThirtyTwoBytes channel_id;
14628 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
14629 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
14630 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
14631 * `user_channel_id` will be randomized for an inbound channel.
14633 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
14634 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
14635 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
14637 struct LDKU128 user_channel_id;
14639 * The `temporary_channel_id` this channel used to be known by during channel establishment.
14641 * Will be `None` for channels created prior to LDK version 0.0.115.
14643 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
14645 struct LDKThirtyTwoBytes former_temporary_channel_id;
14647 * The `node_id` of the channel counterparty.
14649 struct LDKPublicKey counterparty_node_id;
14651 * The outpoint of the channel's funding transaction.
14653 struct LDKOutPoint funding_txo;
14654 } LDKEvent_LDKChannelPending_Body;
14656 typedef struct LDKEvent_LDKChannelReady_Body {
14658 * The `channel_id` of the channel that is ready.
14660 struct LDKThirtyTwoBytes channel_id;
14662 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
14663 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
14664 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
14665 * `user_channel_id` will be randomized for an inbound channel.
14667 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
14668 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
14669 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
14671 struct LDKU128 user_channel_id;
14673 * The `node_id` of the channel counterparty.
14675 struct LDKPublicKey counterparty_node_id;
14677 * The features that this channel will operate with.
14679 struct LDKChannelTypeFeatures channel_type;
14680 } LDKEvent_LDKChannelReady_Body;
14682 typedef struct LDKEvent_LDKChannelClosed_Body {
14684 * The `channel_id` of the channel which has been closed. Note that on-chain transactions
14685 * resolving the channel are likely still awaiting confirmation.
14687 struct LDKThirtyTwoBytes channel_id;
14689 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
14690 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
14691 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
14692 * `user_channel_id` will be randomized for inbound channels.
14693 * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
14694 * zero for objects serialized with LDK versions prior to 0.0.102.
14696 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
14697 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
14698 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
14700 struct LDKU128 user_channel_id;
14702 * The reason the channel was closed.
14704 struct LDKClosureReason reason;
14705 } LDKEvent_LDKChannelClosed_Body;
14707 typedef struct LDKEvent_LDKDiscardFunding_Body {
14709 * The channel_id of the channel which has been closed.
14711 struct LDKThirtyTwoBytes channel_id;
14713 * The full transaction received from the user
14715 struct LDKTransaction transaction;
14716 } LDKEvent_LDKDiscardFunding_Body;
14718 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
14720 * The temporary channel ID of the channel requested to be opened.
14722 * When responding to the request, the `temporary_channel_id` should be passed
14723 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
14724 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
14726 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
14727 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
14729 struct LDKThirtyTwoBytes temporary_channel_id;
14731 * The node_id of the counterparty requesting to open the channel.
14733 * When responding to the request, the `counterparty_node_id` should be passed
14734 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
14735 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
14738 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
14739 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
14741 struct LDKPublicKey counterparty_node_id;
14743 * The channel value of the requested channel.
14745 uint64_t funding_satoshis;
14747 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
14749 uint64_t push_msat;
14751 * The features that this channel will operate with. If you reject the channel, a
14752 * well-behaved counterparty may automatically re-attempt the channel with a new set of
14755 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
14756 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
14759 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
14760 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
14761 * 0.0.107. Channels setting this type also need to get manually accepted via
14762 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
14763 * or will be rejected otherwise.
14765 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
14767 struct LDKChannelTypeFeatures channel_type;
14768 } LDKEvent_LDKOpenChannelRequest_Body;
14770 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
14772 * The channel over which the HTLC was received.
14774 struct LDKThirtyTwoBytes prev_channel_id;
14776 * Destination of the HTLC that failed to be processed.
14778 struct LDKHTLCDestination failed_next_destination;
14779 } LDKEvent_LDKHTLCHandlingFailed_Body;
14781 typedef struct MUST_USE_STRUCT LDKEvent {
14784 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
14785 LDKEvent_LDKPaymentClaimable_Body payment_claimable;
14786 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
14787 LDKEvent_LDKPaymentSent_Body payment_sent;
14788 LDKEvent_LDKPaymentFailed_Body payment_failed;
14789 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
14790 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
14791 LDKEvent_LDKProbeSuccessful_Body probe_successful;
14792 LDKEvent_LDKProbeFailed_Body probe_failed;
14793 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
14794 LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
14795 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
14796 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
14797 LDKEvent_LDKChannelPending_Body channel_pending;
14798 LDKEvent_LDKChannelReady_Body channel_ready;
14799 LDKEvent_LDKChannelClosed_Body channel_closed;
14800 LDKEvent_LDKDiscardFunding_Body discard_funding;
14801 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
14802 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
14804 struct LDKBumpTransactionEvent bump_transaction;
14810 * An enum which can either contain a crate::lightning::events::Event or not
14812 typedef enum LDKCOption_EventZ_Tag {
14814 * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
14816 LDKCOption_EventZ_Some,
14818 * When we're in this state, this COption_EventZ contains nothing
14820 LDKCOption_EventZ_None,
14822 * Must be last for serialization purposes
14824 LDKCOption_EventZ_Sentinel,
14825 } LDKCOption_EventZ_Tag;
14827 typedef struct LDKCOption_EventZ {
14828 LDKCOption_EventZ_Tag tag;
14831 struct LDKEvent some;
14834 } LDKCOption_EventZ;
14837 * The contents of CResult_COption_EventZDecodeErrorZ
14839 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
14841 * A pointer to the contents in the success state.
14842 * Reading from this pointer when `result_ok` is not set is undefined.
14844 struct LDKCOption_EventZ *result;
14846 * A pointer to the contents in the error state.
14847 * Reading from this pointer when `result_ok` is set is undefined.
14849 struct LDKDecodeError *err;
14850 } LDKCResult_COption_EventZDecodeErrorZPtr;
14853 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
14854 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
14855 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14857 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
14859 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
14860 * `err` or `result` depending on the state of `result_ok`.
14862 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
14864 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
14867 } LDKCResult_COption_EventZDecodeErrorZ;
14870 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlockHashChannelMonitorZs of arbitrary size.
14871 * This corresponds to std::vector in C++
14873 typedef struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ {
14875 * The elements in the array.
14876 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14878 struct LDKC2Tuple_BlockHashChannelMonitorZ *data;
14880 * The number of elements pointed to by `data`.
14883 } LDKCVec_C2Tuple_BlockHashChannelMonitorZZ;
14886 * The contents of CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ
14888 typedef union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr {
14890 * A pointer to the contents in the success state.
14891 * Reading from this pointer when `result_ok` is not set is undefined.
14893 struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ *result;
14895 * A pointer to the contents in the error state.
14896 * Reading from this pointer when `result_ok` is set is undefined.
14898 enum LDKIOError *err;
14899 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr;
14902 * A CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents the result of a fallible operation,
14903 * containing a crate::c_types::derived::CVec_C2Tuple_BlockHashChannelMonitorZZ on success and a crate::c_types::IOError on failure.
14904 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14906 typedef struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
14908 * The contents of this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ, accessible via either
14909 * `err` or `result` depending on the state of `result_ok`.
14911 union LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZPtr contents;
14913 * Whether this CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ represents a success state.
14916 } LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ;
14919 * Sub-errors which don't have specific information in them use this type.
14921 typedef struct LDKError {
14923 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
14929 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
14930 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
14932 typedef enum LDKBolt11ParseError_Tag {
14933 LDKBolt11ParseError_Bech32Error,
14934 LDKBolt11ParseError_ParseAmountError,
14935 LDKBolt11ParseError_MalformedSignature,
14936 LDKBolt11ParseError_BadPrefix,
14937 LDKBolt11ParseError_UnknownCurrency,
14938 LDKBolt11ParseError_UnknownSiPrefix,
14939 LDKBolt11ParseError_MalformedHRP,
14940 LDKBolt11ParseError_TooShortDataPart,
14941 LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
14942 LDKBolt11ParseError_DescriptionDecodeError,
14943 LDKBolt11ParseError_PaddingError,
14944 LDKBolt11ParseError_IntegerOverflowError,
14945 LDKBolt11ParseError_InvalidSegWitProgramLength,
14946 LDKBolt11ParseError_InvalidPubKeyHashLength,
14947 LDKBolt11ParseError_InvalidScriptHashLength,
14948 LDKBolt11ParseError_InvalidRecoveryId,
14949 LDKBolt11ParseError_InvalidSliceLength,
14951 * Not an error, but used internally to signal that a part of the invoice should be ignored
14952 * according to BOLT11
14954 LDKBolt11ParseError_Skip,
14956 * Must be last for serialization purposes
14958 LDKBolt11ParseError_Sentinel,
14959 } LDKBolt11ParseError_Tag;
14961 typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
14962 LDKBolt11ParseError_Tag tag;
14965 struct LDKBech32Error bech32_error;
14968 struct LDKError parse_amount_error;
14971 enum LDKSecp256k1Error malformed_signature;
14974 struct LDKError description_decode_error;
14977 struct LDKStr invalid_slice_length;
14980 } LDKBolt11ParseError;
14983 * The contents of CResult_SiPrefixBolt11ParseErrorZ
14985 typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
14987 * A pointer to the contents in the success state.
14988 * Reading from this pointer when `result_ok` is not set is undefined.
14990 enum LDKSiPrefix *result;
14992 * A pointer to the contents in the error state.
14993 * Reading from this pointer when `result_ok` is set is undefined.
14995 struct LDKBolt11ParseError *err;
14996 } LDKCResult_SiPrefixBolt11ParseErrorZPtr;
14999 * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
15000 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
15001 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15003 typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
15005 * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
15006 * `err` or `result` depending on the state of `result_ok`.
15008 union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
15010 * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
15013 } LDKCResult_SiPrefixBolt11ParseErrorZ;
15016 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
15017 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
15018 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
15020 typedef enum LDKParseOrSemanticError_Tag {
15022 * The invoice couldn't be decoded
15024 LDKParseOrSemanticError_ParseError,
15026 * The invoice could be decoded but violates the BOLT11 standard
15028 LDKParseOrSemanticError_SemanticError,
15030 * Must be last for serialization purposes
15032 LDKParseOrSemanticError_Sentinel,
15033 } LDKParseOrSemanticError_Tag;
15035 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
15036 LDKParseOrSemanticError_Tag tag;
15039 struct LDKBolt11ParseError parse_error;
15042 enum LDKBolt11SemanticError semantic_error;
15045 } LDKParseOrSemanticError;
15048 * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
15050 typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
15052 * A pointer to the contents in the success state.
15053 * Reading from this pointer when `result_ok` is not set is undefined.
15055 struct LDKBolt11Invoice *result;
15057 * A pointer to the contents in the error state.
15058 * Reading from this pointer when `result_ok` is set is undefined.
15060 struct LDKParseOrSemanticError *err;
15061 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
15064 * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
15065 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
15066 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15068 typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
15070 * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
15071 * `err` or `result` depending on the state of `result_ok`.
15073 union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
15075 * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
15078 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
15083 * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
15087 * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
15089 typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
15091 * A pointer to the opaque Rust object.
15092 * Nearly everywhere, inner must be non-null, however in places where
15093 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15095 LDKnativeSignedRawBolt11Invoice *inner;
15097 * Indicates that this is the only struct which contains the same pointer.
15098 * Rust functions which take ownership of an object provided via an argument require
15099 * this to be true and invalidate the object pointed to by inner.
15102 } LDKSignedRawBolt11Invoice;
15105 * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
15107 typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
15109 * A pointer to the contents in the success state.
15110 * Reading from this pointer when `result_ok` is not set is undefined.
15112 struct LDKSignedRawBolt11Invoice *result;
15114 * A pointer to the contents in the error state.
15115 * Reading from this pointer when `result_ok` is set is undefined.
15117 struct LDKBolt11ParseError *err;
15118 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
15121 * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
15122 * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
15123 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15125 typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
15127 * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
15128 * `err` or `result` depending on the state of `result_ok`.
15130 union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
15132 * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
15135 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
15140 * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
15141 * but without the signature information.
15142 * Decoding and encoding should not lead to information loss but may lead to different hashes.
15144 * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
15146 typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
15148 * A pointer to the opaque Rust object.
15149 * Nearly everywhere, inner must be non-null, however in places where
15150 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15152 LDKnativeRawBolt11Invoice *inner;
15154 * Indicates that this is the only struct which contains the same pointer.
15155 * Rust functions which take ownership of an object provided via an argument require
15156 * this to be true and invalidate the object pointed to by inner.
15159 } LDKRawBolt11Invoice;
15164 * Recoverable signature
15166 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
15168 * A pointer to the opaque Rust object.
15169 * Nearly everywhere, inner must be non-null, however in places where
15170 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15172 LDKnativeBolt11InvoiceSignature *inner;
15174 * Indicates that this is the only struct which contains the same pointer.
15175 * Rust functions which take ownership of an object provided via an argument require
15176 * this to be true and invalidate the object pointed to by inner.
15179 } LDKBolt11InvoiceSignature;
15182 * A tuple of 3 elements. See the individual fields for the types contained.
15184 typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
15186 * The element at position 0
15188 struct LDKRawBolt11Invoice a;
15190 * The element at position 1
15192 struct LDKThirtyTwoBytes b;
15194 * The element at position 2
15196 struct LDKBolt11InvoiceSignature c;
15197 } LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
15204 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
15206 * A pointer to the opaque Rust object.
15207 * Nearly everywhere, inner must be non-null, however in places where
15208 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15210 LDKnativePayeePubKey *inner;
15212 * Indicates that this is the only struct which contains the same pointer.
15213 * Rust functions which take ownership of an object provided via an argument require
15214 * this to be true and invalidate the object pointed to by inner.
15220 * The contents of CResult_PayeePubKeyErrorZ
15222 typedef union LDKCResult_PayeePubKeyErrorZPtr {
15224 * A pointer to the contents in the success state.
15225 * Reading from this pointer when `result_ok` is not set is undefined.
15227 struct LDKPayeePubKey *result;
15229 * A pointer to the contents in the error state.
15230 * Reading from this pointer when `result_ok` is set is undefined.
15232 enum LDKSecp256k1Error *err;
15233 } LDKCResult_PayeePubKeyErrorZPtr;
15236 * A CResult_PayeePubKeyErrorZ represents the result of a fallible operation,
15237 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
15238 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15240 typedef struct LDKCResult_PayeePubKeyErrorZ {
15242 * The contents of this CResult_PayeePubKeyErrorZ, accessible via either
15243 * `err` or `result` depending on the state of `result_ok`.
15245 union LDKCResult_PayeePubKeyErrorZPtr contents;
15247 * Whether this CResult_PayeePubKeyErrorZ represents a success state.
15250 } LDKCResult_PayeePubKeyErrorZ;
15255 * Private routing information
15258 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
15261 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
15263 * A pointer to the opaque Rust object.
15264 * Nearly everywhere, inner must be non-null, however in places where
15265 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15267 LDKnativePrivateRoute *inner;
15269 * Indicates that this is the only struct which contains the same pointer.
15270 * Rust functions which take ownership of an object provided via an argument require
15271 * this to be true and invalidate the object pointed to by inner.
15277 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
15278 * This corresponds to std::vector in C++
15280 typedef struct LDKCVec_PrivateRouteZ {
15282 * The elements in the array.
15283 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
15285 struct LDKPrivateRoute *data;
15287 * The number of elements pointed to by `data`.
15290 } LDKCVec_PrivateRouteZ;
15295 * A timestamp that refers to a date after 1 January 1970.
15299 * The Unix timestamp representing the stored time has to be positive and no greater than
15300 * [`MAX_TIMESTAMP`].
15302 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
15304 * A pointer to the opaque Rust object.
15305 * Nearly everywhere, inner must be non-null, however in places where
15306 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15308 LDKnativePositiveTimestamp *inner;
15310 * Indicates that this is the only struct which contains the same pointer.
15311 * Rust functions which take ownership of an object provided via an argument require
15312 * this to be true and invalidate the object pointed to by inner.
15315 } LDKPositiveTimestamp;
15318 * The contents of CResult_PositiveTimestampCreationErrorZ
15320 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
15322 * A pointer to the contents in the success state.
15323 * Reading from this pointer when `result_ok` is not set is undefined.
15325 struct LDKPositiveTimestamp *result;
15327 * A pointer to the contents in the error state.
15328 * Reading from this pointer when `result_ok` is set is undefined.
15330 enum LDKCreationError *err;
15331 } LDKCResult_PositiveTimestampCreationErrorZPtr;
15334 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
15335 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
15336 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15338 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
15340 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
15341 * `err` or `result` depending on the state of `result_ok`.
15343 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
15345 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
15348 } LDKCResult_PositiveTimestampCreationErrorZ;
15351 * The contents of CResult_NoneBolt11SemanticErrorZ
15353 typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
15355 * Note that this value is always NULL, as there are no contents in the OK variant
15359 * A pointer to the contents in the error state.
15360 * Reading from this pointer when `result_ok` is set is undefined.
15362 enum LDKBolt11SemanticError *err;
15363 } LDKCResult_NoneBolt11SemanticErrorZPtr;
15366 * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
15367 * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
15368 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15370 typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
15372 * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
15373 * `err` or `result` depending on the state of `result_ok`.
15375 union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
15377 * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
15380 } LDKCResult_NoneBolt11SemanticErrorZ;
15383 * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
15385 typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
15387 * A pointer to the contents in the success state.
15388 * Reading from this pointer when `result_ok` is not set is undefined.
15390 struct LDKBolt11Invoice *result;
15392 * A pointer to the contents in the error state.
15393 * Reading from this pointer when `result_ok` is set is undefined.
15395 enum LDKBolt11SemanticError *err;
15396 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
15399 * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
15400 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
15401 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15403 typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
15405 * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
15406 * `err` or `result` depending on the state of `result_ok`.
15408 union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
15410 * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
15413 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
15416 * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
15417 * This corresponds to std::vector in C++
15419 typedef struct LDKCVec_AddressZ {
15421 * The elements in the array.
15422 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
15424 struct LDKStr *data;
15426 * The number of elements pointed to by `data`.
15429 } LDKCVec_AddressZ;
15434 * Description string
15437 * The description can be at most 639 __bytes__ long
15439 typedef struct MUST_USE_STRUCT LDKDescription {
15441 * A pointer to the opaque Rust object.
15442 * Nearly everywhere, inner must be non-null, however in places where
15443 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15445 LDKnativeDescription *inner;
15447 * Indicates that this is the only struct which contains the same pointer.
15448 * Rust functions which take ownership of an object provided via an argument require
15449 * this to be true and invalidate the object pointed to by inner.
15455 * The contents of CResult_DescriptionCreationErrorZ
15457 typedef union LDKCResult_DescriptionCreationErrorZPtr {
15459 * A pointer to the contents in the success state.
15460 * Reading from this pointer when `result_ok` is not set is undefined.
15462 struct LDKDescription *result;
15464 * A pointer to the contents in the error state.
15465 * Reading from this pointer when `result_ok` is set is undefined.
15467 enum LDKCreationError *err;
15468 } LDKCResult_DescriptionCreationErrorZPtr;
15471 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
15472 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
15473 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15475 typedef struct LDKCResult_DescriptionCreationErrorZ {
15477 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
15478 * `err` or `result` depending on the state of `result_ok`.
15480 union LDKCResult_DescriptionCreationErrorZPtr contents;
15482 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
15485 } LDKCResult_DescriptionCreationErrorZ;
15488 * The contents of CResult_PrivateRouteCreationErrorZ
15490 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
15492 * A pointer to the contents in the success state.
15493 * Reading from this pointer when `result_ok` is not set is undefined.
15495 struct LDKPrivateRoute *result;
15497 * A pointer to the contents in the error state.
15498 * Reading from this pointer when `result_ok` is set is undefined.
15500 enum LDKCreationError *err;
15501 } LDKCResult_PrivateRouteCreationErrorZPtr;
15504 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
15505 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
15506 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15508 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
15510 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
15511 * `err` or `result` depending on the state of `result_ok`.
15513 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
15515 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
15518 } LDKCResult_PrivateRouteCreationErrorZ;
15521 * The contents of CResult_OutPointDecodeErrorZ
15523 typedef union LDKCResult_OutPointDecodeErrorZPtr {
15525 * A pointer to the contents in the success state.
15526 * Reading from this pointer when `result_ok` is not set is undefined.
15528 struct LDKOutPoint *result;
15530 * A pointer to the contents in the error state.
15531 * Reading from this pointer when `result_ok` is set is undefined.
15533 struct LDKDecodeError *err;
15534 } LDKCResult_OutPointDecodeErrorZPtr;
15537 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
15538 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
15539 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15541 typedef struct LDKCResult_OutPointDecodeErrorZ {
15543 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
15544 * `err` or `result` depending on the state of `result_ok`.
15546 union LDKCResult_OutPointDecodeErrorZPtr contents;
15548 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
15551 } LDKCResult_OutPointDecodeErrorZ;
15556 * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
15557 * variable-length integers except that it is serialized in big-endian instead of little-endian.
15559 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
15560 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
15561 * you're looking for an example of a variable-length integer to use for your own project, move
15562 * along, this is a rather poor design.
15564 typedef struct MUST_USE_STRUCT LDKBigSize {
15566 * A pointer to the opaque Rust object.
15567 * Nearly everywhere, inner must be non-null, however in places where
15568 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15570 LDKnativeBigSize *inner;
15572 * Indicates that this is the only struct which contains the same pointer.
15573 * Rust functions which take ownership of an object provided via an argument require
15574 * this to be true and invalidate the object pointed to by inner.
15580 * The contents of CResult_BigSizeDecodeErrorZ
15582 typedef union LDKCResult_BigSizeDecodeErrorZPtr {
15584 * A pointer to the contents in the success state.
15585 * Reading from this pointer when `result_ok` is not set is undefined.
15587 struct LDKBigSize *result;
15589 * A pointer to the contents in the error state.
15590 * Reading from this pointer when `result_ok` is set is undefined.
15592 struct LDKDecodeError *err;
15593 } LDKCResult_BigSizeDecodeErrorZPtr;
15596 * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
15597 * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
15598 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15600 typedef struct LDKCResult_BigSizeDecodeErrorZ {
15602 * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
15603 * `err` or `result` depending on the state of `result_ok`.
15605 union LDKCResult_BigSizeDecodeErrorZPtr contents;
15607 * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
15610 } LDKCResult_BigSizeDecodeErrorZ;
15613 * The contents of CResult_HostnameDecodeErrorZ
15615 typedef union LDKCResult_HostnameDecodeErrorZPtr {
15617 * A pointer to the contents in the success state.
15618 * Reading from this pointer when `result_ok` is not set is undefined.
15620 struct LDKHostname *result;
15622 * A pointer to the contents in the error state.
15623 * Reading from this pointer when `result_ok` is set is undefined.
15625 struct LDKDecodeError *err;
15626 } LDKCResult_HostnameDecodeErrorZPtr;
15629 * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
15630 * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
15631 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15633 typedef struct LDKCResult_HostnameDecodeErrorZ {
15635 * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
15636 * `err` or `result` depending on the state of `result_ok`.
15638 union LDKCResult_HostnameDecodeErrorZPtr contents;
15640 * Whether this CResult_HostnameDecodeErrorZ represents a success state.
15643 } LDKCResult_HostnameDecodeErrorZ;
15648 * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
15649 * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
15651 * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
15653 typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
15655 * A pointer to the opaque Rust object.
15656 * Nearly everywhere, inner must be non-null, however in places where
15657 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15659 LDKnativeTransactionU16LenLimited *inner;
15661 * Indicates that this is the only struct which contains the same pointer.
15662 * Rust functions which take ownership of an object provided via an argument require
15663 * this to be true and invalidate the object pointed to by inner.
15666 } LDKTransactionU16LenLimited;
15669 * The contents of CResult_TransactionU16LenLimitedNoneZ
15671 typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
15673 * A pointer to the contents in the success state.
15674 * Reading from this pointer when `result_ok` is not set is undefined.
15676 struct LDKTransactionU16LenLimited *result;
15678 * Note that this value is always NULL, as there are no contents in the Err variant
15681 } LDKCResult_TransactionU16LenLimitedNoneZPtr;
15684 * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
15685 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
15686 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15688 typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
15690 * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
15691 * `err` or `result` depending on the state of `result_ok`.
15693 union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
15695 * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
15698 } LDKCResult_TransactionU16LenLimitedNoneZ;
15701 * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
15703 typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
15705 * A pointer to the contents in the success state.
15706 * Reading from this pointer when `result_ok` is not set is undefined.
15708 struct LDKTransactionU16LenLimited *result;
15710 * A pointer to the contents in the error state.
15711 * Reading from this pointer when `result_ok` is set is undefined.
15713 struct LDKDecodeError *err;
15714 } LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
15717 * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
15718 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
15719 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15721 typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
15723 * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
15724 * `err` or `result` depending on the state of `result_ok`.
15726 union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
15728 * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
15731 } LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
15734 * The contents of CResult_UntrustedStringDecodeErrorZ
15736 typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
15738 * A pointer to the contents in the success state.
15739 * Reading from this pointer when `result_ok` is not set is undefined.
15741 struct LDKUntrustedString *result;
15743 * A pointer to the contents in the error state.
15744 * Reading from this pointer when `result_ok` is set is undefined.
15746 struct LDKDecodeError *err;
15747 } LDKCResult_UntrustedStringDecodeErrorZPtr;
15750 * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
15751 * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
15752 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15754 typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
15756 * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
15757 * `err` or `result` depending on the state of `result_ok`.
15759 union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
15761 * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
15764 } LDKCResult_UntrustedStringDecodeErrorZ;
15767 * An error that may occur when making a payment.
15769 typedef enum LDKPaymentError_Tag {
15771 * An error resulting from the provided [`Bolt11Invoice`] or payment hash.
15773 LDKPaymentError_Invoice,
15775 * An error occurring when sending a payment.
15777 LDKPaymentError_Sending,
15779 * Must be last for serialization purposes
15781 LDKPaymentError_Sentinel,
15782 } LDKPaymentError_Tag;
15784 typedef struct MUST_USE_STRUCT LDKPaymentError {
15785 LDKPaymentError_Tag tag;
15788 struct LDKStr invoice;
15791 enum LDKRetryableSendFailure sending;
15797 * The contents of CResult_PaymentIdPaymentErrorZ
15799 typedef union LDKCResult_PaymentIdPaymentErrorZPtr {
15801 * A pointer to the contents in the success state.
15802 * Reading from this pointer when `result_ok` is not set is undefined.
15804 struct LDKThirtyTwoBytes *result;
15806 * A pointer to the contents in the error state.
15807 * Reading from this pointer when `result_ok` is set is undefined.
15809 struct LDKPaymentError *err;
15810 } LDKCResult_PaymentIdPaymentErrorZPtr;
15813 * A CResult_PaymentIdPaymentErrorZ represents the result of a fallible operation,
15814 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning_invoice::payment::PaymentError on failure.
15815 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15817 typedef struct LDKCResult_PaymentIdPaymentErrorZ {
15819 * The contents of this CResult_PaymentIdPaymentErrorZ, accessible via either
15820 * `err` or `result` depending on the state of `result_ok`.
15822 union LDKCResult_PaymentIdPaymentErrorZPtr contents;
15824 * Whether this CResult_PaymentIdPaymentErrorZ represents a success state.
15827 } LDKCResult_PaymentIdPaymentErrorZ;
15830 * The contents of CResult_NonePaymentErrorZ
15832 typedef union LDKCResult_NonePaymentErrorZPtr {
15834 * Note that this value is always NULL, as there are no contents in the OK variant
15838 * A pointer to the contents in the error state.
15839 * Reading from this pointer when `result_ok` is set is undefined.
15841 struct LDKPaymentError *err;
15842 } LDKCResult_NonePaymentErrorZPtr;
15845 * A CResult_NonePaymentErrorZ represents the result of a fallible operation,
15846 * containing a () on success and a crate::lightning_invoice::payment::PaymentError on failure.
15847 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15849 typedef struct LDKCResult_NonePaymentErrorZ {
15851 * The contents of this CResult_NonePaymentErrorZ, accessible via either
15852 * `err` or `result` depending on the state of `result_ok`.
15854 union LDKCResult_NonePaymentErrorZPtr contents;
15856 * Whether this CResult_NonePaymentErrorZ represents a success state.
15859 } LDKCResult_NonePaymentErrorZ;
15862 * The contents of CResult_StringErrorZ
15864 typedef union LDKCResult_StringErrorZPtr {
15866 * A pointer to the contents in the success state.
15867 * Reading from this pointer when `result_ok` is not set is undefined.
15869 struct LDKStr *result;
15871 * A pointer to the contents in the error state.
15872 * Reading from this pointer when `result_ok` is set is undefined.
15874 enum LDKSecp256k1Error *err;
15875 } LDKCResult_StringErrorZPtr;
15878 * A CResult_StringErrorZ represents the result of a fallible operation,
15879 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
15880 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15882 typedef struct LDKCResult_StringErrorZ {
15884 * The contents of this CResult_StringErrorZ, accessible via either
15885 * `err` or `result` depending on the state of `result_ok`.
15887 union LDKCResult_StringErrorZPtr contents;
15889 * Whether this CResult_StringErrorZ represents a success state.
15892 } LDKCResult_StringErrorZ;
15897 * A path for sending an [`msgs::OnionMessage`].
15899 typedef struct MUST_USE_STRUCT LDKOnionMessagePath {
15901 * A pointer to the opaque Rust object.
15902 * Nearly everywhere, inner must be non-null, however in places where
15903 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15905 LDKnativeOnionMessagePath *inner;
15907 * Indicates that this is the only struct which contains the same pointer.
15908 * Rust functions which take ownership of an object provided via an argument require
15909 * this to be true and invalidate the object pointed to by inner.
15912 } LDKOnionMessagePath;
15915 * The contents of CResult_OnionMessagePathNoneZ
15917 typedef union LDKCResult_OnionMessagePathNoneZPtr {
15919 * A pointer to the contents in the success state.
15920 * Reading from this pointer when `result_ok` is not set is undefined.
15922 struct LDKOnionMessagePath *result;
15924 * Note that this value is always NULL, as there are no contents in the Err variant
15927 } LDKCResult_OnionMessagePathNoneZPtr;
15930 * A CResult_OnionMessagePathNoneZ represents the result of a fallible operation,
15931 * containing a crate::lightning::onion_message::messenger::OnionMessagePath on success and a () on failure.
15932 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15934 typedef struct LDKCResult_OnionMessagePathNoneZ {
15936 * The contents of this CResult_OnionMessagePathNoneZ, accessible via either
15937 * `err` or `result` depending on the state of `result_ok`.
15939 union LDKCResult_OnionMessagePathNoneZPtr contents;
15941 * Whether this CResult_OnionMessagePathNoneZ represents a success state.
15944 } LDKCResult_OnionMessagePathNoneZ;
15947 * Errors that may occur when [sending an onion message].
15949 * [sending an onion message]: OnionMessenger::send_onion_message
15951 typedef enum LDKSendError_Tag {
15953 * Errored computing onion message packet keys.
15955 LDKSendError_Secp256k1,
15957 * Because implementations such as Eclair will drop onion messages where the message packet
15958 * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
15960 LDKSendError_TooBigPacket,
15962 * The provided [`Destination`] was an invalid [`BlindedPath`], due to having fewer than two
15965 LDKSendError_TooFewBlindedHops,
15967 * Our next-hop peer was offline or does not support onion message forwarding.
15969 LDKSendError_InvalidFirstHop,
15971 * Onion message contents must have a TLV type >= 64.
15973 LDKSendError_InvalidMessage,
15975 * Our next-hop peer's buffer was full or our total outbound buffer was full.
15977 LDKSendError_BufferFull,
15979 * Failed to retrieve our node id from the provided [`NodeSigner`].
15981 * [`NodeSigner`]: crate::sign::NodeSigner
15983 LDKSendError_GetNodeIdFailed,
15985 * We attempted to send to a blinded path where we are the introduction node, and failed to
15986 * advance the blinded path to make the second hop the new introduction node. Either
15987 * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
15988 * new blinding point, or we were attempting to send to ourselves.
15990 LDKSendError_BlindedPathAdvanceFailed,
15992 * Must be last for serialization purposes
15994 LDKSendError_Sentinel,
15995 } LDKSendError_Tag;
15997 typedef struct MUST_USE_STRUCT LDKSendError {
15998 LDKSendError_Tag tag;
16001 enum LDKSecp256k1Error secp256k1;
16007 * The contents of CResult_NoneSendErrorZ
16009 typedef union LDKCResult_NoneSendErrorZPtr {
16011 * Note that this value is always NULL, as there are no contents in the OK variant
16015 * A pointer to the contents in the error state.
16016 * Reading from this pointer when `result_ok` is set is undefined.
16018 struct LDKSendError *err;
16019 } LDKCResult_NoneSendErrorZPtr;
16022 * A CResult_NoneSendErrorZ represents the result of a fallible operation,
16023 * containing a () on success and a crate::lightning::onion_message::messenger::SendError on failure.
16024 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16026 typedef struct LDKCResult_NoneSendErrorZ {
16028 * The contents of this CResult_NoneSendErrorZ, accessible via either
16029 * `err` or `result` depending on the state of `result_ok`.
16031 union LDKCResult_NoneSendErrorZPtr contents;
16033 * Whether this CResult_NoneSendErrorZ represents a success state.
16036 } LDKCResult_NoneSendErrorZ;
16039 * The contents of CResult_BlindedPathNoneZ
16041 typedef union LDKCResult_BlindedPathNoneZPtr {
16043 * A pointer to the contents in the success state.
16044 * Reading from this pointer when `result_ok` is not set is undefined.
16046 struct LDKBlindedPath *result;
16048 * Note that this value is always NULL, as there are no contents in the Err variant
16051 } LDKCResult_BlindedPathNoneZPtr;
16054 * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
16055 * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
16056 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16058 typedef struct LDKCResult_BlindedPathNoneZ {
16060 * The contents of this CResult_BlindedPathNoneZ, accessible via either
16061 * `err` or `result` depending on the state of `result_ok`.
16063 union LDKCResult_BlindedPathNoneZPtr contents;
16065 * Whether this CResult_BlindedPathNoneZ represents a success state.
16068 } LDKCResult_BlindedPathNoneZ;
16071 * The contents of CResult_BlindedPathDecodeErrorZ
16073 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
16075 * A pointer to the contents in the success state.
16076 * Reading from this pointer when `result_ok` is not set is undefined.
16078 struct LDKBlindedPath *result;
16080 * A pointer to the contents in the error state.
16081 * Reading from this pointer when `result_ok` is set is undefined.
16083 struct LDKDecodeError *err;
16084 } LDKCResult_BlindedPathDecodeErrorZPtr;
16087 * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
16088 * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
16089 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16091 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
16093 * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
16094 * `err` or `result` depending on the state of `result_ok`.
16096 union LDKCResult_BlindedPathDecodeErrorZPtr contents;
16098 * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
16101 } LDKCResult_BlindedPathDecodeErrorZ;
16104 * The contents of CResult_BlindedHopDecodeErrorZ
16106 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
16108 * A pointer to the contents in the success state.
16109 * Reading from this pointer when `result_ok` is not set is undefined.
16111 struct LDKBlindedHop *result;
16113 * A pointer to the contents in the error state.
16114 * Reading from this pointer when `result_ok` is set is undefined.
16116 struct LDKDecodeError *err;
16117 } LDKCResult_BlindedHopDecodeErrorZPtr;
16120 * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
16121 * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
16122 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16124 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
16126 * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
16127 * `err` or `result` depending on the state of `result_ok`.
16129 union LDKCResult_BlindedHopDecodeErrorZPtr contents;
16131 * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
16134 } LDKCResult_BlindedHopDecodeErrorZ;
16137 * The contents of CResult_InvoiceErrorDecodeErrorZ
16139 typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
16141 * A pointer to the contents in the success state.
16142 * Reading from this pointer when `result_ok` is not set is undefined.
16144 struct LDKInvoiceError *result;
16146 * A pointer to the contents in the error state.
16147 * Reading from this pointer when `result_ok` is set is undefined.
16149 struct LDKDecodeError *err;
16150 } LDKCResult_InvoiceErrorDecodeErrorZPtr;
16153 * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
16154 * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
16155 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16157 typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
16159 * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
16160 * `err` or `result` depending on the state of `result_ok`.
16162 union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
16164 * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
16167 } LDKCResult_InvoiceErrorDecodeErrorZ;
16172 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
16174 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
16175 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
16176 * [`Confirm::transactions_confirmed`].
16178 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
16179 * may have been spent there. See [`Filter::register_output`] for details.
16181 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
16182 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
16184 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
16186 * A pointer to the opaque Rust object.
16187 * Nearly everywhere, inner must be non-null, however in places where
16188 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16190 LDKnativeWatchedOutput *inner;
16192 * Indicates that this is the only struct which contains the same pointer.
16193 * Rust functions which take ownership of an object provided via an argument require
16194 * this to be true and invalidate the object pointed to by inner.
16197 } LDKWatchedOutput;
16200 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
16203 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
16204 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
16205 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
16206 * receiving full blocks from a chain source, any further filtering is unnecessary.
16208 * After an output has been registered, subsequent block retrievals from the chain source must not
16209 * exclude any transactions matching the new criteria nor any in-block descendants of such
16212 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
16213 * should not block on I/O. Implementations should instead queue the newly monitored data to be
16214 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
16215 * invocation that has called the `Filter` must return [`InProgress`].
16217 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
16218 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
16219 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
16221 typedef struct LDKFilter {
16223 * An opaque pointer which is passed to your function implementations as an argument.
16224 * This has no meaning in the LDK, and can be NULL or any other value.
16228 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
16229 * a spending condition.
16231 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
16233 * Registers interest in spends of a transaction output.
16235 * Note that this method might be called during processing of a new block. You therefore need
16236 * to ensure that also dependent output spents within an already connected block are correctly
16237 * handled, e.g., by re-scanning the block in question whenever new outputs have been
16238 * registered mid-processing.
16240 void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
16242 * Frees any resources associated with this object given its this_arg pointer.
16243 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
16245 void (*free)(void *this_arg);
16249 * An enum which can either contain a crate::lightning::chain::Filter or not
16251 typedef enum LDKCOption_FilterZ_Tag {
16253 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
16255 LDKCOption_FilterZ_Some,
16257 * When we're in this state, this COption_FilterZ contains nothing
16259 LDKCOption_FilterZ_None,
16261 * Must be last for serialization purposes
16263 LDKCOption_FilterZ_Sentinel,
16264 } LDKCOption_FilterZ_Tag;
16266 typedef struct LDKCOption_FilterZ {
16267 LDKCOption_FilterZ_Tag tag;
16270 struct LDKFilter some;
16273 } LDKCOption_FilterZ;
16278 * A read-only reference to a current ChannelMonitor.
16280 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
16283 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
16285 * A pointer to the opaque Rust object.
16286 * Nearly everywhere, inner must be non-null, however in places where
16287 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16289 LDKnativeLockedChannelMonitor *inner;
16291 * Indicates that this is the only struct which contains the same pointer.
16292 * Rust functions which take ownership of an object provided via an argument require
16293 * this to be true and invalidate the object pointed to by inner.
16296 } LDKLockedChannelMonitor;
16299 * The contents of CResult_LockedChannelMonitorNoneZ
16301 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
16303 * A pointer to the contents in the success state.
16304 * Reading from this pointer when `result_ok` is not set is undefined.
16306 struct LDKLockedChannelMonitor *result;
16308 * Note that this value is always NULL, as there are no contents in the Err variant
16311 } LDKCResult_LockedChannelMonitorNoneZPtr;
16314 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
16315 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
16316 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16318 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
16320 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
16321 * `err` or `result` depending on the state of `result_ok`.
16323 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
16325 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
16328 } LDKCResult_LockedChannelMonitorNoneZ;
16331 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
16332 * This corresponds to std::vector in C++
16334 typedef struct LDKCVec_OutPointZ {
16336 * The elements in the array.
16337 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16339 struct LDKOutPoint *data;
16341 * The number of elements pointed to by `data`.
16344 } LDKCVec_OutPointZ;
16349 * An opaque identifier describing a specific [`Persist`] method call.
16351 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
16353 * A pointer to the opaque Rust object.
16354 * Nearly everywhere, inner must be non-null, however in places where
16355 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16357 LDKnativeMonitorUpdateId *inner;
16359 * Indicates that this is the only struct which contains the same pointer.
16360 * Rust functions which take ownership of an object provided via an argument require
16361 * this to be true and invalidate the object pointed to by inner.
16364 } LDKMonitorUpdateId;
16367 * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
16368 * This corresponds to std::vector in C++
16370 typedef struct LDKCVec_MonitorUpdateIdZ {
16372 * The elements in the array.
16373 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16375 struct LDKMonitorUpdateId *data;
16377 * The number of elements pointed to by `data`.
16380 } LDKCVec_MonitorUpdateIdZ;
16383 * A tuple of 2 elements. See the individual fields for the types contained.
16385 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
16387 * The element at position 0
16389 struct LDKOutPoint a;
16391 * The element at position 1
16393 struct LDKCVec_MonitorUpdateIdZ b;
16394 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
16397 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
16398 * This corresponds to std::vector in C++
16400 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
16402 * The elements in the array.
16403 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
16405 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
16407 * The number of elements pointed to by `data`.
16410 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
16413 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
16415 typedef struct LDKPersister {
16417 * An opaque pointer which is passed to your function implementations as an argument.
16418 * This has no meaning in the LDK, and can be NULL or any other value.
16422 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
16424 struct LDKCResult_NoneErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
16426 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
16428 struct LDKCResult_NoneErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
16430 * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
16432 struct LDKCResult_NoneErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
16434 * Frees any resources associated with this object given its this_arg pointer.
16435 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
16437 void (*free)(void *this_arg);
16443 * A string that displays only printable characters, replacing control characters with
16444 * [`core::char::REPLACEMENT_CHARACTER`].
16446 typedef struct MUST_USE_STRUCT LDKPrintableString {
16448 * A pointer to the opaque Rust object.
16449 * Nearly everywhere, inner must be non-null, however in places where
16450 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16452 LDKnativePrintableString *inner;
16454 * Indicates that this is the only struct which contains the same pointer.
16455 * Rust functions which take ownership of an object provided via an argument require
16456 * this to be true and invalidate the object pointed to by inner.
16459 } LDKPrintableString;
16462 * A callback which is called when a [`Future`] completes.
16464 * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
16465 * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
16468 * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
16469 * futures when they receive a wake, rather than immediately executing them.
16471 typedef struct LDKFutureCallback {
16473 * An opaque pointer which is passed to your function implementations as an argument.
16474 * This has no meaning in the LDK, and can be NULL or any other value.
16478 * The method which is called.
16480 void (*call)(const void *this_arg);
16482 * Frees any resources associated with this object given its this_arg pointer.
16483 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
16485 void (*free)(void *this_arg);
16486 } LDKFutureCallback;
16491 * A struct which can be used to select across many [`Future`]s at once without relying on a full
16494 typedef struct MUST_USE_STRUCT LDKSleeper {
16496 * A pointer to the opaque Rust object.
16497 * Nearly everywhere, inner must be non-null, however in places where
16498 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16500 LDKnativeSleeper *inner;
16502 * Indicates that this is the only struct which contains the same pointer.
16503 * Rust functions which take ownership of an object provided via an argument require
16504 * this to be true and invalidate the object pointed to by inner.
16512 * Configuration we set when applicable.
16514 * Default::default() provides sane defaults.
16516 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
16518 * A pointer to the opaque Rust object.
16519 * Nearly everywhere, inner must be non-null, however in places where
16520 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16522 LDKnativeChannelHandshakeConfig *inner;
16524 * Indicates that this is the only struct which contains the same pointer.
16525 * Rust functions which take ownership of an object provided via an argument require
16526 * this to be true and invalidate the object pointed to by inner.
16529 } LDKChannelHandshakeConfig;
16534 * Optional channel limits which are applied during channel creation.
16536 * These limits are only applied to our counterparty's limits, not our own.
16538 * Use 0/`<type>::max_value()` as appropriate to skip checking.
16540 * Provides sane defaults for most configurations.
16542 * Most additional limits are disabled except those with which specify a default in individual
16543 * field documentation. Note that this may result in barely-usable channels, but since they
16544 * are applied mostly only to incoming channels that's not much of a problem.
16546 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
16548 * A pointer to the opaque Rust object.
16549 * Nearly everywhere, inner must be non-null, however in places where
16550 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16552 LDKnativeChannelHandshakeLimits *inner;
16554 * Indicates that this is the only struct which contains the same pointer.
16555 * Rust functions which take ownership of an object provided via an argument require
16556 * this to be true and invalidate the object pointed to by inner.
16559 } LDKChannelHandshakeLimits;
16564 * A parallel struct to [`ChannelConfig`] to define partial updates.
16566 typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
16568 * A pointer to the opaque Rust object.
16569 * Nearly everywhere, inner must be non-null, however in places where
16570 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16572 LDKnativeChannelConfigUpdate *inner;
16574 * Indicates that this is the only struct which contains the same pointer.
16575 * Rust functions which take ownership of an object provided via an argument require
16576 * this to be true and invalidate the object pointed to by inner.
16579 } LDKChannelConfigUpdate;
16584 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
16586 * Default::default() provides sane defaults for most configurations
16587 * (but currently with 0 relay fees!)
16589 typedef struct MUST_USE_STRUCT LDKUserConfig {
16591 * A pointer to the opaque Rust object.
16592 * Nearly everywhere, inner must be non-null, however in places where
16593 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16595 LDKnativeUserConfig *inner;
16597 * Indicates that this is the only struct which contains the same pointer.
16598 * Rust functions which take ownership of an object provided via an argument require
16599 * this to be true and invalidate the object pointed to by inner.
16607 * The best known block as identified by its hash and height.
16609 typedef struct MUST_USE_STRUCT LDKBestBlock {
16611 * A pointer to the opaque Rust object.
16612 * Nearly everywhere, inner must be non-null, however in places where
16613 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16615 LDKnativeBestBlock *inner;
16617 * Indicates that this is the only struct which contains the same pointer.
16618 * Rust functions which take ownership of an object provided via an argument require
16619 * this to be true and invalidate the object pointed to by inner.
16625 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
16628 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
16629 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
16630 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
16633 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
16634 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
16635 * other similar filtering.
16637 typedef struct LDKListen {
16639 * An opaque pointer which is passed to your function implementations as an argument.
16640 * This has no meaning in the LDK, and can be NULL or any other value.
16644 * Notifies the listener that a block was added at the given height, with the transaction data
16645 * possibly filtered.
16647 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
16649 * Notifies the listener that a block was added at the given height.
16651 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
16653 * Notifies the listener that a block was removed at the given height.
16655 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
16657 * Frees any resources associated with this object given its this_arg pointer.
16658 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
16660 void (*free)(void *this_arg);
16664 * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
16665 * chain or unconfirmed during a chain reorganization.
16667 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
16668 * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
16669 * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
16670 * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
16671 * with reference to the confirmation status of the monitored objects.
16674 * The intended use is as follows:
16675 * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
16676 * outputs are, respectively, confirmed or spent on chain.
16677 * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
16678 * [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
16679 * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
16683 * Clients must call these methods in chain order. Specifically:
16684 * - Transactions which are confirmed in a particular block must be given before transactions
16685 * confirmed in a later block.
16686 * - Dependent transactions within the same block must be given in topological order, possibly in
16688 * - All unconfirmed transactions must be given after the original confirmations and before *any*
16689 * reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
16690 * never be interleaved, but always conduced *en bloc*.
16691 * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
16692 * in regard to the new block.
16694 * See individual method documentation for further details.
16696 * [`transactions_confirmed`]: Self::transactions_confirmed
16697 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
16698 * [`best_block_updated`]: Self::best_block_updated
16699 * [`get_relevant_txids`]: Self::get_relevant_txids
16701 typedef struct LDKConfirm {
16703 * An opaque pointer which is passed to your function implementations as an argument.
16704 * This has no meaning in the LDK, and can be NULL or any other value.
16708 * Notifies LDK of transactions confirmed in a block with a given header and height.
16710 * Must be called for any transactions registered by [`Filter::register_tx`] or any
16711 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
16712 * appearing in the same block do not need to be included in the same call; instead, multiple
16713 * calls with additional transactions may be made so long as they are made in [chain order].
16715 * May be called before or after [`best_block_updated`] for the corresponding block. However,
16716 * in the event of a chain reorganization, it must not be called with a `header` that is no
16717 * longer in the chain as of the last call to [`best_block_updated`].
16719 * [chain order]: Confirm#order
16720 * [`best_block_updated`]: Self::best_block_updated
16722 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
16724 * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
16726 * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
16727 * reorganized out of the best chain or if it is no longer confirmed in the block with the
16728 * given block hash. Once called, the given transaction will not be returned
16729 * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
16731 * [`get_relevant_txids`]: Self::get_relevant_txids
16732 * [`transactions_confirmed`]: Self::transactions_confirmed
16734 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
16736 * Notifies LDK of an update to the best header connected at the given height.
16738 * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
16741 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
16743 * Returns transactions that must be monitored for reorganization out of the chain along
16744 * with the hash of the block as part of which it had been previously confirmed.
16746 * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
16747 * 0.0.112 and prior, in which case you need to manually track previous confirmations.
16749 * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
16750 * confirmations to be safe from a chain reorganization. Will not include any transactions
16751 * passed to [`transaction_unconfirmed`], unless later reconfirmed.
16753 * Must be called to determine the subset of transactions that must be monitored for
16754 * reorganization. Will be idempotent between calls but may change as a result of calls to the
16755 * other interface methods. Thus, this is useful to determine which transactions must be
16756 * given to [`transaction_unconfirmed`].
16758 * If any of the returned transactions are confirmed in a block other than the one with the
16759 * given hash, they need to be unconfirmed and reconfirmed via [`transaction_unconfirmed`] and
16760 * [`transactions_confirmed`], respectively.
16762 * [`transactions_confirmed`]: Self::transactions_confirmed
16763 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
16765 struct LDKCVec_C2Tuple_TxidCOption_BlockHashZZZ (*get_relevant_txids)(const void *this_arg);
16767 * Frees any resources associated with this object given its this_arg pointer.
16768 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
16770 void (*free)(void *this_arg);
16774 * `Persist` defines behavior for persisting channel monitors: this could mean
16775 * writing once to disk, and/or uploading to one or more backup services.
16777 * Each method can return three possible values:
16778 * * If persistence (including any relevant `fsync()` calls) happens immediately, the
16779 * implementation should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal
16780 * channel operation should continue.
16781 * * If persistence happens asynchronously, implementations should first ensure the
16782 * [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
16783 * [`ChannelMonitorUpdateStatus::InProgress`] while the update continues in the background.
16784 * Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be called with
16785 * the corresponding [`MonitorUpdateId`].
16787 * Note that unlike the direct [`chain::Watch`] interface,
16788 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
16790 * * If persistence fails for some reason, implementations should return
16791 * [`ChannelMonitorUpdateStatus::PermanentFailure`], in which case the channel will likely be
16792 * closed without broadcasting the latest state. See
16793 * [`ChannelMonitorUpdateStatus::PermanentFailure`] for more details.
16795 typedef struct LDKPersist {
16797 * An opaque pointer which is passed to your function implementations as an argument.
16798 * This has no meaning in the LDK, and can be NULL or any other value.
16802 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
16803 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
16805 * The data can be stored any way you want, but the identifier provided by LDK is the
16806 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
16807 * and the stored channel data). Note that you **must** persist every new monitor to disk.
16809 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
16810 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
16812 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
16813 * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
16815 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
16816 * [`Writeable::write`]: crate::util::ser::Writeable::write
16818 enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
16820 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
16823 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
16824 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
16827 * During blockchain synchronization operations, this may be called with no
16828 * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
16829 * Note that after the full [`ChannelMonitor`] is persisted any previous
16830 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
16831 * applied to the persisted [`ChannelMonitor`] as they were already applied.
16833 * If an implementer chooses to persist the updates only, they need to make
16834 * sure that all the updates are applied to the `ChannelMonitors` *before*
16835 * the set of channel monitors is given to the `ChannelManager`
16836 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
16837 * applying a monitor update to a monitor. If full `ChannelMonitors` are
16838 * persisted, then there is no need to persist individual updates.
16840 * Note that there could be a performance tradeoff between persisting complete
16841 * channel monitors on every update vs. persisting only updates and applying
16842 * them in batches. The size of each monitor grows `O(number of state updates)`
16843 * whereas updates are small and `O(1)`.
16845 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
16846 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
16848 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
16849 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
16850 * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
16852 * [`Writeable::write`]: crate::util::ser::Writeable::write
16854 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
16856 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);
16858 * Frees any resources associated with this object given its this_arg pointer.
16859 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
16861 void (*free)(void *this_arg);
16867 * An implementation of [`chain::Watch`] for monitoring channels.
16869 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
16870 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
16871 * or used independently to monitor channels remotely. See the [module-level documentation] for
16874 * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
16875 * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
16876 * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
16877 * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
16878 * environment with spotty connections, like on mobile.
16880 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
16881 * [module-level documentation]: crate::chain::chainmonitor
16882 * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
16884 typedef struct MUST_USE_STRUCT LDKChainMonitor {
16886 * A pointer to the opaque Rust object.
16887 * Nearly everywhere, inner must be non-null, however in places where
16888 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16890 LDKnativeChainMonitor *inner;
16892 * Indicates that this is the only struct which contains the same pointer.
16893 * Rust functions which take ownership of an object provided via an argument require
16894 * this to be true and invalidate the object pointed to by inner.
16900 * A trait implemented for objects handling events from [`EventsProvider`].
16902 * An async variation also exists for implementations of [`EventsProvider`] that support async
16903 * event handling. The async event handler should satisfy the generic bounds: `F:
16904 * core::future::Future, H: Fn(Event) -> F`.
16906 typedef struct LDKEventHandler {
16908 * An opaque pointer which is passed to your function implementations as an argument.
16909 * This has no meaning in the LDK, and can be NULL or any other value.
16913 * Handles the given [`Event`].
16915 * See [`EventsProvider`] for details that must be considered when implementing this method.
16917 void (*handle_event)(const void *this_arg, struct LDKEvent event);
16919 * Frees any resources associated with this object given its this_arg pointer.
16920 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
16922 void (*free)(void *this_arg);
16926 * A trait indicating an object may generate events.
16928 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
16930 * Implementations of this trait may also feature an async version of event handling, as shown with
16931 * [`ChannelManager::process_pending_events_async`] and
16932 * [`ChainMonitor::process_pending_events_async`].
16936 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
16937 * event since the last invocation.
16939 * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
16940 * and replay any unhandled events on startup. An [`Event`] is considered handled when
16941 * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
16942 * relevant changes to disk *before* returning.
16944 * Further, because an application may crash between an [`Event`] being handled and the
16945 * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
16946 * effect, [`Event`]s may be replayed.
16948 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
16949 * consult the provider's documentation on the implication of processing events and how a handler
16950 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
16951 * [`ChainMonitor::process_pending_events`]).
16953 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
16956 * [`process_pending_events`]: Self::process_pending_events
16957 * [`handle_event`]: EventHandler::handle_event
16958 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
16959 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
16960 * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
16961 * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
16963 typedef struct LDKEventsProvider {
16965 * An opaque pointer which is passed to your function implementations as an argument.
16966 * This has no meaning in the LDK, and can be NULL or any other value.
16970 * Processes any events generated since the last call using the given event handler.
16972 * See the trait-level documentation for requirements.
16974 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
16976 * Frees any resources associated with this object given its this_arg pointer.
16977 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
16979 void (*free)(void *this_arg);
16980 } LDKEventsProvider;
16985 * Chain-related parameters used to construct a new `ChannelManager`.
16987 * Typically, the block-specific parameters are derived from the best block hash for the network,
16988 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
16989 * are not needed when deserializing a previously constructed `ChannelManager`.
16991 typedef struct MUST_USE_STRUCT LDKChainParameters {
16993 * A pointer to the opaque Rust object.
16994 * Nearly everywhere, inner must be non-null, however in places where
16995 * the Rust equivalent takes an Option, it may be set to null to indicate None.
16997 LDKnativeChainParameters *inner;
16999 * Indicates that this is the only struct which contains the same pointer.
17000 * Rust functions which take ownership of an object provided via an argument require
17001 * this to be true and invalidate the object pointed to by inner.
17004 } LDKChainParameters;
17007 * Strategies available to retry payment path failures.
17009 typedef enum LDKRetry_Tag {
17011 * Max number of attempts to retry payment.
17013 * Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
17014 * retry, and may retry multiple failed HTLCs at once if they failed around the same time and
17015 * were retried along a route from a single call to [`Router::find_route_with_id`].
17019 * Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
17020 * see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
17022 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
17026 * Must be last for serialization purposes
17031 typedef struct MUST_USE_STRUCT LDKRetry {
17035 uintptr_t attempts;
17044 * A trait indicating an object may generate message send events
17046 typedef struct LDKMessageSendEventsProvider {
17048 * An opaque pointer which is passed to your function implementations as an argument.
17049 * This has no meaning in the LDK, and can be NULL or any other value.
17053 * Gets the list of pending events which were generated by previous actions, clearing the list
17056 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
17058 * Frees any resources associated with this object given its this_arg pointer.
17059 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17061 void (*free)(void *this_arg);
17062 } LDKMessageSendEventsProvider;
17065 * A trait to describe an object which can receive channel messages.
17067 * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
17068 * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
17070 typedef struct LDKChannelMessageHandler {
17072 * An opaque pointer which is passed to your function implementations as an argument.
17073 * This has no meaning in the LDK, and can be NULL or any other value.
17077 * Handle an incoming `open_channel` message from the given peer.
17079 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
17081 * Handle an incoming `open_channel2` message from the given peer.
17083 void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
17085 * Handle an incoming `accept_channel` message from the given peer.
17087 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
17089 * Handle an incoming `accept_channel2` message from the given peer.
17091 void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
17093 * Handle an incoming `funding_created` message from the given peer.
17095 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
17097 * Handle an incoming `funding_signed` message from the given peer.
17099 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
17101 * Handle an incoming `channel_ready` message from the given peer.
17103 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
17105 * Handle an incoming `shutdown` message from the given peer.
17107 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
17109 * Handle an incoming `closing_signed` message from the given peer.
17111 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
17113 * Handle an incoming `tx_add_input message` from the given peer.
17115 void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
17117 * Handle an incoming `tx_add_output` message from the given peer.
17119 void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
17121 * Handle an incoming `tx_remove_input` message from the given peer.
17123 void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
17125 * Handle an incoming `tx_remove_output` message from the given peer.
17127 void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
17129 * Handle an incoming `tx_complete message` from the given peer.
17131 void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
17133 * Handle an incoming `tx_signatures` message from the given peer.
17135 void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
17137 * Handle an incoming `tx_init_rbf` message from the given peer.
17139 void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
17141 * Handle an incoming `tx_ack_rbf` message from the given peer.
17143 void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
17145 * Handle an incoming `tx_abort message` from the given peer.
17147 void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
17149 * Handle an incoming `update_add_htlc` message from the given peer.
17151 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
17153 * Handle an incoming `update_fulfill_htlc` message from the given peer.
17155 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
17157 * Handle an incoming `update_fail_htlc` message from the given peer.
17159 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
17161 * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
17163 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
17165 * Handle an incoming `commitment_signed` message from the given peer.
17167 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
17169 * Handle an incoming `revoke_and_ack` message from the given peer.
17171 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
17173 * Handle an incoming `update_fee` message from the given peer.
17175 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
17177 * Handle an incoming `announcement_signatures` message from the given peer.
17179 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
17181 * Indicates a connection to the peer failed/an existing connection was lost.
17183 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
17185 * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
17187 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
17188 * with us. Implementors should be somewhat conservative about doing so, however, as other
17189 * message handlers may still wish to communicate with this peer.
17191 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
17193 * Handle an incoming `channel_reestablish` message from the given peer.
17195 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
17197 * Handle an incoming `channel_update` message from the given peer.
17199 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
17201 * Handle an incoming `error` message from the given peer.
17203 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
17205 * Gets the node feature flags which this handler itself supports. All available handlers are
17206 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
17207 * which are broadcasted in our [`NodeAnnouncement`] message.
17209 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
17211 * Gets the init feature flags which should be sent to the given peer. All available handlers
17212 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
17213 * which are sent in our [`Init`] message.
17215 * Note that this method is called before [`Self::peer_connected`].
17217 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
17219 * Gets the genesis hashes for this `ChannelMessageHandler` indicating which chains it supports.
17221 * If it's `None`, then no particular network chain hash compatibility will be enforced when
17222 * connecting to peers.
17224 struct LDKCOption_CVec_ChainHashZZ (*get_genesis_hashes)(const void *this_arg);
17226 * Implementation of MessageSendEventsProvider for this object.
17228 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
17230 * Frees any resources associated with this object given its this_arg pointer.
17231 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17233 void (*free)(void *this_arg);
17234 } LDKChannelMessageHandler;
17239 * Arguments for the creation of a ChannelManager that are not deserialized.
17241 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
17243 * 1) Deserialize all stored [`ChannelMonitor`]s.
17244 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
17245 * `<(BlockHash, ChannelManager)>::read(reader, args)`
17246 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
17247 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
17248 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
17249 * same way you would handle a [`chain::Filter`] call using
17250 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
17251 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
17252 * 5) Disconnect/connect blocks on the [`ChannelManager`].
17253 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
17254 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
17255 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
17257 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
17258 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
17260 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
17261 * call any other methods on the newly-deserialized [`ChannelManager`].
17263 * Note that because some channels may be closed during deserialization, it is critical that you
17264 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
17265 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
17266 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
17267 * not force-close the same channels but consider them live), you may end up revoking a state for
17268 * which you've already broadcasted the transaction.
17270 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
17272 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
17274 * A pointer to the opaque Rust object.
17275 * Nearly everywhere, inner must be non-null, however in places where
17276 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17278 LDKnativeChannelManagerReadArgs *inner;
17280 * Indicates that this is the only struct which contains the same pointer.
17281 * Rust functions which take ownership of an object provided via an argument require
17282 * this to be true and invalidate the object pointed to by inner.
17285 } LDKChannelManagerReadArgs;
17290 * A set of keys that were HKDF-expanded from an initial call to
17291 * [`NodeSigner::get_inbound_payment_key_material`].
17293 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
17295 typedef struct MUST_USE_STRUCT LDKExpandedKey {
17297 * A pointer to the opaque Rust object.
17298 * Nearly everywhere, inner must be non-null, however in places where
17299 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17301 LDKnativeExpandedKey *inner;
17303 * Indicates that this is the only struct which contains the same pointer.
17304 * Rust functions which take ownership of an object provided via an argument require
17305 * this to be true and invalidate the object pointed to by inner.
17311 * A 3-byte byte array.
17313 typedef struct LDKThreeBytes {
17321 * A trait to describe an object which can receive routing messages.
17323 * # Implementor DoS Warnings
17325 * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
17326 * handling inbound queries. Implementors using an on-disk network graph should be aware of
17327 * repeated disk I/O for queries accessing different parts of the network graph.
17329 typedef struct LDKRoutingMessageHandler {
17331 * An opaque pointer which is passed to your function implementations as an argument.
17332 * This has no meaning in the LDK, and can be NULL or any other value.
17336 * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
17337 * `false` or returning an `Err` otherwise.
17339 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
17341 * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
17342 * or returning an `Err` otherwise.
17344 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
17346 * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
17347 * `false` or returning an `Err` otherwise.
17349 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
17351 * Gets channel announcements and updates required to dump our routing table to a remote node,
17352 * starting at the `short_channel_id` indicated by `starting_point` and including announcements
17353 * for a single channel.
17355 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
17357 * Gets a node announcement required to dump our routing table to a remote node, starting at
17358 * the node *after* the provided pubkey and including up to one announcement immediately
17359 * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
17360 * If `None` is provided for `starting_point`, we start at the first node.
17362 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
17363 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
17365 struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
17367 * Called when a connection is established with a peer. This can be used to
17368 * perform routing table synchronization using a strategy defined by the
17371 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
17372 * with us. Implementors should be somewhat conservative about doing so, however, as other
17373 * message handlers may still wish to communicate with this peer.
17375 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
17377 * Handles the reply of a query we initiated to learn about channels
17378 * for a given range of blocks. We can expect to receive one or more
17379 * replies to a single query.
17381 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
17383 * Handles the reply of a query we initiated asking for routing gossip
17384 * messages for a list of channels. We should receive this message when
17385 * a node has completed its best effort to send us the pertaining routing
17388 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
17390 * Handles when a peer asks us to send a list of `short_channel_id`s
17391 * for the requested range of blocks.
17393 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
17395 * Handles when a peer asks us to send routing gossip messages for a
17396 * list of `short_channel_id`s.
17398 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
17400 * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
17401 * pending some async action. While there is no guarantee of the rate of future messages, the
17402 * caller should seek to reduce the rate of new gossip messages handled, especially
17403 * [`ChannelAnnouncement`]s.
17405 bool (*processing_queue_high)(const void *this_arg);
17407 * Gets the node feature flags which this handler itself supports. All available handlers are
17408 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
17409 * which are broadcasted in our [`NodeAnnouncement`] message.
17411 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
17413 * Gets the init feature flags which should be sent to the given peer. All available handlers
17414 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
17415 * which are sent in our [`Init`] message.
17417 * Note that this method is called before [`Self::peer_connected`].
17419 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
17421 * Implementation of MessageSendEventsProvider for this object.
17423 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
17425 * Frees any resources associated with this object given its this_arg pointer.
17426 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17428 void (*free)(void *this_arg);
17429 } LDKRoutingMessageHandler;
17432 * A trait indicating an object may generate onion messages to send
17434 typedef struct LDKOnionMessageProvider {
17436 * An opaque pointer which is passed to your function implementations as an argument.
17437 * This has no meaning in the LDK, and can be NULL or any other value.
17441 * Gets the next pending onion message for the peer with the given node id.
17443 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
17445 struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
17447 * Frees any resources associated with this object given its this_arg pointer.
17448 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17450 void (*free)(void *this_arg);
17451 } LDKOnionMessageProvider;
17454 * A trait to describe an object that can receive onion messages.
17456 typedef struct LDKOnionMessageHandler {
17458 * An opaque pointer which is passed to your function implementations as an argument.
17459 * This has no meaning in the LDK, and can be NULL or any other value.
17463 * Handle an incoming `onion_message` message from the given peer.
17465 void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
17467 * Called when a connection is established with a peer. Can be used to track which peers
17468 * advertise onion message support and are online.
17470 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
17471 * with us. Implementors should be somewhat conservative about doing so, however, as other
17472 * message handlers may still wish to communicate with this peer.
17474 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
17476 * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
17477 * drop and refuse to forward onion messages to this peer.
17479 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
17481 * Gets the node feature flags which this handler itself supports. All available handlers are
17482 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
17483 * which are broadcasted in our [`NodeAnnouncement`] message.
17485 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
17487 * Gets the init feature flags which should be sent to the given peer. All available handlers
17488 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
17489 * which are sent in our [`Init`] message.
17491 * Note that this method is called before [`Self::peer_connected`].
17493 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
17495 * Implementation of OnionMessageProvider for this object.
17497 struct LDKOnionMessageProvider OnionMessageProvider;
17499 * Frees any resources associated with this object given its this_arg pointer.
17500 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17502 void (*free)(void *this_arg);
17503 } LDKOnionMessageHandler;
17506 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
17509 typedef struct LDKCustomMessageReader {
17511 * An opaque pointer which is passed to your function implementations as an argument.
17512 * This has no meaning in the LDK, and can be NULL or any other value.
17516 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
17517 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
17518 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
17519 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
17521 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
17523 * Frees any resources associated with this object given its this_arg pointer.
17524 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17526 void (*free)(void *this_arg);
17527 } LDKCustomMessageReader;
17530 * A handler provided to [`PeerManager`] for reading and handling custom messages.
17532 * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
17533 * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
17534 * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
17536 * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
17537 * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
17539 typedef struct LDKCustomMessageHandler {
17541 * An opaque pointer which is passed to your function implementations as an argument.
17542 * This has no meaning in the LDK, and can be NULL or any other value.
17546 * Handles the given message sent from `sender_node_id`, possibly producing messages for
17547 * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
17550 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
17552 * Returns the list of pending messages that were generated by the handler, clearing the list
17553 * in the process. Each message is paired with the node id of the intended recipient. If no
17554 * connection to the node exists, then the message is simply not sent.
17556 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
17558 * Gets the node feature flags which this handler itself supports. All available handlers are
17559 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
17560 * which are broadcasted in our [`NodeAnnouncement`] message.
17562 * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
17564 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
17566 * Gets the init feature flags which should be sent to the given peer. All available handlers
17567 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
17568 * which are sent in our [`Init`] message.
17570 * [`Init`]: crate::ln::msgs::Init
17572 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
17574 * Implementation of CustomMessageReader for this object.
17576 struct LDKCustomMessageReader CustomMessageReader;
17578 * Frees any resources associated with this object given its this_arg pointer.
17579 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17581 void (*free)(void *this_arg);
17582 } LDKCustomMessageHandler;
17587 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
17588 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
17590 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
17592 * A pointer to the opaque Rust object.
17593 * Nearly everywhere, inner must be non-null, however in places where
17594 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17596 LDKnativeIgnoringMessageHandler *inner;
17598 * Indicates that this is the only struct which contains the same pointer.
17599 * Rust functions which take ownership of an object provided via an argument require
17600 * this to be true and invalidate the object pointed to by inner.
17603 } LDKIgnoringMessageHandler;
17606 * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
17608 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
17610 typedef struct LDKOffersMessageHandler {
17612 * An opaque pointer which is passed to your function implementations as an argument.
17613 * This has no meaning in the LDK, and can be NULL or any other value.
17617 * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
17618 * or replying with an error.
17620 struct LDKCOption_OffersMessageZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message);
17622 * Frees any resources associated with this object given its this_arg pointer.
17623 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17625 void (*free)(void *this_arg);
17626 } LDKOffersMessageHandler;
17629 * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
17630 * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
17631 * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
17632 * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
17635 * See [`OnionMessenger`] for example usage.
17637 * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
17638 * [`CustomMessage`]: Self::CustomMessage
17640 typedef struct LDKCustomOnionMessageHandler {
17642 * An opaque pointer which is passed to your function implementations as an argument.
17643 * This has no meaning in the LDK, and can be NULL or any other value.
17647 * Called with the custom message that was received, returning a response to send, if any.
17649 struct LDKCOption_CustomOnionMessageContentsZ (*handle_custom_message)(const void *this_arg, struct LDKCustomOnionMessageContents msg);
17651 * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
17652 * message type is unknown.
17654 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
17656 * Frees any resources associated with this object given its this_arg pointer.
17657 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17659 void (*free)(void *this_arg);
17660 } LDKCustomOnionMessageHandler;
17665 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
17666 * You can provide one of these as the route_handler in a MessageHandler.
17668 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
17670 * A pointer to the opaque Rust object.
17671 * Nearly everywhere, inner must be non-null, however in places where
17672 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17674 LDKnativeErroringMessageHandler *inner;
17676 * Indicates that this is the only struct which contains the same pointer.
17677 * Rust functions which take ownership of an object provided via an argument require
17678 * this to be true and invalidate the object pointed to by inner.
17681 } LDKErroringMessageHandler;
17686 * Provides references to trait impls which handle different types of messages.
17688 typedef struct MUST_USE_STRUCT LDKMessageHandler {
17690 * A pointer to the opaque Rust object.
17691 * Nearly everywhere, inner must be non-null, however in places where
17692 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17694 LDKnativeMessageHandler *inner;
17696 * Indicates that this is the only struct which contains the same pointer.
17697 * Rust functions which take ownership of an object provided via an argument require
17698 * this to be true and invalidate the object pointed to by inner.
17701 } LDKMessageHandler;
17704 * Provides an object which can be used to send data to and which uniquely identifies a connection
17705 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
17706 * implement Hash to meet the PeerManager API.
17708 * For efficiency, [`Clone`] should be relatively cheap for this type.
17710 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
17711 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
17712 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
17713 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
17714 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
17715 * to simply use another value which is guaranteed to be globally unique instead.
17717 typedef struct LDKSocketDescriptor {
17719 * An opaque pointer which is passed to your function implementations as an argument.
17720 * This has no meaning in the LDK, and can be NULL or any other value.
17724 * Attempts to send some data from the given slice to the peer.
17726 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
17727 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
17728 * called and further write attempts may occur until that time.
17730 * If the returned size is smaller than `data.len()`, a
17731 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
17732 * written. Additionally, until a `send_data` event completes fully, no further
17733 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
17734 * prevent denial-of-service issues, you should not read or buffer any data from the socket
17737 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
17738 * (indicating that read events should be paused to prevent DoS in the send buffer),
17739 * `resume_read` may be set indicating that read events on this descriptor should resume. A
17740 * `resume_read` of false carries no meaning, and should not cause any action.
17742 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
17744 * Disconnect the socket pointed to by this SocketDescriptor.
17746 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
17747 * call (doing so is a noop).
17749 void (*disconnect_socket)(void *this_arg);
17751 * Checks if two objects are equal given this object's this_arg pointer and another object.
17753 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
17755 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
17756 * This is used, for example, for inclusion of this object in a hash map.
17758 uint64_t (*hash)(const void *this_arg);
17760 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
17761 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
17762 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
17764 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
17766 * Frees any resources associated with this object given its this_arg pointer.
17767 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
17769 void (*free)(void *this_arg);
17770 } LDKSocketDescriptor;
17775 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
17776 * socket events into messages which it passes on to its [`MessageHandler`].
17778 * Locks are taken internally, so you must never assume that reentrancy from a
17779 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
17781 * Calls to [`read_event`] will decode relevant messages and pass them to the
17782 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
17783 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
17784 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
17785 * calls only after previous ones have returned.
17787 * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
17788 * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
17789 * essentially you should default to using a [`SimpleRefPeerManager`], and use a
17790 * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
17791 * you're using lightning-net-tokio.
17793 * [`read_event`]: PeerManager::read_event
17795 typedef struct MUST_USE_STRUCT LDKPeerManager {
17797 * A pointer to the opaque Rust object.
17798 * Nearly everywhere, inner must be non-null, however in places where
17799 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17801 LDKnativePeerManager *inner;
17803 * Indicates that this is the only struct which contains the same pointer.
17804 * Rust functions which take ownership of an object provided via an argument require
17805 * this to be true and invalidate the object pointed to by inner.
17813 * Static channel fields used to build transactions given per-commitment fields, organized by
17814 * broadcaster/countersignatory.
17816 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
17817 * as_holder_broadcastable and as_counterparty_broadcastable functions.
17819 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
17821 * A pointer to the opaque Rust object.
17822 * Nearly everywhere, inner must be non-null, however in places where
17823 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17825 LDKnativeDirectedChannelTransactionParameters *inner;
17827 * Indicates that this is the only struct which contains the same pointer.
17828 * Rust functions which take ownership of an object provided via an argument require
17829 * this to be true and invalidate the object pointed to by inner.
17832 } LDKDirectedChannelTransactionParameters;
17837 * Features used within an `offer`.
17839 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
17841 * A pointer to the opaque Rust object.
17842 * Nearly everywhere, inner must be non-null, however in places where
17843 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17845 LDKnativeOfferFeatures *inner;
17847 * Indicates that this is the only struct which contains the same pointer.
17848 * Rust functions which take ownership of an object provided via an argument require
17849 * this to be true and invalidate the object pointed to by inner.
17852 } LDKOfferFeatures;
17857 * Features used within an `invoice_request`.
17859 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
17861 * A pointer to the opaque Rust object.
17862 * Nearly everywhere, inner must be non-null, however in places where
17863 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17865 LDKnativeInvoiceRequestFeatures *inner;
17867 * Indicates that this is the only struct which contains the same pointer.
17868 * Rust functions which take ownership of an object provided via an argument require
17869 * this to be true and invalidate the object pointed to by inner.
17872 } LDKInvoiceRequestFeatures;
17875 * Integer in the range `0..=16`
17877 typedef struct LDKWitnessVersion {
17879 } LDKWitnessVersion;
17884 * A semantically valid [`Bolt12Invoice`] that hasn't been signed.
17886 typedef struct MUST_USE_STRUCT LDKUnsignedBolt12Invoice {
17888 * A pointer to the opaque Rust object.
17889 * Nearly everywhere, inner must be non-null, however in places where
17890 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17892 LDKnativeUnsignedBolt12Invoice *inner;
17894 * Indicates that this is the only struct which contains the same pointer.
17895 * Rust functions which take ownership of an object provided via an argument require
17896 * this to be true and invalidate the object pointed to by inner.
17899 } LDKUnsignedBolt12Invoice;
17904 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
17906 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
17907 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
17909 typedef struct MUST_USE_STRUCT LDKErroneousField {
17911 * A pointer to the opaque Rust object.
17912 * Nearly everywhere, inner must be non-null, however in places where
17913 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17915 LDKnativeErroneousField *inner;
17917 * Indicates that this is the only struct which contains the same pointer.
17918 * Rust functions which take ownership of an object provided via an argument require
17919 * this to be true and invalidate the object pointed to by inner.
17922 } LDKErroneousField;
17927 * A semantically valid [`InvoiceRequest`] that hasn't been signed.
17929 typedef struct MUST_USE_STRUCT LDKUnsignedInvoiceRequest {
17931 * A pointer to the opaque Rust object.
17932 * Nearly everywhere, inner must be non-null, however in places where
17933 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17935 LDKnativeUnsignedInvoiceRequest *inner;
17937 * Indicates that this is the only struct which contains the same pointer.
17938 * Rust functions which take ownership of an object provided via an argument require
17939 * this to be true and invalidate the object pointed to by inner.
17942 } LDKUnsignedInvoiceRequest;
17947 * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
17948 * another currency.
17950 typedef struct MUST_USE_STRUCT LDKAmount {
17952 * A pointer to the opaque Rust object.
17953 * Nearly everywhere, inner must be non-null, however in places where
17954 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17956 LDKnativeAmount *inner;
17958 * Indicates that this is the only struct which contains the same pointer.
17959 * Rust functions which take ownership of an object provided via an argument require
17960 * this to be true and invalidate the object pointed to by inner.
17968 * Quantity of items supported by an [`Offer`].
17970 typedef struct MUST_USE_STRUCT LDKQuantity {
17972 * A pointer to the opaque Rust object.
17973 * Nearly everywhere, inner must be non-null, however in places where
17974 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17976 LDKnativeQuantity *inner;
17978 * Indicates that this is the only struct which contains the same pointer.
17979 * Rust functions which take ownership of an object provided via an argument require
17980 * this to be true and invalidate the object pointed to by inner.
17988 * Receives and validates network updates from peers,
17989 * stores authentic and relevant data as a network graph.
17990 * This network graph is then used for routing payments.
17991 * Provides interface to help with initial routing sync by
17992 * serving historical announcements.
17994 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
17996 * A pointer to the opaque Rust object.
17997 * Nearly everywhere, inner must be non-null, however in places where
17998 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18000 LDKnativeP2PGossipSync *inner;
18002 * Indicates that this is the only struct which contains the same pointer.
18003 * Rust functions which take ownership of an object provided via an argument require
18004 * this to be true and invalidate the object pointed to by inner.
18007 } LDKP2PGossipSync;
18012 * A read-only view of [`NetworkGraph`].
18014 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
18016 * A pointer to the opaque Rust object.
18017 * Nearly everywhere, inner must be non-null, however in places where
18018 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18020 LDKnativeReadOnlyNetworkGraph *inner;
18022 * Indicates that this is the only struct which contains the same pointer.
18023 * Rust functions which take ownership of an object provided via an argument require
18024 * this to be true and invalidate the object pointed to by inner.
18027 } LDKReadOnlyNetworkGraph;
18032 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
18033 * source node to a target node.
18035 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
18037 * A pointer to the opaque Rust object.
18038 * Nearly everywhere, inner must be non-null, however in places where
18039 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18041 LDKnativeDirectedChannelInfo *inner;
18043 * Indicates that this is the only struct which contains the same pointer.
18044 * Rust functions which take ownership of an object provided via an argument require
18045 * this to be true and invalidate the object pointed to by inner.
18048 } LDKDirectedChannelInfo;
18051 * The effective capacity of a channel for routing purposes.
18053 * While this may be smaller than the actual channel capacity, amounts greater than
18054 * [`Self::as_msat`] should not be routed through the channel.
18056 typedef enum LDKEffectiveCapacity_Tag {
18058 * The available liquidity in the channel known from being a channel counterparty, and thus a
18061 LDKEffectiveCapacity_ExactLiquidity,
18063 * The maximum HTLC amount in one direction as advertised on the gossip network.
18065 LDKEffectiveCapacity_AdvertisedMaxHTLC,
18067 * The total capacity of the channel as determined by the funding transaction.
18069 LDKEffectiveCapacity_Total,
18071 * A capacity sufficient to route any payment, typically used for private channels provided by
18074 LDKEffectiveCapacity_Infinite,
18076 * The maximum HTLC amount as provided by an invoice route hint.
18078 LDKEffectiveCapacity_HintMaxHTLC,
18080 * A capacity that is unknown possibly because either the chain state is unavailable to know
18081 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
18083 LDKEffectiveCapacity_Unknown,
18085 * Must be last for serialization purposes
18087 LDKEffectiveCapacity_Sentinel,
18088 } LDKEffectiveCapacity_Tag;
18090 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
18092 * Either the inbound or outbound liquidity depending on the direction, denominated in
18095 uint64_t liquidity_msat;
18096 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
18098 typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
18100 * The maximum HTLC amount denominated in millisatoshi.
18102 uint64_t amount_msat;
18103 } LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
18105 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
18107 * The funding amount denominated in millisatoshi.
18109 uint64_t capacity_msat;
18111 * The maximum HTLC amount denominated in millisatoshi.
18113 uint64_t htlc_maximum_msat;
18114 } LDKEffectiveCapacity_LDKTotal_Body;
18116 typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
18118 * The maximum HTLC amount denominated in millisatoshi.
18120 uint64_t amount_msat;
18121 } LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
18123 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
18124 LDKEffectiveCapacity_Tag tag;
18126 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
18127 LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
18128 LDKEffectiveCapacity_LDKTotal_Body total;
18129 LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
18131 } LDKEffectiveCapacity;
18136 * A [`Router`] implemented using [`find_route`].
18138 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
18140 * A pointer to the opaque Rust object.
18141 * Nearly everywhere, inner must be non-null, however in places where
18142 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18144 LDKnativeDefaultRouter *inner;
18146 * Indicates that this is the only struct which contains the same pointer.
18147 * Rust functions which take ownership of an object provided via an argument require
18148 * this to be true and invalidate the object pointed to by inner.
18151 } LDKDefaultRouter;
18156 * [`Score`] implementation that factors in in-flight HTLC liquidity.
18158 * Useful for custom [`Router`] implementations to wrap their [`Score`] on-the-fly when calling
18161 * [`Score`]: crate::routing::scoring::Score
18163 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
18165 * A pointer to the opaque Rust object.
18166 * Nearly everywhere, inner must be non-null, however in places where
18167 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18169 LDKnativeScorerAccountingForInFlightHtlcs *inner;
18171 * Indicates that this is the only struct which contains the same pointer.
18172 * Rust functions which take ownership of an object provided via an argument require
18173 * this to be true and invalidate the object pointed to by inner.
18176 } LDKScorerAccountingForInFlightHtlcs;
18179 * The recipient of a payment, differing based on whether they've hidden their identity with route
18182 typedef enum LDKPayee_Tag {
18184 * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
18185 * will be included in the final [`Route`].
18189 * The recipient included these route hints in their BOLT11 invoice.
18193 * Must be last for serialization purposes
18198 typedef struct LDKPayee_LDKBlinded_Body {
18200 * Aggregated routing info and blinded paths, for routing to the payee without knowing their
18203 struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints;
18205 * Features supported by the payee.
18207 * May be set from the payee's invoice. May be `None` if the invoice does not contain any
18210 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18212 struct LDKBolt12InvoiceFeatures features;
18213 } LDKPayee_LDKBlinded_Body;
18215 typedef struct LDKPayee_LDKClear_Body {
18217 * The node id of the payee.
18219 struct LDKPublicKey node_id;
18221 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
18223 struct LDKCVec_RouteHintZ route_hints;
18225 * Features supported by the payee.
18227 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
18228 * does not contain any features.
18230 * [`for_keysend`]: PaymentParameters::for_keysend
18232 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18234 struct LDKBolt11InvoiceFeatures features;
18236 * The minimum CLTV delta at the end of the route. This value must not be zero.
18238 uint32_t final_cltv_expiry_delta;
18239 } LDKPayee_LDKClear_Body;
18241 typedef struct MUST_USE_STRUCT LDKPayee {
18244 LDKPayee_LDKBlinded_Body blinded;
18245 LDKPayee_LDKClear_Body clear;
18252 * A concrete implementation of [`LockableScore`] which supports multi-threading.
18254 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
18256 * A pointer to the opaque Rust object.
18257 * Nearly everywhere, inner must be non-null, however in places where
18258 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18260 LDKnativeMultiThreadedLockableScore *inner;
18262 * Indicates that this is the only struct which contains the same pointer.
18263 * Rust functions which take ownership of an object provided via an argument require
18264 * this to be true and invalidate the object pointed to by inner.
18267 } LDKMultiThreadedLockableScore;
18272 * A locked `MultiThreadedLockableScore`.
18274 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLock {
18276 * A pointer to the opaque Rust object.
18277 * Nearly everywhere, inner must be non-null, however in places where
18278 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18280 LDKnativeMultiThreadedScoreLock *inner;
18282 * Indicates that this is the only struct which contains the same pointer.
18283 * Rust functions which take ownership of an object provided via an argument require
18284 * this to be true and invalidate the object pointed to by inner.
18287 } LDKMultiThreadedScoreLock;
18292 * Parameters for configuring [`ProbabilisticScorer`].
18294 * Used to configure decay parameters that are static throughout the lifetime of the scorer.
18295 * these decay parameters affect the score of the channel penalty and are not changed on a
18296 * per-route penalty cost call.
18298 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
18300 * A pointer to the opaque Rust object.
18301 * Nearly everywhere, inner must be non-null, however in places where
18302 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18304 LDKnativeProbabilisticScoringDecayParameters *inner;
18306 * Indicates that this is the only struct which contains the same pointer.
18307 * Rust functions which take ownership of an object provided via an argument require
18308 * this to be true and invalidate the object pointed to by inner.
18311 } LDKProbabilisticScoringDecayParameters;
18316 * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
18317 * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
18319 * Your `node_id` is seed/0'.
18320 * Unilateral closes may use seed/1'.
18321 * Cooperative closes may use seed/2'.
18322 * The two close keys may be needed to claim on-chain funds!
18324 * This struct cannot be used for nodes that wish to support receiving phantom payments;
18325 * [`PhantomKeysManager`] must be used instead.
18327 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
18328 * previously issued invoices and attempts to pay previous invoices will fail.
18330 typedef struct MUST_USE_STRUCT LDKKeysManager {
18332 * A pointer to the opaque Rust object.
18333 * Nearly everywhere, inner must be non-null, however in places where
18334 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18336 LDKnativeKeysManager *inner;
18338 * Indicates that this is the only struct which contains the same pointer.
18339 * Rust functions which take ownership of an object provided via an argument require
18340 * this to be true and invalidate the object pointed to by inner.
18348 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
18351 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
18352 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
18353 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
18354 * itself without ever needing to forward to this fake node.
18356 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
18357 * provide some fault tolerance, because payers will automatically retry paying other provided
18358 * nodes in the case that one node goes down.
18360 * Note that multi-path payments are not supported in phantom invoices for security reasons.
18361 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
18362 * invoices and attempts to pay previous invoices will fail.
18364 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
18366 * A pointer to the opaque Rust object.
18367 * Nearly everywhere, inner must be non-null, however in places where
18368 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18370 LDKnativePhantomKeysManager *inner;
18372 * Indicates that this is the only struct which contains the same pointer.
18373 * Rust functions which take ownership of an object provided via an argument require
18374 * this to be true and invalidate the object pointed to by inner.
18377 } LDKPhantomKeysManager;
18380 * The destination of an onion message.
18382 typedef enum LDKDestination_Tag {
18384 * We're sending this onion message to a node.
18386 LDKDestination_Node,
18388 * We're sending this onion message to a blinded path.
18390 LDKDestination_BlindedPath,
18392 * Must be last for serialization purposes
18394 LDKDestination_Sentinel,
18395 } LDKDestination_Tag;
18397 typedef struct MUST_USE_STRUCT LDKDestination {
18398 LDKDestination_Tag tag;
18401 struct LDKPublicKey node;
18404 struct LDKBlindedPath blinded_path;
18410 * A trait defining behavior for routing an [`OnionMessage`].
18412 * [`OnionMessage`]: msgs::OnionMessage
18414 typedef struct LDKMessageRouter {
18416 * An opaque pointer which is passed to your function implementations as an argument.
18417 * This has no meaning in the LDK, and can be NULL or any other value.
18421 * Returns a route for sending an [`OnionMessage`] to the given [`Destination`].
18423 * [`OnionMessage`]: msgs::OnionMessage
18425 struct LDKCResult_OnionMessagePathNoneZ (*find_path)(const void *this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination);
18427 * Frees any resources associated with this object given its this_arg pointer.
18428 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18430 void (*free)(void *this_arg);
18431 } LDKMessageRouter;
18436 * A sender, receiver and forwarder of onion messages. In upcoming releases, this object will be
18437 * used to retrieve invoices and fulfill invoice requests from [offers]. Currently, only sending
18438 * and receiving custom onion messages is supported.
18443 * # extern crate bitcoin;
18444 * # use bitcoin::hashes::_export::_core::time::Duration;
18445 * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
18446 * # use lightning::blinded_path::BlindedPath;
18447 * # use lightning::sign::KeysManager;
18448 * # use lightning::ln::peer_handler::IgnoringMessageHandler;
18449 * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessenger, OnionMessagePath};
18450 * # use lightning::onion_message::packet::{CustomOnionMessageContents, OnionMessageContents};
18451 * # use lightning::util::logger::{Logger, Record};
18452 * # use lightning::util::ser::{Writeable, Writer};
18453 * # use lightning::io;
18454 * # use std::sync::Arc;
18455 * # struct FakeLogger;
18456 * # impl Logger for FakeLogger {
18457 * # fn log(&self, record: &Record) { unimplemented!() }
18459 * # struct FakeMessageRouter {}
18460 * # impl MessageRouter for FakeMessageRouter {
18461 * # fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
18462 * # unimplemented!()
18465 * # let seed = [42u8; 32];
18466 * # let time = Duration::from_secs(123456);
18467 * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
18468 * # let logger = Arc::new(FakeLogger {});
18469 * # let node_secret = SecretKey::from_slice(&hex::decode(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
18470 * # let secp_ctx = Secp256k1::new();
18471 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
18472 * # let (hop_node_id2, hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1, hop_node_id1);
18473 * # let destination_node_id = hop_node_id1;
18474 * # let message_router = Arc::new(FakeMessageRouter {});
18475 * # let custom_message_handler = IgnoringMessageHandler {};
18476 * # let offers_message_handler = IgnoringMessageHandler {};
18477 * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
18478 * // ChannelManager.
18479 * let onion_messenger = OnionMessenger::new(
18480 * &keys_manager, &keys_manager, logger, message_router, &offers_message_handler,
18481 * &custom_message_handler
18484 * # struct YourCustomMessage {}
18485 * impl Writeable for YourCustomMessage {
18486 * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
18488 * \t\t// Write your custom onion message to `w`
18491 * impl CustomOnionMessageContents for YourCustomMessage {
18492 * \tfn tlv_type(&self) -> u64 {
18493 * \t\t# let your_custom_message_type = 42;
18494 * \t\tyour_custom_message_type
18497 * // Send a custom onion message to a node id.
18498 * let path = OnionMessagePath {
18499 * \tintermediate_nodes: vec![hop_node_id1, hop_node_id2],
18500 * \tdestination: Destination::Node(destination_node_id),
18502 * let reply_path = None;
18503 * # let your_custom_message = YourCustomMessage {};
18504 * let message = OnionMessageContents::Custom(your_custom_message);
18505 * onion_messenger.send_onion_message(path, message, reply_path);
18507 * // Create a blinded path to yourself, for someone to send an onion message to.
18508 * # let your_node_id = hop_node_id1;
18509 * let hops = [hop_node_id3, hop_node_id4, your_node_id];
18510 * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
18512 * // Send a custom onion message to a blinded path.
18513 * let path = OnionMessagePath {
18514 * \tintermediate_nodes: vec![hop_node_id1, hop_node_id2],
18515 * \tdestination: Destination::BlindedPath(blinded_path),
18517 * let reply_path = None;
18518 * # let your_custom_message = YourCustomMessage {};
18519 * let message = OnionMessageContents::Custom(your_custom_message);
18520 * onion_messenger.send_onion_message(path, message, reply_path);
18523 * [offers]: <https://github.com/lightning/bolts/pull/798>
18524 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
18526 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
18528 * A pointer to the opaque Rust object.
18529 * Nearly everywhere, inner must be non-null, however in places where
18530 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18532 LDKnativeOnionMessenger *inner;
18534 * Indicates that this is the only struct which contains the same pointer.
18535 * Rust functions which take ownership of an object provided via an argument require
18536 * this to be true and invalidate the object pointed to by inner.
18539 } LDKOnionMessenger;
18544 * A [`MessageRouter`] that always fails.
18546 typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
18548 * A pointer to the opaque Rust object.
18549 * Nearly everywhere, inner must be non-null, however in places where
18550 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18552 LDKnativeDefaultMessageRouter *inner;
18554 * Indicates that this is the only struct which contains the same pointer.
18555 * Rust functions which take ownership of an object provided via an argument require
18556 * this to be true and invalidate the object pointed to by inner.
18559 } LDKDefaultMessageRouter;
18562 * The contents of an onion message. In the context of offers, this would be the invoice, invoice
18563 * request, or invoice error.
18565 typedef enum LDKOnionMessageContents_Tag {
18567 * A message related to BOLT 12 Offers.
18569 LDKOnionMessageContents_Offers,
18571 * A custom onion message specified by the user.
18573 LDKOnionMessageContents_Custom,
18575 * Must be last for serialization purposes
18577 LDKOnionMessageContents_Sentinel,
18578 } LDKOnionMessageContents_Tag;
18580 typedef struct MUST_USE_STRUCT LDKOnionMessageContents {
18581 LDKOnionMessageContents_Tag tag;
18584 struct LDKOffersMessage offers;
18587 struct LDKCustomOnionMessageContents custom;
18590 } LDKOnionMessageContents;
18595 * The parameters required to derive a channel signer via [`SignerProvider`].
18597 typedef struct MUST_USE_STRUCT LDKChannelDerivationParameters {
18599 * A pointer to the opaque Rust object.
18600 * Nearly everywhere, inner must be non-null, however in places where
18601 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18603 LDKnativeChannelDerivationParameters *inner;
18605 * Indicates that this is the only struct which contains the same pointer.
18606 * Rust functions which take ownership of an object provided via an argument require
18607 * this to be true and invalidate the object pointed to by inner.
18610 } LDKChannelDerivationParameters;
18613 * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
18614 * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
18615 * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
18616 * which can provide a default implementation of this trait when used with [`Wallet`].
18618 typedef struct LDKCoinSelectionSource {
18620 * An opaque pointer which is passed to your function implementations as an argument.
18621 * This has no meaning in the LDK, and can be NULL or any other value.
18625 * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
18626 * available to spend. Implementations are free to pick their coin selection algorithm of
18627 * choice, as long as the following requirements are met:
18629 * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
18630 * throughout coin selection, but must not be returned as part of the result.
18631 * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
18632 * throughout coin selection. In some cases, like when funding an anchor transaction, this
18633 * set is empty. Implementations should ensure they handle this correctly on their end,
18634 * e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
18635 * provided, in which case a zero-value empty OP_RETURN output can be used instead.
18636 * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
18637 * inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
18639 * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
18640 * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
18641 * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
18642 * delaying block inclusion.
18644 * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
18645 * can be re-used within new fee-bumped iterations of the original claiming transaction,
18646 * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
18647 * transaction associated with it, and all of the available UTXOs have already been assigned to
18648 * other claims, implementations must be willing to double spend their UTXOs. The choice of
18649 * which UTXOs to double spend is left to the implementation, but it must strive to keep the
18650 * set of other claims being double spent to a minimum.
18652 struct LDKCResult_CoinSelectionNoneZ (*select_confirmed_utxos)(const void *this_arg, struct LDKThirtyTwoBytes claim_id, struct LDKCVec_InputZ must_spend, struct LDKCVec_TxOutZ must_pay_to, uint32_t target_feerate_sat_per_1000_weight);
18654 * Signs and provides the full witness for all inputs within the transaction known to the
18655 * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
18657 struct LDKCResult_TransactionNoneZ (*sign_tx)(const void *this_arg, struct LDKTransaction tx);
18659 * Frees any resources associated with this object given its this_arg pointer.
18660 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18662 void (*free)(void *this_arg);
18663 } LDKCoinSelectionSource;
18666 * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
18667 * provide a default implementation to [`CoinSelectionSource`].
18669 typedef struct LDKWalletSource {
18671 * An opaque pointer which is passed to your function implementations as an argument.
18672 * This has no meaning in the LDK, and can be NULL or any other value.
18676 * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
18678 struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
18680 * Returns a script to use for change above dust resulting from a successful coin selection
18683 struct LDKCResult_ScriptNoneZ (*get_change_script)(const void *this_arg);
18685 * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
18686 * the transaction known to the wallet (i.e., any provided via
18687 * [`WalletSource::list_confirmed_utxos`]).
18689 struct LDKCResult_TransactionNoneZ (*sign_tx)(const void *this_arg, struct LDKTransaction tx);
18691 * Frees any resources associated with this object given its this_arg pointer.
18692 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18694 void (*free)(void *this_arg);
18700 * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
18701 * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
18702 * spends may happen.
18704 typedef struct MUST_USE_STRUCT LDKWallet {
18706 * A pointer to the opaque Rust object.
18707 * Nearly everywhere, inner must be non-null, however in places where
18708 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18710 LDKnativeWallet *inner;
18712 * Indicates that this is the only struct which contains the same pointer.
18713 * Rust functions which take ownership of an object provided via an argument require
18714 * this to be true and invalidate the object pointed to by inner.
18722 * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
18723 * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
18724 * Replace-By-Fee (RBF).
18726 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
18728 typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
18730 * A pointer to the opaque Rust object.
18731 * Nearly everywhere, inner must be non-null, however in places where
18732 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18734 LDKnativeBumpTransactionEventHandler *inner;
18736 * Indicates that this is the only struct which contains the same pointer.
18737 * Rust functions which take ownership of an object provided via an argument require
18738 * this to be true and invalidate the object pointed to by inner.
18741 } LDKBumpTransactionEventHandler;
18746 * FilesystemPersister persists channel data on disk, where each channel's
18747 * data is stored in a file named after its funding outpoint.
18749 * Warning: this module does the best it can with calls to persist data, but it
18750 * can only guarantee that the data is passed to the drive. It is up to the
18751 * drive manufacturers to do the actual persistence properly, which they often
18752 * don't (especially on consumer-grade hardware). Therefore, it is up to the
18753 * user to validate their entire storage stack, to ensure the writes are
18755 * Corollary: especially when dealing with larger amounts of money, it is best
18756 * practice to have multiple channel data backups and not rely only on one
18757 * FilesystemPersister.
18759 typedef struct MUST_USE_STRUCT LDKFilesystemPersister {
18761 * A pointer to the opaque Rust object.
18762 * Nearly everywhere, inner must be non-null, however in places where
18763 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18765 LDKnativeFilesystemPersister *inner;
18767 * Indicates that this is the only struct which contains the same pointer.
18768 * Rust functions which take ownership of an object provided via an argument require
18769 * this to be true and invalidate the object pointed to by inner.
18772 } LDKFilesystemPersister;
18777 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
18778 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
18779 * responsibilities are:
18780 * * Processing [`Event`]s with a user-provided [`EventHandler`].
18781 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
18782 * writing it to disk/backups by invoking the callback given to it at startup.
18783 * [`ChannelManager`] persistence should be done in the background.
18784 * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
18785 * and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
18786 * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
18787 * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
18789 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
18790 * upon as doing so may result in high latency.
18794 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
18795 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
18796 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
18797 * unilateral chain closure fees are at risk.
18799 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
18800 * [`Event`]: lightning::events::Event
18801 * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
18802 * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
18803 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
18805 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
18807 * A pointer to the opaque Rust object.
18808 * Nearly everywhere, inner must be non-null, however in places where
18809 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18811 LDKnativeBackgroundProcessor *inner;
18813 * Indicates that this is the only struct which contains the same pointer.
18814 * Rust functions which take ownership of an object provided via an argument require
18815 * this to be true and invalidate the object pointed to by inner.
18818 } LDKBackgroundProcessor;
18823 * The main Rapid Gossip Sync object.
18825 * See [crate-level documentation] for usage.
18827 * [crate-level documentation]: crate
18829 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
18831 * A pointer to the opaque Rust object.
18832 * Nearly everywhere, inner must be non-null, however in places where
18833 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18835 LDKnativeRapidGossipSync *inner;
18837 * Indicates that this is the only struct which contains the same pointer.
18838 * Rust functions which take ownership of an object provided via an argument require
18839 * this to be true and invalidate the object pointed to by inner.
18842 } LDKRapidGossipSync;
18845 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
18847 typedef enum LDKGossipSync_Tag {
18849 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
18853 * Rapid gossip sync from a trusted server.
18855 LDKGossipSync_Rapid,
18859 LDKGossipSync_None,
18861 * Must be last for serialization purposes
18863 LDKGossipSync_Sentinel,
18864 } LDKGossipSync_Tag;
18866 typedef struct MUST_USE_STRUCT LDKGossipSync {
18867 LDKGossipSync_Tag tag;
18871 * Note that this field is expected to be a reference.
18873 struct LDKP2PGossipSync p2p;
18877 * Note that this field is expected to be a reference.
18879 struct LDKRapidGossipSync rapid;
18887 * Data of the [`RawBolt11Invoice`] that is encoded in the data part
18889 typedef struct MUST_USE_STRUCT LDKRawDataPart {
18891 * A pointer to the opaque Rust object.
18892 * Nearly everywhere, inner must be non-null, however in places where
18893 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18895 LDKnativeRawDataPart *inner;
18897 * Indicates that this is the only struct which contains the same pointer.
18898 * Rust functions which take ownership of an object provided via an argument require
18899 * this to be true and invalidate the object pointed to by inner.
18909 typedef struct MUST_USE_STRUCT LDKSha256 {
18911 * A pointer to the opaque Rust object.
18912 * Nearly everywhere, inner must be non-null, however in places where
18913 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18915 LDKnativeSha256 *inner;
18917 * Indicates that this is the only struct which contains the same pointer.
18918 * Rust functions which take ownership of an object provided via an argument require
18919 * this to be true and invalidate the object pointed to by inner.
18927 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
18930 typedef struct MUST_USE_STRUCT LDKExpiryTime {
18932 * A pointer to the opaque Rust object.
18933 * Nearly everywhere, inner must be non-null, however in places where
18934 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18936 LDKnativeExpiryTime *inner;
18938 * Indicates that this is the only struct which contains the same pointer.
18939 * Rust functions which take ownership of an object provided via an argument require
18940 * this to be true and invalidate the object pointed to by inner.
18948 * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
18950 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
18952 * A pointer to the opaque Rust object.
18953 * Nearly everywhere, inner must be non-null, however in places where
18954 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18956 LDKnativeMinFinalCltvExpiryDelta *inner;
18958 * Indicates that this is the only struct which contains the same pointer.
18959 * Rust functions which take ownership of an object provided via an argument require
18960 * this to be true and invalidate the object pointed to by inner.
18963 } LDKMinFinalCltvExpiryDelta;
18966 * A 20-byte byte array.
18968 typedef struct LDKTwentyBytes {
18976 * Fallback address in case no LN payment is possible
18978 typedef enum LDKFallback_Tag {
18979 LDKFallback_SegWitProgram,
18980 LDKFallback_PubKeyHash,
18981 LDKFallback_ScriptHash,
18983 * Must be last for serialization purposes
18985 LDKFallback_Sentinel,
18988 typedef struct LDKFallback_LDKSegWitProgram_Body {
18989 struct LDKWitnessVersion version;
18990 struct LDKCVec_u8Z program;
18991 } LDKFallback_LDKSegWitProgram_Body;
18993 typedef struct MUST_USE_STRUCT LDKFallback {
18994 LDKFallback_Tag tag;
18996 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
18998 struct LDKTwentyBytes pub_key_hash;
19001 struct LDKTwentyBytes script_hash;
19006 extern const uintptr_t MAX_BUF_SIZE;
19008 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
19010 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
19012 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
19014 extern const uint32_t ANTI_REORG_DELAY;
19016 extern const uint16_t BREAKDOWN_TIMEOUT;
19018 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
19020 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
19022 extern const uint16_t MAX_HTLCS;
19024 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
19026 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
19028 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
19030 extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
19032 extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
19034 extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
19036 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
19038 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
19040 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
19042 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
19044 extern const uint64_t MAX_TIMESTAMP;
19046 extern const uint64_t DEFAULT_EXPIRY_TIME;
19048 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
19050 extern const uint8_t TAG_PAYMENT_HASH;
19052 extern const uint8_t TAG_DESCRIPTION;
19054 extern const uint8_t TAG_PAYEE_PUB_KEY;
19056 extern const uint8_t TAG_DESCRIPTION_HASH;
19058 extern const uint8_t TAG_EXPIRY_TIME;
19060 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
19062 extern const uint8_t TAG_FALLBACK;
19064 extern const uint8_t TAG_PRIVATE_ROUTE;
19066 extern const uint8_t TAG_PAYMENT_SECRET;
19068 extern const uint8_t TAG_PAYMENT_METADATA;
19070 extern const uint8_t TAG_FEATURES;
19072 struct LDKStr _ldk_get_compiled_version(void);
19074 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
19077 * Gets the 128-bit integer, as 16 little-endian bytes
19079 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
19082 * Constructs a new U128 from 16 little-endian bytes
19084 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
19087 * Convenience function for constructing a new BigEndianScalar
19089 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
19092 * Creates a new Bech32Error which has the same data as `orig`
19094 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
19097 * Releases any memory held by the given `Bech32Error` (which is currently none)
19099 void Bech32Error_free(struct LDKBech32Error o);
19102 * Frees the data buffer, if data_is_owned is set and datalen > 0.
19104 void Transaction_free(struct LDKTransaction _res);
19107 * Creates a new Witness which has the same data as `orig` but with a new buffer.
19109 struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
19112 * Frees the data pointed to by data
19114 void Witness_free(struct LDKWitness _res);
19117 * Frees the witness and script_sig in a TxIn
19119 void TxIn_free(struct LDKTxIn _res);
19122 * Convenience function for constructing a new TxIn
19124 struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
19127 * Convenience function for constructing a new TxOut
19129 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
19132 * Frees the data pointed to by script_pubkey.
19134 void TxOut_free(struct LDKTxOut _res);
19137 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
19139 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
19142 * Frees the data buffer, if chars_is_owned is set and len > 0.
19144 void Str_free(struct LDKStr _res);
19146 #if defined(LDK_DEBUG_BUILD)
19148 * This function exists for memory safety testing purposes. It should never be used in production
19151 const void *__unmangle_inner_ptr(const void *ptr);
19155 * Constructs a new COption_DurationZ containing a u64
19157 struct LDKCOption_DurationZ COption_DurationZ_some(uint64_t o);
19160 * Constructs a new COption_DurationZ containing nothing
19162 struct LDKCOption_DurationZ COption_DurationZ_none(void);
19165 * Frees any resources associated with the u64, if we are in the Some state
19167 void COption_DurationZ_free(struct LDKCOption_DurationZ _res);
19170 * Creates a new COption_DurationZ which has the same data as `orig`
19171 * but with all dynamically-allocated buffers duplicated in new buffers.
19173 struct LDKCOption_DurationZ COption_DurationZ_clone(const struct LDKCOption_DurationZ *NONNULL_PTR orig);
19176 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19178 void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
19181 * Constructs a new COption_u64Z containing a u64
19183 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
19186 * Constructs a new COption_u64Z containing nothing
19188 struct LDKCOption_u64Z COption_u64Z_none(void);
19191 * Frees any resources associated with the u64, if we are in the Some state
19193 void COption_u64Z_free(struct LDKCOption_u64Z _res);
19196 * Creates a new COption_u64Z which has the same data as `orig`
19197 * but with all dynamically-allocated buffers duplicated in new buffers.
19199 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
19202 * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
19204 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o);
19207 * Creates a new CResult_RefundBolt12ParseErrorZ in the error state.
19209 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
19212 * Checks if the given object is currently in the success state
19214 bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o);
19217 * Frees any resources used by the CResult_RefundBolt12ParseErrorZ.
19219 void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res);
19222 * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig`
19223 * but with all dynamically-allocated buffers duplicated in new buffers.
19225 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig);
19228 * Creates a new CResult_NoneAPIErrorZ in the success state.
19230 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
19233 * Creates a new CResult_NoneAPIErrorZ in the error state.
19235 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
19238 * Checks if the given object is currently in the success state
19240 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
19243 * Frees any resources used by the CResult_NoneAPIErrorZ.
19245 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
19248 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
19249 * but with all dynamically-allocated buffers duplicated in new buffers.
19251 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
19254 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19256 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
19259 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19261 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
19264 * Constructs a new COption_PaymentSecretZ containing a crate::c_types::ThirtyTwoBytes
19266 struct LDKCOption_PaymentSecretZ COption_PaymentSecretZ_some(struct LDKThirtyTwoBytes o);
19269 * Constructs a new COption_PaymentSecretZ containing nothing
19271 struct LDKCOption_PaymentSecretZ COption_PaymentSecretZ_none(void);
19274 * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
19276 void COption_PaymentSecretZ_free(struct LDKCOption_PaymentSecretZ _res);
19279 * Creates a new COption_PaymentSecretZ which has the same data as `orig`
19280 * but with all dynamically-allocated buffers duplicated in new buffers.
19282 struct LDKCOption_PaymentSecretZ COption_PaymentSecretZ_clone(const struct LDKCOption_PaymentSecretZ *NONNULL_PTR orig);
19285 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19287 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
19290 * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
19292 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
19295 * Constructs a new COption_CVec_u8ZZ containing nothing
19297 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
19300 * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
19302 void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
19305 * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
19306 * but with all dynamically-allocated buffers duplicated in new buffers.
19308 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
19311 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
19313 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
19316 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
19318 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
19321 * Checks if the given object is currently in the success state
19323 bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
19326 * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
19328 void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
19331 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
19332 * but with all dynamically-allocated buffers duplicated in new buffers.
19334 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
19337 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
19339 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
19342 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
19344 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
19347 * Checks if the given object is currently in the success state
19349 bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
19352 * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
19354 void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
19357 * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
19358 * but with all dynamically-allocated buffers duplicated in new buffers.
19360 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
19363 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
19365 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
19368 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
19370 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
19373 * Checks if the given object is currently in the success state
19375 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
19378 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
19380 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
19383 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
19384 * but with all dynamically-allocated buffers duplicated in new buffers.
19386 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
19389 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
19391 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
19394 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
19396 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
19399 * Checks if the given object is currently in the success state
19401 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
19404 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
19406 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
19409 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
19410 * but with all dynamically-allocated buffers duplicated in new buffers.
19412 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
19415 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
19417 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
19420 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
19422 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
19425 * Checks if the given object is currently in the success state
19427 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
19430 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
19432 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
19435 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
19436 * but with all dynamically-allocated buffers duplicated in new buffers.
19438 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
19441 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19443 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
19446 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19448 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
19451 * Constructs a new COption_PackedLockTimeZ containing a u32
19453 struct LDKCOption_PackedLockTimeZ COption_PackedLockTimeZ_some(uint32_t o);
19456 * Constructs a new COption_PackedLockTimeZ containing nothing
19458 struct LDKCOption_PackedLockTimeZ COption_PackedLockTimeZ_none(void);
19461 * Frees any resources associated with the u32, if we are in the Some state
19463 void COption_PackedLockTimeZ_free(struct LDKCOption_PackedLockTimeZ _res);
19466 * Creates a new COption_PackedLockTimeZ which has the same data as `orig`
19467 * but with all dynamically-allocated buffers duplicated in new buffers.
19469 struct LDKCOption_PackedLockTimeZ COption_PackedLockTimeZ_clone(const struct LDKCOption_PackedLockTimeZ *NONNULL_PTR orig);
19472 * Creates a new tuple which has the same data as `orig`
19473 * but with all dynamically-allocated buffers duplicated in new buffers.
19475 struct LDKC2Tuple_PartiallySignedTransactionusizeZ C2Tuple_PartiallySignedTransactionusizeZ_clone(const struct LDKC2Tuple_PartiallySignedTransactionusizeZ *NONNULL_PTR orig);
19478 * Creates a new C2Tuple_PartiallySignedTransactionusizeZ from the contained elements.
19480 struct LDKC2Tuple_PartiallySignedTransactionusizeZ C2Tuple_PartiallySignedTransactionusizeZ_new(struct LDKCVec_u8Z a, uintptr_t b);
19483 * Frees any resources used by the C2Tuple_PartiallySignedTransactionusizeZ.
19485 void C2Tuple_PartiallySignedTransactionusizeZ_free(struct LDKC2Tuple_PartiallySignedTransactionusizeZ _res);
19488 * Creates a new CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ in the success state.
19490 struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_ok(struct LDKC2Tuple_PartiallySignedTransactionusizeZ o);
19493 * Creates a new CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ in the error state.
19495 struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_err(void);
19498 * Checks if the given object is currently in the success state
19500 bool CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ *NONNULL_PTR o);
19503 * Frees any resources used by the CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ.
19505 void CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_free(struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ _res);
19508 * Creates a new CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ which has the same data as `orig`
19509 * but with all dynamically-allocated buffers duplicated in new buffers.
19511 struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ CResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ_clone(const struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ *NONNULL_PTR orig);
19514 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19516 void CVec_PaymentPreimageZ_free(struct LDKCVec_PaymentPreimageZ _res);
19519 * Creates a new CResult_NoneNoneZ in the success state.
19521 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
19524 * Creates a new CResult_NoneNoneZ in the error state.
19526 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
19529 * Checks if the given object is currently in the success state
19531 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
19534 * Frees any resources used by the CResult_NoneNoneZ.
19536 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
19539 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
19540 * but with all dynamically-allocated buffers duplicated in new buffers.
19542 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
19545 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19547 void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res);
19550 * Creates a new tuple which has the same data as `orig`
19551 * but with all dynamically-allocated buffers duplicated in new buffers.
19553 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_clone(const struct LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR orig);
19556 * Creates a new C2Tuple_SignatureCVec_SignatureZZ from the contained elements.
19558 struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b);
19561 * Frees any resources used by the C2Tuple_SignatureCVec_SignatureZZ.
19563 void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res);
19566 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state.
19568 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o);
19571 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the error state.
19573 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void);
19576 * Checks if the given object is currently in the success state
19578 bool CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR o);
19581 * Frees any resources used by the CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ.
19583 void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res);
19586 * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ which has the same data as `orig`
19587 * but with all dynamically-allocated buffers duplicated in new buffers.
19589 struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR orig);
19592 * Creates a new CResult_SignatureNoneZ in the success state.
19594 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o);
19597 * Creates a new CResult_SignatureNoneZ in the error state.
19599 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void);
19602 * Checks if the given object is currently in the success state
19604 bool CResult_SignatureNoneZ_is_ok(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR o);
19607 * Frees any resources used by the CResult_SignatureNoneZ.
19609 void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res);
19612 * Creates a new CResult_SignatureNoneZ which has the same data as `orig`
19613 * but with all dynamically-allocated buffers duplicated in new buffers.
19615 struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_clone(const struct LDKCResult_SignatureNoneZ *NONNULL_PTR orig);
19618 * Creates a new CResult_PublicKeyNoneZ in the success state.
19620 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
19623 * Creates a new CResult_PublicKeyNoneZ in the error state.
19625 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
19628 * Checks if the given object is currently in the success state
19630 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
19633 * Frees any resources used by the CResult_PublicKeyNoneZ.
19635 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
19638 * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
19639 * but with all dynamically-allocated buffers duplicated in new buffers.
19641 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
19644 * Constructs a new COption_ScalarZ containing a crate::c_types::BigEndianScalar
19646 struct LDKCOption_ScalarZ COption_ScalarZ_some(struct LDKBigEndianScalar o);
19649 * Constructs a new COption_ScalarZ containing nothing
19651 struct LDKCOption_ScalarZ COption_ScalarZ_none(void);
19654 * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
19656 void COption_ScalarZ_free(struct LDKCOption_ScalarZ _res);
19659 * Creates a new COption_ScalarZ which has the same data as `orig`
19660 * but with all dynamically-allocated buffers duplicated in new buffers.
19662 struct LDKCOption_ScalarZ COption_ScalarZ_clone(const struct LDKCOption_ScalarZ *NONNULL_PTR orig);
19665 * Creates a new CResult_SharedSecretNoneZ in the success state.
19667 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
19670 * Creates a new CResult_SharedSecretNoneZ in the error state.
19672 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_err(void);
19675 * Checks if the given object is currently in the success state
19677 bool CResult_SharedSecretNoneZ_is_ok(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR o);
19680 * Frees any resources used by the CResult_SharedSecretNoneZ.
19682 void CResult_SharedSecretNoneZ_free(struct LDKCResult_SharedSecretNoneZ _res);
19685 * Creates a new CResult_SharedSecretNoneZ which has the same data as `orig`
19686 * but with all dynamically-allocated buffers duplicated in new buffers.
19688 struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_clone(const struct LDKCResult_SharedSecretNoneZ *NONNULL_PTR orig);
19691 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19693 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
19696 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
19698 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
19701 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
19703 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
19706 * Checks if the given object is currently in the success state
19708 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
19711 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
19713 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
19716 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
19717 * but with all dynamically-allocated buffers duplicated in new buffers.
19719 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
19722 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
19724 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
19727 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
19729 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
19732 * Checks if the given object is currently in the success state
19734 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
19737 * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
19739 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
19742 * Creates a new CResult_ScriptNoneZ in the success state.
19744 struct LDKCResult_ScriptNoneZ CResult_ScriptNoneZ_ok(struct LDKCVec_u8Z o);
19747 * Creates a new CResult_ScriptNoneZ in the error state.
19749 struct LDKCResult_ScriptNoneZ CResult_ScriptNoneZ_err(void);
19752 * Checks if the given object is currently in the success state
19754 bool CResult_ScriptNoneZ_is_ok(const struct LDKCResult_ScriptNoneZ *NONNULL_PTR o);
19757 * Frees any resources used by the CResult_ScriptNoneZ.
19759 void CResult_ScriptNoneZ_free(struct LDKCResult_ScriptNoneZ _res);
19762 * Creates a new CResult_ScriptNoneZ which has the same data as `orig`
19763 * but with all dynamically-allocated buffers duplicated in new buffers.
19765 struct LDKCResult_ScriptNoneZ CResult_ScriptNoneZ_clone(const struct LDKCResult_ScriptNoneZ *NONNULL_PTR orig);
19768 * Creates a new CResult_ShutdownScriptNoneZ in the success state.
19770 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o);
19773 * Creates a new CResult_ShutdownScriptNoneZ in the error state.
19775 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void);
19778 * Checks if the given object is currently in the success state
19780 bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o);
19783 * Frees any resources used by the CResult_ShutdownScriptNoneZ.
19785 void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res);
19788 * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig`
19789 * but with all dynamically-allocated buffers duplicated in new buffers.
19791 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig);
19794 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19796 void CVec_CVec_u8ZZ_free(struct LDKCVec_CVec_u8ZZ _res);
19799 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the success state.
19801 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_ok(struct LDKCVec_CVec_u8ZZ o);
19804 * Creates a new CResult_CVec_CVec_u8ZZNoneZ in the error state.
19806 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_err(void);
19809 * Checks if the given object is currently in the success state
19811 bool CResult_CVec_CVec_u8ZZNoneZ_is_ok(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR o);
19814 * Frees any resources used by the CResult_CVec_CVec_u8ZZNoneZ.
19816 void CResult_CVec_CVec_u8ZZNoneZ_free(struct LDKCResult_CVec_CVec_u8ZZNoneZ _res);
19819 * Creates a new CResult_CVec_CVec_u8ZZNoneZ which has the same data as `orig`
19820 * but with all dynamically-allocated buffers duplicated in new buffers.
19822 struct LDKCResult_CVec_CVec_u8ZZNoneZ CResult_CVec_CVec_u8ZZNoneZ_clone(const struct LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR orig);
19825 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
19827 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
19830 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
19832 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
19835 * Checks if the given object is currently in the success state
19837 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
19840 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
19842 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
19845 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
19846 * but with all dynamically-allocated buffers duplicated in new buffers.
19848 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
19851 * Creates a new CResult_PartiallySignedTransactionNoneZ in the success state.
19853 struct LDKCResult_PartiallySignedTransactionNoneZ CResult_PartiallySignedTransactionNoneZ_ok(struct LDKCVec_u8Z o);
19856 * Creates a new CResult_PartiallySignedTransactionNoneZ in the error state.
19858 struct LDKCResult_PartiallySignedTransactionNoneZ CResult_PartiallySignedTransactionNoneZ_err(void);
19861 * Checks if the given object is currently in the success state
19863 bool CResult_PartiallySignedTransactionNoneZ_is_ok(const struct LDKCResult_PartiallySignedTransactionNoneZ *NONNULL_PTR o);
19866 * Frees any resources used by the CResult_PartiallySignedTransactionNoneZ.
19868 void CResult_PartiallySignedTransactionNoneZ_free(struct LDKCResult_PartiallySignedTransactionNoneZ _res);
19871 * Creates a new CResult_PartiallySignedTransactionNoneZ which has the same data as `orig`
19872 * but with all dynamically-allocated buffers duplicated in new buffers.
19874 struct LDKCResult_PartiallySignedTransactionNoneZ CResult_PartiallySignedTransactionNoneZ_clone(const struct LDKCResult_PartiallySignedTransactionNoneZ *NONNULL_PTR orig);
19877 * Creates a new CResult_TransactionNoneZ in the success state.
19879 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
19882 * Creates a new CResult_TransactionNoneZ in the error state.
19884 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
19887 * Checks if the given object is currently in the success state
19889 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
19892 * Frees any resources used by the CResult_TransactionNoneZ.
19894 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
19897 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
19898 * but with all dynamically-allocated buffers duplicated in new buffers.
19900 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
19903 * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
19905 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
19908 * Constructs a new COption_WriteableScoreZ containing nothing
19910 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
19913 * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
19915 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
19918 * Creates a new CResult_NoneErrorZ in the success state.
19920 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_ok(void);
19923 * Creates a new CResult_NoneErrorZ in the error state.
19925 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_err(enum LDKIOError e);
19928 * Checks if the given object is currently in the success state
19930 bool CResult_NoneErrorZ_is_ok(const struct LDKCResult_NoneErrorZ *NONNULL_PTR o);
19933 * Frees any resources used by the CResult_NoneErrorZ.
19935 void CResult_NoneErrorZ_free(struct LDKCResult_NoneErrorZ _res);
19938 * Creates a new CResult_NoneErrorZ which has the same data as `orig`
19939 * but with all dynamically-allocated buffers duplicated in new buffers.
19941 struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig);
19944 * Frees the buffer pointed to by `data` if `datalen` is non-0.
19946 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
19949 * Creates a new CResult_RouteLightningErrorZ in the success state.
19951 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
19954 * Creates a new CResult_RouteLightningErrorZ in the error state.
19956 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
19959 * Checks if the given object is currently in the success state
19961 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
19964 * Frees any resources used by the CResult_RouteLightningErrorZ.
19966 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
19969 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
19970 * but with all dynamically-allocated buffers duplicated in new buffers.
19972 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
19975 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
19977 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
19980 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
19982 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
19985 * Checks if the given object is currently in the success state
19987 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
19990 * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
19992 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
19995 * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
19996 * but with all dynamically-allocated buffers duplicated in new buffers.
19998 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
20001 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
20003 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
20006 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
20008 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
20011 * Checks if the given object is currently in the success state
20013 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
20016 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
20018 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
20021 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
20022 * but with all dynamically-allocated buffers duplicated in new buffers.
20024 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
20027 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20029 void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
20032 * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
20034 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
20037 * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
20039 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
20042 * Checks if the given object is currently in the success state
20044 bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
20047 * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
20049 void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
20052 * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
20053 * but with all dynamically-allocated buffers duplicated in new buffers.
20055 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
20058 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20060 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
20063 * Constructs a new COption_u32Z containing a u32
20065 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
20068 * Constructs a new COption_u32Z containing nothing
20070 struct LDKCOption_u32Z COption_u32Z_none(void);
20073 * Frees any resources associated with the u32, if we are in the Some state
20075 void COption_u32Z_free(struct LDKCOption_u32Z _res);
20078 * Creates a new COption_u32Z which has the same data as `orig`
20079 * but with all dynamically-allocated buffers duplicated in new buffers.
20081 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
20084 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20086 void CVec_PathZ_free(struct LDKCVec_PathZ _res);
20089 * Creates a new CResult_RouteDecodeErrorZ in the success state.
20091 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
20094 * Creates a new CResult_RouteDecodeErrorZ in the error state.
20096 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
20099 * Checks if the given object is currently in the success state
20101 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
20104 * Frees any resources used by the CResult_RouteDecodeErrorZ.
20106 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
20109 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
20110 * but with all dynamically-allocated buffers duplicated in new buffers.
20112 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
20115 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
20117 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
20120 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
20122 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
20125 * Checks if the given object is currently in the success state
20127 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
20130 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
20132 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
20135 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
20136 * but with all dynamically-allocated buffers duplicated in new buffers.
20138 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
20141 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20143 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
20146 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
20148 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
20151 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
20153 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
20156 * Checks if the given object is currently in the success state
20158 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
20161 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
20163 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
20166 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
20167 * but with all dynamically-allocated buffers duplicated in new buffers.
20169 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
20172 * Creates a new tuple which has the same data as `orig`
20173 * but with all dynamically-allocated buffers duplicated in new buffers.
20175 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
20178 * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
20180 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
20183 * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
20185 void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
20188 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20190 void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
20193 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20195 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
20198 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20200 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
20203 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
20205 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
20208 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
20210 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
20213 * Checks if the given object is currently in the success state
20215 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
20218 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
20220 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
20223 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
20224 * but with all dynamically-allocated buffers duplicated in new buffers.
20226 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
20229 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
20231 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
20234 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
20236 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
20239 * Checks if the given object is currently in the success state
20241 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
20244 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
20246 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
20249 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
20250 * but with all dynamically-allocated buffers duplicated in new buffers.
20252 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
20255 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20257 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
20260 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
20262 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
20265 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
20267 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
20270 * Checks if the given object is currently in the success state
20272 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
20275 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
20277 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
20280 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
20281 * but with all dynamically-allocated buffers duplicated in new buffers.
20283 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
20286 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20288 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
20291 * Creates a new tuple which has the same data as `orig`
20292 * but with all dynamically-allocated buffers duplicated in new buffers.
20294 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
20297 * Creates a new C2Tuple_u64u64Z from the contained elements.
20299 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
20302 * Frees any resources used by the C2Tuple_u64u64Z.
20304 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
20307 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
20309 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
20312 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
20314 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
20317 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
20319 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
20322 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
20323 * but with all dynamically-allocated buffers duplicated in new buffers.
20325 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
20328 * Creates a new tuple which has the same data as `orig`
20329 * but with all dynamically-allocated buffers duplicated in new buffers.
20331 struct LDKC2Tuple_Z C2Tuple_Z_clone(const struct LDKC2Tuple_Z *NONNULL_PTR orig);
20334 * Creates a new C2Tuple_Z from the contained elements.
20336 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKEightU16s a, struct LDKEightU16s b);
20339 * Frees any resources used by the C2Tuple_Z.
20341 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
20344 * Creates a new tuple which has the same data as `orig`
20345 * but with all dynamically-allocated buffers duplicated in new buffers.
20347 struct LDKC2Tuple__u168_u168Z C2Tuple__u168_u168Z_clone(const struct LDKC2Tuple__u168_u168Z *NONNULL_PTR orig);
20350 * Creates a new C2Tuple__u168_u168Z from the contained elements.
20352 struct LDKC2Tuple__u168_u168Z C2Tuple__u168_u168Z_new(struct LDKEightU16s a, struct LDKEightU16s b);
20355 * Frees any resources used by the C2Tuple__u168_u168Z.
20357 void C2Tuple__u168_u168Z_free(struct LDKC2Tuple__u168_u168Z _res);
20360 * Constructs a new COption_C2Tuple_EightU16sEightU16sZZ containing a crate::c_types::derived::C2Tuple__u168_u168Z
20362 struct LDKCOption_C2Tuple_EightU16sEightU16sZZ COption_C2Tuple_EightU16sEightU16sZZ_some(struct LDKC2Tuple__u168_u168Z o);
20365 * Constructs a new COption_C2Tuple_EightU16sEightU16sZZ containing nothing
20367 struct LDKCOption_C2Tuple_EightU16sEightU16sZZ COption_C2Tuple_EightU16sEightU16sZZ_none(void);
20370 * Frees any resources associated with the crate::c_types::derived::C2Tuple__u168_u168Z, if we are in the Some state
20372 void COption_C2Tuple_EightU16sEightU16sZZ_free(struct LDKCOption_C2Tuple_EightU16sEightU16sZZ _res);
20375 * Creates a new COption_C2Tuple_EightU16sEightU16sZZ which has the same data as `orig`
20376 * but with all dynamically-allocated buffers duplicated in new buffers.
20378 struct LDKCOption_C2Tuple_EightU16sEightU16sZZ COption_C2Tuple_EightU16sEightU16sZZ_clone(const struct LDKCOption_C2Tuple_EightU16sEightU16sZZ *NONNULL_PTR orig);
20381 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
20383 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
20386 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
20388 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
20391 * Checks if the given object is currently in the success state
20393 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
20396 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
20398 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
20401 * Creates a new tuple which has the same data as `orig`
20402 * but with all dynamically-allocated buffers duplicated in new buffers.
20404 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
20407 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
20409 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
20412 * Frees any resources used by the C2Tuple_usizeTransactionZ.
20414 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
20417 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20419 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
20422 * Constructs a new COption_BlockHashZ containing a crate::c_types::ThirtyTwoBytes
20424 struct LDKCOption_BlockHashZ COption_BlockHashZ_some(struct LDKThirtyTwoBytes o);
20427 * Constructs a new COption_BlockHashZ containing nothing
20429 struct LDKCOption_BlockHashZ COption_BlockHashZ_none(void);
20432 * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
20434 void COption_BlockHashZ_free(struct LDKCOption_BlockHashZ _res);
20437 * Creates a new COption_BlockHashZ which has the same data as `orig`
20438 * but with all dynamically-allocated buffers duplicated in new buffers.
20440 struct LDKCOption_BlockHashZ COption_BlockHashZ_clone(const struct LDKCOption_BlockHashZ *NONNULL_PTR orig);
20443 * Creates a new tuple which has the same data as `orig`
20444 * but with all dynamically-allocated buffers duplicated in new buffers.
20446 struct LDKC2Tuple_TxidCOption_BlockHashZZ C2Tuple_TxidCOption_BlockHashZZ_clone(const struct LDKC2Tuple_TxidCOption_BlockHashZZ *NONNULL_PTR orig);
20449 * Creates a new C2Tuple_TxidCOption_BlockHashZZ from the contained elements.
20451 struct LDKC2Tuple_TxidCOption_BlockHashZZ C2Tuple_TxidCOption_BlockHashZZ_new(struct LDKThirtyTwoBytes a, struct LDKCOption_BlockHashZ b);
20454 * Frees any resources used by the C2Tuple_TxidCOption_BlockHashZZ.
20456 void C2Tuple_TxidCOption_BlockHashZZ_free(struct LDKC2Tuple_TxidCOption_BlockHashZZ _res);
20459 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20461 void CVec_C2Tuple_TxidCOption_BlockHashZZZ_free(struct LDKCVec_C2Tuple_TxidCOption_BlockHashZZZ _res);
20464 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20466 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
20469 * Creates a new tuple which has the same data as `orig`
20470 * but with all dynamically-allocated buffers duplicated in new buffers.
20472 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
20475 * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
20477 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
20480 * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
20482 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
20485 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20487 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
20490 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
20492 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
20495 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
20497 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
20500 * Checks if the given object is currently in the success state
20502 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
20505 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
20507 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
20510 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
20511 * but with all dynamically-allocated buffers duplicated in new buffers.
20513 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
20516 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
20518 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
20521 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
20523 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
20526 * Checks if the given object is currently in the success state
20528 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
20531 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
20533 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
20536 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
20537 * but with all dynamically-allocated buffers duplicated in new buffers.
20539 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
20542 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
20544 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
20547 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
20549 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
20552 * Checks if the given object is currently in the success state
20554 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
20557 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
20559 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
20562 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
20563 * but with all dynamically-allocated buffers duplicated in new buffers.
20565 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
20568 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state.
20570 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o);
20573 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state.
20575 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
20578 * Checks if the given object is currently in the success state
20580 bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
20583 * Frees any resources used by the CResult_Bolt11InvoiceFeaturesDecodeErrorZ.
20585 void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res);
20588 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
20589 * but with all dynamically-allocated buffers duplicated in new buffers.
20591 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
20594 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state.
20596 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o);
20599 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state.
20601 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
20604 * Checks if the given object is currently in the success state
20606 bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
20609 * Frees any resources used by the CResult_Bolt12InvoiceFeaturesDecodeErrorZ.
20611 void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res);
20614 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
20615 * but with all dynamically-allocated buffers duplicated in new buffers.
20617 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
20620 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
20622 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
20625 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
20627 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
20630 * Checks if the given object is currently in the success state
20632 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
20635 * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
20637 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
20640 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
20641 * but with all dynamically-allocated buffers duplicated in new buffers.
20643 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
20646 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
20648 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
20651 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
20653 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
20656 * Checks if the given object is currently in the success state
20658 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
20661 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
20663 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
20666 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
20667 * but with all dynamically-allocated buffers duplicated in new buffers.
20669 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
20672 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20674 void CVec_ChainHashZ_free(struct LDKCVec_ChainHashZ _res);
20677 * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
20679 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o);
20682 * Creates a new CResult_OfferBolt12ParseErrorZ in the error state.
20684 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
20687 * Checks if the given object is currently in the success state
20689 bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o);
20692 * Frees any resources used by the CResult_OfferBolt12ParseErrorZ.
20694 void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res);
20697 * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig`
20698 * but with all dynamically-allocated buffers duplicated in new buffers.
20700 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig);
20703 * Creates a new CResult_PublicKeyErrorZ in the success state.
20705 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o);
20708 * Creates a new CResult_PublicKeyErrorZ in the error state.
20710 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e);
20713 * Checks if the given object is currently in the success state
20715 bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o);
20718 * Frees any resources used by the CResult_PublicKeyErrorZ.
20720 void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res);
20723 * Creates a new CResult_PublicKeyErrorZ which has the same data as `orig`
20724 * but with all dynamically-allocated buffers duplicated in new buffers.
20726 struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig);
20729 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
20731 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
20734 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
20736 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
20739 * Checks if the given object is currently in the success state
20741 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
20744 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
20746 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
20749 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
20750 * but with all dynamically-allocated buffers duplicated in new buffers.
20752 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
20755 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
20757 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
20760 * Constructs a new COption_NetworkUpdateZ containing nothing
20762 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
20765 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
20767 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
20770 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
20771 * but with all dynamically-allocated buffers duplicated in new buffers.
20773 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
20776 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
20778 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
20781 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
20783 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
20786 * Checks if the given object is currently in the success state
20788 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
20791 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
20793 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
20796 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
20797 * but with all dynamically-allocated buffers duplicated in new buffers.
20799 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
20802 * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
20804 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
20807 * Constructs a new COption_UtxoLookupZ containing nothing
20809 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
20812 * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
20814 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
20817 * Creates a new CResult_NoneLightningErrorZ in the success state.
20819 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
20822 * Creates a new CResult_NoneLightningErrorZ in the error state.
20824 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
20827 * Checks if the given object is currently in the success state
20829 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
20832 * Frees any resources used by the CResult_NoneLightningErrorZ.
20834 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
20837 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
20838 * but with all dynamically-allocated buffers duplicated in new buffers.
20840 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
20843 * Creates a new CResult_boolLightningErrorZ in the success state.
20845 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
20848 * Creates a new CResult_boolLightningErrorZ in the error state.
20850 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
20853 * Checks if the given object is currently in the success state
20855 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
20858 * Frees any resources used by the CResult_boolLightningErrorZ.
20860 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
20863 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
20864 * but with all dynamically-allocated buffers duplicated in new buffers.
20866 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
20869 * Creates a new tuple which has the same data as `orig`
20870 * but with all dynamically-allocated buffers duplicated in new buffers.
20872 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
20875 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
20877 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
20880 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
20882 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
20885 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
20887 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
20890 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
20892 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
20895 * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
20897 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
20900 * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
20901 * but with all dynamically-allocated buffers duplicated in new buffers.
20903 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
20906 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20908 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
20911 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
20913 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
20916 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
20918 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
20921 * Checks if the given object is currently in the success state
20923 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
20926 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
20928 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
20931 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
20932 * but with all dynamically-allocated buffers duplicated in new buffers.
20934 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
20937 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
20939 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
20942 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
20944 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
20947 * Checks if the given object is currently in the success state
20949 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
20952 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
20954 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
20957 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
20958 * but with all dynamically-allocated buffers duplicated in new buffers.
20960 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
20963 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
20965 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
20968 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
20970 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
20973 * Checks if the given object is currently in the success state
20975 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
20978 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
20980 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
20983 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
20984 * but with all dynamically-allocated buffers duplicated in new buffers.
20986 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
20989 * Frees the buffer pointed to by `data` if `datalen` is non-0.
20991 void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
20994 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
20996 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
20999 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
21001 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
21004 * Checks if the given object is currently in the success state
21006 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
21009 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
21011 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
21014 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
21015 * but with all dynamically-allocated buffers duplicated in new buffers.
21017 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
21020 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
21022 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
21025 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
21027 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
21030 * Checks if the given object is currently in the success state
21032 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
21035 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
21037 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
21040 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
21041 * but with all dynamically-allocated buffers duplicated in new buffers.
21043 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
21046 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
21048 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
21051 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
21053 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
21056 * Checks if the given object is currently in the success state
21058 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
21061 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
21063 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
21066 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
21067 * but with all dynamically-allocated buffers duplicated in new buffers.
21069 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
21072 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
21074 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
21077 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
21079 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
21082 * Checks if the given object is currently in the success state
21084 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
21087 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
21089 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
21092 * Constructs a new COption_CVec_NetAddressZZ containing a crate::c_types::derived::CVec_NetAddressZ
21094 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_some(struct LDKCVec_NetAddressZ o);
21097 * Constructs a new COption_CVec_NetAddressZZ containing nothing
21099 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_none(void);
21102 * Frees any resources associated with the crate::c_types::derived::CVec_NetAddressZ, if we are in the Some state
21104 void COption_CVec_NetAddressZZ_free(struct LDKCOption_CVec_NetAddressZZ _res);
21107 * Creates a new COption_CVec_NetAddressZZ which has the same data as `orig`
21108 * but with all dynamically-allocated buffers duplicated in new buffers.
21110 struct LDKCOption_CVec_NetAddressZZ COption_CVec_NetAddressZZ_clone(const struct LDKCOption_CVec_NetAddressZZ *NONNULL_PTR orig);
21113 * Constructs a new COption_PaymentPreimageZ containing a crate::c_types::ThirtyTwoBytes
21115 struct LDKCOption_PaymentPreimageZ COption_PaymentPreimageZ_some(struct LDKThirtyTwoBytes o);
21118 * Constructs a new COption_PaymentPreimageZ containing nothing
21120 struct LDKCOption_PaymentPreimageZ COption_PaymentPreimageZ_none(void);
21123 * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
21125 void COption_PaymentPreimageZ_free(struct LDKCOption_PaymentPreimageZ _res);
21128 * Creates a new COption_PaymentPreimageZ which has the same data as `orig`
21129 * but with all dynamically-allocated buffers duplicated in new buffers.
21131 struct LDKCOption_PaymentPreimageZ COption_PaymentPreimageZ_clone(const struct LDKCOption_PaymentPreimageZ *NONNULL_PTR orig);
21134 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21136 void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res);
21139 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21141 void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res);
21144 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21146 void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res);
21149 * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut
21151 struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o);
21154 * Constructs a new COption_TxOutZ containing nothing
21156 struct LDKCOption_TxOutZ COption_TxOutZ_none(void);
21159 * Frees any resources associated with the crate::c_types::TxOut, if we are in the Some state
21161 void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res);
21164 * Creates a new COption_TxOutZ which has the same data as `orig`
21165 * but with all dynamically-allocated buffers duplicated in new buffers.
21167 struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig);
21170 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21172 void CVec_InputZ_free(struct LDKCVec_InputZ _res);
21175 * Creates a new CResult_CoinSelectionNoneZ in the success state.
21177 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o);
21180 * Creates a new CResult_CoinSelectionNoneZ in the error state.
21182 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void);
21185 * Checks if the given object is currently in the success state
21187 bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o);
21190 * Frees any resources used by the CResult_CoinSelectionNoneZ.
21192 void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res);
21195 * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig`
21196 * but with all dynamically-allocated buffers duplicated in new buffers.
21198 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig);
21201 * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
21203 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o);
21206 * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
21208 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void);
21211 * Checks if the given object is currently in the success state
21213 bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o);
21216 * Frees any resources used by the CResult_CVec_UtxoZNoneZ.
21218 void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res);
21221 * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
21222 * but with all dynamically-allocated buffers duplicated in new buffers.
21224 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig);
21227 * Constructs a new COption_u16Z containing a u16
21229 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
21232 * Constructs a new COption_u16Z containing nothing
21234 struct LDKCOption_u16Z COption_u16Z_none(void);
21237 * Frees any resources associated with the u16, if we are in the Some state
21239 void COption_u16Z_free(struct LDKCOption_u16Z _res);
21242 * Creates a new COption_u16Z which has the same data as `orig`
21243 * but with all dynamically-allocated buffers duplicated in new buffers.
21245 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
21248 * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channelmanager::ChannelShutdownState
21250 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
21253 * Constructs a new COption_ChannelShutdownStateZ containing nothing
21255 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
21258 * Frees any resources associated with the crate::lightning::ln::channelmanager::ChannelShutdownState, if we are in the Some state
21260 void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
21263 * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
21264 * but with all dynamically-allocated buffers duplicated in new buffers.
21266 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
21269 * Constructs a new COption_PaymentHashZ containing a crate::c_types::ThirtyTwoBytes
21271 struct LDKCOption_PaymentHashZ COption_PaymentHashZ_some(struct LDKThirtyTwoBytes o);
21274 * Constructs a new COption_PaymentHashZ containing nothing
21276 struct LDKCOption_PaymentHashZ COption_PaymentHashZ_none(void);
21279 * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
21281 void COption_PaymentHashZ_free(struct LDKCOption_PaymentHashZ _res);
21284 * Creates a new COption_PaymentHashZ which has the same data as `orig`
21285 * but with all dynamically-allocated buffers duplicated in new buffers.
21287 struct LDKCOption_PaymentHashZ COption_PaymentHashZ_clone(const struct LDKCOption_PaymentHashZ *NONNULL_PTR orig);
21290 * Creates a new CResult__u832APIErrorZ in the success state.
21292 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_ok(struct LDKThirtyTwoBytes o);
21295 * Creates a new CResult__u832APIErrorZ in the error state.
21297 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_err(struct LDKAPIError e);
21300 * Checks if the given object is currently in the success state
21302 bool CResult__u832APIErrorZ_is_ok(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR o);
21305 * Frees any resources used by the CResult__u832APIErrorZ.
21307 void CResult__u832APIErrorZ_free(struct LDKCResult__u832APIErrorZ _res);
21310 * Creates a new CResult__u832APIErrorZ which has the same data as `orig`
21311 * but with all dynamically-allocated buffers duplicated in new buffers.
21313 struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig);
21316 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21318 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
21321 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
21323 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
21326 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
21328 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
21331 * Checks if the given object is currently in the success state
21333 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
21336 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
21338 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
21341 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
21342 * but with all dynamically-allocated buffers duplicated in new buffers.
21344 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
21347 * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
21349 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
21352 * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
21354 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
21357 * Checks if the given object is currently in the success state
21359 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
21362 * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
21364 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
21367 * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
21368 * but with all dynamically-allocated buffers duplicated in new buffers.
21370 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
21373 * Creates a new CResult_PaymentHashPaymentSendFailureZ in the success state.
21375 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
21378 * Creates a new CResult_PaymentHashPaymentSendFailureZ in the error state.
21380 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
21383 * Checks if the given object is currently in the success state
21385 bool CResult_PaymentHashPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR o);
21388 * Frees any resources used by the CResult_PaymentHashPaymentSendFailureZ.
21390 void CResult_PaymentHashPaymentSendFailureZ_free(struct LDKCResult_PaymentHashPaymentSendFailureZ _res);
21393 * Creates a new CResult_PaymentHashPaymentSendFailureZ which has the same data as `orig`
21394 * but with all dynamically-allocated buffers duplicated in new buffers.
21396 struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_clone(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR orig);
21399 * Creates a new CResult_PaymentHashRetryableSendFailureZ in the success state.
21401 struct LDKCResult_PaymentHashRetryableSendFailureZ CResult_PaymentHashRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
21404 * Creates a new CResult_PaymentHashRetryableSendFailureZ in the error state.
21406 struct LDKCResult_PaymentHashRetryableSendFailureZ CResult_PaymentHashRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
21409 * Checks if the given object is currently in the success state
21411 bool CResult_PaymentHashRetryableSendFailureZ_is_ok(const struct LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR o);
21414 * Frees any resources used by the CResult_PaymentHashRetryableSendFailureZ.
21416 void CResult_PaymentHashRetryableSendFailureZ_free(struct LDKCResult_PaymentHashRetryableSendFailureZ _res);
21419 * Creates a new CResult_PaymentHashRetryableSendFailureZ which has the same data as `orig`
21420 * but with all dynamically-allocated buffers duplicated in new buffers.
21422 struct LDKCResult_PaymentHashRetryableSendFailureZ CResult_PaymentHashRetryableSendFailureZ_clone(const struct LDKCResult_PaymentHashRetryableSendFailureZ *NONNULL_PTR orig);
21425 * Creates a new tuple which has the same data as `orig`
21426 * but with all dynamically-allocated buffers duplicated in new buffers.
21428 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig);
21431 * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements.
21433 struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
21436 * Frees any resources used by the C2Tuple_PaymentHashPaymentIdZ.
21438 void C2Tuple_PaymentHashPaymentIdZ_free(struct LDKC2Tuple_PaymentHashPaymentIdZ _res);
21441 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state.
21443 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(struct LDKC2Tuple_PaymentHashPaymentIdZ o);
21446 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state.
21448 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
21451 * Checks if the given object is currently in the success state
21453 bool CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR o);
21456 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.
21458 void CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res);
21461 * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ which has the same data as `orig`
21462 * but with all dynamically-allocated buffers duplicated in new buffers.
21464 struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR orig);
21467 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21469 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
21472 * Creates a new tuple which has the same data as `orig`
21473 * but with all dynamically-allocated buffers duplicated in new buffers.
21475 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
21478 * Creates a new C2Tuple_PaymentHashPaymentSecretZ from the contained elements.
21480 struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
21483 * Frees any resources used by the C2Tuple_PaymentHashPaymentSecretZ.
21485 void C2Tuple_PaymentHashPaymentSecretZ_free(struct LDKC2Tuple_PaymentHashPaymentSecretZ _res);
21488 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state.
21490 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(struct LDKC2Tuple_PaymentHashPaymentSecretZ o);
21493 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the error state.
21495 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err(void);
21498 * Checks if the given object is currently in the success state
21500 bool CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR o);
21503 * Frees any resources used by the CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ.
21505 void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res);
21508 * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ which has the same data as `orig`
21509 * but with all dynamically-allocated buffers duplicated in new buffers.
21511 struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(const struct LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR orig);
21514 * Creates a new CResult_PaymentSecretNoneZ in the success state.
21516 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
21519 * Creates a new CResult_PaymentSecretNoneZ in the error state.
21521 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_err(void);
21524 * Checks if the given object is currently in the success state
21526 bool CResult_PaymentSecretNoneZ_is_ok(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR o);
21529 * Frees any resources used by the CResult_PaymentSecretNoneZ.
21531 void CResult_PaymentSecretNoneZ_free(struct LDKCResult_PaymentSecretNoneZ _res);
21534 * Creates a new CResult_PaymentSecretNoneZ which has the same data as `orig`
21535 * but with all dynamically-allocated buffers duplicated in new buffers.
21537 struct LDKCResult_PaymentSecretNoneZ CResult_PaymentSecretNoneZ_clone(const struct LDKCResult_PaymentSecretNoneZ *NONNULL_PTR orig);
21540 * Creates a new CResult_PaymentPreimageAPIErrorZ in the success state.
21542 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
21545 * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state.
21547 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_err(struct LDKAPIError e);
21550 * Checks if the given object is currently in the success state
21552 bool CResult_PaymentPreimageAPIErrorZ_is_ok(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR o);
21555 * Frees any resources used by the CResult_PaymentPreimageAPIErrorZ.
21557 void CResult_PaymentPreimageAPIErrorZ_free(struct LDKCResult_PaymentPreimageAPIErrorZ _res);
21560 * Creates a new CResult_PaymentPreimageAPIErrorZ which has the same data as `orig`
21561 * but with all dynamically-allocated buffers duplicated in new buffers.
21563 struct LDKCResult_PaymentPreimageAPIErrorZ CResult_PaymentPreimageAPIErrorZ_clone(const struct LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR orig);
21566 * Constructs a new COption_CVec_ChainHashZZ containing a crate::c_types::derived::CVec_ChainHashZ
21568 struct LDKCOption_CVec_ChainHashZZ COption_CVec_ChainHashZZ_some(struct LDKCVec_ChainHashZ o);
21571 * Constructs a new COption_CVec_ChainHashZZ containing nothing
21573 struct LDKCOption_CVec_ChainHashZZ COption_CVec_ChainHashZZ_none(void);
21576 * Frees any resources associated with the crate::c_types::derived::CVec_ChainHashZ, if we are in the Some state
21578 void COption_CVec_ChainHashZZ_free(struct LDKCOption_CVec_ChainHashZZ _res);
21581 * Creates a new COption_CVec_ChainHashZZ which has the same data as `orig`
21582 * but with all dynamically-allocated buffers duplicated in new buffers.
21584 struct LDKCOption_CVec_ChainHashZZ COption_CVec_ChainHashZZ_clone(const struct LDKCOption_CVec_ChainHashZZ *NONNULL_PTR orig);
21587 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
21589 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
21592 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
21594 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
21597 * Checks if the given object is currently in the success state
21599 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
21602 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
21604 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
21607 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
21608 * but with all dynamically-allocated buffers duplicated in new buffers.
21610 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
21613 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
21615 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
21618 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
21620 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
21623 * Checks if the given object is currently in the success state
21625 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
21628 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
21630 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
21633 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
21634 * but with all dynamically-allocated buffers duplicated in new buffers.
21636 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
21639 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
21641 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
21644 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
21646 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
21649 * Checks if the given object is currently in the success state
21651 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
21654 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
21656 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
21659 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
21660 * but with all dynamically-allocated buffers duplicated in new buffers.
21662 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
21665 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
21667 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
21670 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
21672 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
21675 * Checks if the given object is currently in the success state
21677 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
21680 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
21682 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
21685 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
21686 * but with all dynamically-allocated buffers duplicated in new buffers.
21688 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
21691 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
21693 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
21696 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
21698 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
21701 * Checks if the given object is currently in the success state
21703 bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
21706 * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
21708 void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
21711 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
21712 * but with all dynamically-allocated buffers duplicated in new buffers.
21714 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
21717 * Frees the buffer pointed to by `data` if `datalen` is non-0.
21719 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
21722 * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
21724 struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
21727 * Frees any resources used by the C2Tuple_BlockHashChannelManagerZ.
21729 void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res);
21732 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state.
21734 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o);
21737 * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
21739 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
21742 * Checks if the given object is currently in the success state
21744 bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o);
21747 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.
21749 void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res);
21752 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state.
21754 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o);
21757 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state.
21759 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e);
21762 * Checks if the given object is currently in the success state
21764 bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o);
21767 * Frees any resources used by the CResult_MaxDustHTLCExposureDecodeErrorZ.
21769 void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res);
21772 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig`
21773 * but with all dynamically-allocated buffers duplicated in new buffers.
21775 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig);
21778 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
21780 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
21783 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
21785 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
21788 * Checks if the given object is currently in the success state
21790 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
21793 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
21795 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
21798 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
21799 * but with all dynamically-allocated buffers duplicated in new buffers.
21801 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
21804 * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure
21806 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o);
21809 * Constructs a new COption_MaxDustHTLCExposureZ containing nothing
21811 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void);
21814 * Frees any resources associated with the crate::lightning::util::config::MaxDustHTLCExposure, if we are in the Some state
21816 void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res);
21819 * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig`
21820 * but with all dynamically-allocated buffers duplicated in new buffers.
21822 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig);
21825 * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
21827 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
21830 * Constructs a new COption_APIErrorZ containing nothing
21832 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
21835 * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
21837 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
21840 * Creates a new COption_APIErrorZ which has the same data as `orig`
21841 * but with all dynamically-allocated buffers duplicated in new buffers.
21843 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
21846 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
21848 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
21851 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
21853 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
21856 * Checks if the given object is currently in the success state
21858 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
21861 * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
21863 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
21866 * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
21867 * but with all dynamically-allocated buffers duplicated in new buffers.
21869 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
21872 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
21874 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
21877 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
21879 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
21882 * Checks if the given object is currently in the success state
21884 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
21887 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
21889 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
21892 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
21893 * but with all dynamically-allocated buffers duplicated in new buffers.
21895 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
21898 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
21900 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
21903 * Constructs a new COption_MonitorEventZ containing nothing
21905 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
21908 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
21910 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
21913 * Creates a new COption_MonitorEventZ which has the same data as `orig`
21914 * but with all dynamically-allocated buffers duplicated in new buffers.
21916 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
21919 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
21921 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
21924 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
21926 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
21929 * Checks if the given object is currently in the success state
21931 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
21934 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
21936 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
21939 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
21940 * but with all dynamically-allocated buffers duplicated in new buffers.
21942 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
21945 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
21947 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
21950 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
21952 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
21955 * Checks if the given object is currently in the success state
21957 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
21960 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
21962 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
21965 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
21966 * but with all dynamically-allocated buffers duplicated in new buffers.
21968 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
21971 * Creates a new tuple which has the same data as `orig`
21972 * but with all dynamically-allocated buffers duplicated in new buffers.
21974 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_clone(const struct LDKC2Tuple_OutPointScriptZ *NONNULL_PTR orig);
21977 * Creates a new C2Tuple_OutPointScriptZ from the contained elements.
21979 struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
21982 * Frees any resources used by the C2Tuple_OutPointScriptZ.
21984 void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res);
21987 * Creates a new tuple which has the same data as `orig`
21988 * but with all dynamically-allocated buffers duplicated in new buffers.
21990 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_clone(const struct LDKC2Tuple_u32ScriptZ *NONNULL_PTR orig);
21993 * Creates a new C2Tuple_u32ScriptZ from the contained elements.
21995 struct LDKC2Tuple_u32ScriptZ C2Tuple_u32ScriptZ_new(uint32_t a, struct LDKCVec_u8Z b);
21998 * Frees any resources used by the C2Tuple_u32ScriptZ.
22000 void C2Tuple_u32ScriptZ_free(struct LDKC2Tuple_u32ScriptZ _res);
22003 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22005 void CVec_C2Tuple_u32ScriptZZ_free(struct LDKCVec_C2Tuple_u32ScriptZZ _res);
22008 * Creates a new tuple which has the same data as `orig`
22009 * but with all dynamically-allocated buffers duplicated in new buffers.
22011 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR orig);
22014 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ from the contained elements.
22016 struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32ScriptZZ b);
22019 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ.
22021 void C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res);
22024 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22026 void CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res);
22029 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22031 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
22034 * Creates a new tuple which has the same data as `orig`
22035 * but with all dynamically-allocated buffers duplicated in new buffers.
22037 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
22040 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
22042 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
22045 * Frees any resources used by the C2Tuple_u32TxOutZ.
22047 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
22050 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22052 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
22055 * Creates a new tuple which has the same data as `orig`
22056 * but with all dynamically-allocated buffers duplicated in new buffers.
22058 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
22061 * Creates a new C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ from the contained elements.
22063 struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
22066 * Frees any resources used by the C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ.
22068 void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res);
22071 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22073 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
22076 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22078 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
22081 * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements.
22083 struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
22086 * Frees any resources used by the C2Tuple_BlockHashChannelMonitorZ.
22088 void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res);
22091 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state.
22093 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o);
22096 * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
22098 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
22101 * Checks if the given object is currently in the success state
22103 bool CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
22106 * Frees any resources used by the CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.
22108 void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res);
22111 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
22113 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
22116 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
22118 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
22121 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22123 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
22126 * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage
22128 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o);
22131 * Constructs a new COption_OffersMessageZ containing nothing
22133 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void);
22136 * Frees any resources associated with the crate::lightning::onion_message::offers::OffersMessage, if we are in the Some state
22138 void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res);
22141 * Creates a new COption_OffersMessageZ which has the same data as `orig`
22142 * but with all dynamically-allocated buffers duplicated in new buffers.
22144 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig);
22147 * Constructs a new COption_CustomOnionMessageContentsZ containing a crate::lightning::onion_message::packet::CustomOnionMessageContents
22149 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_some(struct LDKCustomOnionMessageContents o);
22152 * Constructs a new COption_CustomOnionMessageContentsZ containing nothing
22154 struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_none(void);
22157 * Frees any resources associated with the crate::lightning::onion_message::packet::CustomOnionMessageContents, if we are in the Some state
22159 void COption_CustomOnionMessageContentsZ_free(struct LDKCOption_CustomOnionMessageContentsZ _res);
22162 * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the success state.
22164 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_CustomOnionMessageContentsZ o);
22167 * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the error state.
22169 struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
22172 * Checks if the given object is currently in the success state
22174 bool CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
22177 * Frees any resources used by the CResult_COption_CustomOnionMessageContentsZDecodeErrorZ.
22179 void CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res);
22182 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
22184 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
22187 * Constructs a new COption_TypeZ containing nothing
22189 struct LDKCOption_TypeZ COption_TypeZ_none(void);
22192 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
22194 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
22197 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
22199 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
22202 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
22204 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
22207 * Checks if the given object is currently in the success state
22209 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
22212 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
22214 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
22217 * Constructs a new COption_NetAddressZ containing a crate::lightning::ln::msgs::NetAddress
22219 struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o);
22222 * Constructs a new COption_NetAddressZ containing nothing
22224 struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void);
22227 * Frees any resources associated with the crate::lightning::ln::msgs::NetAddress, if we are in the Some state
22229 void COption_NetAddressZ_free(struct LDKCOption_NetAddressZ _res);
22232 * Creates a new COption_NetAddressZ which has the same data as `orig`
22233 * but with all dynamically-allocated buffers duplicated in new buffers.
22235 struct LDKCOption_NetAddressZ COption_NetAddressZ_clone(const struct LDKCOption_NetAddressZ *NONNULL_PTR orig);
22238 * Creates a new tuple which has the same data as `orig`
22239 * but with all dynamically-allocated buffers duplicated in new buffers.
22241 struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ C2Tuple_PublicKeyCOption_NetAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ *NONNULL_PTR orig);
22244 * Creates a new C2Tuple_PublicKeyCOption_NetAddressZZ from the contained elements.
22246 struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ C2Tuple_PublicKeyCOption_NetAddressZZ_new(struct LDKPublicKey a, struct LDKCOption_NetAddressZ b);
22249 * Frees any resources used by the C2Tuple_PublicKeyCOption_NetAddressZZ.
22251 void C2Tuple_PublicKeyCOption_NetAddressZZ_free(struct LDKC2Tuple_PublicKeyCOption_NetAddressZZ _res);
22254 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22256 void CVec_C2Tuple_PublicKeyCOption_NetAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ _res);
22259 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
22261 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
22264 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
22266 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
22269 * Checks if the given object is currently in the success state
22271 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
22274 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
22276 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
22279 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
22280 * but with all dynamically-allocated buffers duplicated in new buffers.
22282 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
22285 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
22287 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
22290 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
22292 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
22295 * Checks if the given object is currently in the success state
22297 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
22300 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
22302 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
22305 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
22306 * but with all dynamically-allocated buffers duplicated in new buffers.
22308 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
22311 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
22313 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
22316 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
22318 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
22321 * Checks if the given object is currently in the success state
22323 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
22326 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
22328 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
22331 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
22332 * but with all dynamically-allocated buffers duplicated in new buffers.
22334 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
22337 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
22339 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
22342 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
22344 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
22347 * Checks if the given object is currently in the success state
22349 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
22352 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
22354 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
22357 * Constructs a new COption_KeyPairZ containing a crate::c_types::SecretKey
22359 struct LDKCOption_KeyPairZ COption_KeyPairZ_some(struct LDKSecretKey o);
22362 * Constructs a new COption_KeyPairZ containing nothing
22364 struct LDKCOption_KeyPairZ COption_KeyPairZ_none(void);
22367 * Frees any resources associated with the crate::c_types::SecretKey, if we are in the Some state
22369 void COption_KeyPairZ_free(struct LDKCOption_KeyPairZ _res);
22372 * Creates a new COption_KeyPairZ which has the same data as `orig`
22373 * but with all dynamically-allocated buffers duplicated in new buffers.
22375 struct LDKCOption_KeyPairZ COption_KeyPairZ_clone(const struct LDKCOption_KeyPairZ *NONNULL_PTR orig);
22378 * Creates a new CResult_COption_KeyPairZNoneZ in the success state.
22380 struct LDKCResult_COption_KeyPairZNoneZ CResult_COption_KeyPairZNoneZ_ok(struct LDKCOption_KeyPairZ o);
22383 * Creates a new CResult_COption_KeyPairZNoneZ in the error state.
22385 struct LDKCResult_COption_KeyPairZNoneZ CResult_COption_KeyPairZNoneZ_err(void);
22388 * Checks if the given object is currently in the success state
22390 bool CResult_COption_KeyPairZNoneZ_is_ok(const struct LDKCResult_COption_KeyPairZNoneZ *NONNULL_PTR o);
22393 * Frees any resources used by the CResult_COption_KeyPairZNoneZ.
22395 void CResult_COption_KeyPairZNoneZ_free(struct LDKCResult_COption_KeyPairZNoneZ _res);
22398 * Creates a new CResult_COption_KeyPairZNoneZ which has the same data as `orig`
22399 * but with all dynamically-allocated buffers duplicated in new buffers.
22401 struct LDKCResult_COption_KeyPairZNoneZ CResult_COption_KeyPairZNoneZ_clone(const struct LDKCResult_COption_KeyPairZNoneZ *NONNULL_PTR orig);
22404 * Constructs a new COption_ScriptZ containing a crate::c_types::derived::CVec_u8Z
22406 struct LDKCOption_ScriptZ COption_ScriptZ_some(struct LDKCVec_u8Z o);
22409 * Constructs a new COption_ScriptZ containing nothing
22411 struct LDKCOption_ScriptZ COption_ScriptZ_none(void);
22414 * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
22416 void COption_ScriptZ_free(struct LDKCOption_ScriptZ _res);
22419 * Creates a new COption_ScriptZ which has the same data as `orig`
22420 * but with all dynamically-allocated buffers duplicated in new buffers.
22422 struct LDKCOption_ScriptZ COption_ScriptZ_clone(const struct LDKCOption_ScriptZ *NONNULL_PTR orig);
22425 * Constructs a new COption_NoneZ containing a
22427 enum LDKCOption_NoneZ COption_NoneZ_some(void);
22430 * Constructs a new COption_NoneZ containing nothing
22432 enum LDKCOption_NoneZ COption_NoneZ_none(void);
22435 * Frees any resources associated with the , if we are in the Some state
22437 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
22440 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22442 void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res);
22445 * Constructs a new COption_i64Z containing a i64
22447 struct LDKCOption_i64Z COption_i64Z_some(int64_t o);
22450 * Constructs a new COption_i64Z containing nothing
22452 struct LDKCOption_i64Z COption_i64Z_none(void);
22455 * Frees any resources associated with the i64, if we are in the Some state
22457 void COption_i64Z_free(struct LDKCOption_i64Z _res);
22460 * Creates a new COption_i64Z which has the same data as `orig`
22461 * but with all dynamically-allocated buffers duplicated in new buffers.
22463 struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig);
22466 * Constructs a new COption_TxidZ containing a crate::c_types::ThirtyTwoBytes
22468 struct LDKCOption_TxidZ COption_TxidZ_some(struct LDKThirtyTwoBytes o);
22471 * Constructs a new COption_TxidZ containing nothing
22473 struct LDKCOption_TxidZ COption_TxidZ_none(void);
22476 * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
22478 void COption_TxidZ_free(struct LDKCOption_TxidZ _res);
22481 * Creates a new COption_TxidZ which has the same data as `orig`
22482 * but with all dynamically-allocated buffers duplicated in new buffers.
22484 struct LDKCOption_TxidZ COption_TxidZ_clone(const struct LDKCOption_TxidZ *NONNULL_PTR orig);
22487 * Creates a new CResult_NetAddressDecodeErrorZ in the success state.
22489 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_ok(struct LDKNetAddress o);
22492 * Creates a new CResult_NetAddressDecodeErrorZ in the error state.
22494 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_err(struct LDKDecodeError e);
22497 * Checks if the given object is currently in the success state
22499 bool CResult_NetAddressDecodeErrorZ_is_ok(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR o);
22502 * Frees any resources used by the CResult_NetAddressDecodeErrorZ.
22504 void CResult_NetAddressDecodeErrorZ_free(struct LDKCResult_NetAddressDecodeErrorZ _res);
22507 * Creates a new CResult_NetAddressDecodeErrorZ which has the same data as `orig`
22508 * but with all dynamically-allocated buffers duplicated in new buffers.
22510 struct LDKCResult_NetAddressDecodeErrorZ CResult_NetAddressDecodeErrorZ_clone(const struct LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR orig);
22513 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22515 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
22518 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22520 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
22523 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22525 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
22528 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22530 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
22533 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
22535 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
22538 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
22540 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
22543 * Checks if the given object is currently in the success state
22545 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
22548 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
22550 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
22553 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
22554 * but with all dynamically-allocated buffers duplicated in new buffers.
22556 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
22559 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state.
22561 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o);
22564 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state.
22566 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
22569 * Checks if the given object is currently in the success state
22571 bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o);
22574 * Frees any resources used by the CResult_AcceptChannelV2DecodeErrorZ.
22576 void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res);
22579 * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig`
22580 * but with all dynamically-allocated buffers duplicated in new buffers.
22582 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig);
22585 * Creates a new CResult_TxAddInputDecodeErrorZ in the success state.
22587 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o);
22590 * Creates a new CResult_TxAddInputDecodeErrorZ in the error state.
22592 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e);
22595 * Checks if the given object is currently in the success state
22597 bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o);
22600 * Frees any resources used by the CResult_TxAddInputDecodeErrorZ.
22602 void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res);
22605 * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig`
22606 * but with all dynamically-allocated buffers duplicated in new buffers.
22608 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig);
22611 * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state.
22613 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o);
22616 * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state.
22618 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e);
22621 * Checks if the given object is currently in the success state
22623 bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o);
22626 * Frees any resources used by the CResult_TxAddOutputDecodeErrorZ.
22628 void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res);
22631 * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig`
22632 * but with all dynamically-allocated buffers duplicated in new buffers.
22634 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig);
22637 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state.
22639 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o);
22642 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state.
22644 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e);
22647 * Checks if the given object is currently in the success state
22649 bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o);
22652 * Frees any resources used by the CResult_TxRemoveInputDecodeErrorZ.
22654 void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res);
22657 * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig`
22658 * but with all dynamically-allocated buffers duplicated in new buffers.
22660 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig);
22663 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state.
22665 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o);
22668 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state.
22670 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e);
22673 * Checks if the given object is currently in the success state
22675 bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o);
22678 * Frees any resources used by the CResult_TxRemoveOutputDecodeErrorZ.
22680 void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res);
22683 * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig`
22684 * but with all dynamically-allocated buffers duplicated in new buffers.
22686 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig);
22689 * Creates a new CResult_TxCompleteDecodeErrorZ in the success state.
22691 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o);
22694 * Creates a new CResult_TxCompleteDecodeErrorZ in the error state.
22696 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e);
22699 * Checks if the given object is currently in the success state
22701 bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o);
22704 * Frees any resources used by the CResult_TxCompleteDecodeErrorZ.
22706 void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res);
22709 * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig`
22710 * but with all dynamically-allocated buffers duplicated in new buffers.
22712 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig);
22715 * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state.
22717 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o);
22720 * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state.
22722 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
22725 * Checks if the given object is currently in the success state
22727 bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o);
22730 * Frees any resources used by the CResult_TxSignaturesDecodeErrorZ.
22732 void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res);
22735 * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig`
22736 * but with all dynamically-allocated buffers duplicated in new buffers.
22738 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig);
22741 * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state.
22743 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o);
22746 * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state.
22748 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e);
22751 * Checks if the given object is currently in the success state
22753 bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o);
22756 * Frees any resources used by the CResult_TxInitRbfDecodeErrorZ.
22758 void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res);
22761 * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig`
22762 * but with all dynamically-allocated buffers duplicated in new buffers.
22764 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig);
22767 * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state.
22769 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o);
22772 * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state.
22774 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e);
22777 * Checks if the given object is currently in the success state
22779 bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o);
22782 * Frees any resources used by the CResult_TxAckRbfDecodeErrorZ.
22784 void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res);
22787 * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig`
22788 * but with all dynamically-allocated buffers duplicated in new buffers.
22790 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig);
22793 * Creates a new CResult_TxAbortDecodeErrorZ in the success state.
22795 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o);
22798 * Creates a new CResult_TxAbortDecodeErrorZ in the error state.
22800 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e);
22803 * Checks if the given object is currently in the success state
22805 bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o);
22808 * Frees any resources used by the CResult_TxAbortDecodeErrorZ.
22810 void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res);
22813 * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig`
22814 * but with all dynamically-allocated buffers duplicated in new buffers.
22816 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig);
22819 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
22821 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
22824 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
22826 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
22829 * Checks if the given object is currently in the success state
22831 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
22834 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
22836 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
22839 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
22840 * but with all dynamically-allocated buffers duplicated in new buffers.
22842 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
22845 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
22847 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
22850 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
22852 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
22855 * Checks if the given object is currently in the success state
22857 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
22860 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
22862 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
22865 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
22866 * but with all dynamically-allocated buffers duplicated in new buffers.
22868 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
22871 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
22873 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
22876 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
22878 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
22881 * Checks if the given object is currently in the success state
22883 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
22886 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
22888 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
22891 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
22892 * but with all dynamically-allocated buffers duplicated in new buffers.
22894 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
22897 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
22899 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
22902 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
22904 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
22907 * Checks if the given object is currently in the success state
22909 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
22912 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
22914 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
22917 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
22918 * but with all dynamically-allocated buffers duplicated in new buffers.
22920 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
22923 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
22925 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
22928 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
22930 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
22933 * Checks if the given object is currently in the success state
22935 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
22938 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
22940 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
22943 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
22944 * but with all dynamically-allocated buffers duplicated in new buffers.
22946 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
22949 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
22951 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
22954 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
22956 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
22959 * Checks if the given object is currently in the success state
22961 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
22964 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
22966 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
22969 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
22970 * but with all dynamically-allocated buffers duplicated in new buffers.
22972 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
22975 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
22977 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
22980 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
22982 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
22985 * Checks if the given object is currently in the success state
22987 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
22990 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
22992 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
22995 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
22996 * but with all dynamically-allocated buffers duplicated in new buffers.
22998 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
23001 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
23003 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
23006 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
23008 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
23011 * Checks if the given object is currently in the success state
23013 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
23016 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
23018 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
23021 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
23022 * but with all dynamically-allocated buffers duplicated in new buffers.
23024 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
23027 * Creates a new CResult_InitDecodeErrorZ in the success state.
23029 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
23032 * Creates a new CResult_InitDecodeErrorZ in the error state.
23034 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
23037 * Checks if the given object is currently in the success state
23039 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
23042 * Frees any resources used by the CResult_InitDecodeErrorZ.
23044 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
23047 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
23048 * but with all dynamically-allocated buffers duplicated in new buffers.
23050 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
23053 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
23055 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
23058 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
23060 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
23063 * Checks if the given object is currently in the success state
23065 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
23068 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
23070 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
23073 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
23074 * but with all dynamically-allocated buffers duplicated in new buffers.
23076 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
23079 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state.
23081 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o);
23084 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state.
23086 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
23089 * Checks if the given object is currently in the success state
23091 bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o);
23094 * Frees any resources used by the CResult_OpenChannelV2DecodeErrorZ.
23096 void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res);
23099 * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig`
23100 * but with all dynamically-allocated buffers duplicated in new buffers.
23102 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig);
23105 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
23107 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
23110 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
23112 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
23115 * Checks if the given object is currently in the success state
23117 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
23120 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
23122 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
23125 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
23126 * but with all dynamically-allocated buffers duplicated in new buffers.
23128 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
23131 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
23133 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
23136 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
23138 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
23141 * Checks if the given object is currently in the success state
23143 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
23146 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
23148 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
23151 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
23152 * but with all dynamically-allocated buffers duplicated in new buffers.
23154 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
23157 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
23159 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
23162 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
23164 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
23167 * Checks if the given object is currently in the success state
23169 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
23172 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
23174 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
23177 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
23178 * but with all dynamically-allocated buffers duplicated in new buffers.
23180 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
23183 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
23185 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
23188 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
23190 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
23193 * Checks if the given object is currently in the success state
23195 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
23198 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
23200 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
23203 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
23204 * but with all dynamically-allocated buffers duplicated in new buffers.
23206 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
23209 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
23211 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
23214 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
23216 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
23219 * Checks if the given object is currently in the success state
23221 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
23224 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
23226 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
23229 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
23230 * but with all dynamically-allocated buffers duplicated in new buffers.
23232 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
23235 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
23237 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
23240 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
23242 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
23245 * Checks if the given object is currently in the success state
23247 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
23250 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
23252 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
23255 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
23256 * but with all dynamically-allocated buffers duplicated in new buffers.
23258 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
23261 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
23263 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
23266 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
23268 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
23271 * Checks if the given object is currently in the success state
23273 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
23276 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
23278 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
23281 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
23282 * but with all dynamically-allocated buffers duplicated in new buffers.
23284 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
23287 * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
23289 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
23292 * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
23294 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
23297 * Checks if the given object is currently in the success state
23299 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
23302 * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
23304 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
23307 * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
23308 * but with all dynamically-allocated buffers duplicated in new buffers.
23310 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
23313 * Creates a new CResult_PingDecodeErrorZ in the success state.
23315 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
23318 * Creates a new CResult_PingDecodeErrorZ in the error state.
23320 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
23323 * Checks if the given object is currently in the success state
23325 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
23328 * Frees any resources used by the CResult_PingDecodeErrorZ.
23330 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
23333 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
23334 * but with all dynamically-allocated buffers duplicated in new buffers.
23336 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
23339 * Creates a new CResult_PongDecodeErrorZ in the success state.
23341 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
23344 * Creates a new CResult_PongDecodeErrorZ in the error state.
23346 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
23349 * Checks if the given object is currently in the success state
23351 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
23354 * Frees any resources used by the CResult_PongDecodeErrorZ.
23356 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
23359 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
23360 * but with all dynamically-allocated buffers duplicated in new buffers.
23362 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
23365 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
23367 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
23370 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
23372 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
23375 * Checks if the given object is currently in the success state
23377 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
23380 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
23382 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
23385 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
23386 * but with all dynamically-allocated buffers duplicated in new buffers.
23388 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
23391 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
23393 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
23396 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
23398 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
23401 * Checks if the given object is currently in the success state
23403 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
23406 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
23408 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
23411 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
23412 * but with all dynamically-allocated buffers duplicated in new buffers.
23414 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
23417 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
23419 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
23422 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
23424 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
23427 * Checks if the given object is currently in the success state
23429 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
23432 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
23434 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
23437 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
23438 * but with all dynamically-allocated buffers duplicated in new buffers.
23440 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
23443 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
23445 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
23448 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
23450 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
23453 * Checks if the given object is currently in the success state
23455 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
23458 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
23460 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
23463 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
23464 * but with all dynamically-allocated buffers duplicated in new buffers.
23466 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
23469 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
23471 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
23474 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
23476 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
23479 * Checks if the given object is currently in the success state
23481 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
23484 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
23486 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
23489 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
23490 * but with all dynamically-allocated buffers duplicated in new buffers.
23492 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
23495 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
23497 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
23500 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
23502 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
23505 * Checks if the given object is currently in the success state
23507 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
23510 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
23512 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
23515 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
23516 * but with all dynamically-allocated buffers duplicated in new buffers.
23518 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
23521 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
23523 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
23526 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
23528 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
23531 * Checks if the given object is currently in the success state
23533 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
23536 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
23538 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
23541 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
23542 * but with all dynamically-allocated buffers duplicated in new buffers.
23544 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
23547 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
23549 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
23552 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
23554 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
23557 * Checks if the given object is currently in the success state
23559 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
23562 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
23564 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
23567 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
23568 * but with all dynamically-allocated buffers duplicated in new buffers.
23570 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
23573 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
23575 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
23578 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
23580 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
23583 * Checks if the given object is currently in the success state
23585 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
23588 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
23590 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
23593 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
23594 * but with all dynamically-allocated buffers duplicated in new buffers.
23596 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
23599 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
23601 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
23604 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
23606 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
23609 * Checks if the given object is currently in the success state
23611 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
23614 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
23616 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
23619 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
23620 * but with all dynamically-allocated buffers duplicated in new buffers.
23622 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
23625 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
23627 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
23630 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
23632 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
23635 * Checks if the given object is currently in the success state
23637 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
23640 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
23642 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
23645 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
23646 * but with all dynamically-allocated buffers duplicated in new buffers.
23648 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
23651 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
23653 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
23656 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
23658 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
23661 * Checks if the given object is currently in the success state
23663 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
23666 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
23668 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
23671 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
23672 * but with all dynamically-allocated buffers duplicated in new buffers.
23674 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
23677 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
23679 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
23682 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
23684 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
23687 * Checks if the given object is currently in the success state
23689 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
23692 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
23694 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
23697 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
23698 * but with all dynamically-allocated buffers duplicated in new buffers.
23700 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
23703 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23705 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
23708 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
23710 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
23713 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
23715 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
23718 * Checks if the given object is currently in the success state
23720 bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
23723 * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
23725 void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
23728 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
23729 * but with all dynamically-allocated buffers duplicated in new buffers.
23731 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
23734 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23736 void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
23739 * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
23741 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
23744 * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
23746 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
23749 * Checks if the given object is currently in the success state
23751 bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
23754 * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
23756 void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
23759 * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
23760 * but with all dynamically-allocated buffers duplicated in new buffers.
23762 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
23765 * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
23767 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
23770 * Constructs a new COption_HTLCClaimZ containing nothing
23772 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
23775 * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
23777 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
23780 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
23782 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
23785 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
23787 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
23790 * Checks if the given object is currently in the success state
23792 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
23795 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
23797 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
23800 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
23801 * but with all dynamically-allocated buffers duplicated in new buffers.
23803 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
23806 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
23808 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
23811 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
23813 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
23816 * Checks if the given object is currently in the success state
23818 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
23821 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
23823 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
23826 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
23827 * but with all dynamically-allocated buffers duplicated in new buffers.
23829 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
23832 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
23834 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
23837 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
23839 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
23842 * Checks if the given object is currently in the success state
23844 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
23847 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
23849 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
23852 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
23853 * but with all dynamically-allocated buffers duplicated in new buffers.
23855 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
23858 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
23860 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
23863 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
23865 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
23868 * Checks if the given object is currently in the success state
23870 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
23873 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
23875 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
23878 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
23879 * but with all dynamically-allocated buffers duplicated in new buffers.
23881 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
23884 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
23886 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
23889 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
23891 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
23894 * Checks if the given object is currently in the success state
23896 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
23899 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
23901 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
23904 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
23905 * but with all dynamically-allocated buffers duplicated in new buffers.
23907 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
23910 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
23912 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
23915 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
23917 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
23920 * Checks if the given object is currently in the success state
23922 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
23925 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
23927 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
23930 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
23931 * but with all dynamically-allocated buffers duplicated in new buffers.
23933 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
23936 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
23938 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
23941 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
23943 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
23946 * Checks if the given object is currently in the success state
23948 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
23951 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
23953 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
23956 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
23957 * but with all dynamically-allocated buffers duplicated in new buffers.
23959 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
23962 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
23964 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
23967 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
23969 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
23972 * Checks if the given object is currently in the success state
23974 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
23977 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
23979 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
23982 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
23983 * but with all dynamically-allocated buffers duplicated in new buffers.
23985 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
23988 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
23990 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
23993 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
23995 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
23998 * Checks if the given object is currently in the success state
24000 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
24003 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
24005 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
24008 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
24010 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
24013 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
24015 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
24018 * Checks if the given object is currently in the success state
24020 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
24023 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
24025 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
24028 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
24029 * but with all dynamically-allocated buffers duplicated in new buffers.
24031 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
24034 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
24036 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
24039 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
24041 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
24044 * Checks if the given object is currently in the success state
24046 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
24049 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
24051 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
24054 * Creates a new CResult_CVec_SignatureZNoneZ in the success state.
24056 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o);
24059 * Creates a new CResult_CVec_SignatureZNoneZ in the error state.
24061 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void);
24064 * Checks if the given object is currently in the success state
24066 bool CResult_CVec_SignatureZNoneZ_is_ok(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR o);
24069 * Frees any resources used by the CResult_CVec_SignatureZNoneZ.
24071 void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res);
24074 * Creates a new CResult_CVec_SignatureZNoneZ which has the same data as `orig`
24075 * but with all dynamically-allocated buffers duplicated in new buffers.
24077 struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_clone(const struct LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR orig);
24080 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
24082 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
24085 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
24087 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
24090 * Checks if the given object is currently in the success state
24092 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
24095 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
24097 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
24100 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
24101 * but with all dynamically-allocated buffers duplicated in new buffers.
24103 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
24106 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
24108 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
24111 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
24113 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
24116 * Checks if the given object is currently in the success state
24118 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
24121 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
24123 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
24126 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
24127 * but with all dynamically-allocated buffers duplicated in new buffers.
24129 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
24132 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
24134 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
24137 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
24139 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
24142 * Checks if the given object is currently in the success state
24144 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
24147 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
24149 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
24152 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
24153 * but with all dynamically-allocated buffers duplicated in new buffers.
24155 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
24158 * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
24160 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
24163 * Constructs a new COption_PathFailureZ containing nothing
24165 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
24168 * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
24170 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
24173 * Creates a new COption_PathFailureZ which has the same data as `orig`
24174 * but with all dynamically-allocated buffers duplicated in new buffers.
24176 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
24179 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
24181 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
24184 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
24186 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
24189 * Checks if the given object is currently in the success state
24191 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
24194 * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
24196 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
24199 * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
24200 * but with all dynamically-allocated buffers duplicated in new buffers.
24202 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
24205 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
24207 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
24210 * Constructs a new COption_ClosureReasonZ containing nothing
24212 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
24215 * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
24217 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
24220 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
24221 * but with all dynamically-allocated buffers duplicated in new buffers.
24223 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
24226 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
24228 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
24231 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
24233 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
24236 * Checks if the given object is currently in the success state
24238 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
24241 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
24243 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
24246 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
24247 * but with all dynamically-allocated buffers duplicated in new buffers.
24249 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
24252 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
24254 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
24257 * Constructs a new COption_HTLCDestinationZ containing nothing
24259 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
24262 * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
24264 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
24267 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
24268 * but with all dynamically-allocated buffers duplicated in new buffers.
24270 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
24273 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
24275 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
24278 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
24280 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
24283 * Checks if the given object is currently in the success state
24285 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
24288 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
24290 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
24293 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
24294 * but with all dynamically-allocated buffers duplicated in new buffers.
24296 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
24299 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
24301 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
24304 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
24306 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
24309 * Checks if the given object is currently in the success state
24311 bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
24314 * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
24316 void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
24319 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
24320 * but with all dynamically-allocated buffers duplicated in new buffers.
24322 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
24325 * Constructs a new COption_u128Z containing a crate::c_types::U128
24327 struct LDKCOption_u128Z COption_u128Z_some(struct LDKU128 o);
24330 * Constructs a new COption_u128Z containing nothing
24332 struct LDKCOption_u128Z COption_u128Z_none(void);
24335 * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
24337 void COption_u128Z_free(struct LDKCOption_u128Z _res);
24340 * Creates a new COption_u128Z which has the same data as `orig`
24341 * but with all dynamically-allocated buffers duplicated in new buffers.
24343 struct LDKCOption_u128Z COption_u128Z_clone(const struct LDKCOption_u128Z *NONNULL_PTR orig);
24346 * Constructs a new COption_PaymentIdZ containing a crate::c_types::ThirtyTwoBytes
24348 struct LDKCOption_PaymentIdZ COption_PaymentIdZ_some(struct LDKThirtyTwoBytes o);
24351 * Constructs a new COption_PaymentIdZ containing nothing
24353 struct LDKCOption_PaymentIdZ COption_PaymentIdZ_none(void);
24356 * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
24358 void COption_PaymentIdZ_free(struct LDKCOption_PaymentIdZ _res);
24361 * Creates a new COption_PaymentIdZ which has the same data as `orig`
24362 * but with all dynamically-allocated buffers duplicated in new buffers.
24364 struct LDKCOption_PaymentIdZ COption_PaymentIdZ_clone(const struct LDKCOption_PaymentIdZ *NONNULL_PTR orig);
24367 * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
24369 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
24372 * Constructs a new COption_PaymentFailureReasonZ containing nothing
24374 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
24377 * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
24379 void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
24382 * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
24383 * but with all dynamically-allocated buffers duplicated in new buffers.
24385 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
24388 * Constructs a new COption_EventZ containing a crate::lightning::events::Event
24390 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
24393 * Constructs a new COption_EventZ containing nothing
24395 struct LDKCOption_EventZ COption_EventZ_none(void);
24398 * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
24400 void COption_EventZ_free(struct LDKCOption_EventZ _res);
24403 * Creates a new COption_EventZ which has the same data as `orig`
24404 * but with all dynamically-allocated buffers duplicated in new buffers.
24406 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
24409 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
24411 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
24414 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
24416 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
24419 * Checks if the given object is currently in the success state
24421 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
24424 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
24426 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
24429 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
24430 * but with all dynamically-allocated buffers duplicated in new buffers.
24432 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
24435 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24437 void CVec_C2Tuple_BlockHashChannelMonitorZZ_free(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ _res);
24440 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
24442 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(struct LDKCVec_C2Tuple_BlockHashChannelMonitorZZ o);
24445 * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
24447 struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(enum LDKIOError e);
24450 * Checks if the given object is currently in the success state
24452 bool CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ *NONNULL_PTR o);
24455 * Frees any resources used by the CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.
24457 void CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(struct LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ _res);
24460 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
24462 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o);
24465 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state.
24467 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
24470 * Checks if the given object is currently in the success state
24472 bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o);
24475 * Frees any resources used by the CResult_SiPrefixBolt11ParseErrorZ.
24477 void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res);
24480 * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig`
24481 * but with all dynamically-allocated buffers duplicated in new buffers.
24483 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig);
24486 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state.
24488 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o);
24491 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state.
24493 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
24496 * Checks if the given object is currently in the success state
24498 bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
24501 * Frees any resources used by the CResult_Bolt11InvoiceParseOrSemanticErrorZ.
24503 void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res);
24506 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig`
24507 * but with all dynamically-allocated buffers duplicated in new buffers.
24509 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
24512 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
24514 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o);
24517 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
24519 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
24522 * Checks if the given object is currently in the success state
24524 bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o);
24527 * Frees any resources used by the CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ.
24529 void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res);
24532 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
24533 * but with all dynamically-allocated buffers duplicated in new buffers.
24535 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig);
24538 * Creates a new tuple which has the same data as `orig`
24539 * but with all dynamically-allocated buffers duplicated in new buffers.
24541 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig);
24544 * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements.
24546 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c);
24549 * Frees any resources used by the C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.
24551 void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res);
24554 * Creates a new CResult_PayeePubKeyErrorZ in the success state.
24556 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o);
24559 * Creates a new CResult_PayeePubKeyErrorZ in the error state.
24561 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e);
24564 * Checks if the given object is currently in the success state
24566 bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o);
24569 * Frees any resources used by the CResult_PayeePubKeyErrorZ.
24571 void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res);
24574 * Creates a new CResult_PayeePubKeyErrorZ which has the same data as `orig`
24575 * but with all dynamically-allocated buffers duplicated in new buffers.
24577 struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig);
24580 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24582 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
24585 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
24587 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
24590 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
24592 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
24595 * Checks if the given object is currently in the success state
24597 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
24600 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
24602 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
24605 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
24606 * but with all dynamically-allocated buffers duplicated in new buffers.
24608 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
24611 * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
24613 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void);
24616 * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
24618 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
24621 * Checks if the given object is currently in the success state
24623 bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o);
24626 * Frees any resources used by the CResult_NoneBolt11SemanticErrorZ.
24628 void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res);
24631 * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
24632 * but with all dynamically-allocated buffers duplicated in new buffers.
24634 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig);
24637 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state.
24639 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o);
24642 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state.
24644 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
24647 * Checks if the given object is currently in the success state
24649 bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o);
24652 * Frees any resources used by the CResult_Bolt11InvoiceBolt11SemanticErrorZ.
24654 void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res);
24657 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig`
24658 * but with all dynamically-allocated buffers duplicated in new buffers.
24660 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig);
24663 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24665 void CVec_AddressZ_free(struct LDKCVec_AddressZ _res);
24668 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
24670 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
24673 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
24675 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
24678 * Checks if the given object is currently in the success state
24680 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
24683 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
24685 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
24688 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
24689 * but with all dynamically-allocated buffers duplicated in new buffers.
24691 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
24694 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
24696 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
24699 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
24701 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
24704 * Checks if the given object is currently in the success state
24706 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
24709 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
24711 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
24714 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
24715 * but with all dynamically-allocated buffers duplicated in new buffers.
24717 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
24720 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
24722 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
24725 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
24727 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
24730 * Checks if the given object is currently in the success state
24732 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
24735 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
24737 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
24740 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
24741 * but with all dynamically-allocated buffers duplicated in new buffers.
24743 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
24746 * Creates a new CResult_BigSizeDecodeErrorZ in the success state.
24748 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o);
24751 * Creates a new CResult_BigSizeDecodeErrorZ in the error state.
24753 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e);
24756 * Checks if the given object is currently in the success state
24758 bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o);
24761 * Frees any resources used by the CResult_BigSizeDecodeErrorZ.
24763 void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res);
24766 * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig`
24767 * but with all dynamically-allocated buffers duplicated in new buffers.
24769 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
24772 * Creates a new CResult_HostnameDecodeErrorZ in the success state.
24774 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o);
24777 * Creates a new CResult_HostnameDecodeErrorZ in the error state.
24779 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e);
24782 * Checks if the given object is currently in the success state
24784 bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o);
24787 * Frees any resources used by the CResult_HostnameDecodeErrorZ.
24789 void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res);
24792 * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig`
24793 * but with all dynamically-allocated buffers duplicated in new buffers.
24795 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig);
24798 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state.
24800 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o);
24803 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state.
24805 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void);
24808 * Checks if the given object is currently in the success state
24810 bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o);
24813 * Frees any resources used by the CResult_TransactionU16LenLimitedNoneZ.
24815 void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res);
24818 * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig`
24819 * but with all dynamically-allocated buffers duplicated in new buffers.
24821 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig);
24824 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state.
24826 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o);
24829 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state.
24831 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e);
24834 * Checks if the given object is currently in the success state
24836 bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o);
24839 * Frees any resources used by the CResult_TransactionU16LenLimitedDecodeErrorZ.
24841 void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res);
24844 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig`
24845 * but with all dynamically-allocated buffers duplicated in new buffers.
24847 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
24850 * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
24852 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
24855 * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
24857 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
24860 * Checks if the given object is currently in the success state
24862 bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
24865 * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
24867 void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
24870 * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
24871 * but with all dynamically-allocated buffers duplicated in new buffers.
24873 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
24876 * Creates a new CResult_PaymentIdPaymentErrorZ in the success state.
24878 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o);
24881 * Creates a new CResult_PaymentIdPaymentErrorZ in the error state.
24883 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e);
24886 * Checks if the given object is currently in the success state
24888 bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o);
24891 * Frees any resources used by the CResult_PaymentIdPaymentErrorZ.
24893 void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res);
24896 * Creates a new CResult_PaymentIdPaymentErrorZ which has the same data as `orig`
24897 * but with all dynamically-allocated buffers duplicated in new buffers.
24899 struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig);
24902 * Creates a new CResult_NonePaymentErrorZ in the success state.
24904 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_ok(void);
24907 * Creates a new CResult_NonePaymentErrorZ in the error state.
24909 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_err(struct LDKPaymentError e);
24912 * Checks if the given object is currently in the success state
24914 bool CResult_NonePaymentErrorZ_is_ok(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR o);
24917 * Frees any resources used by the CResult_NonePaymentErrorZ.
24919 void CResult_NonePaymentErrorZ_free(struct LDKCResult_NonePaymentErrorZ _res);
24922 * Creates a new CResult_NonePaymentErrorZ which has the same data as `orig`
24923 * but with all dynamically-allocated buffers duplicated in new buffers.
24925 struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_clone(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR orig);
24928 * Creates a new CResult_StringErrorZ in the success state.
24930 struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o);
24933 * Creates a new CResult_StringErrorZ in the error state.
24935 struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e);
24938 * Checks if the given object is currently in the success state
24940 bool CResult_StringErrorZ_is_ok(const struct LDKCResult_StringErrorZ *NONNULL_PTR o);
24943 * Frees any resources used by the CResult_StringErrorZ.
24945 void CResult_StringErrorZ_free(struct LDKCResult_StringErrorZ _res);
24948 * Creates a new CResult_StringErrorZ which has the same data as `orig`
24949 * but with all dynamically-allocated buffers duplicated in new buffers.
24951 struct LDKCResult_StringErrorZ CResult_StringErrorZ_clone(const struct LDKCResult_StringErrorZ *NONNULL_PTR orig);
24954 * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
24956 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
24959 * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
24961 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
24964 * Checks if the given object is currently in the success state
24966 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
24969 * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
24971 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
24974 * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
24975 * but with all dynamically-allocated buffers duplicated in new buffers.
24977 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
24980 * Creates a new CResult_OnionMessagePathNoneZ in the success state.
24982 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o);
24985 * Creates a new CResult_OnionMessagePathNoneZ in the error state.
24987 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void);
24990 * Checks if the given object is currently in the success state
24992 bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o);
24995 * Frees any resources used by the CResult_OnionMessagePathNoneZ.
24997 void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res);
25000 * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig`
25001 * but with all dynamically-allocated buffers duplicated in new buffers.
25003 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
25006 * Creates a new CResult_NoneSendErrorZ in the success state.
25008 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_ok(void);
25011 * Creates a new CResult_NoneSendErrorZ in the error state.
25013 struct LDKCResult_NoneSendErrorZ CResult_NoneSendErrorZ_err(struct LDKSendError e);
25016 * Checks if the given object is currently in the success state
25018 bool CResult_NoneSendErrorZ_is_ok(const struct LDKCResult_NoneSendErrorZ *NONNULL_PTR o);
25021 * Frees any resources used by the CResult_NoneSendErrorZ.
25023 void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res);
25026 * Creates a new CResult_BlindedPathNoneZ in the success state.
25028 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
25031 * Creates a new CResult_BlindedPathNoneZ in the error state.
25033 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
25036 * Checks if the given object is currently in the success state
25038 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
25041 * Frees any resources used by the CResult_BlindedPathNoneZ.
25043 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
25046 * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
25047 * but with all dynamically-allocated buffers duplicated in new buffers.
25049 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
25052 * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
25054 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
25057 * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
25059 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
25062 * Checks if the given object is currently in the success state
25064 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
25067 * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
25069 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
25072 * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
25073 * but with all dynamically-allocated buffers duplicated in new buffers.
25075 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
25078 * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
25080 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
25083 * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
25085 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
25088 * Checks if the given object is currently in the success state
25090 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
25093 * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
25095 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
25098 * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
25099 * but with all dynamically-allocated buffers duplicated in new buffers.
25101 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
25104 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
25106 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o);
25109 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state.
25111 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e);
25114 * Checks if the given object is currently in the success state
25116 bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o);
25119 * Frees any resources used by the CResult_InvoiceErrorDecodeErrorZ.
25121 void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res);
25124 * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig`
25125 * but with all dynamically-allocated buffers duplicated in new buffers.
25127 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig);
25130 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
25132 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
25135 * Constructs a new COption_FilterZ containing nothing
25137 struct LDKCOption_FilterZ COption_FilterZ_none(void);
25140 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
25142 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
25145 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
25147 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
25150 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
25152 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
25155 * Checks if the given object is currently in the success state
25157 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
25160 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
25162 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
25165 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25167 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
25170 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25172 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
25175 * Creates a new tuple which has the same data as `orig`
25176 * but with all dynamically-allocated buffers duplicated in new buffers.
25178 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
25181 * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
25183 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
25186 * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
25188 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
25191 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25193 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
25196 * Frees any resources used by the APIError
25198 void APIError_free(struct LDKAPIError this_ptr);
25201 * Creates a copy of the APIError
25203 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
25206 * Utility method to constructs a new APIMisuseError-variant APIError
25208 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
25211 * Utility method to constructs a new FeeRateTooHigh-variant APIError
25213 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
25216 * Utility method to constructs a new InvalidRoute-variant APIError
25218 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
25221 * Utility method to constructs a new ChannelUnavailable-variant APIError
25223 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
25226 * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
25228 struct LDKAPIError APIError_monitor_update_in_progress(void);
25231 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
25233 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
25236 * Checks if two APIErrors contain equal inner contents.
25237 * This ignores pointers and is_owned flags and looks at the values in fields.
25239 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
25242 * Serialize the APIError object into a byte array which can be read by APIError_read
25244 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
25247 * Read a APIError from a byte array, created by APIError_write
25249 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
25252 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
25254 void BigSize_free(struct LDKBigSize this_obj);
25256 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
25258 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
25261 * Constructs a new BigSize given each field
25263 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
25266 * Creates a copy of the BigSize
25268 struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig);
25271 * Generates a non-cryptographic 64-bit hash of the BigSize.
25273 uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o);
25276 * Checks if two BigSizes contain equal inner contents.
25277 * This ignores pointers and is_owned flags and looks at the values in fields.
25278 * Two objects with NULL inner values will be considered "equal" here.
25280 bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b);
25283 * Serialize the BigSize object into a byte array which can be read by BigSize_read
25285 struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
25288 * Read a BigSize from a byte array, created by BigSize_write
25290 struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
25293 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
25295 void Hostname_free(struct LDKHostname this_obj);
25298 * Creates a copy of the Hostname
25300 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
25303 * Checks if two Hostnames contain equal inner contents.
25304 * This ignores pointers and is_owned flags and looks at the values in fields.
25305 * Two objects with NULL inner values will be considered "equal" here.
25307 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
25310 * Returns the length of the hostname.
25312 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
25315 * Serialize the Hostname object into a byte array which can be read by Hostname_read
25317 struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj);
25320 * Read a Hostname from a byte array, created by Hostname_write
25322 struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser);
25325 * Frees any resources used by the TransactionU16LenLimited, if is_owned is set and inner is non-NULL.
25327 void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj);
25330 * Creates a copy of the TransactionU16LenLimited
25332 struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig);
25335 * Checks if two TransactionU16LenLimiteds contain equal inner contents.
25336 * This ignores pointers and is_owned flags and looks at the values in fields.
25337 * Two objects with NULL inner values will be considered "equal" here.
25339 bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b);
25342 * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus-
25343 * serialized length is <= u16::MAX.
25345 MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction);
25348 * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`.
25350 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg);
25353 * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read
25355 struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj);
25358 * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write
25360 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser);
25363 * Creates a digital signature of a message given a SecretKey, like the node's secret.
25364 * 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.
25365 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
25367 struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
25370 * Recovers the PublicKey of the signer of the message given the message and the signature.
25372 struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
25375 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
25376 * and the PublicKey.
25378 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
25381 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
25383 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
25386 * Calls the free function if one is set
25388 void Persister_free(struct LDKPersister this_ptr);
25391 * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
25393 void UntrustedString_free(struct LDKUntrustedString this_obj);
25395 struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
25397 void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
25400 * Constructs a new UntrustedString given each field
25402 MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
25405 * Creates a copy of the UntrustedString
25407 struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
25410 * Checks if two UntrustedStrings contain equal inner contents.
25411 * This ignores pointers and is_owned flags and looks at the values in fields.
25412 * Two objects with NULL inner values will be considered "equal" here.
25414 bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
25417 * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
25419 struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
25422 * Read a UntrustedString from a byte array, created by UntrustedString_write
25424 struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
25427 * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
25429 void PrintableString_free(struct LDKPrintableString this_obj);
25431 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
25433 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
25436 * Constructs a new PrintableString given each field
25438 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
25441 * Calls the free function if one is set
25443 void FutureCallback_free(struct LDKFutureCallback this_ptr);
25446 * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
25448 void Future_free(struct LDKFuture this_obj);
25451 * Creates a copy of the Future
25453 struct LDKFuture Future_clone(const struct LDKFuture *NONNULL_PTR orig);
25456 * Registers a callback to be called upon completion of this future. If the future has already
25457 * completed, the callback will be called immediately.
25459 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
25462 * Waits until this [`Future`] completes.
25464 void Future_wait(struct LDKFuture this_arg);
25467 * Waits until this [`Future`] completes or the given amount of time has elapsed.
25469 * Returns true if the [`Future`] completed, false if the time elapsed.
25471 MUST_USE_RES bool Future_wait_timeout(struct LDKFuture this_arg, uint64_t max_wait);
25474 * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
25476 void Sleeper_free(struct LDKSleeper this_obj);
25479 * Constructs a new sleeper from one future, allowing blocking on it.
25481 MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(struct LDKFuture future);
25484 * Constructs a new sleeper from two futures, allowing blocking on both at once.
25486 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(struct LDKFuture fut_a, struct LDKFuture fut_b);
25489 * Constructs a new sleeper on many futures, allowing blocking on all at once.
25491 MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
25494 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
25496 void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
25499 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
25500 * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
25503 MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
25506 * Creates a copy of the Level
25508 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
25511 * Utility method to constructs a new Gossip-variant Level
25513 enum LDKLevel Level_gossip(void);
25516 * Utility method to constructs a new Trace-variant Level
25518 enum LDKLevel Level_trace(void);
25521 * Utility method to constructs a new Debug-variant Level
25523 enum LDKLevel Level_debug(void);
25526 * Utility method to constructs a new Info-variant Level
25528 enum LDKLevel Level_info(void);
25531 * Utility method to constructs a new Warn-variant Level
25533 enum LDKLevel Level_warn(void);
25536 * Utility method to constructs a new Error-variant Level
25538 enum LDKLevel Level_error(void);
25541 * Checks if two Levels contain equal inner contents.
25542 * This ignores pointers and is_owned flags and looks at the values in fields.
25544 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
25547 * Generates a non-cryptographic 64-bit hash of the Level.
25549 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
25552 * Returns the most verbose logging level.
25554 MUST_USE_RES enum LDKLevel Level_max(void);
25557 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
25559 void Record_free(struct LDKRecord this_obj);
25562 * The verbosity level of the message.
25564 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
25567 * The verbosity level of the message.
25569 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
25572 * The message body.
25574 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
25577 * The message body.
25579 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
25582 * The module path of the message.
25584 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
25587 * The module path of the message.
25589 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
25592 * The source file containing the message.
25594 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
25597 * The source file containing the message.
25599 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
25602 * The line containing the message.
25604 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
25607 * The line containing the message.
25609 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
25612 * Creates a copy of the Record
25614 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
25617 * Calls the free function if one is set
25619 void Logger_free(struct LDKLogger this_ptr);
25622 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
25624 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
25627 * Confirmations we will wait for before considering the channel locked in.
25628 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
25629 * equivalent limit applied to outbound channels).
25631 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
25632 * transaction before operation. If you wish to accept channels with zero confirmations, see
25633 * [`UserConfig::manually_accept_inbound_channels`] and
25634 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
25636 * Default value: 6.
25638 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
25639 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
25641 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
25644 * Confirmations we will wait for before considering the channel locked in.
25645 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
25646 * equivalent limit applied to outbound channels).
25648 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
25649 * transaction before operation. If you wish to accept channels with zero confirmations, see
25650 * [`UserConfig::manually_accept_inbound_channels`] and
25651 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
25653 * Default value: 6.
25655 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
25656 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
25658 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
25661 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
25662 * the number of blocks we have to punish our counterparty if they broadcast a revoked
25665 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
25666 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
25667 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
25668 * possibly with time in between to RBF the spending transaction).
25670 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
25671 * case of an honest unilateral channel close, which implicitly decrease the economic value of
25674 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
25675 * can tweak config to ask for more security, not less.
25677 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
25680 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
25681 * the number of blocks we have to punish our counterparty if they broadcast a revoked
25684 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
25685 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
25686 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
25687 * possibly with time in between to RBF the spending transaction).
25689 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
25690 * case of an honest unilateral channel close, which implicitly decrease the economic value of
25693 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
25694 * can tweak config to ask for more security, not less.
25696 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
25699 * Set to the smallest value HTLC we will accept to process.
25701 * This value is sent to our counterparty on channel-open and we close the channel any time
25702 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
25704 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
25707 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
25710 * Set to the smallest value HTLC we will accept to process.
25712 * This value is sent to our counterparty on channel-open and we close the channel any time
25713 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
25715 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
25718 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
25721 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
25724 * This can be set to a value between 1-100, where the value corresponds to the percent of the
25725 * channel value in whole percentages.
25728 * * If configured to another value than the default value 10, any new channels created with
25729 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
25730 * `ChannelManager`.
25732 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
25733 * no way to configure the cap for the total value of outbound HTLCs in-flight.
25735 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
25736 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
25737 * restrict exposure to loss due to being offline for too long.
25738 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
25739 * for more information.
25741 * Default value: 10.
25742 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
25743 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
25745 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
25748 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
25751 * This can be set to a value between 1-100, where the value corresponds to the percent of the
25752 * channel value in whole percentages.
25755 * * If configured to another value than the default value 10, any new channels created with
25756 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
25757 * `ChannelManager`.
25759 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
25760 * no way to configure the cap for the total value of outbound HTLCs in-flight.
25762 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
25763 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
25764 * restrict exposure to loss due to being offline for too long.
25765 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
25766 * for more information.
25768 * Default value: 10.
25769 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
25770 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
25772 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
25775 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
25776 * BOLTs) option for outbound private channels. This provides better privacy by not including
25777 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
25778 * relay HTLCs to us using the channel's SCID alias.
25780 * If this option is set, channels may be created that will not be readable by LDK versions
25781 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
25782 * [`DecodeError::InvalidValue`].
25784 * Note that setting this to true does *not* prevent us from opening channels with
25785 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
25786 * private channel without that option.
25788 * Ignored if the channel is negotiated to be announced, see
25789 * [`ChannelHandshakeConfig::announced_channel`] and
25790 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
25792 * Default value: false. This value is likely to change to true in the future.
25794 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
25795 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
25797 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
25800 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
25801 * BOLTs) option for outbound private channels. This provides better privacy by not including
25802 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
25803 * relay HTLCs to us using the channel's SCID alias.
25805 * If this option is set, channels may be created that will not be readable by LDK versions
25806 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
25807 * [`DecodeError::InvalidValue`].
25809 * Note that setting this to true does *not* prevent us from opening channels with
25810 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
25811 * private channel without that option.
25813 * Ignored if the channel is negotiated to be announced, see
25814 * [`ChannelHandshakeConfig::announced_channel`] and
25815 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
25817 * Default value: false. This value is likely to change to true in the future.
25819 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
25820 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
25822 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
25825 * Set to announce the channel publicly and notify all nodes that they can route via this
25828 * This should only be set to true for nodes which expect to be online reliably.
25830 * As the node which funds a channel picks this value this will only apply for new outbound
25831 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
25833 * Default value: false.
25835 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
25838 * Set to announce the channel publicly and notify all nodes that they can route via this
25841 * This should only be set to true for nodes which expect to be online reliably.
25843 * As the node which funds a channel picks this value this will only apply for new outbound
25844 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
25846 * Default value: false.
25848 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
25851 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
25852 * supports it, they will then enforce the mutual-close output to us matches what we provided
25853 * at intialization, preventing us from closing to an alternate pubkey.
25855 * This is set to true by default to provide a slight increase in security, though ultimately
25856 * any attacker who is able to take control of a channel can just as easily send the funds via
25857 * lightning payments, so we never require that our counterparties support this option.
25859 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
25861 * Default value: true.
25863 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
25865 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
25868 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
25869 * supports it, they will then enforce the mutual-close output to us matches what we provided
25870 * at intialization, preventing us from closing to an alternate pubkey.
25872 * This is set to true by default to provide a slight increase in security, though ultimately
25873 * any attacker who is able to take control of a channel can just as easily send the funds via
25874 * lightning payments, so we never require that our counterparties support this option.
25876 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
25878 * Default value: true.
25880 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
25882 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
25885 * The Proportion of the channel value to configure as counterparty's channel reserve,
25886 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
25888 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
25889 * on their side, at all times.
25890 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
25891 * claiming at least this value on chain.
25893 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
25894 * amount can never be used for payments.
25895 * Also, if our selected channel reserve for counterparty and counterparty's selected
25896 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
25899 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
25900 * other than the default value.
25902 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
25903 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
25904 * as 1000 sats instead, which is a safe implementation-specific lower bound.
25905 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
25906 * instead, although channel negotiations will fail in that case.
25908 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
25911 * The Proportion of the channel value to configure as counterparty's channel reserve,
25912 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
25914 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
25915 * on their side, at all times.
25916 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
25917 * claiming at least this value on chain.
25919 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
25920 * amount can never be used for payments.
25921 * Also, if our selected channel reserve for counterparty and counterparty's selected
25922 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
25925 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
25926 * other than the default value.
25928 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
25929 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
25930 * as 1000 sats instead, which is a safe implementation-specific lower bound.
25931 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
25932 * instead, although channel negotiations will fail in that case.
25934 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
25937 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
25938 * channels. This feature requires having a reserve of onchain funds readily available to bump
25939 * transactions in the event of a channel force close to avoid the possibility of losing funds.
25941 * Note that if you wish accept inbound channels with anchor outputs, you must enable
25942 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
25943 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
25944 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
25945 * channels featuring anchor outputs in the event of a force close.
25947 * If this option is set, channels may be created that will not be readable by LDK versions
25948 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
25949 * [`DecodeError::InvalidValue`].
25951 * Note that setting this to true does *not* prevent us from opening channels with
25952 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
25953 * fall back to a `static_remote_key` channel.
25955 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
25956 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
25957 * Considered Harmful`] mailing list post.
25959 * Default value: false. This value is likely to change to true in the future.
25961 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
25962 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
25963 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
25964 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
25966 bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
25969 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
25970 * channels. This feature requires having a reserve of onchain funds readily available to bump
25971 * transactions in the event of a channel force close to avoid the possibility of losing funds.
25973 * Note that if you wish accept inbound channels with anchor outputs, you must enable
25974 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
25975 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
25976 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
25977 * channels featuring anchor outputs in the event of a force close.
25979 * If this option is set, channels may be created that will not be readable by LDK versions
25980 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
25981 * [`DecodeError::InvalidValue`].
25983 * Note that setting this to true does *not* prevent us from opening channels with
25984 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
25985 * fall back to a `static_remote_key` channel.
25987 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
25988 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
25989 * Considered Harmful`] mailing list post.
25991 * Default value: false. This value is likely to change to true in the future.
25993 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
25994 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
25995 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
25996 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
25998 void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
26001 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
26003 * Increasing the value can help improve liquidity and stability in
26004 * routing at the cost of higher long term disk / DB usage.
26006 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
26007 * other than the default value.
26009 * Default value: 50
26010 * Maximum value: 483, any values larger will be treated as 483.
26011 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
26013 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
26016 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
26018 * Increasing the value can help improve liquidity and stability in
26019 * routing at the cost of higher long term disk / DB usage.
26021 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
26022 * other than the default value.
26024 * Default value: 50
26025 * Maximum value: 483, any values larger will be treated as 483.
26026 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
26028 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
26031 * Constructs a new ChannelHandshakeConfig given each field
26033 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, bool negotiate_anchors_zero_fee_htlc_tx_arg, uint16_t our_max_accepted_htlcs_arg);
26036 * Creates a copy of the ChannelHandshakeConfig
26038 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
26041 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
26043 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
26046 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
26048 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
26051 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
26052 * only applies to inbound channels.
26054 * Default value: 0.
26056 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
26059 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
26060 * only applies to inbound channels.
26062 * Default value: 0.
26064 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
26067 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
26068 * only applies to inbound channels.
26070 * Default value: 2^24 - 1.
26072 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
26075 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
26076 * only applies to inbound channels.
26078 * Default value: 2^24 - 1.
26080 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
26083 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
26084 * you to limit the maximum minimum-size they can require.
26086 * Default value: u64::max_value.
26088 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
26091 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
26092 * you to limit the maximum minimum-size they can require.
26094 * Default value: u64::max_value.
26096 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
26099 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
26100 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
26102 * Default value: 0.
26104 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
26107 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
26108 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
26110 * Default value: 0.
26112 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
26115 * The remote node will require we keep a certain amount in direct payment to ourselves at all
26116 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
26117 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
26119 * Default value: u64::max_value.
26121 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
26124 * The remote node will require we keep a certain amount in direct payment to ourselves at all
26125 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
26126 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
26128 * Default value: u64::max_value.
26130 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
26133 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
26134 * time. This allows you to set a minimum such value.
26136 * Default value: 0.
26138 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
26141 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
26142 * time. This allows you to set a minimum such value.
26144 * Default value: 0.
26146 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
26149 * Before a channel is usable the funding transaction will need to be confirmed by at least a
26150 * certain number of blocks, specified by the node which is not the funder (as the funder can
26151 * assume they aren't going to double-spend themselves).
26152 * This config allows you to set a limit on the maximum amount of time to wait.
26154 * Default value: 144, or roughly one day and only applies to outbound channels.
26156 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
26159 * Before a channel is usable the funding transaction will need to be confirmed by at least a
26160 * certain number of blocks, specified by the node which is not the funder (as the funder can
26161 * assume they aren't going to double-spend themselves).
26162 * This config allows you to set a limit on the maximum amount of time to wait.
26164 * Default value: 144, or roughly one day and only applies to outbound channels.
26166 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
26169 * Whether we implicitly trust funding transactions generated by us for our own outbound
26170 * channels to not be double-spent.
26172 * If this is set, we assume that our own funding transactions are *never* double-spent, and
26173 * thus we can trust them without any confirmations. This is generally a reasonable
26174 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
26175 * control of the signing keys).
26177 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
26178 * double-spend the funding transaction to RBF with an alternative channel open.
26180 * This only applies if our counterparty set their confirmations-required value to 0, and we
26181 * always trust our own funding transaction at 1 confirmation irrespective of this value.
26182 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
26183 * `true` (0) and `false` (1).
26185 * Default value: true
26187 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
26190 * Whether we implicitly trust funding transactions generated by us for our own outbound
26191 * channels to not be double-spent.
26193 * If this is set, we assume that our own funding transactions are *never* double-spent, and
26194 * thus we can trust them without any confirmations. This is generally a reasonable
26195 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
26196 * control of the signing keys).
26198 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
26199 * double-spend the funding transaction to RBF with an alternative channel open.
26201 * This only applies if our counterparty set their confirmations-required value to 0, and we
26202 * always trust our own funding transaction at 1 confirmation irrespective of this value.
26203 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
26204 * `true` (0) and `false` (1).
26206 * Default value: true
26208 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
26211 * Set to force an incoming channel to match our announced channel preference in
26212 * [`ChannelHandshakeConfig::announced_channel`].
26214 * For a node which is not online reliably, this should be set to true and
26215 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
26216 * channels will ever be opened.
26218 * Default value: true.
26220 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
26223 * Set to force an incoming channel to match our announced channel preference in
26224 * [`ChannelHandshakeConfig::announced_channel`].
26226 * For a node which is not online reliably, this should be set to true and
26227 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
26228 * channels will ever be opened.
26230 * Default value: true.
26232 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
26235 * Set to the amount of time we're willing to wait to claim money back to us.
26237 * Not checking this value would be a security issue, as our peer would be able to set it to
26238 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
26240 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
26241 * reduce the loss of having useless locked funds (if your peer accepts)
26243 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
26246 * Set to the amount of time we're willing to wait to claim money back to us.
26248 * Not checking this value would be a security issue, as our peer would be able to set it to
26249 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
26251 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
26252 * reduce the loss of having useless locked funds (if your peer accepts)
26254 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
26257 * Constructs a new ChannelHandshakeLimits given each field
26259 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);
26262 * Creates a copy of the ChannelHandshakeLimits
26264 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
26267 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
26269 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
26272 * Frees any resources used by the MaxDustHTLCExposure
26274 void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr);
26277 * Creates a copy of the MaxDustHTLCExposure
26279 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig);
26282 * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure
26284 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a);
26287 * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure
26289 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a);
26292 * Checks if two MaxDustHTLCExposures contain equal inner contents.
26293 * This ignores pointers and is_owned flags and looks at the values in fields.
26295 bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b);
26298 * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read
26300 struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj);
26303 * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write
26305 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser);
26308 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
26310 void ChannelConfig_free(struct LDKChannelConfig this_obj);
26313 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
26314 * over the channel.
26315 * This may be allowed to change at runtime in a later update, however doing so must result in
26316 * update messages sent to notify all nodes of our updated relay fee.
26318 * Default value: 0.
26320 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
26323 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
26324 * over the channel.
26325 * This may be allowed to change at runtime in a later update, however doing so must result in
26326 * update messages sent to notify all nodes of our updated relay fee.
26328 * Default value: 0.
26330 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
26333 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
26334 * excess of [`forwarding_fee_proportional_millionths`].
26335 * This may be allowed to change at runtime in a later update, however doing so must result in
26336 * update messages sent to notify all nodes of our updated relay fee.
26338 * The default value of a single satoshi roughly matches the market rate on many routing nodes
26339 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
26342 * Default value: 1000.
26344 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
26346 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
26349 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
26350 * excess of [`forwarding_fee_proportional_millionths`].
26351 * This may be allowed to change at runtime in a later update, however doing so must result in
26352 * update messages sent to notify all nodes of our updated relay fee.
26354 * The default value of a single satoshi roughly matches the market rate on many routing nodes
26355 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
26358 * Default value: 1000.
26360 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
26362 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
26365 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
26366 * the channel this config applies to.
26368 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
26369 * HTLC balance when a channel appears on-chain whereas
26370 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
26371 * (non-HTLC-encumbered) balance.
26373 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
26374 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
26375 * commitment transaction at least once per this many blocks (minus some margin to allow us
26376 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
26377 * the spending transaction).
26379 * Default value: 72 (12 hours at an average of 6 blocks/hour).
26380 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
26381 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
26383 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
26385 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
26388 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
26389 * the channel this config applies to.
26391 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
26392 * HTLC balance when a channel appears on-chain whereas
26393 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
26394 * (non-HTLC-encumbered) balance.
26396 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
26397 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
26398 * commitment transaction at least once per this many blocks (minus some margin to allow us
26399 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
26400 * the spending transaction).
26402 * Default value: 72 (12 hours at an average of 6 blocks/hour).
26403 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
26404 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
26406 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
26408 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
26411 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
26412 * small to claim on-chain.
26414 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
26415 * not be claimable on-chain, instead being turned into additional miner fees if either
26416 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
26417 * to such payments may be sustantial if there are many dust HTLCs present when the
26418 * channel is force-closed.
26420 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
26421 * channel negotiated throughout the channel open process, along with the fees required to have
26422 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
26423 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
26424 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
26425 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
26426 * variant is primarily intended for use with pre-anchor channels.
26428 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
26429 * exposure across all three types per-channel.
26431 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
26433 struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
26436 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
26437 * small to claim on-chain.
26439 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
26440 * not be claimable on-chain, instead being turned into additional miner fees if either
26441 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
26442 * to such payments may be sustantial if there are many dust HTLCs present when the
26443 * channel is force-closed.
26445 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
26446 * channel negotiated throughout the channel open process, along with the fees required to have
26447 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
26448 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
26449 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
26450 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
26451 * variant is primarily intended for use with pre-anchor channels.
26453 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
26454 * exposure across all three types per-channel.
26456 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
26458 void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
26461 * The additional fee we're willing to pay to avoid waiting for the counterparty's
26462 * `to_self_delay` to reclaim funds.
26464 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
26465 * closing transaction which both sides find acceptable, ultimately paid by the channel
26466 * funder/initiator.
26468 * When we are the funder, because we have to pay the channel closing fee, we bound the
26469 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
26470 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
26471 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
26472 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
26475 * When we are not the funder, we require the closing transaction fee pay at least our
26476 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
26477 * Thus, this value is ignored when we are not the funder.
26479 * Default value: 1000 satoshis.
26481 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
26482 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
26484 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
26487 * The additional fee we're willing to pay to avoid waiting for the counterparty's
26488 * `to_self_delay` to reclaim funds.
26490 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
26491 * closing transaction which both sides find acceptable, ultimately paid by the channel
26492 * funder/initiator.
26494 * When we are the funder, because we have to pay the channel closing fee, we bound the
26495 * acceptable fee by our [`Background`] and [`Normal`] fees, with the upper bound increased by
26496 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
26497 * [`Normal`] feerate during normal operation, this value represents the additional fee we're
26498 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
26501 * When we are not the funder, we require the closing transaction fee pay at least our
26502 * [`Background`] fee estimate, but allow our counterparty to pay as much fee as they like.
26503 * Thus, this value is ignored when we are not the funder.
26505 * Default value: 1000 satoshis.
26507 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
26508 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
26510 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
26513 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
26514 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
26517 * - The payee will set this option and set its invoice route hints to use [intercept scids]
26518 * generated by this channel's counterparty.
26519 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
26520 * [`forward_intercepted_htlc`] with less than the amount provided in
26521 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
26522 * actual forward amounts is their fee.
26525 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
26526 * as-expected if this feature is activated, otherwise they may lose money!
26527 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
26531 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
26532 * Unsetting this flag between restarts may lead to payment receive failures.
26534 * Default value: false.
26536 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
26537 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
26538 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
26539 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
26540 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
26541 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
26543 bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
26546 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
26547 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
26550 * - The payee will set this option and set its invoice route hints to use [intercept scids]
26551 * generated by this channel's counterparty.
26552 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
26553 * [`forward_intercepted_htlc`] with less than the amount provided in
26554 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
26555 * actual forward amounts is their fee.
26558 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
26559 * as-expected if this feature is activated, otherwise they may lose money!
26560 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
26564 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
26565 * Unsetting this flag between restarts may lead to payment receive failures.
26567 * Default value: false.
26569 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
26570 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
26571 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
26572 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
26573 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
26574 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
26576 void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
26579 * Constructs a new ChannelConfig given each field
26581 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, struct LDKMaxDustHTLCExposure max_dust_htlc_exposure_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg, bool accept_underpaying_htlcs_arg);
26584 * Creates a copy of the ChannelConfig
26586 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
26589 * Checks if two ChannelConfigs contain equal inner contents.
26590 * This ignores pointers and is_owned flags and looks at the values in fields.
26591 * Two objects with NULL inner values will be considered "equal" here.
26593 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
26596 * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
26598 void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update);
26601 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
26603 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
26606 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
26608 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
26611 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
26613 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
26616 * Frees any resources used by the ChannelConfigUpdate, if is_owned is set and inner is non-NULL.
26618 void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj);
26620 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
26622 void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
26624 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
26626 void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
26628 struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
26630 void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
26634 * Returns a copy of the field.
26636 struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
26638 void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val);
26640 struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
26642 void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
26645 * Constructs a new ChannelConfigUpdate given each field
26647 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_new(struct LDKCOption_u32Z forwarding_fee_proportional_millionths_arg, struct LDKCOption_u32Z forwarding_fee_base_msat_arg, struct LDKCOption_u16Z cltv_expiry_delta_arg, struct LDKCOption_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg, struct LDKCOption_u64Z force_close_avoidance_max_fee_satoshis_arg);
26650 * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
26652 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void);
26655 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
26657 void UserConfig_free(struct LDKUserConfig this_obj);
26660 * Channel handshake config that we propose to our counterparty.
26662 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
26665 * Channel handshake config that we propose to our counterparty.
26667 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
26670 * Limits applied to our counterparty's proposed channel handshake config settings.
26672 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
26675 * Limits applied to our counterparty's proposed channel handshake config settings.
26677 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
26680 * Channel config which affects behavior during channel lifetime.
26682 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
26685 * Channel config which affects behavior during channel lifetime.
26687 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
26690 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
26691 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
26692 * node which is not online reliably.
26694 * For nodes which are not online reliably, you should set all channels to *not* be announced
26695 * (using [`ChannelHandshakeConfig::announced_channel`] and
26696 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
26697 * ensure you are not exposed to any forwarding risk.
26699 * Note that because you cannot change a channel's announced state after creation, there is no
26700 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
26701 * from a publicly-announced forwarding node to a private non-forwarding node you must close
26702 * all your channels and open new ones. For privacy, you should also change your node_id
26703 * (swapping all private and public key material for new ones) at that time.
26705 * Default value: false.
26707 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
26710 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
26711 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
26712 * node which is not online reliably.
26714 * For nodes which are not online reliably, you should set all channels to *not* be announced
26715 * (using [`ChannelHandshakeConfig::announced_channel`] and
26716 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
26717 * ensure you are not exposed to any forwarding risk.
26719 * Note that because you cannot change a channel's announced state after creation, there is no
26720 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
26721 * from a publicly-announced forwarding node to a private non-forwarding node you must close
26722 * all your channels and open new ones. For privacy, you should also change your node_id
26723 * (swapping all private and public key material for new ones) at that time.
26725 * Default value: false.
26727 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
26730 * If this is set to false, we do not accept inbound requests to open a new channel.
26731 * Default value: true.
26733 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
26736 * If this is set to false, we do not accept inbound requests to open a new channel.
26737 * Default value: true.
26739 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
26742 * If this is set to true, the user needs to manually accept inbound requests to open a new
26745 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
26746 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
26747 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
26748 * user explicitly chooses to accept the request.
26750 * Default value: false.
26752 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
26753 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
26754 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
26756 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
26759 * If this is set to true, the user needs to manually accept inbound requests to open a new
26762 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
26763 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
26764 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
26765 * user explicitly chooses to accept the request.
26767 * Default value: false.
26769 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
26770 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
26771 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
26773 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
26776 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
26777 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
26778 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
26780 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
26782 * Default value: false.
26784 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
26785 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
26787 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
26790 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
26791 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
26792 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
26794 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
26796 * Default value: false.
26798 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
26799 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
26801 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
26804 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
26805 * parts. If this is set to true, we'll accept the payment.
26807 * Setting this to true will break backwards compatibility upon downgrading to an LDK
26808 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
26809 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
26811 * Default value: false.
26813 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
26815 bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
26818 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
26819 * parts. If this is set to true, we'll accept the payment.
26821 * Setting this to true will break backwards compatibility upon downgrading to an LDK
26822 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
26823 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
26825 * Default value: false.
26827 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
26829 void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
26832 * Constructs a new UserConfig given each field
26834 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, bool accept_mpp_keysend_arg);
26837 * Creates a copy of the UserConfig
26839 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
26842 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
26844 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
26847 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
26849 void BestBlock_free(struct LDKBestBlock this_obj);
26852 * Creates a copy of the BestBlock
26854 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
26857 * Checks if two BestBlocks contain equal inner contents.
26858 * This ignores pointers and is_owned flags and looks at the values in fields.
26859 * Two objects with NULL inner values will be considered "equal" here.
26861 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
26864 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
26867 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
26870 * Returns a `BestBlock` as identified by the given block hash and height.
26872 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
26875 * Returns the best block hash.
26877 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
26880 * Returns the best block height.
26882 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
26885 * Calls the free function if one is set
26887 void Listen_free(struct LDKListen this_ptr);
26890 * Calls the free function if one is set
26892 void Confirm_free(struct LDKConfirm this_ptr);
26895 * Creates a copy of the ChannelMonitorUpdateStatus
26897 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
26900 * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
26902 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
26905 * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
26907 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
26910 * Utility method to constructs a new PermanentFailure-variant ChannelMonitorUpdateStatus
26912 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_permanent_failure(void);
26915 * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
26916 * This ignores pointers and is_owned flags and looks at the values in fields.
26918 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
26921 * Calls the free function if one is set
26923 void Watch_free(struct LDKWatch this_ptr);
26926 * Calls the free function if one is set
26928 void Filter_free(struct LDKFilter this_ptr);
26931 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
26933 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
26936 * First block where the transaction output may have been spent.
26938 struct LDKCOption_BlockHashZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
26941 * First block where the transaction output may have been spent.
26943 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_BlockHashZ val);
26946 * Outpoint identifying the transaction output.
26948 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
26951 * Outpoint identifying the transaction output.
26953 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
26956 * Spending condition of the transaction output.
26958 struct LDKu8slice WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
26961 * Spending condition of the transaction output.
26963 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
26966 * Constructs a new WatchedOutput given each field
26968 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_BlockHashZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
26971 * Creates a copy of the WatchedOutput
26973 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
26976 * Checks if two WatchedOutputs contain equal inner contents.
26977 * This ignores pointers and is_owned flags and looks at the values in fields.
26978 * Two objects with NULL inner values will be considered "equal" here.
26980 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
26983 * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
26985 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
26988 * Calls the free function if one is set
26990 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
26993 * Creates a copy of the ConfirmationTarget
26995 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
26998 * Utility method to constructs a new MempoolMinimum-variant ConfirmationTarget
27000 enum LDKConfirmationTarget ConfirmationTarget_mempool_minimum(void);
27003 * Utility method to constructs a new Background-variant ConfirmationTarget
27005 enum LDKConfirmationTarget ConfirmationTarget_background(void);
27008 * Utility method to constructs a new Normal-variant ConfirmationTarget
27010 enum LDKConfirmationTarget ConfirmationTarget_normal(void);
27013 * Utility method to constructs a new HighPriority-variant ConfirmationTarget
27015 enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
27018 * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
27020 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
27023 * Checks if two ConfirmationTargets contain equal inner contents.
27024 * This ignores pointers and is_owned flags and looks at the values in fields.
27026 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
27029 * Calls the free function if one is set
27031 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
27034 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
27036 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
27039 * Creates a copy of the MonitorUpdateId
27041 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
27044 * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
27046 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
27049 * Checks if two MonitorUpdateIds contain equal inner contents.
27050 * This ignores pointers and is_owned flags and looks at the values in fields.
27051 * Two objects with NULL inner values will be considered "equal" here.
27053 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
27056 * Calls the free function if one is set
27058 void Persist_free(struct LDKPersist this_ptr);
27061 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
27063 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
27066 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
27068 void ChainMonitor_free(struct LDKChainMonitor this_obj);
27071 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
27073 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
27074 * will call back to it indicating transactions and outputs of interest. This allows clients to
27075 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
27076 * always need to fetch full blocks absent another means for determining which blocks contain
27077 * transactions relevant to the watched channels.
27079 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
27082 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
27083 * claims which are awaiting confirmation.
27085 * Includes the balances from each [`ChannelMonitor`] *except* those included in
27086 * `ignored_channels`, allowing you to filter out balances from channels which are still open
27087 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
27089 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
27090 * inclusion in the return value.
27092 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
27095 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
27096 * such [`ChannelMonitor`] is currently being monitored for.
27098 * Note that the result holds a mutex over our monitor set, and should not be held
27101 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
27104 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
27106 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
27107 * monitoring for on-chain state resolutions.
27109 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
27112 * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
27114 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
27117 * Indicates the persistence of a [`ChannelMonitor`] has completed after
27118 * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
27120 * Thus, the anticipated use is, at a high level:
27121 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
27122 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
27123 * returning [`ChannelMonitorUpdateStatus::InProgress`],
27124 * 2) once all remote copies are updated, you call this function with the
27125 * `completed_update_id` that completed, and once all pending updates have completed the
27126 * channel will be re-enabled.
27128 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
27129 * registered [`ChannelMonitor`]s.
27131 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);
27134 * Gets a [`Future`] that completes when an event is available either via
27135 * [`chain::Watch::release_pending_monitor_events`] or
27136 * [`EventsProvider::process_pending_events`].
27138 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
27139 * [`ChainMonitor`] and should instead register actions to be taken later.
27141 * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
27143 MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
27146 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
27147 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
27148 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
27149 * invoking this every 30 seconds, or lower if running in an environment with spotty
27150 * connections, like on mobile.
27152 void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
27155 * Constructs a new Listen which calls the relevant methods on this_arg.
27156 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
27158 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
27161 * Constructs a new Confirm which calls the relevant methods on this_arg.
27162 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
27164 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
27167 * Constructs a new Watch which calls the relevant methods on this_arg.
27168 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
27170 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
27173 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
27174 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
27176 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
27179 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
27181 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
27184 * The sequence number of this update. Updates *must* be replayed in-order according to this
27185 * sequence number (and updates may panic if they are not). The update_id values are strictly
27186 * increasing and increase by one for each new update, with two exceptions specified below.
27188 * This sequence number is also used to track up to which points updates which returned
27189 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
27190 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
27192 * The only instances we allow where update_id values are not strictly increasing have a
27193 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
27194 * will force close the channel by broadcasting the latest commitment transaction or
27195 * special post-force-close updates, like providing preimages necessary to claim outputs on the
27196 * broadcast commitment transaction. See its docs for more details.
27198 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
27200 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
27203 * The sequence number of this update. Updates *must* be replayed in-order according to this
27204 * sequence number (and updates may panic if they are not). The update_id values are strictly
27205 * increasing and increase by one for each new update, with two exceptions specified below.
27207 * This sequence number is also used to track up to which points updates which returned
27208 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
27209 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
27211 * The only instances we allow where update_id values are not strictly increasing have a
27212 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
27213 * will force close the channel by broadcasting the latest commitment transaction or
27214 * special post-force-close updates, like providing preimages necessary to claim outputs on the
27215 * broadcast commitment transaction. See its docs for more details.
27217 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
27219 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
27222 * Creates a copy of the ChannelMonitorUpdate
27224 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
27227 * Checks if two ChannelMonitorUpdates contain equal inner contents.
27228 * This ignores pointers and is_owned flags and looks at the values in fields.
27229 * Two objects with NULL inner values will be considered "equal" here.
27231 bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
27234 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
27236 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
27239 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
27241 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
27244 * Frees any resources used by the MonitorEvent
27246 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
27249 * Creates a copy of the MonitorEvent
27251 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
27254 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
27256 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
27259 * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent
27261 struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
27264 * Utility method to constructs a new Completed-variant MonitorEvent
27266 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
27269 * Utility method to constructs a new UpdateFailed-variant MonitorEvent
27271 struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
27274 * Checks if two MonitorEvents contain equal inner contents.
27275 * This ignores pointers and is_owned flags and looks at the values in fields.
27277 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
27280 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
27282 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
27285 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
27287 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
27290 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
27292 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
27295 * Creates a copy of the HTLCUpdate
27297 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
27300 * Checks if two HTLCUpdates contain equal inner contents.
27301 * This ignores pointers and is_owned flags and looks at the values in fields.
27302 * Two objects with NULL inner values will be considered "equal" here.
27304 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
27307 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
27309 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
27312 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
27314 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
27317 * Frees any resources used by the Balance
27319 void Balance_free(struct LDKBalance this_ptr);
27322 * Creates a copy of the Balance
27324 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
27327 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
27329 struct LDKBalance Balance_claimable_on_channel_close(uint64_t claimable_amount_satoshis);
27332 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
27334 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t claimable_amount_satoshis, uint32_t confirmation_height);
27337 * Utility method to constructs a new ContentiousClaimable-variant Balance
27339 struct LDKBalance Balance_contentious_claimable(uint64_t claimable_amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage);
27342 * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
27344 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash);
27347 * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
27349 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t claimable_amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash);
27352 * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
27354 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t claimable_amount_satoshis);
27357 * Checks if two Balances contain equal inner contents.
27358 * This ignores pointers and is_owned flags and looks at the values in fields.
27360 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
27363 * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able
27364 * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more
27365 * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
27366 * [`Balance::MaybePreimageClaimableHTLC`].
27368 * On-chain fees required to claim the balance are not included in this amount.
27370 MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg);
27373 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
27375 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
27378 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
27380 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
27383 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
27386 * panics if the given update is not the next update by update_id.
27388 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);
27391 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
27394 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
27397 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
27399 MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
27402 * Gets a list of txids, with their output scripts (in the order they appear in the
27403 * transaction), which we must learn about spends of via block_connected().
27405 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
27408 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
27409 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
27410 * have been registered.
27412 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter);
27415 * Get the list of HTLCs who's status has been updated on chain. This should be called by
27416 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
27418 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
27421 * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
27423 * For channels featuring anchor outputs, this method will also process [`BumpTransaction`]
27424 * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain
27425 * within each channel. As the confirmation of a commitment transaction may be critical to the
27426 * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an
27427 * environment with spotty connections, like on mobile.
27429 * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
27430 * order to handle these events.
27432 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
27433 * [`BumpTransaction`]: crate::events::Event::BumpTransaction
27435 void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
27438 * Gets the `node_id` of the counterparty for this channel.
27440 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
27443 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27445 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
27448 * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
27449 * the Channel was out-of-date.
27451 * You may also use this to broadcast the latest local commitment transaction, either because
27452 * a monitor update failed with [`ChannelMonitorUpdateStatus::PermanentFailure`] or because we've
27453 * fallen behind (i.e. we've received proof that our counterparty side knows a revocation
27454 * secret we gave them that they shouldn't know).
27456 * Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty
27457 * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
27458 * close channel with their commitment transaction after a substantial amount of time. Best
27459 * may be to contact the other node operator out-of-band to coordinate other options available
27460 * to you. In any-case, the choice is up to you.
27462 * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
27464 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);
27467 * Processes transactions in a newly connected block, which may result in any of the following:
27468 * - update the monitor's state against resolved HTLCs
27469 * - punish the counterparty in the case of seeing a revoked commitment transaction
27470 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
27471 * - detect settled outputs for later spending
27472 * - schedule and bump any in-flight claims
27474 * Returns any new outputs to watch from `txdata`; after called, these are also included in
27475 * [`get_outputs_to_watch`].
27477 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
27479 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);
27482 * Determines if the disconnected block contained any transactions of interest and updates
27485 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);
27488 * Processes transactions confirmed in a block with the given header and height, returning new
27489 * outputs to watch. See [`block_connected`] for details.
27491 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
27492 * blocks. See [`chain::Confirm`] for calling expectations.
27494 * [`block_connected`]: Self::block_connected
27496 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);
27499 * Processes a transaction that was reorganized out of the chain.
27501 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
27502 * than blocks. See [`chain::Confirm`] for calling expectations.
27504 * [`block_disconnected`]: Self::block_disconnected
27506 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);
27509 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
27510 * [`block_connected`] for details.
27512 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
27513 * blocks. See [`chain::Confirm`] for calling expectations.
27515 * [`block_connected`]: Self::block_connected
27517 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);
27520 * Returns the set of txids that should be monitored for re-organization out of the chain.
27522 MUST_USE_RES struct LDKCVec_C2Tuple_TxidCOption_BlockHashZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
27525 * Gets the latest best block which was connected either via the [`chain::Listen`] or
27526 * [`chain::Confirm`] interfaces.
27528 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
27531 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
27532 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
27533 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
27534 * invoking this every 30 seconds, or lower if running in an environment with spotty
27535 * connections, like on mobile.
27537 void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger);
27540 * Gets the balances in this channel which are either claimable by us if we were to
27541 * force-close the channel now or which are claimable on-chain (possibly awaiting
27544 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
27545 * included here until an [`Event::SpendableOutputs`] event has been generated for the
27546 * balance, or until our counterparty has claimed the balance and accrued several
27547 * confirmations on the claim transaction.
27549 * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
27550 * LDK prior to 0.0.111, balances may not be fully captured if our counterparty broadcasted
27553 * See [`Balance`] for additional details on the types of claimable balances which
27554 * may be returned here and their meanings.
27556 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
27559 * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
27561 struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
27564 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
27566 void OutPoint_free(struct LDKOutPoint this_obj);
27569 * The referenced transaction's txid.
27571 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
27574 * The referenced transaction's txid.
27576 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27579 * The index of the referenced output in its transaction's vout.
27581 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
27584 * The index of the referenced output in its transaction's vout.
27586 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
27589 * Constructs a new OutPoint given each field
27591 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
27594 * Creates a copy of the OutPoint
27596 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
27599 * Checks if two OutPoints contain equal inner contents.
27600 * This ignores pointers and is_owned flags and looks at the values in fields.
27601 * Two objects with NULL inner values will be considered "equal" here.
27603 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
27606 * Generates a non-cryptographic 64-bit hash of the OutPoint.
27608 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
27611 * Convert an `OutPoint` to a lightning channel id.
27613 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
27616 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
27618 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
27621 * Read a OutPoint from a byte array, created by OutPoint_write
27623 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
27626 * Creates a copy of the FailureCode
27628 enum LDKFailureCode FailureCode_clone(const enum LDKFailureCode *NONNULL_PTR orig);
27631 * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
27633 enum LDKFailureCode FailureCode_temporary_node_failure(void);
27636 * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
27638 enum LDKFailureCode FailureCode_required_node_feature_missing(void);
27641 * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
27643 enum LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
27646 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
27648 void ChannelManager_free(struct LDKChannelManager this_obj);
27651 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
27653 void ChainParameters_free(struct LDKChainParameters this_obj);
27656 * The network for determining the `chain_hash` in Lightning messages.
27658 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
27661 * The network for determining the `chain_hash` in Lightning messages.
27663 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
27666 * The hash and height of the latest block successfully connected.
27668 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
27670 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
27673 * The hash and height of the latest block successfully connected.
27675 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
27677 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
27680 * Constructs a new ChainParameters given each field
27682 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
27685 * Creates a copy of the ChainParameters
27687 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
27690 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
27692 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
27695 * Base routing fee in millisatoshis.
27697 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
27700 * Base routing fee in millisatoshis.
27702 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
27705 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
27707 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
27710 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
27712 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
27715 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
27716 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
27717 * `cltv_expiry_delta` for more details.
27719 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
27722 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
27723 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
27724 * `cltv_expiry_delta` for more details.
27726 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
27729 * Constructs a new CounterpartyForwardingInfo given each field
27731 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);
27734 * Creates a copy of the CounterpartyForwardingInfo
27736 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
27739 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
27741 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
27744 * The node_id of our counterparty
27746 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
27749 * The node_id of our counterparty
27751 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
27754 * The Features the channel counterparty provided upon last connection.
27755 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
27756 * many routing-relevant features are present in the init context.
27758 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
27761 * The Features the channel counterparty provided upon last connection.
27762 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
27763 * many routing-relevant features are present in the init context.
27765 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
27768 * The value, in satoshis, that must always be held in the channel for our counterparty. This
27769 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
27770 * claiming at least this value on chain.
27772 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
27774 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
27776 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
27779 * The value, in satoshis, that must always be held in the channel for our counterparty. This
27780 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
27781 * claiming at least this value on chain.
27783 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
27785 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
27787 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
27790 * Information on the fees and requirements that the counterparty requires when forwarding
27791 * payments to us through this channel.
27793 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27795 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
27798 * Information on the fees and requirements that the counterparty requires when forwarding
27799 * payments to us through this channel.
27801 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27803 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
27806 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
27807 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
27808 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
27810 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
27813 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
27814 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
27815 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
27817 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27820 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
27822 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
27825 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
27827 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27830 * Constructs a new ChannelCounterparty given each field
27832 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);
27835 * Creates a copy of the ChannelCounterparty
27837 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
27840 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
27842 void ChannelDetails_free(struct LDKChannelDetails this_obj);
27845 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
27846 * thereafter this is the txid of the funding transaction xor the funding transaction output).
27847 * Note that this means this value is *not* persistent - it can change once during the
27848 * lifetime of the channel.
27850 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
27853 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
27854 * thereafter this is the txid of the funding transaction xor the funding transaction output).
27855 * Note that this means this value is *not* persistent - it can change once during the
27856 * lifetime of the channel.
27858 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
27861 * Parameters which apply to our counterparty. See individual fields for more information.
27863 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
27866 * Parameters which apply to our counterparty. See individual fields for more information.
27868 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
27871 * The Channel's funding transaction output, if we've negotiated the funding transaction with
27872 * our counterparty already.
27874 * Note that, if this has been set, `channel_id` will be equivalent to
27875 * `funding_txo.unwrap().to_channel_id()`.
27877 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27879 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
27882 * The Channel's funding transaction output, if we've negotiated the funding transaction with
27883 * our counterparty already.
27885 * Note that, if this has been set, `channel_id` will be equivalent to
27886 * `funding_txo.unwrap().to_channel_id()`.
27888 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27890 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
27893 * The features which this channel operates with. See individual features for more info.
27895 * `None` until negotiation completes and the channel type is finalized.
27897 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
27899 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
27902 * The features which this channel operates with. See individual features for more info.
27904 * `None` until negotiation completes and the channel type is finalized.
27906 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
27908 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
27911 * The position of the funding transaction in the chain. None if the funding transaction has
27912 * not yet been confirmed and the channel fully opened.
27914 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
27915 * payments instead of this. See [`get_inbound_payment_scid`].
27917 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
27918 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
27920 * [`inbound_scid_alias`]: Self::inbound_scid_alias
27921 * [`outbound_scid_alias`]: Self::outbound_scid_alias
27922 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
27923 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
27924 * [`confirmations_required`]: Self::confirmations_required
27926 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
27929 * The position of the funding transaction in the chain. None if the funding transaction has
27930 * not yet been confirmed and the channel fully opened.
27932 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
27933 * payments instead of this. See [`get_inbound_payment_scid`].
27935 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
27936 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
27938 * [`inbound_scid_alias`]: Self::inbound_scid_alias
27939 * [`outbound_scid_alias`]: Self::outbound_scid_alias
27940 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
27941 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
27942 * [`confirmations_required`]: Self::confirmations_required
27944 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27947 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
27948 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
27949 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
27952 * This will be `None` as long as the channel is not available for routing outbound payments.
27954 * [`short_channel_id`]: Self::short_channel_id
27955 * [`confirmations_required`]: Self::confirmations_required
27957 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
27960 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
27961 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
27962 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
27965 * This will be `None` as long as the channel is not available for routing outbound payments.
27967 * [`short_channel_id`]: Self::short_channel_id
27968 * [`confirmations_required`]: Self::confirmations_required
27970 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27973 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
27974 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
27975 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
27976 * when they see a payment to be routed to us.
27978 * Our counterparty may choose to rotate this value at any time, though will always recognize
27979 * previous values for inbound payment forwarding.
27981 * [`short_channel_id`]: Self::short_channel_id
27983 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
27986 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
27987 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
27988 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
27989 * when they see a payment to be routed to us.
27991 * Our counterparty may choose to rotate this value at any time, though will always recognize
27992 * previous values for inbound payment forwarding.
27994 * [`short_channel_id`]: Self::short_channel_id
27996 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
27999 * The value, in satoshis, of this channel as appears in the funding output
28001 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28004 * The value, in satoshis, of this channel as appears in the funding output
28006 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
28009 * The value, in satoshis, that must always be held in the channel for us. This value ensures
28010 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
28011 * this value on chain.
28013 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
28015 * This value will be `None` for outbound channels until the counterparty accepts the channel.
28017 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
28019 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28022 * The value, in satoshis, that must always be held in the channel for us. This value ensures
28023 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
28024 * this value on chain.
28026 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
28028 * This value will be `None` for outbound channels until the counterparty accepts the channel.
28030 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
28032 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
28035 * The `user_channel_id` passed in to create_channel, or a random value if the channel was
28036 * inbound. This may be zero for inbound channels serialized with LDK versions prior to
28039 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28042 * The `user_channel_id` passed in to create_channel, or a random value if the channel was
28043 * inbound. This may be zero for inbound channels serialized with LDK versions prior to
28046 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
28049 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
28050 * which is applied to commitment and HTLC transactions.
28052 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
28054 struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28057 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
28058 * which is applied to commitment and HTLC transactions.
28060 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
28062 void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
28065 * Our total balance. This is the amount we would get if we close the channel.
28066 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
28067 * amount is not likely to be recoverable on close.
28069 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
28070 * balance is not available for inclusion in new outbound HTLCs). This further does not include
28071 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
28072 * This does not consider any on-chain fees.
28074 * See also [`ChannelDetails::outbound_capacity_msat`]
28076 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28079 * Our total balance. This is the amount we would get if we close the channel.
28080 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
28081 * amount is not likely to be recoverable on close.
28083 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
28084 * balance is not available for inclusion in new outbound HTLCs). This further does not include
28085 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
28086 * This does not consider any on-chain fees.
28088 * See also [`ChannelDetails::outbound_capacity_msat`]
28090 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
28093 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
28094 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
28095 * available for inclusion in new outbound HTLCs). This further does not include any pending
28096 * outgoing HTLCs which are awaiting some other resolution to be sent.
28098 * See also [`ChannelDetails::balance_msat`]
28100 * This value is not exact. Due to various in-flight changes, feerate changes, and our
28101 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
28102 * should be able to spend nearly this amount.
28104 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28107 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
28108 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
28109 * available for inclusion in new outbound HTLCs). This further does not include any pending
28110 * outgoing HTLCs which are awaiting some other resolution to be sent.
28112 * See also [`ChannelDetails::balance_msat`]
28114 * This value is not exact. Due to various in-flight changes, feerate changes, and our
28115 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
28116 * should be able to spend nearly this amount.
28118 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
28121 * The available outbound capacity for sending a single HTLC to the remote peer. This is
28122 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
28123 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
28124 * to use a limit as close as possible to the HTLC limit we can currently send.
28126 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
28127 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
28129 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28132 * The available outbound capacity for sending a single HTLC to the remote peer. This is
28133 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
28134 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
28135 * to use a limit as close as possible to the HTLC limit we can currently send.
28137 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
28138 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
28140 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
28143 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
28144 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
28145 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
28146 * route which is valid.
28148 uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28151 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
28152 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
28153 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
28154 * route which is valid.
28156 void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
28159 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
28160 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
28161 * available for inclusion in new inbound HTLCs).
28162 * Note that there are some corner cases not fully handled here, so the actual available
28163 * inbound capacity may be slightly higher than this.
28165 * This value is not exact. Due to various in-flight changes, feerate changes, and our
28166 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
28167 * However, our counterparty should be able to spend nearly this amount.
28169 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28172 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
28173 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
28174 * available for inclusion in new inbound HTLCs).
28175 * Note that there are some corner cases not fully handled here, so the actual available
28176 * inbound capacity may be slightly higher than this.
28178 * This value is not exact. Due to various in-flight changes, feerate changes, and our
28179 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
28180 * However, our counterparty should be able to spend nearly this amount.
28182 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
28185 * The number of required confirmations on the funding transaction before the funding will be
28186 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
28187 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
28188 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
28189 * [`ChannelHandshakeLimits::max_minimum_depth`].
28191 * This value will be `None` for outbound channels until the counterparty accepts the channel.
28193 * [`is_outbound`]: ChannelDetails::is_outbound
28194 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
28195 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
28197 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28200 * The number of required confirmations on the funding transaction before the funding will be
28201 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
28202 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
28203 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
28204 * [`ChannelHandshakeLimits::max_minimum_depth`].
28206 * This value will be `None` for outbound channels until the counterparty accepts the channel.
28208 * [`is_outbound`]: ChannelDetails::is_outbound
28209 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
28210 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
28212 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
28215 * The current number of confirmations on the funding transaction.
28217 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
28219 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28222 * The current number of confirmations on the funding transaction.
28224 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
28226 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
28229 * The number of blocks (after our commitment transaction confirms) that we will need to wait
28230 * until we can claim our funds after we force-close the channel. During this time our
28231 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
28232 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
28233 * time to claim our non-HTLC-encumbered funds.
28235 * This value will be `None` for outbound channels until the counterparty accepts the channel.
28237 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28240 * The number of blocks (after our commitment transaction confirms) that we will need to wait
28241 * until we can claim our funds after we force-close the channel. During this time our
28242 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
28243 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
28244 * time to claim our non-HTLC-encumbered funds.
28246 * This value will be `None` for outbound channels until the counterparty accepts the channel.
28248 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
28251 * True if the channel was initiated (and thus funded) by us.
28253 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28256 * True if the channel was initiated (and thus funded) by us.
28258 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
28261 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
28262 * channel is not currently being shut down. `channel_ready` message exchange implies the
28263 * required confirmation count has been reached (and we were connected to the peer at some
28264 * point after the funding transaction received enough confirmations). The required
28265 * confirmation count is provided in [`confirmations_required`].
28267 * [`confirmations_required`]: ChannelDetails::confirmations_required
28269 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28272 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
28273 * channel is not currently being shut down. `channel_ready` message exchange implies the
28274 * required confirmation count has been reached (and we were connected to the peer at some
28275 * point after the funding transaction received enough confirmations). The required
28276 * confirmation count is provided in [`confirmations_required`].
28278 * [`confirmations_required`]: ChannelDetails::confirmations_required
28280 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
28283 * The stage of the channel's shutdown.
28284 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
28286 * Returns a copy of the field.
28288 struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28291 * The stage of the channel's shutdown.
28292 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
28294 void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
28297 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
28298 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
28300 * This is a strict superset of `is_channel_ready`.
28302 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28305 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
28306 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
28308 * This is a strict superset of `is_channel_ready`.
28310 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
28313 * True if this channel is (or will be) publicly-announced.
28315 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28318 * True if this channel is (or will be) publicly-announced.
28320 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
28323 * The smallest value HTLC (in msat) we will accept, for this channel. This field
28324 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
28326 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28329 * The smallest value HTLC (in msat) we will accept, for this channel. This field
28330 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
28332 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
28335 * The largest value HTLC (in msat) we currently will accept, for this channel.
28337 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28340 * The largest value HTLC (in msat) we currently will accept, for this channel.
28342 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
28345 * Set of configurable parameters that affect channel operation.
28347 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
28349 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
28351 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
28354 * Set of configurable parameters that affect channel operation.
28356 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
28358 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
28360 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
28363 * Constructs a new ChannelDetails given each field
28365 MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z outbound_scid_alias_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, struct LDKU128 user_channel_id_arg, struct LDKCOption_u32Z feerate_sat_per_1000_weight_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_msat_arg, uint64_t next_outbound_htlc_minimum_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, struct LDKCOption_ChannelShutdownStateZ channel_shutdown_state_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);
28368 * Creates a copy of the ChannelDetails
28370 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
28373 * Gets the current SCID which should be used to identify this channel for inbound payments.
28374 * This should be used for providing invoice hints or in any other context where our
28375 * counterparty will forward a payment to us.
28377 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
28378 * [`ChannelDetails::short_channel_id`]. See those for more information.
28380 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
28383 * Gets the current SCID which should be used to identify this channel for outbound payments.
28384 * This should be used in [`Route`]s to describe the first hop or in other contexts where
28385 * we're sending or forwarding a payment outbound over this channel.
28387 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
28388 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
28390 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
28393 * Creates a copy of the ChannelShutdownState
28395 enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
28398 * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
28400 enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
28403 * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
28405 enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
28408 * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
28410 enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
28413 * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
28415 enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
28418 * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
28420 enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
28423 * Checks if two ChannelShutdownStates contain equal inner contents.
28424 * This ignores pointers and is_owned flags and looks at the values in fields.
28426 bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
28429 * Frees any resources used by the RecentPaymentDetails
28431 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
28434 * Creates a copy of the RecentPaymentDetails
28436 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
28439 * Utility method to constructs a new Pending-variant RecentPaymentDetails
28441 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
28444 * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
28446 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKCOption_PaymentHashZ payment_hash);
28449 * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
28451 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_hash);
28454 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
28456 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
28459 * The list of channels to be included in the invoice route hints.
28461 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
28464 * The list of channels to be included in the invoice route hints.
28466 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
28469 * A fake scid used for representing the phantom node's fake channel in generating the invoice
28472 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
28475 * A fake scid used for representing the phantom node's fake channel in generating the invoice
28478 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
28481 * The pubkey of the real backing node that would ultimately receive the payment.
28483 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
28486 * The pubkey of the real backing node that would ultimately receive the payment.
28488 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
28491 * Constructs a new PhantomRouteHints given each field
28493 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
28496 * Creates a copy of the PhantomRouteHints
28498 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
28501 * Constructs a new `ChannelManager` to hold several channels and route between them.
28503 * The current time or latest block header time can be provided as the `current_timestamp`.
28505 * This is the main \"logic hub\" for all channel-related actions, and implements
28506 * [`ChannelMessageHandler`].
28508 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
28510 * Users need to notify the new `ChannelManager` when a new block is connected or
28511 * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
28512 * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
28515 * [`block_connected`]: chain::Listen::block_connected
28516 * [`block_disconnected`]: chain::Listen::block_disconnected
28517 * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
28519 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, uint32_t current_timestamp);
28522 * Gets the current configuration applied to all new channels.
28524 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
28527 * Creates a new outbound channel to the given remote node and with the given value.
28529 * `user_channel_id` will be provided back as in
28530 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
28531 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
28532 * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
28533 * is simply copied to events and otherwise ignored.
28535 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
28536 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
28538 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
28539 * generate a shutdown scriptpubkey or destination script set by
28540 * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
28542 * Note that we do not check if you are currently connected to the given peer. If no
28543 * connection is available, the outbound `open_channel` message may fail to send, resulting in
28544 * the channel eventually being silently forgotten (dropped on reload).
28546 * Returns the new Channel's temporary `channel_id`. This ID will appear as
28547 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
28548 * [`ChannelDetails::channel_id`] until after
28549 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
28550 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
28551 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
28553 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
28554 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
28555 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
28557 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
28559 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);
28562 * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
28563 * more information.
28565 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
28568 * Gets the list of usable channels, in random order. Useful as an argument to
28569 * [`Router::find_route`] to ensure non-announced channels are used.
28571 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
28572 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
28575 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
28578 * Gets the list of channels we have with a given counterparty, in random order.
28580 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
28583 * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
28584 * successful path, or have unresolved HTLCs.
28586 * This can be useful for payments that may have been prepared, but ultimately not sent, as a
28587 * result of a crash. If such a payment exists, is not listed here, and an
28588 * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
28590 * [`Event::PaymentSent`]: events::Event::PaymentSent
28592 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
28595 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
28596 * will be accepted on the given channel, and after additional timeout/the closing of all
28597 * pending HTLCs, the channel will be closed on chain.
28599 * * If we are the channel initiator, we will pay between our [`Background`] and
28600 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
28602 * * If our counterparty is the channel initiator, we will require a channel closing
28603 * transaction feerate of at least our [`Background`] feerate or the feerate which
28604 * would appear on a force-closure transaction, whichever is lower. We will allow our
28605 * counterparty to pay as much fee as they'd like, however.
28607 * May generate a [`SendShutdown`] message event on success, which should be relayed.
28609 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
28610 * generate a shutdown scriptpubkey or destination script set by
28611 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
28614 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
28615 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
28616 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
28617 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
28619 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);
28622 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
28623 * will be accepted on the given channel, and after additional timeout/the closing of all
28624 * pending HTLCs, the channel will be closed on chain.
28626 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
28627 * the channel being closed or not:
28628 * * If we are the channel initiator, we will pay at least this feerate on the closing
28629 * transaction. The upper-bound is set by
28630 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`Normal`] fee
28631 * estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
28632 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
28633 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
28634 * will appear on a force-closure transaction, whichever is lower).
28636 * The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction.
28637 * Will fail if a shutdown script has already been set for this channel by
28638 * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
28639 * also be compatible with our and the counterparty's features.
28641 * May generate a [`SendShutdown`] message event on success, which should be relayed.
28643 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
28644 * generate a shutdown scriptpubkey or destination script set by
28645 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
28648 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
28649 * [`Background`]: crate::chain::chaininterface::ConfirmationTarget::Background
28650 * [`Normal`]: crate::chain::chaininterface::ConfirmationTarget::Normal
28651 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
28653 * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
28655 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_feerate_and_script(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKCOption_u32Z target_feerate_sats_per_1000_weight, struct LDKShutdownScript shutdown_script);
28658 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
28659 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
28660 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
28663 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);
28666 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
28667 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
28668 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
28670 * You can always get the latest local transaction(s) to broadcast from
28671 * [`ChannelMonitor::get_latest_holder_commitment_txn`].
28673 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);
28676 * Force close all channels, immediately broadcasting the latest local commitment transaction
28677 * for each to the chain and rejecting new HTLCs on each.
28679 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
28682 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
28683 * local transaction(s).
28685 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
28688 * Sends a payment along a given route.
28690 * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
28691 * fields for more info.
28693 * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
28694 * [`PeerManager::process_events`]).
28696 * # Avoiding Duplicate Payments
28698 * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
28699 * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
28700 * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
28701 * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
28702 * second payment with the same [`PaymentId`].
28704 * Thus, in order to ensure duplicate payments are not sent, you should implement your own
28705 * tracking of payments, including state to indicate once a payment has completed. Because you
28706 * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
28707 * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
28708 * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
28710 * Additionally, in the scenario where we begin the process of sending a payment, but crash
28711 * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
28712 * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
28713 * [`ChannelManager::list_recent_payments`] for more information.
28715 * # Possible Error States on [`PaymentSendFailure`]
28717 * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
28718 * each entry matching the corresponding-index entry in the route paths, see
28719 * [`PaymentSendFailure`] for more info.
28721 * In general, a path may raise:
28722 * * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
28723 * node public key) is specified.
28724 * * [`APIError::ChannelUnavailable`] if the next-hop channel is not available for updates
28725 * (including due to previous monitor update failure or new permanent monitor update
28727 * * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
28728 * relevant updates.
28730 * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
28731 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
28732 * different route unless you intend to pay twice!
28734 * [`RouteHop`]: crate::routing::router::RouteHop
28735 * [`Event::PaymentSent`]: events::Event::PaymentSent
28736 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
28737 * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
28738 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
28739 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
28741 MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment_with_route(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
28744 * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
28745 * `route_params` and retry failed payment paths based on `retry_strategy`.
28747 MUST_USE_RES struct LDKCResult_NoneRetryableSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
28750 * Signals that no further retries for the given payment should occur. Useful if you have a
28751 * pending outbound payment with retries remaining, but wish to stop retrying the payment before
28752 * retries are exhausted.
28754 * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
28755 * as there are no remaining pending HTLCs for this payment.
28757 * Note that calling this method does *not* prevent a payment from succeeding. You must still
28758 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
28759 * determine the ultimate status of a payment.
28761 * If an [`Event::PaymentFailed`] event is generated and we restart without this
28762 * [`ChannelManager`] having been persisted, another [`Event::PaymentFailed`] may be generated.
28764 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
28765 * [`Event::PaymentSent`]: events::Event::PaymentSent
28767 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
28770 * Send a spontaneous payment, which is a payment that does not require the recipient to have
28771 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
28772 * the preimage, it must be a cryptographically secure random value that no intermediate node
28773 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
28774 * never reach the recipient.
28776 * See [`send_payment`] documentation for more details on the return value of this function
28777 * and idempotency guarantees provided by the [`PaymentId`] key.
28779 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
28780 * [`send_payment`] for more information about the risks of duplicate preimage usage.
28782 * [`send_payment`]: Self::send_payment
28784 MUST_USE_RES struct LDKCResult_PaymentHashPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKCOption_PaymentPreimageZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
28787 * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
28788 * based on `route_params` and retry failed payment paths based on `retry_strategy`.
28790 * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
28793 * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
28795 MUST_USE_RES struct LDKCResult_PaymentHashRetryableSendFailureZ ChannelManager_send_spontaneous_payment_with_retry(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_PaymentPreimageZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
28798 * Send a payment that is probing the given route for liquidity. We calculate the
28799 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
28800 * us to easily discern them from real payments.
28802 MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
28805 * Call this upon creation of a funding transaction for the given channel.
28807 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
28808 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
28810 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
28811 * across the p2p network.
28813 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
28814 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
28816 * May panic if the output found in the funding transaction is duplicative with some other
28817 * channel (note that this should be trivially prevented by using unique funding transaction
28818 * keys per-channel).
28820 * Do NOT broadcast the funding transaction yourself. When we have safely received our
28821 * counterparty's signature the funding transaction will automatically be broadcast via the
28822 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
28824 * Note that this includes RBF or similar transaction replacement strategies - lightning does
28825 * not currently support replacing a funding transaction on an existing channel. Instead,
28826 * create a new channel with a conflicting funding transaction.
28828 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
28829 * the wallet software generating the funding transaction to apply anti-fee sniping as
28830 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
28831 * for more details.
28833 * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
28834 * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
28836 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);
28839 * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
28841 * Once the updates are applied, each eligible channel (advertised with a known short channel
28842 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
28843 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
28844 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
28846 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
28847 * `counterparty_node_id` is provided.
28849 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
28850 * below [`MIN_CLTV_EXPIRY_DELTA`].
28852 * If an error is returned, none of the updates should be considered applied.
28854 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
28855 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
28856 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
28857 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
28858 * [`ChannelUpdate`]: msgs::ChannelUpdate
28859 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
28860 * [`APIMisuseError`]: APIError::APIMisuseError
28862 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_partial_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update);
28865 * Atomically updates the [`ChannelConfig`] for the given channels.
28867 * Once the updates are applied, each eligible channel (advertised with a known short channel
28868 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
28869 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
28870 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
28872 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
28873 * `counterparty_node_id` is provided.
28875 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
28876 * below [`MIN_CLTV_EXPIRY_DELTA`].
28878 * If an error is returned, none of the updates should be considered applied.
28880 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
28881 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
28882 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
28883 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
28884 * [`ChannelUpdate`]: msgs::ChannelUpdate
28885 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
28886 * [`APIMisuseError`]: APIError::APIMisuseError
28888 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);
28891 * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
28892 * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
28894 * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
28895 * channel to a receiving node if the node lacks sufficient inbound liquidity.
28897 * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
28898 * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
28899 * receiver's invoice route hints. These route hints will signal to LDK to generate an
28900 * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
28901 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
28903 * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
28904 * you from forwarding more than you received. See
28905 * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
28908 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
28911 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
28912 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
28913 * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
28915 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);
28918 * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
28919 * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
28921 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
28924 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
28926 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
28929 * Processes HTLCs which are pending waiting on random forward delay.
28931 * Should only really ever be called in response to a PendingHTLCsForwardable event.
28932 * Will likely generate further events.
28934 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
28937 * Performs actions which should happen on startup and roughly once per minute thereafter.
28939 * This currently includes:
28940 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
28941 * * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
28942 * than a minute, informing the network that they should no longer attempt to route over
28944 * * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
28945 * with the current [`ChannelConfig`].
28946 * * Removing peers which have disconnected but and no longer have any channels.
28947 * * Force-closing and removing channels which have not completed establishment in a timely manner.
28949 * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
28950 * estimate fetches.
28952 * [`ChannelUpdate`]: msgs::ChannelUpdate
28953 * [`ChannelConfig`]: crate::util::config::ChannelConfig
28955 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
28958 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
28959 * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
28960 * along the path (including in our own channel on which we received it).
28962 * Note that in some cases around unclean shutdown, it is possible the payment may have
28963 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
28964 * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
28965 * may have already been failed automatically by LDK if it was nearing its expiration time.
28967 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
28968 * [`ChannelManager::claim_funds`]), you should still monitor for
28969 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
28970 * startup during which time claims that were in-progress at shutdown may be replayed.
28972 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
28975 * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
28976 * reason for the failure.
28978 * See [`FailureCode`] for valid failure codes.
28980 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], enum LDKFailureCode failure_code);
28983 * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
28984 * [`MessageSendEvent`]s needed to claim the payment.
28986 * This method is guaranteed to ensure the payment has been claimed but only if the current
28987 * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
28988 * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
28989 * successful. It will generally be available in the next [`process_pending_events`] call.
28991 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
28992 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
28993 * event matches your expectation. If you fail to do so and call this method, you may provide
28994 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
28996 * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
28997 * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
28998 * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
28999 * [`process_pending_events`]: EventsProvider::process_pending_events
29000 * [`create_inbound_payment`]: Self::create_inbound_payment
29001 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
29003 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
29006 * Gets the node_id held by this ChannelManager
29008 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
29011 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
29013 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
29014 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
29017 * The `user_channel_id` parameter will be provided back in
29018 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
29019 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
29021 * Note that this method will return an error and reject the channel, if it requires support
29022 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
29023 * used to accept such channels.
29025 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
29026 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
29028 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);
29031 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
29032 * it as confirmed immediately.
29034 * The `user_channel_id` parameter will be provided back in
29035 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
29036 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
29038 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
29039 * and (if the counterparty agrees), enables forwarding of payments immediately.
29041 * This fully trusts that the counterparty has honestly and correctly constructed the funding
29042 * transaction and blindly assumes that it will eventually confirm.
29044 * If it does not confirm before we decide to close the channel, or if the funding transaction
29045 * does not pay to the correct script the correct amount, *you will lose funds*.
29047 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
29048 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
29050 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);
29053 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
29056 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
29057 * [`PaymentHash`] and [`PaymentPreimage`] for you.
29059 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which
29060 * will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with
29061 * its [`PaymentPurpose::InvoicePayment::payment_preimage`] field filled in. That should then be
29062 * passed directly to [`claim_funds`].
29064 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
29066 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
29067 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
29071 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
29072 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
29074 * Errors if `min_value_msat` is greater than total bitcoin supply.
29076 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
29077 * on versions of LDK prior to 0.0.114.
29079 * [`claim_funds`]: Self::claim_funds
29080 * [`PaymentClaimable`]: events::Event::PaymentClaimable
29081 * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
29082 * [`PaymentPurpose::InvoicePayment`]: events::PaymentPurpose::InvoicePayment
29083 * [`PaymentPurpose::InvoicePayment::payment_preimage`]: events::PaymentPurpose::InvoicePayment::payment_preimage
29084 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
29086 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);
29089 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
29090 * stored external to LDK.
29092 * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
29093 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
29094 * the `min_value_msat` provided here, if one is provided.
29096 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
29097 * note that LDK will not stop you from registering duplicate payment hashes for inbound
29100 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
29101 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
29102 * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
29103 * sender \"proof-of-payment\" unless they have paid the required amount.
29105 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
29106 * in excess of the current time. This should roughly match the expiry time set in the invoice.
29107 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
29108 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
29109 * invoices when no timeout is set.
29111 * Note that we use block header time to time-out pending inbound payments (with some margin
29112 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
29113 * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
29114 * If you need exact expiry semantics, you should enforce them upon receipt of
29115 * [`PaymentClaimable`].
29117 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
29118 * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
29120 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
29121 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
29125 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
29126 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
29128 * Errors if `min_value_msat` is greater than total bitcoin supply.
29130 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
29131 * on versions of LDK prior to 0.0.114.
29133 * [`create_inbound_payment`]: Self::create_inbound_payment
29134 * [`PaymentClaimable`]: events::Event::PaymentClaimable
29136 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);
29139 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
29140 * previously returned from [`create_inbound_payment`].
29142 * [`create_inbound_payment`]: Self::create_inbound_payment
29144 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);
29147 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
29148 * are used when constructing the phantom invoice's route hints.
29150 * [phantom node payments]: crate::sign::PhantomKeysManager
29152 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
29155 * Gets route hints for use in receiving [phantom node payments].
29157 * [phantom node payments]: crate::sign::PhantomKeysManager
29159 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
29162 * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
29163 * used when constructing the route hints for HTLCs intended to be intercepted. See
29164 * [`ChannelManager::forward_intercepted_htlc`].
29166 * Note that this method is not guaranteed to return unique values, you may need to call it a few
29167 * times to get a unique scid.
29169 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
29172 * Gets inflight HTLC information by processing pending outbound payments that are in
29173 * our channels. May be used during pathfinding to account for in-use channel liquidity.
29175 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
29178 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
29179 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
29181 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
29184 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
29185 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
29187 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
29190 * Constructs a new Listen which calls the relevant methods on this_arg.
29191 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
29193 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
29196 * Constructs a new Confirm which calls the relevant methods on this_arg.
29197 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
29199 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
29202 * Gets a [`Future`] that completes when this [`ChannelManager`] needs to be persisted.
29204 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
29205 * [`ChannelManager`] and should instead register actions to be taken later.
29208 MUST_USE_RES struct LDKFuture ChannelManager_get_persistable_update_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
29211 * Gets the latest best block which was connected either via the [`chain::Listen`] or
29212 * [`chain::Confirm`] interfaces.
29214 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
29217 * Fetches the set of [`NodeFeatures`] flags which are provided by or required by
29218 * [`ChannelManager`].
29220 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
29223 * Fetches the set of [`ChannelFeatures`] flags which are provided by or required by
29224 * [`ChannelManager`].
29226 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
29229 * Fetches the set of [`ChannelTypeFeatures`] flags which are provided by or required by
29230 * [`ChannelManager`].
29232 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
29235 * Fetches the set of [`InitFeatures`] flags which are provided by or required by
29236 * [`ChannelManager`].
29238 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
29241 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
29242 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
29244 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
29247 * Fetches the set of [`InitFeatures`] flags which are provided by or required by
29248 * [`ChannelManager`].
29250 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
29253 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
29255 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
29258 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
29260 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
29263 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
29265 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
29268 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
29270 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
29273 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
29275 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
29278 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
29280 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
29283 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
29285 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
29288 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
29290 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
29293 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
29295 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
29298 * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
29300 struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
29303 * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
29305 struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
29308 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
29310 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
29313 * A cryptographically secure source of entropy.
29315 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
29318 * A cryptographically secure source of entropy.
29320 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
29323 * A signer that is able to perform node-scoped cryptographic operations.
29325 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
29328 * A signer that is able to perform node-scoped cryptographic operations.
29330 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
29333 * The keys provider which will give us relevant keys. Some keys will be loaded during
29334 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
29337 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
29340 * The keys provider which will give us relevant keys. Some keys will be loaded during
29341 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
29344 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
29347 * The fee_estimator for use in the ChannelManager in the future.
29349 * No calls to the FeeEstimator will be made during deserialization.
29351 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
29354 * The fee_estimator for use in the ChannelManager in the future.
29356 * No calls to the FeeEstimator will be made during deserialization.
29358 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
29361 * The chain::Watch for use in the ChannelManager in the future.
29363 * No calls to the chain::Watch will be made during deserialization. It is assumed that
29364 * you have deserialized ChannelMonitors separately and will add them to your
29365 * chain::Watch after deserializing this ChannelManager.
29367 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
29370 * The chain::Watch for use in the ChannelManager in the future.
29372 * No calls to the chain::Watch will be made during deserialization. It is assumed that
29373 * you have deserialized ChannelMonitors separately and will add them to your
29374 * chain::Watch after deserializing this ChannelManager.
29376 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
29379 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
29380 * used to broadcast the latest local commitment transactions of channels which must be
29381 * force-closed during deserialization.
29383 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
29386 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
29387 * used to broadcast the latest local commitment transactions of channels which must be
29388 * force-closed during deserialization.
29390 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
29393 * The router which will be used in the ChannelManager in the future for finding routes
29394 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
29396 * No calls to the router will be made during deserialization.
29398 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
29401 * The router which will be used in the ChannelManager in the future for finding routes
29402 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
29404 * No calls to the router will be made during deserialization.
29406 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
29409 * The Logger for use in the ChannelManager and which may be used to log information during
29412 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
29415 * The Logger for use in the ChannelManager and which may be used to log information during
29418 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
29421 * Default settings used for new channels. Any existing channels will continue to use the
29422 * runtime settings which were stored when the ChannelManager was serialized.
29424 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
29427 * Default settings used for new channels. Any existing channels will continue to use the
29428 * runtime settings which were stored when the ChannelManager was serialized.
29430 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
29433 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
29434 * HashMap for you. This is primarily useful for C bindings where it is not practical to
29435 * populate a HashMap directly from C.
29437 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);
29440 * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
29442 struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
29445 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
29447 void ExpandedKey_free(struct LDKExpandedKey this_obj);
29450 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
29452 * It is recommended to cache this value and not regenerate it for each new inbound payment.
29454 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
29457 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
29458 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
29459 * a `ChannelManager`.
29461 * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
29462 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
29463 * regenerate it for each new inbound payment.
29465 * `current_time` is a Unix timestamp representing the current time.
29467 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
29468 * on versions of LDK prior to 0.0.114.
29470 * [phantom node payments]: crate::sign::PhantomKeysManager
29471 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
29473 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);
29476 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
29477 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
29478 * without a `ChannelManager`.
29480 * See [`create`] for information on the `keys` and `current_time` parameters.
29482 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
29483 * on versions of LDK prior to 0.0.114.
29485 * [phantom node payments]: crate::sign::PhantomKeysManager
29487 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);
29490 * Frees any resources used by the DecodeError
29492 void DecodeError_free(struct LDKDecodeError this_ptr);
29495 * Creates a copy of the DecodeError
29497 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
29500 * Utility method to constructs a new UnknownVersion-variant DecodeError
29502 struct LDKDecodeError DecodeError_unknown_version(void);
29505 * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
29507 struct LDKDecodeError DecodeError_unknown_required_feature(void);
29510 * Utility method to constructs a new InvalidValue-variant DecodeError
29512 struct LDKDecodeError DecodeError_invalid_value(void);
29515 * Utility method to constructs a new ShortRead-variant DecodeError
29517 struct LDKDecodeError DecodeError_short_read(void);
29520 * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
29522 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
29525 * Utility method to constructs a new Io-variant DecodeError
29527 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
29530 * Utility method to constructs a new UnsupportedCompression-variant DecodeError
29532 struct LDKDecodeError DecodeError_unsupported_compression(void);
29535 * Checks if two DecodeErrors contain equal inner contents.
29536 * This ignores pointers and is_owned flags and looks at the values in fields.
29538 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
29541 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
29543 void Init_free(struct LDKInit this_obj);
29546 * The relevant features which the sender supports.
29548 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
29551 * The relevant features which the sender supports.
29553 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
29556 * Indicates chains the sender is interested in.
29558 * If there are no common chains, the connection will be closed.
29560 * Returns a copy of the field.
29562 struct LDKCOption_CVec_ChainHashZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
29565 * Indicates chains the sender is interested in.
29567 * If there are no common chains, the connection will be closed.
29569 void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ChainHashZZ val);
29572 * The receipient's network address.
29574 * This adds the option to report a remote IP address back to a connecting peer using the init
29575 * message. A node can decide to use that information to discover a potential update to its
29576 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
29579 struct LDKCOption_NetAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
29582 * The receipient's network address.
29584 * This adds the option to report a remote IP address back to a connecting peer using the init
29585 * message. A node can decide to use that information to discover a potential update to its
29586 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
29589 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_NetAddressZ val);
29592 * Constructs a new Init given each field
29594 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ChainHashZZ networks_arg, struct LDKCOption_NetAddressZ remote_network_address_arg);
29597 * Creates a copy of the Init
29599 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
29602 * Checks if two Inits contain equal inner contents.
29603 * This ignores pointers and is_owned flags and looks at the values in fields.
29604 * Two objects with NULL inner values will be considered "equal" here.
29606 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
29609 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
29611 void ErrorMessage_free(struct LDKErrorMessage this_obj);
29614 * The channel ID involved in the error.
29616 * All-0s indicates a general error unrelated to a specific channel, after which all channels
29617 * with the sending peer should be closed.
29619 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
29622 * The channel ID involved in the error.
29624 * All-0s indicates a general error unrelated to a specific channel, after which all channels
29625 * with the sending peer should be closed.
29627 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
29630 * A possibly human-readable error description.
29632 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
29633 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
29634 * the terminal emulator or the logging subsystem.
29636 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
29639 * A possibly human-readable error description.
29641 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
29642 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
29643 * the terminal emulator or the logging subsystem.
29645 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
29648 * Constructs a new ErrorMessage given each field
29650 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
29653 * Creates a copy of the ErrorMessage
29655 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
29658 * Checks if two ErrorMessages contain equal inner contents.
29659 * This ignores pointers and is_owned flags and looks at the values in fields.
29660 * Two objects with NULL inner values will be considered "equal" here.
29662 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
29665 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
29667 void WarningMessage_free(struct LDKWarningMessage this_obj);
29670 * The channel ID involved in the warning.
29672 * All-0s indicates a warning unrelated to a specific channel.
29674 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
29677 * The channel ID involved in the warning.
29679 * All-0s indicates a warning unrelated to a specific channel.
29681 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
29684 * A possibly human-readable warning description.
29686 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
29687 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
29688 * the terminal emulator or the logging subsystem.
29690 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
29693 * A possibly human-readable warning description.
29695 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
29696 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
29697 * the terminal emulator or the logging subsystem.
29699 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
29702 * Constructs a new WarningMessage given each field
29704 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
29707 * Creates a copy of the WarningMessage
29709 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
29712 * Checks if two WarningMessages contain equal inner contents.
29713 * This ignores pointers and is_owned flags and looks at the values in fields.
29714 * Two objects with NULL inner values will be considered "equal" here.
29716 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
29719 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
29721 void Ping_free(struct LDKPing this_obj);
29724 * The desired response length.
29726 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
29729 * The desired response length.
29731 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
29734 * The ping packet size.
29736 * This field is not sent on the wire. byteslen zeros are sent.
29738 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
29741 * The ping packet size.
29743 * This field is not sent on the wire. byteslen zeros are sent.
29745 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
29748 * Constructs a new Ping given each field
29750 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
29753 * Creates a copy of the Ping
29755 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
29758 * Checks if two Pings contain equal inner contents.
29759 * This ignores pointers and is_owned flags and looks at the values in fields.
29760 * Two objects with NULL inner values will be considered "equal" here.
29762 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
29765 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
29767 void Pong_free(struct LDKPong this_obj);
29770 * The pong packet size.
29772 * This field is not sent on the wire. byteslen zeros are sent.
29774 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
29777 * The pong packet size.
29779 * This field is not sent on the wire. byteslen zeros are sent.
29781 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
29784 * Constructs a new Pong given each field
29786 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
29789 * Creates a copy of the Pong
29791 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
29794 * Checks if two Pongs contain equal inner contents.
29795 * This ignores pointers and is_owned flags and looks at the values in fields.
29796 * Two objects with NULL inner values will be considered "equal" here.
29798 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
29801 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
29803 void OpenChannel_free(struct LDKOpenChannel this_obj);
29806 * The genesis hash of the blockchain where the channel is to be opened
29808 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
29811 * The genesis hash of the blockchain where the channel is to be opened
29813 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
29816 * A temporary channel ID, until the funding outpoint is announced
29818 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
29821 * A temporary channel ID, until the funding outpoint is announced
29823 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
29826 * The channel value
29828 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29831 * The channel value
29833 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
29836 * The amount to push to the counterparty as part of the open, in milli-satoshi
29838 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29841 * The amount to push to the counterparty as part of the open, in milli-satoshi
29843 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
29846 * The threshold below which outputs on transactions broadcast by sender will be omitted
29848 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29851 * The threshold below which outputs on transactions broadcast by sender will be omitted
29853 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
29856 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
29858 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29861 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
29863 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
29866 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
29868 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29871 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
29873 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
29876 * The minimum HTLC size incoming to sender, in milli-satoshi
29878 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29881 * The minimum HTLC size incoming to sender, in milli-satoshi
29883 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
29886 * The feerate per 1000-weight of sender generated transactions, until updated by
29889 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29892 * The feerate per 1000-weight of sender generated transactions, until updated by
29895 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
29898 * The number of blocks which the counterparty will have to wait to claim on-chain funds if
29899 * they broadcast a commitment transaction
29901 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29904 * The number of blocks which the counterparty will have to wait to claim on-chain funds if
29905 * they broadcast a commitment transaction
29907 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
29910 * The maximum number of inbound HTLCs towards sender
29912 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29915 * The maximum number of inbound HTLCs towards sender
29917 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
29920 * The sender's key controlling the funding transaction
29922 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29925 * The sender's key controlling the funding transaction
29927 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29930 * Used to derive a revocation key for transactions broadcast by counterparty
29932 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29935 * Used to derive a revocation key for transactions broadcast by counterparty
29937 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29940 * A payment key to sender for transactions broadcast by counterparty
29942 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29945 * A payment key to sender for transactions broadcast by counterparty
29947 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29950 * Used to derive a payment key to sender for transactions broadcast by sender
29952 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29955 * Used to derive a payment key to sender for transactions broadcast by sender
29957 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29960 * Used to derive an HTLC payment key to sender
29962 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29965 * Used to derive an HTLC payment key to sender
29967 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29970 * The first to-be-broadcast-by-sender transaction's per commitment point
29972 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29975 * The first to-be-broadcast-by-sender transaction's per commitment point
29977 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29980 * The channel flags to be used
29982 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29985 * The channel flags to be used
29987 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
29990 * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
29992 struct LDKCOption_ScriptZ OpenChannel_get_shutdown_scriptpubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
29995 * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
29997 void OpenChannel_set_shutdown_scriptpubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCOption_ScriptZ val);
30000 * The channel type that this channel will represent
30002 * If this is `None`, we derive the channel type from the intersection of our
30003 * feature bits with our counterparty's feature bits from the [`Init`] message.
30005 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30007 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
30010 * The channel type that this channel will represent
30012 * If this is `None`, we derive the channel type from the intersection of our
30013 * feature bits with our counterparty's feature bits from the [`Init`] message.
30015 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30017 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
30020 * Constructs a new OpenChannel given each field
30022 MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t push_msat_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t channel_reserve_satoshis_arg, uint64_t htlc_minimum_msat_arg, uint32_t feerate_per_kw_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, 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, struct LDKPublicKey first_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_ScriptZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
30025 * Creates a copy of the OpenChannel
30027 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
30030 * Checks if two OpenChannels contain equal inner contents.
30031 * This ignores pointers and is_owned flags and looks at the values in fields.
30032 * Two objects with NULL inner values will be considered "equal" here.
30034 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
30037 * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
30039 void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
30042 * The genesis hash of the blockchain where the channel is to be opened
30044 const uint8_t (*OpenChannelV2_get_chain_hash(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
30047 * The genesis hash of the blockchain where the channel is to be opened
30049 void OpenChannelV2_set_chain_hash(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
30052 * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
30054 const uint8_t (*OpenChannelV2_get_temporary_channel_id(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
30057 * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
30059 void OpenChannelV2_set_temporary_channel_id(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
30062 * The feerate for the funding transaction set by the channel initiator
30064 uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30067 * The feerate for the funding transaction set by the channel initiator
30069 void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
30072 * The feerate for the commitment transaction set by the channel initiator
30074 uint32_t OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30077 * The feerate for the commitment transaction set by the channel initiator
30079 void OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
30082 * Part of the channel value contributed by the channel initiator
30084 uint64_t OpenChannelV2_get_funding_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30087 * Part of the channel value contributed by the channel initiator
30089 void OpenChannelV2_set_funding_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
30092 * The threshold below which outputs on transactions broadcast by the channel initiator will be
30095 uint64_t OpenChannelV2_get_dust_limit_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30098 * The threshold below which outputs on transactions broadcast by the channel initiator will be
30101 void OpenChannelV2_set_dust_limit_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
30104 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
30106 uint64_t OpenChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30109 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
30111 void OpenChannelV2_set_max_htlc_value_in_flight_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
30114 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
30116 uint64_t OpenChannelV2_get_htlc_minimum_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30119 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
30121 void OpenChannelV2_set_htlc_minimum_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
30124 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
30125 * broadcast a commitment transaction
30127 uint16_t OpenChannelV2_get_to_self_delay(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30130 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
30131 * broadcast a commitment transaction
30133 void OpenChannelV2_set_to_self_delay(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
30136 * The maximum number of inbound HTLCs towards channel initiator
30138 uint16_t OpenChannelV2_get_max_accepted_htlcs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30141 * The maximum number of inbound HTLCs towards channel initiator
30143 void OpenChannelV2_set_max_accepted_htlcs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
30146 * The locktime for the funding transaction
30148 uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30151 * The locktime for the funding transaction
30153 void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
30156 * The channel initiator's key controlling the funding transaction
30158 struct LDKPublicKey OpenChannelV2_get_funding_pubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30161 * The channel initiator's key controlling the funding transaction
30163 void OpenChannelV2_set_funding_pubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30166 * Used to derive a revocation key for transactions broadcast by counterparty
30168 struct LDKPublicKey OpenChannelV2_get_revocation_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30171 * Used to derive a revocation key for transactions broadcast by counterparty
30173 void OpenChannelV2_set_revocation_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30176 * A payment key to channel initiator for transactions broadcast by counterparty
30178 struct LDKPublicKey OpenChannelV2_get_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30181 * A payment key to channel initiator for transactions broadcast by counterparty
30183 void OpenChannelV2_set_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30186 * Used to derive a payment key to channel initiator for transactions broadcast by channel
30189 struct LDKPublicKey OpenChannelV2_get_delayed_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30192 * Used to derive a payment key to channel initiator for transactions broadcast by channel
30195 void OpenChannelV2_set_delayed_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30198 * Used to derive an HTLC payment key to channel initiator
30200 struct LDKPublicKey OpenChannelV2_get_htlc_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30203 * Used to derive an HTLC payment key to channel initiator
30205 void OpenChannelV2_set_htlc_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30208 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
30210 struct LDKPublicKey OpenChannelV2_get_first_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30213 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
30215 void OpenChannelV2_set_first_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30218 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
30220 struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30223 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
30225 void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30230 uint8_t OpenChannelV2_get_channel_flags(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30235 void OpenChannelV2_set_channel_flags(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint8_t val);
30238 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
30239 * collaboratively close
30241 struct LDKCOption_ScriptZ OpenChannelV2_get_shutdown_scriptpubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30244 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
30245 * collaboratively close
30247 void OpenChannelV2_set_shutdown_scriptpubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_ScriptZ val);
30250 * The channel type that this channel will represent. If none is set, we derive the channel
30251 * type from the intersection of our feature bits with our counterparty's feature bits from
30252 * the Init message.
30254 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30256 struct LDKChannelTypeFeatures OpenChannelV2_get_channel_type(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30259 * The channel type that this channel will represent. If none is set, we derive the channel
30260 * type from the intersection of our feature bits with our counterparty's feature bits from
30261 * the Init message.
30263 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30265 void OpenChannelV2_set_channel_type(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
30268 * Optionally, a requirement that only confirmed inputs can be added
30270 enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
30273 * Optionally, a requirement that only confirmed inputs can be added
30275 void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
30278 * Constructs a new OpenChannelV2 given each field
30280 MUST_USE_RES struct LDKOpenChannelV2 OpenChannelV2_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKThirtyTwoBytes temporary_channel_id_arg, uint32_t funding_feerate_sat_per_1000_weight_arg, uint32_t commitment_feerate_sat_per_1000_weight_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKPublicKey second_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_ScriptZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
30283 * Creates a copy of the OpenChannelV2
30285 struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
30288 * Checks if two OpenChannelV2s contain equal inner contents.
30289 * This ignores pointers and is_owned flags and looks at the values in fields.
30290 * Two objects with NULL inner values will be considered "equal" here.
30292 bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
30295 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
30297 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
30300 * A temporary channel ID, until the funding outpoint is announced
30302 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
30305 * A temporary channel ID, until the funding outpoint is announced
30307 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
30310 * The threshold below which outputs on transactions broadcast by sender will be omitted
30312 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30315 * The threshold below which outputs on transactions broadcast by sender will be omitted
30317 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
30320 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
30322 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30325 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
30327 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
30330 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
30332 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30335 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
30337 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
30340 * The minimum HTLC size incoming to sender, in milli-satoshi
30342 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30345 * The minimum HTLC size incoming to sender, in milli-satoshi
30347 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
30350 * Minimum depth of the funding transaction before the channel is considered open
30352 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30355 * Minimum depth of the funding transaction before the channel is considered open
30357 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
30360 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
30362 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30365 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
30367 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
30370 * The maximum number of inbound HTLCs towards sender
30372 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30375 * The maximum number of inbound HTLCs towards sender
30377 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
30380 * The sender's key controlling the funding transaction
30382 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30385 * The sender's key controlling the funding transaction
30387 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30390 * Used to derive a revocation key for transactions broadcast by counterparty
30392 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30395 * Used to derive a revocation key for transactions broadcast by counterparty
30397 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30400 * A payment key to sender for transactions broadcast by counterparty
30402 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30405 * A payment key to sender for transactions broadcast by counterparty
30407 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30410 * Used to derive a payment key to sender for transactions broadcast by sender
30412 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30415 * Used to derive a payment key to sender for transactions broadcast by sender
30417 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30420 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
30422 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30425 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
30427 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30430 * The first to-be-broadcast-by-sender transaction's per commitment point
30432 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30435 * The first to-be-broadcast-by-sender transaction's per commitment point
30437 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30440 * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
30442 struct LDKCOption_ScriptZ AcceptChannel_get_shutdown_scriptpubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30445 * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
30447 void AcceptChannel_set_shutdown_scriptpubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCOption_ScriptZ val);
30450 * The channel type that this channel will represent.
30452 * If this is `None`, we derive the channel type from the intersection of
30453 * our feature bits with our counterparty's feature bits from the [`Init`] message.
30454 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
30456 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30458 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
30461 * The channel type that this channel will represent.
30463 * If this is `None`, we derive the channel type from the intersection of
30464 * our feature bits with our counterparty's feature bits from the [`Init`] message.
30465 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
30467 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30469 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
30472 * Constructs a new AcceptChannel given each field
30474 MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t channel_reserve_satoshis_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, 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, struct LDKPublicKey first_per_commitment_point_arg, struct LDKCOption_ScriptZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
30477 * Creates a copy of the AcceptChannel
30479 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
30482 * Checks if two AcceptChannels contain equal inner contents.
30483 * This ignores pointers and is_owned flags and looks at the values in fields.
30484 * Two objects with NULL inner values will be considered "equal" here.
30486 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
30489 * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
30491 void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
30494 * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
30496 const uint8_t (*AcceptChannelV2_get_temporary_channel_id(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr))[32];
30499 * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
30501 void AcceptChannelV2_set_temporary_channel_id(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
30504 * Part of the channel value contributed by the channel acceptor
30506 uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30509 * Part of the channel value contributed by the channel acceptor
30511 void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
30514 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
30517 uint64_t AcceptChannelV2_get_dust_limit_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30520 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
30523 void AcceptChannelV2_set_dust_limit_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
30526 * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
30528 uint64_t AcceptChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30531 * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
30533 void AcceptChannelV2_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
30536 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
30538 uint64_t AcceptChannelV2_get_htlc_minimum_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30541 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
30543 void AcceptChannelV2_set_htlc_minimum_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
30546 * Minimum depth of the funding transaction before the channel is considered open
30548 uint32_t AcceptChannelV2_get_minimum_depth(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30551 * Minimum depth of the funding transaction before the channel is considered open
30553 void AcceptChannelV2_set_minimum_depth(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
30556 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
30557 * broadcast a commitment transaction
30559 uint16_t AcceptChannelV2_get_to_self_delay(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30562 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
30563 * broadcast a commitment transaction
30565 void AcceptChannelV2_set_to_self_delay(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
30568 * The maximum number of inbound HTLCs towards channel acceptor
30570 uint16_t AcceptChannelV2_get_max_accepted_htlcs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30573 * The maximum number of inbound HTLCs towards channel acceptor
30575 void AcceptChannelV2_set_max_accepted_htlcs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
30578 * The channel acceptor's key controlling the funding transaction
30580 struct LDKPublicKey AcceptChannelV2_get_funding_pubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30583 * The channel acceptor's key controlling the funding transaction
30585 void AcceptChannelV2_set_funding_pubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30588 * Used to derive a revocation key for transactions broadcast by counterparty
30590 struct LDKPublicKey AcceptChannelV2_get_revocation_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30593 * Used to derive a revocation key for transactions broadcast by counterparty
30595 void AcceptChannelV2_set_revocation_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30598 * A payment key to channel acceptor for transactions broadcast by counterparty
30600 struct LDKPublicKey AcceptChannelV2_get_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30603 * A payment key to channel acceptor for transactions broadcast by counterparty
30605 void AcceptChannelV2_set_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30608 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
30611 struct LDKPublicKey AcceptChannelV2_get_delayed_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30614 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
30617 void AcceptChannelV2_set_delayed_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30620 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
30622 struct LDKPublicKey AcceptChannelV2_get_htlc_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30625 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
30627 void AcceptChannelV2_set_htlc_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30630 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
30632 struct LDKPublicKey AcceptChannelV2_get_first_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30635 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
30637 void AcceptChannelV2_set_first_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30640 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
30642 struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30645 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
30647 void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30650 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
30651 * collaboratively close
30653 struct LDKCOption_ScriptZ AcceptChannelV2_get_shutdown_scriptpubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30656 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
30657 * collaboratively close
30659 void AcceptChannelV2_set_shutdown_scriptpubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_ScriptZ val);
30662 * The channel type that this channel will represent. If none is set, we derive the channel
30663 * type from the intersection of our feature bits with our counterparty's feature bits from
30664 * the Init message.
30666 * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
30668 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
30670 struct LDKChannelTypeFeatures AcceptChannelV2_get_channel_type(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30673 * The channel type that this channel will represent. If none is set, we derive the channel
30674 * type from the intersection of our feature bits with our counterparty's feature bits from
30675 * the Init message.
30677 * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
30679 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
30681 void AcceptChannelV2_set_channel_type(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
30684 * Optionally, a requirement that only confirmed inputs can be added
30686 enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
30689 * Optionally, a requirement that only confirmed inputs can be added
30691 void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
30694 * Constructs a new AcceptChannelV2 given each field
30696 MUST_USE_RES struct LDKAcceptChannelV2 AcceptChannelV2_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKPublicKey second_per_commitment_point_arg, struct LDKCOption_ScriptZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
30699 * Creates a copy of the AcceptChannelV2
30701 struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
30704 * Checks if two AcceptChannelV2s contain equal inner contents.
30705 * This ignores pointers and is_owned flags and looks at the values in fields.
30706 * Two objects with NULL inner values will be considered "equal" here.
30708 bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
30711 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
30713 void FundingCreated_free(struct LDKFundingCreated this_obj);
30716 * A temporary channel ID, until the funding is established
30718 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
30721 * A temporary channel ID, until the funding is established
30723 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
30726 * The funding transaction ID
30728 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
30731 * The funding transaction ID
30733 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
30736 * The specific output index funding this channel
30738 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
30741 * The specific output index funding this channel
30743 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
30746 * The signature of the channel initiator (funder) on the initial commitment transaction
30748 struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
30751 * The signature of the channel initiator (funder) on the initial commitment transaction
30753 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val);
30756 * Constructs a new FundingCreated given each field
30758 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);
30761 * Creates a copy of the FundingCreated
30763 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
30766 * Checks if two FundingCreateds contain equal inner contents.
30767 * This ignores pointers and is_owned flags and looks at the values in fields.
30768 * Two objects with NULL inner values will be considered "equal" here.
30770 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
30773 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
30775 void FundingSigned_free(struct LDKFundingSigned this_obj);
30780 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
30785 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
30788 * The signature of the channel acceptor (fundee) on the initial commitment transaction
30790 struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
30793 * The signature of the channel acceptor (fundee) on the initial commitment transaction
30795 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
30798 * Constructs a new FundingSigned given each field
30800 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg);
30803 * Creates a copy of the FundingSigned
30805 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
30808 * Checks if two FundingSigneds contain equal inner contents.
30809 * This ignores pointers and is_owned flags and looks at the values in fields.
30810 * Two objects with NULL inner values will be considered "equal" here.
30812 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
30815 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
30817 void ChannelReady_free(struct LDKChannelReady this_obj);
30822 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
30827 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
30830 * The per-commitment point of the second commitment transaction
30832 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
30835 * The per-commitment point of the second commitment transaction
30837 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
30840 * If set, provides a `short_channel_id` alias for this channel.
30842 * The sender will accept payments to be forwarded over this SCID and forward them to this
30843 * messages' recipient.
30845 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
30848 * If set, provides a `short_channel_id` alias for this channel.
30850 * The sender will accept payments to be forwarded over this SCID and forward them to this
30851 * messages' recipient.
30853 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30856 * Constructs a new ChannelReady given each field
30858 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);
30861 * Creates a copy of the ChannelReady
30863 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
30866 * Checks if two ChannelReadys contain equal inner contents.
30867 * This ignores pointers and is_owned flags and looks at the values in fields.
30868 * Two objects with NULL inner values will be considered "equal" here.
30870 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
30873 * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
30875 void TxAddInput_free(struct LDKTxAddInput this_obj);
30880 const uint8_t (*TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr))[32];
30885 void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
30888 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
30891 uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
30894 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
30897 void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
30900 * Serialized transaction that contains the output this input spends to verify that it is non
30903 struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
30906 * Serialized transaction that contains the output this input spends to verify that it is non
30909 void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
30912 * The index of the output being spent
30914 uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
30917 * The index of the output being spent
30919 void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
30922 * The sequence number of this input
30924 uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
30927 * The sequence number of this input
30929 void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
30932 * Constructs a new TxAddInput given each field
30934 MUST_USE_RES struct LDKTxAddInput TxAddInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg, struct LDKTransactionU16LenLimited prevtx_arg, uint32_t prevtx_out_arg, uint32_t sequence_arg);
30937 * Creates a copy of the TxAddInput
30939 struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
30942 * Checks if two TxAddInputs contain equal inner contents.
30943 * This ignores pointers and is_owned flags and looks at the values in fields.
30944 * Two objects with NULL inner values will be considered "equal" here.
30946 bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
30949 * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
30951 void TxAddOutput_free(struct LDKTxAddOutput this_obj);
30956 const uint8_t (*TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr))[32];
30961 void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
30964 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
30967 uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
30970 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
30973 void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
30976 * The satoshi value of the output
30978 uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
30981 * The satoshi value of the output
30983 void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
30986 * The scriptPubKey for the output
30988 struct LDKu8slice TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
30991 * The scriptPubKey for the output
30993 void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
30996 * Constructs a new TxAddOutput given each field
30998 MUST_USE_RES struct LDKTxAddOutput TxAddOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg, uint64_t sats_arg, struct LDKCVec_u8Z script_arg);
31001 * Creates a copy of the TxAddOutput
31003 struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
31006 * Checks if two TxAddOutputs contain equal inner contents.
31007 * This ignores pointers and is_owned flags and looks at the values in fields.
31008 * Two objects with NULL inner values will be considered "equal" here.
31010 bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
31013 * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
31015 void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
31020 const uint8_t (*TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr))[32];
31025 void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31028 * The serial ID of the input to be removed
31030 uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
31033 * The serial ID of the input to be removed
31035 void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
31038 * Constructs a new TxRemoveInput given each field
31040 MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
31043 * Creates a copy of the TxRemoveInput
31045 struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
31048 * Checks if two TxRemoveInputs contain equal inner contents.
31049 * This ignores pointers and is_owned flags and looks at the values in fields.
31050 * Two objects with NULL inner values will be considered "equal" here.
31052 bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
31055 * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
31057 void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
31062 const uint8_t (*TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr))[32];
31067 void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31070 * The serial ID of the output to be removed
31072 uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
31075 * The serial ID of the output to be removed
31077 void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
31080 * Constructs a new TxRemoveOutput given each field
31082 MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
31085 * Creates a copy of the TxRemoveOutput
31087 struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
31090 * Checks if two TxRemoveOutputs contain equal inner contents.
31091 * This ignores pointers and is_owned flags and looks at the values in fields.
31092 * Two objects with NULL inner values will be considered "equal" here.
31094 bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
31097 * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
31099 void TxComplete_free(struct LDKTxComplete this_obj);
31104 const uint8_t (*TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr))[32];
31109 void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31112 * Constructs a new TxComplete given each field
31114 MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKThirtyTwoBytes channel_id_arg);
31117 * Creates a copy of the TxComplete
31119 struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
31122 * Checks if two TxCompletes contain equal inner contents.
31123 * This ignores pointers and is_owned flags and looks at the values in fields.
31124 * Two objects with NULL inner values will be considered "equal" here.
31126 bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
31129 * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
31131 void TxSignatures_free(struct LDKTxSignatures this_obj);
31136 const uint8_t (*TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
31141 void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31146 const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
31151 void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31154 * The list of witnesses
31156 * Returns a copy of the field.
31158 struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
31161 * The list of witnesses
31163 void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
31166 * Constructs a new TxSignatures given each field
31168 MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg);
31171 * Creates a copy of the TxSignatures
31173 struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
31176 * Checks if two TxSignaturess contain equal inner contents.
31177 * This ignores pointers and is_owned flags and looks at the values in fields.
31178 * Two objects with NULL inner values will be considered "equal" here.
31180 bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
31183 * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
31185 void TxInitRbf_free(struct LDKTxInitRbf this_obj);
31190 const uint8_t (*TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr))[32];
31195 void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31198 * The locktime of the transaction
31200 uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
31203 * The locktime of the transaction
31205 void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
31208 * The feerate of the transaction
31210 uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
31213 * The feerate of the transaction
31215 void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
31218 * The number of satoshis the sender will contribute to or, if negative, remove from
31219 * (e.g. splice-out) the funding output of the transaction
31221 struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
31224 * The number of satoshis the sender will contribute to or, if negative, remove from
31225 * (e.g. splice-out) the funding output of the transaction
31227 void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
31230 * Constructs a new TxInitRbf given each field
31232 MUST_USE_RES struct LDKTxInitRbf TxInitRbf_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t locktime_arg, uint32_t feerate_sat_per_1000_weight_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
31235 * Creates a copy of the TxInitRbf
31237 struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
31240 * Checks if two TxInitRbfs contain equal inner contents.
31241 * This ignores pointers and is_owned flags and looks at the values in fields.
31242 * Two objects with NULL inner values will be considered "equal" here.
31244 bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
31247 * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
31249 void TxAckRbf_free(struct LDKTxAckRbf this_obj);
31254 const uint8_t (*TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr))[32];
31259 void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31262 * The number of satoshis the sender will contribute to or, if negative, remove from
31263 * (e.g. splice-out) the funding output of the transaction
31265 struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
31268 * The number of satoshis the sender will contribute to or, if negative, remove from
31269 * (e.g. splice-out) the funding output of the transaction
31271 void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
31274 * Constructs a new TxAckRbf given each field
31276 MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
31279 * Creates a copy of the TxAckRbf
31281 struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
31284 * Checks if two TxAckRbfs contain equal inner contents.
31285 * This ignores pointers and is_owned flags and looks at the values in fields.
31286 * Two objects with NULL inner values will be considered "equal" here.
31288 bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
31291 * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
31293 void TxAbort_free(struct LDKTxAbort this_obj);
31298 const uint8_t (*TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr))[32];
31303 void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31308 * Returns a copy of the field.
31310 struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
31315 void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
31318 * Constructs a new TxAbort given each field
31320 MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
31323 * Creates a copy of the TxAbort
31325 struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
31328 * Checks if two TxAborts contain equal inner contents.
31329 * This ignores pointers and is_owned flags and looks at the values in fields.
31330 * Two objects with NULL inner values will be considered "equal" here.
31332 bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
31335 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
31337 void Shutdown_free(struct LDKShutdown this_obj);
31342 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
31347 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31350 * The destination of this peer's funds on closing.
31352 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
31354 struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
31357 * The destination of this peer's funds on closing.
31359 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
31361 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
31364 * Constructs a new Shutdown given each field
31366 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
31369 * Creates a copy of the Shutdown
31371 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
31374 * Checks if two Shutdowns contain equal inner contents.
31375 * This ignores pointers and is_owned flags and looks at the values in fields.
31376 * Two objects with NULL inner values will be considered "equal" here.
31378 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
31381 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
31383 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
31386 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
31389 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
31392 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
31395 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
31398 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
31401 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
31404 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
31407 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
31410 * Constructs a new ClosingSignedFeeRange given each field
31412 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
31415 * Creates a copy of the ClosingSignedFeeRange
31417 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
31420 * Checks if two ClosingSignedFeeRanges contain equal inner contents.
31421 * This ignores pointers and is_owned flags and looks at the values in fields.
31422 * Two objects with NULL inner values will be considered "equal" here.
31424 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
31427 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
31429 void ClosingSigned_free(struct LDKClosingSigned this_obj);
31434 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
31439 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31442 * The proposed total fee for the closing transaction
31444 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
31447 * The proposed total fee for the closing transaction
31449 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
31452 * A signature on the closing transaction
31454 struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
31457 * A signature on the closing transaction
31459 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
31462 * The minimum and maximum fees which the sender is willing to accept, provided only by new
31465 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31467 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
31470 * The minimum and maximum fees which the sender is willing to accept, provided only by new
31473 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
31475 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
31478 * Constructs a new ClosingSigned given each field
31480 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);
31483 * Creates a copy of the ClosingSigned
31485 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
31488 * Checks if two ClosingSigneds contain equal inner contents.
31489 * This ignores pointers and is_owned flags and looks at the values in fields.
31490 * Two objects with NULL inner values will be considered "equal" here.
31492 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
31495 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
31497 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
31502 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
31507 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31512 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
31517 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
31520 * The HTLC value in milli-satoshi
31522 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
31525 * The HTLC value in milli-satoshi
31527 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
31530 * The payment hash, the pre-image of which controls HTLC redemption
31532 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
31535 * The payment hash, the pre-image of which controls HTLC redemption
31537 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31540 * The expiry height of the HTLC
31542 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
31545 * The expiry height of the HTLC
31547 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
31550 * The extra fee skimmed by the sender of this message. See
31551 * [`ChannelConfig::accept_underpaying_htlcs`].
31553 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
31555 struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
31558 * The extra fee skimmed by the sender of this message. See
31559 * [`ChannelConfig::accept_underpaying_htlcs`].
31561 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
31563 void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
31566 * Creates a copy of the UpdateAddHTLC
31568 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
31571 * Checks if two UpdateAddHTLCs contain equal inner contents.
31572 * This ignores pointers and is_owned flags and looks at the values in fields.
31573 * Two objects with NULL inner values will be considered "equal" here.
31575 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
31578 * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
31580 void OnionMessage_free(struct LDKOnionMessage this_obj);
31583 * Used in decrypting the onion packet's payload.
31585 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
31588 * Used in decrypting the onion packet's payload.
31590 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31593 * Creates a copy of the OnionMessage
31595 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
31598 * Checks if two OnionMessages contain equal inner contents.
31599 * This ignores pointers and is_owned flags and looks at the values in fields.
31600 * Two objects with NULL inner values will be considered "equal" here.
31602 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
31605 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
31607 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
31612 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
31617 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31622 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
31627 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
31630 * The pre-image of the payment hash, allowing HTLC redemption
31632 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
31635 * The pre-image of the payment hash, allowing HTLC redemption
31637 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31640 * Constructs a new UpdateFulfillHTLC given each field
31642 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
31645 * Creates a copy of the UpdateFulfillHTLC
31647 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
31650 * Checks if two UpdateFulfillHTLCs contain equal inner contents.
31651 * This ignores pointers and is_owned flags and looks at the values in fields.
31652 * Two objects with NULL inner values will be considered "equal" here.
31654 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
31657 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
31659 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
31664 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
31669 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31674 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
31679 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
31682 * Creates a copy of the UpdateFailHTLC
31684 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
31687 * Checks if two UpdateFailHTLCs contain equal inner contents.
31688 * This ignores pointers and is_owned flags and looks at the values in fields.
31689 * Two objects with NULL inner values will be considered "equal" here.
31691 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
31694 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
31696 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
31701 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
31706 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31711 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
31716 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
31721 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
31726 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
31729 * Creates a copy of the UpdateFailMalformedHTLC
31731 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
31734 * Checks if two UpdateFailMalformedHTLCs 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 UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
31741 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
31743 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
31748 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
31753 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31756 * A signature on the commitment transaction
31758 struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
31761 * A signature on the commitment transaction
31763 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val);
31766 * Signatures on the HTLC transactions
31768 * Returns a copy of the field.
31770 struct LDKCVec_SignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
31773 * Signatures on the HTLC transactions
31775 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
31778 * Constructs a new CommitmentSigned given each field
31780 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg);
31783 * Creates a copy of the CommitmentSigned
31785 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
31788 * Checks if two CommitmentSigneds contain equal inner contents.
31789 * This ignores pointers and is_owned flags and looks at the values in fields.
31790 * Two objects with NULL inner values will be considered "equal" here.
31792 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
31795 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
31797 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
31802 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
31807 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31810 * The secret corresponding to the per-commitment point
31812 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
31815 * The secret corresponding to the per-commitment point
31817 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31820 * The next sender-broadcast commitment transaction's per-commitment point
31822 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
31825 * The next sender-broadcast commitment transaction's per-commitment point
31827 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31830 * Constructs a new RevokeAndACK given each field
31832 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);
31835 * Creates a copy of the RevokeAndACK
31837 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
31840 * Checks if two RevokeAndACKs contain equal inner contents.
31841 * This ignores pointers and is_owned flags and looks at the values in fields.
31842 * Two objects with NULL inner values will be considered "equal" here.
31844 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
31847 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
31849 void UpdateFee_free(struct LDKUpdateFee this_obj);
31854 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
31859 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31862 * Fee rate per 1000-weight of the transaction
31864 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
31867 * Fee rate per 1000-weight of the transaction
31869 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
31872 * Constructs a new UpdateFee given each field
31874 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
31877 * Creates a copy of the UpdateFee
31879 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
31882 * Checks if two UpdateFees contain equal inner contents.
31883 * This ignores pointers and is_owned flags and looks at the values in fields.
31884 * Two objects with NULL inner values will be considered "equal" here.
31886 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
31889 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
31891 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
31896 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
31901 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31904 * The next commitment number for the sender
31906 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
31909 * The next commitment number for the sender
31911 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
31914 * The next commitment number for the recipient
31916 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
31919 * The next commitment number for the recipient
31921 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
31924 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
31925 * belonging to the recipient
31927 const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
31930 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
31931 * belonging to the recipient
31933 void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31936 * The sender's per-commitment point for their current commitment transaction
31938 struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
31941 * The sender's per-commitment point for their current commitment transaction
31943 void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31946 * The next funding transaction ID
31948 struct LDKCOption_TxidZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
31951 * The next funding transaction ID
31953 void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_TxidZ val);
31956 * Constructs a new ChannelReestablish given each field
31958 MUST_USE_RES struct LDKChannelReestablish ChannelReestablish_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t next_local_commitment_number_arg, uint64_t next_remote_commitment_number_arg, struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg, struct LDKCOption_TxidZ next_funding_txid_arg);
31961 * Creates a copy of the ChannelReestablish
31963 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
31966 * Checks if two ChannelReestablishs contain equal inner contents.
31967 * This ignores pointers and is_owned flags and looks at the values in fields.
31968 * Two objects with NULL inner values will be considered "equal" here.
31970 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
31973 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
31975 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
31980 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
31985 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31988 * The short channel ID
31990 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
31993 * The short channel ID
31995 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
31998 * A signature by the node key
32000 struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
32003 * A signature by the node key
32005 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
32008 * A signature by the funding key
32010 struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
32013 * A signature by the funding key
32015 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val);
32018 * Constructs a new AnnouncementSignatures given each field
32020 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);
32023 * Creates a copy of the AnnouncementSignatures
32025 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
32028 * Checks if two AnnouncementSignaturess contain equal inner contents.
32029 * This ignores pointers and is_owned flags and looks at the values in fields.
32030 * Two objects with NULL inner values will be considered "equal" here.
32032 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
32035 * Frees any resources used by the NetAddress
32037 void NetAddress_free(struct LDKNetAddress this_ptr);
32040 * Creates a copy of the NetAddress
32042 struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
32045 * Utility method to constructs a new IPv4-variant NetAddress
32047 struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
32050 * Utility method to constructs a new IPv6-variant NetAddress
32052 struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
32055 * Utility method to constructs a new OnionV2-variant NetAddress
32057 struct LDKNetAddress NetAddress_onion_v2(struct LDKTwelveBytes a);
32060 * Utility method to constructs a new OnionV3-variant NetAddress
32062 struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
32065 * Utility method to constructs a new Hostname-variant NetAddress
32067 struct LDKNetAddress NetAddress_hostname(struct LDKHostname hostname, uint16_t port);
32070 * Checks if two NetAddresss contain equal inner contents.
32071 * This ignores pointers and is_owned flags and looks at the values in fields.
32073 bool NetAddress_eq(const struct LDKNetAddress *NONNULL_PTR a, const struct LDKNetAddress *NONNULL_PTR b);
32076 * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
32078 struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
32081 * Read a NetAddress from a byte array, created by NetAddress_write
32083 struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
32086 * Frees any resources used by the UnsignedGossipMessage
32088 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
32091 * Creates a copy of the UnsignedGossipMessage
32093 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
32096 * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
32098 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
32101 * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
32103 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
32106 * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
32108 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
32111 * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
32113 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
32116 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
32118 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
32121 * The advertised features
32123 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
32126 * The advertised features
32128 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
32131 * A strictly monotonic announcement counter, with gaps allowed
32133 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
32136 * A strictly monotonic announcement counter, with gaps allowed
32138 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
32141 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
32144 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
32147 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
32150 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
32153 * An RGB color for UI purposes
32155 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
32158 * An RGB color for UI purposes
32160 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
32163 * An alias, for UI purposes.
32165 * This should be sanitized before use. There is no guarantee of uniqueness.
32167 struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
32170 * An alias, for UI purposes.
32172 * This should be sanitized before use. There is no guarantee of uniqueness.
32174 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
32177 * List of addresses on which this node is reachable
32179 * Returns a copy of the field.
32181 struct LDKCVec_NetAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
32184 * List of addresses on which this node is reachable
32186 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val);
32189 * Creates a copy of the UnsignedNodeAnnouncement
32191 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
32194 * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
32195 * This ignores pointers and is_owned flags and looks at the values in fields.
32196 * Two objects with NULL inner values will be considered "equal" here.
32198 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
32201 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
32203 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
32206 * The signature by the node key
32208 struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
32211 * The signature by the node key
32213 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
32216 * The actual content of the announcement
32218 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
32221 * The actual content of the announcement
32223 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
32226 * Constructs a new NodeAnnouncement given each field
32228 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
32231 * Creates a copy of the NodeAnnouncement
32233 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
32236 * Checks if two NodeAnnouncements contain equal inner contents.
32237 * This ignores pointers and is_owned flags and looks at the values in fields.
32238 * Two objects with NULL inner values will be considered "equal" here.
32240 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
32243 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
32245 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
32248 * The advertised channel features
32250 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
32253 * The advertised channel features
32255 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
32258 * The genesis hash of the blockchain where the channel is to be opened
32260 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
32263 * The genesis hash of the blockchain where the channel is to be opened
32265 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32268 * The short channel ID
32270 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
32273 * The short channel ID
32275 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
32278 * One of the two `node_id`s which are endpoints of this channel
32280 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
32283 * One of the two `node_id`s which are endpoints of this channel
32285 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
32288 * The other of the two `node_id`s which are endpoints of this channel
32290 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
32293 * The other of the two `node_id`s which are endpoints of this channel
32295 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
32298 * The funding key for the first node
32300 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
32303 * The funding key for the first node
32305 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
32308 * The funding key for the second node
32310 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
32313 * The funding key for the second node
32315 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
32318 * Creates a copy of the UnsignedChannelAnnouncement
32320 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
32323 * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
32324 * This ignores pointers and is_owned flags and looks at the values in fields.
32325 * Two objects with NULL inner values will be considered "equal" here.
32327 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
32330 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
32332 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
32335 * Authentication of the announcement by the first public node
32337 struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
32340 * Authentication of the announcement by the first public node
32342 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
32345 * Authentication of the announcement by the second public node
32347 struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
32350 * Authentication of the announcement by the second public node
32352 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
32355 * Proof of funding UTXO ownership by the first public node
32357 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
32360 * Proof of funding UTXO ownership by the first public node
32362 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
32365 * Proof of funding UTXO ownership by the second public node
32367 struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
32370 * Proof of funding UTXO ownership by the second public node
32372 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val);
32375 * The actual announcement
32377 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
32380 * The actual announcement
32382 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
32385 * Constructs a new ChannelAnnouncement given each field
32387 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);
32390 * Creates a copy of the ChannelAnnouncement
32392 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
32395 * Checks if two ChannelAnnouncements contain equal inner contents.
32396 * This ignores pointers and is_owned flags and looks at the values in fields.
32397 * Two objects with NULL inner values will be considered "equal" here.
32399 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
32402 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
32404 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
32407 * The genesis hash of the blockchain where the channel is to be opened
32409 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
32412 * The genesis hash of the blockchain where the channel is to be opened
32414 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32417 * The short channel ID
32419 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
32422 * The short channel ID
32424 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
32427 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
32429 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
32432 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
32434 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
32439 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
32444 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
32447 * The number of blocks such that if:
32448 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
32449 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
32450 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
32451 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
32452 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
32453 * forwarding. Note that the HTLC sender is the one who originally sets this value when
32454 * constructing the route.
32456 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
32459 * The number of blocks such that if:
32460 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
32461 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
32462 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
32463 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
32464 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
32465 * forwarding. Note that the HTLC sender is the one who originally sets this value when
32466 * constructing the route.
32468 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
32471 * The minimum HTLC size incoming to sender, in milli-satoshi
32473 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
32476 * The minimum HTLC size incoming to sender, in milli-satoshi
32478 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
32481 * The maximum HTLC value incoming to sender, in milli-satoshi.
32483 * This used to be optional.
32485 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
32488 * The maximum HTLC value incoming to sender, in milli-satoshi.
32490 * This used to be optional.
32492 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
32495 * The base HTLC fee charged by sender, in milli-satoshi
32497 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
32500 * The base HTLC fee charged by sender, in milli-satoshi
32502 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
32505 * The amount to fee multiplier, in micro-satoshi
32507 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
32510 * The amount to fee multiplier, in micro-satoshi
32512 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
32515 * Excess data which was signed as a part of the message which we do not (yet) understand how
32518 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
32520 * Returns a copy of the field.
32522 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
32525 * Excess data which was signed as a part of the message which we do not (yet) understand how
32528 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
32530 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
32533 * Constructs a new UnsignedChannelUpdate given each field
32535 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);
32538 * Creates a copy of the UnsignedChannelUpdate
32540 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
32543 * Checks if two UnsignedChannelUpdates contain equal inner contents.
32544 * This ignores pointers and is_owned flags and looks at the values in fields.
32545 * Two objects with NULL inner values will be considered "equal" here.
32547 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
32550 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
32552 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
32555 * A signature of the channel update
32557 struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
32560 * A signature of the channel update
32562 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val);
32565 * The actual channel update
32567 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
32570 * The actual channel update
32572 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
32575 * Constructs a new ChannelUpdate given each field
32577 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
32580 * Creates a copy of the ChannelUpdate
32582 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
32585 * Checks if two ChannelUpdates contain equal inner contents.
32586 * This ignores pointers and is_owned flags and looks at the values in fields.
32587 * Two objects with NULL inner values will be considered "equal" here.
32589 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
32592 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
32594 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
32597 * The genesis hash of the blockchain being queried
32599 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
32602 * The genesis hash of the blockchain being queried
32604 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32607 * The height of the first block for the channel UTXOs being queried
32609 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
32612 * The height of the first block for the channel UTXOs being queried
32614 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
32617 * The number of blocks to include in the query results
32619 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
32622 * The number of blocks to include in the query results
32624 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
32627 * Constructs a new QueryChannelRange given each field
32629 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
32632 * Creates a copy of the QueryChannelRange
32634 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
32637 * Checks if two QueryChannelRanges contain equal inner contents.
32638 * This ignores pointers and is_owned flags and looks at the values in fields.
32639 * Two objects with NULL inner values will be considered "equal" here.
32641 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
32644 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
32646 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
32649 * The genesis hash of the blockchain being queried
32651 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
32654 * The genesis hash of the blockchain being queried
32656 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32659 * The height of the first block in the range of the reply
32661 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
32664 * The height of the first block in the range of the reply
32666 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
32669 * The number of blocks included in the range of the reply
32671 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
32674 * The number of blocks included in the range of the reply
32676 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
32679 * True when this is the final reply for a query
32681 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
32684 * True when this is the final reply for a query
32686 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
32689 * The `short_channel_id`s in the channel range
32691 * Returns a copy of the field.
32693 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
32696 * The `short_channel_id`s in the channel range
32698 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
32701 * Constructs a new ReplyChannelRange given each field
32703 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);
32706 * Creates a copy of the ReplyChannelRange
32708 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
32711 * Checks if two ReplyChannelRanges contain equal inner contents.
32712 * This ignores pointers and is_owned flags and looks at the values in fields.
32713 * Two objects with NULL inner values will be considered "equal" here.
32715 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
32718 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
32720 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
32723 * The genesis hash of the blockchain being queried
32725 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
32728 * The genesis hash of the blockchain being queried
32730 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32733 * The short_channel_ids that are being queried
32735 * Returns a copy of the field.
32737 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
32740 * The short_channel_ids that are being queried
32742 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
32745 * Constructs a new QueryShortChannelIds given each field
32747 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
32750 * Creates a copy of the QueryShortChannelIds
32752 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
32755 * Checks if two QueryShortChannelIdss contain equal inner contents.
32756 * This ignores pointers and is_owned flags and looks at the values in fields.
32757 * Two objects with NULL inner values will be considered "equal" here.
32759 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
32762 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
32764 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
32767 * The genesis hash of the blockchain that was queried
32769 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
32772 * The genesis hash of the blockchain that was queried
32774 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32777 * Indicates if the query recipient maintains up-to-date channel
32778 * information for the `chain_hash`
32780 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
32783 * Indicates if the query recipient maintains up-to-date channel
32784 * information for the `chain_hash`
32786 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
32789 * Constructs a new ReplyShortChannelIdsEnd given each field
32791 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
32794 * Creates a copy of the ReplyShortChannelIdsEnd
32796 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
32799 * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
32800 * This ignores pointers and is_owned flags and looks at the values in fields.
32801 * Two objects with NULL inner values will be considered "equal" here.
32803 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
32806 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
32808 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
32811 * The genesis hash of the blockchain for channel and node information
32813 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
32816 * The genesis hash of the blockchain for channel and node information
32818 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32821 * The starting unix timestamp
32823 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
32826 * The starting unix timestamp
32828 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
32831 * The range of information in seconds
32833 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
32836 * The range of information in seconds
32838 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
32841 * Constructs a new GossipTimestampFilter given each field
32843 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
32846 * Creates a copy of the GossipTimestampFilter
32848 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
32851 * Checks if two GossipTimestampFilters contain equal inner contents.
32852 * This ignores pointers and is_owned flags and looks at the values in fields.
32853 * Two objects with NULL inner values will be considered "equal" here.
32855 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
32858 * Frees any resources used by the ErrorAction
32860 void ErrorAction_free(struct LDKErrorAction this_ptr);
32863 * Creates a copy of the ErrorAction
32865 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
32868 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
32870 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
32873 * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
32875 struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
32878 * Utility method to constructs a new IgnoreError-variant ErrorAction
32880 struct LDKErrorAction ErrorAction_ignore_error(void);
32883 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
32885 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
32888 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
32890 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
32893 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
32895 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
32898 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
32900 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
32903 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
32905 void LightningError_free(struct LDKLightningError this_obj);
32908 * A human-readable message describing the error
32910 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
32913 * A human-readable message describing the error
32915 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
32918 * The action which should be taken against the offending peer.
32920 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
32923 * The action which should be taken against the offending peer.
32925 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
32928 * Constructs a new LightningError given each field
32930 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
32933 * Creates a copy of the LightningError
32935 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
32938 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
32940 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
32943 * `update_add_htlc` messages which should be sent
32945 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
32948 * `update_add_htlc` messages which should be sent
32950 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
32953 * `update_fulfill_htlc` messages which should be sent
32955 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
32958 * `update_fulfill_htlc` messages which should be sent
32960 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
32963 * `update_fail_htlc` messages which should be sent
32965 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
32968 * `update_fail_htlc` messages which should be sent
32970 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
32973 * `update_fail_malformed_htlc` messages which should be sent
32975 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
32978 * `update_fail_malformed_htlc` messages which should be sent
32980 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
32983 * An `update_fee` message which should be sent
32985 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32987 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
32990 * An `update_fee` message which should be sent
32992 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32994 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
32997 * A `commitment_signed` message which should be sent
32999 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
33002 * A `commitment_signed` message which should be sent
33004 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
33007 * Constructs a new CommitmentUpdate given each field
33009 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);
33012 * Creates a copy of the CommitmentUpdate
33014 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
33017 * Checks if two CommitmentUpdates contain equal inner contents.
33018 * This ignores pointers and is_owned flags and looks at the values in fields.
33019 * Two objects with NULL inner values will be considered "equal" here.
33021 bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
33024 * Calls the free function if one is set
33026 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
33029 * Calls the free function if one is set
33031 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
33034 * Calls the free function if one is set
33036 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
33039 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
33041 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
33044 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
33046 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
33049 * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
33051 struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
33054 * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
33056 struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
33059 * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
33061 struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
33064 * Read a TxAddInput from a byte array, created by TxAddInput_write
33066 struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
33069 * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
33071 struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
33074 * Read a TxAddOutput from a byte array, created by TxAddOutput_write
33076 struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
33079 * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
33081 struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
33084 * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
33086 struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
33089 * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
33091 struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
33094 * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
33096 struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
33099 * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
33101 struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
33104 * Read a TxComplete from a byte array, created by TxComplete_write
33106 struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
33109 * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
33111 struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
33114 * Read a TxSignatures from a byte array, created by TxSignatures_write
33116 struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
33119 * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
33121 struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
33124 * Read a TxInitRbf from a byte array, created by TxInitRbf_write
33126 struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
33129 * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
33131 struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
33134 * Read a TxAckRbf from a byte array, created by TxAckRbf_write
33136 struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
33139 * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
33141 struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
33144 * Read a TxAbort from a byte array, created by TxAbort_write
33146 struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
33149 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
33151 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
33154 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
33156 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
33159 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
33161 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
33164 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
33166 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
33169 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
33171 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
33174 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
33176 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
33179 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
33181 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
33184 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
33186 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
33189 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
33191 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
33194 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
33196 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
33199 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
33201 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
33204 * Read a FundingCreated from a byte array, created by FundingCreated_write
33206 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
33209 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
33211 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
33214 * Read a FundingSigned from a byte array, created by FundingSigned_write
33216 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
33219 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
33221 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
33224 * Read a ChannelReady from a byte array, created by ChannelReady_write
33226 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
33229 * Serialize the Init object into a byte array which can be read by Init_read
33231 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
33234 * Read a Init from a byte array, created by Init_write
33236 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
33239 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
33241 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
33244 * Read a OpenChannel from a byte array, created by OpenChannel_write
33246 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
33249 * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
33251 struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
33254 * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
33256 struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
33259 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
33261 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
33264 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
33266 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
33269 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
33271 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
33274 * Read a Shutdown from a byte array, created by Shutdown_write
33276 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
33279 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
33281 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
33284 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
33286 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
33289 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
33291 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
33294 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
33296 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
33299 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
33301 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
33304 * Read a UpdateFee from a byte array, created by UpdateFee_write
33306 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
33309 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
33311 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
33314 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
33316 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
33319 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
33321 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
33324 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
33326 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
33329 * Read a OnionMessage from a byte array, created by OnionMessage_write
33331 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
33334 * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
33336 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
33339 * Serialize the Ping object into a byte array which can be read by Ping_read
33341 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
33344 * Read a Ping from a byte array, created by Ping_write
33346 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
33349 * Serialize the Pong object into a byte array which can be read by Pong_read
33351 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
33354 * Read a Pong from a byte array, created by Pong_write
33356 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
33359 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
33361 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
33364 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
33366 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
33369 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
33371 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
33374 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
33376 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
33379 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
33381 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
33384 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
33386 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
33389 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
33391 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
33394 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
33396 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
33399 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
33401 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
33404 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
33406 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
33409 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
33411 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
33414 * Read a WarningMessage from a byte array, created by WarningMessage_write
33416 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
33419 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
33421 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
33424 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
33426 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
33429 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
33431 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
33434 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
33436 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
33439 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
33441 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
33444 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
33446 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
33449 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
33451 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
33454 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
33456 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
33459 * Calculates the overflow safe ending block height for the query.
33461 * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
33463 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
33466 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
33468 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
33471 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
33473 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
33476 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
33478 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
33481 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
33483 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
33486 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
33488 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
33491 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
33493 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
33496 * Calls the free function if one is set
33498 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
33501 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
33503 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
33506 * Constructs a new IgnoringMessageHandler given each field
33508 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
33511 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
33512 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
33514 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
33517 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
33518 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
33520 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
33523 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
33524 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
33526 struct LDKOnionMessageProvider IgnoringMessageHandler_as_OnionMessageProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
33529 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
33530 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
33532 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
33535 * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
33536 * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
33538 struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
33541 * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
33542 * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
33544 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
33547 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
33548 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
33550 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
33553 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
33554 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
33556 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
33559 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
33561 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
33564 * Constructs a new ErroringMessageHandler
33566 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
33569 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
33570 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
33572 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
33575 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
33576 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
33578 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
33581 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
33583 void MessageHandler_free(struct LDKMessageHandler this_obj);
33586 * A message handler which handles messages specific to channels. Usually this is just a
33587 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
33589 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
33591 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
33594 * A message handler which handles messages specific to channels. Usually this is just a
33595 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
33597 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
33599 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
33602 * A message handler which handles messages updating our knowledge of the network channel
33603 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
33605 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
33607 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
33610 * A message handler which handles messages updating our knowledge of the network channel
33611 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
33613 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
33615 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
33618 * A message handler which handles onion messages. This should generally be an
33619 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
33621 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
33623 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
33626 * A message handler which handles onion messages. This should generally be an
33627 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
33629 * [`OnionMessenger`]: crate::onion_message::OnionMessenger
33631 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
33634 * A message handler which handles custom messages. The only LDK-provided implementation is
33635 * [`IgnoringMessageHandler`].
33637 const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
33640 * A message handler which handles custom messages. The only LDK-provided implementation is
33641 * [`IgnoringMessageHandler`].
33643 void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
33646 * Constructs a new MessageHandler given each field
33648 MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg, struct LDKOnionMessageHandler onion_message_handler_arg, struct LDKCustomMessageHandler custom_message_handler_arg);
33651 * Creates a copy of a SocketDescriptor
33653 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
33656 * Calls the free function if one is set
33658 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
33661 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
33663 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
33666 * Constructs a new PeerHandleError given each field
33668 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
33671 * Creates a copy of the PeerHandleError
33673 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
33676 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
33678 void PeerManager_free(struct LDKPeerManager this_obj);
33681 * Constructs a new `PeerManager` with the given message handlers.
33683 * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
33684 * cryptographically secure random bytes.
33686 * `current_time` is used as an always-increasing counter that survives across restarts and is
33687 * incremented irregularly internally. In general it is best to simply use the current UNIX
33688 * timestamp, however if it is not available a persistent counter that increases once per
33689 * minute should suffice.
33691 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 LDKNodeSigner node_signer);
33694 * Get a list of tuples mapping from node id to network addresses for peers which have
33695 * completed the initial handshake.
33697 * For outbound connections, the [`PublicKey`] will be the same as the `their_node_id` parameter
33698 * passed in to [`Self::new_outbound_connection`], however entries will only appear once the initial
33699 * handshake has completed and we are sure the remote peer has the private key for the given
33702 * The returned `Option`s will only be `Some` if an address had been previously given via
33703 * [`Self::new_outbound_connection`] or [`Self::new_inbound_connection`].
33705 MUST_USE_RES struct LDKCVec_C2Tuple_PublicKeyCOption_NetAddressZZZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
33708 * Indicates a new outbound connection has been established to a node with the given `node_id`
33709 * and an optional remote network address.
33711 * The remote network address adds the option to report a remote IP address back to a connecting
33712 * peer using the init message.
33713 * The user should pass the remote network address of the host they are connected to.
33715 * If an `Err` is returned here you must disconnect the connection immediately.
33717 * Returns a small number of bytes to send to the remote node (currently always 50).
33719 * Panics if descriptor is duplicative with some other descriptor which has not yet been
33720 * [`socket_disconnected`].
33722 * [`socket_disconnected`]: PeerManager::socket_disconnected
33724 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);
33727 * Indicates a new inbound connection has been established to a node with an optional remote
33730 * The remote network address adds the option to report a remote IP address back to a connecting
33731 * peer using the init message.
33732 * The user should pass the remote network address of the host they are connected to.
33734 * May refuse the connection by returning an Err, but will never write bytes to the remote end
33735 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
33736 * the connection immediately.
33738 * Panics if descriptor is duplicative with some other descriptor which has not yet been
33739 * [`socket_disconnected`].
33741 * [`socket_disconnected`]: PeerManager::socket_disconnected
33743 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);
33746 * Indicates that there is room to write data to the given socket descriptor.
33748 * May return an Err to indicate that the connection should be closed.
33750 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
33751 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
33752 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
33753 * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't
33756 * [`send_data`]: SocketDescriptor::send_data
33757 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
33759 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
33762 * Indicates that data was read from the given socket descriptor.
33764 * May return an Err to indicate that the connection should be closed.
33766 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
33767 * Thus, however, you should call [`process_events`] after any `read_event` to generate
33768 * [`send_data`] calls to handle responses.
33770 * If `Ok(true)` is returned, further read_events should not be triggered until a
33771 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
33774 * In order to avoid processing too many messages at once per peer, `data` should be on the
33777 * [`send_data`]: SocketDescriptor::send_data
33778 * [`process_events`]: PeerManager::process_events
33780 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);
33783 * Checks for any events generated by our handlers and processes them. Includes sending most
33784 * response messages as well as messages generated by calls to handler functions directly (eg
33785 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
33787 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
33790 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
33791 * or one of the other clients provided in our language bindings.
33793 * Note that if there are any other calls to this function waiting on lock(s) this may return
33794 * without doing any work. All available events that need handling will be handled before the
33795 * other calls return.
33797 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
33798 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
33799 * [`send_data`]: SocketDescriptor::send_data
33801 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
33804 * Indicates that the given socket descriptor's connection is now closed.
33806 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
33809 * Disconnect a peer given its node id.
33811 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
33812 * peer. Thus, be very careful about reentrancy issues.
33814 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
33816 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
33819 * Disconnects all currently-connected peers. This is useful on platforms where there may be
33820 * an indication that TCP sockets have stalled even if we weren't around to time them out
33821 * using regular ping/pongs.
33823 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
33826 * Send pings to each peer and disconnect those which did not respond to the last round of
33829 * This may be called on any timescale you want, however, roughly once every ten seconds is
33830 * preferred. The call rate determines both how often we send a ping to our peers and how much
33831 * time they have to respond before we disconnect them.
33833 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
33836 * [`send_data`]: SocketDescriptor::send_data
33838 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
33841 * Generates a signed node_announcement from the given arguments, sending it to all connected
33842 * peers. Note that peers will likely ignore this message unless we have at least one public
33843 * channel which has at least six confirmations on-chain.
33845 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
33846 * node to humans. They carry no in-protocol meaning.
33848 * `addresses` represent the set (possibly empty) of socket addresses on which this node
33849 * accepts incoming connections. These will be included in the node_announcement, publicly
33850 * tying these addresses together and to this node. If you wish to preserve user privacy,
33851 * addresses should likely contain only Tor Onion addresses.
33853 * Panics if `addresses` is absurdly large (more than 100).
33855 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
33857 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
33860 * Gets the weight for an HTLC-Success transaction.
33862 uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
33865 * Gets the weight for an HTLC-Timeout transaction.
33867 uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
33870 * Creates a copy of the HTLCClaim
33872 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
33875 * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
33877 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
33880 * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
33882 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
33885 * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
33887 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
33890 * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
33892 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
33895 * Utility method to constructs a new Revocation-variant HTLCClaim
33897 enum LDKHTLCClaim HTLCClaim_revocation(void);
33900 * Checks if two HTLCClaims contain equal inner contents.
33901 * This ignores pointers and is_owned flags and looks at the values in fields.
33903 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
33906 * Check if a given input witness attempts to claim a HTLC.
33908 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
33911 * Build the commitment secret from the seed and the commitment number
33913 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
33916 * Build a closing transaction
33918 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);
33921 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
33923 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
33926 * Creates a copy of the CounterpartyCommitmentSecrets
33928 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
33931 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
33933 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
33936 * Returns the minimum index of all stored secrets. Note that indexes start
33937 * at 1 << 48 and get decremented by one for each new secret.
33939 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
33942 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
33943 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
33945 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
33948 * Returns the secret at `idx`.
33949 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
33951 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
33953 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
33956 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
33958 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
33961 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
33963 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
33966 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
33967 * from the base secret and the per_commitment_point.
33969 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
33972 * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key)
33973 * from the base point and the per_commitment_key. This is the public equivalent of
33974 * derive_private_key - using only public keys to derive a public key instead of private keys.
33976 struct LDKPublicKey derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point);
33979 * Derives a per-commitment-transaction revocation key from its constituent parts.
33981 * Only the cheating participant owns a valid witness to propagate a revoked
33982 * commitment transaction, thus per_commitment_secret always come from cheater
33983 * and revocation_base_secret always come from punisher, which is the broadcaster
33984 * of the transaction spending with this key knowledge.
33986 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
33989 * Derives a per-commitment-transaction revocation public key from its constituent parts. This is
33990 * the public equivalend of derive_private_revocation_key - using only public keys to derive a
33991 * public key instead of private keys.
33993 * Only the cheating participant owns a valid witness to propagate a revoked
33994 * commitment transaction, thus per_commitment_point always come from cheater
33995 * and revocation_base_point always come from punisher, which is the broadcaster
33996 * of the transaction spending with this key knowledge.
33998 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
33999 * generated (ie our own).
34001 struct LDKPublicKey derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point);
34004 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
34006 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
34009 * The broadcaster's per-commitment public key which was used to derive the other keys.
34011 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
34014 * The broadcaster's per-commitment public key which was used to derive the other keys.
34016 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34019 * The revocation key which is used to allow the broadcaster of the commitment
34020 * transaction to provide their counterparty the ability to punish them if they broadcast
34023 struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
34026 * The revocation key which is used to allow the broadcaster of the commitment
34027 * transaction to provide their counterparty the ability to punish them if they broadcast
34030 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34033 * Broadcaster's HTLC Key
34035 struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
34038 * Broadcaster's HTLC Key
34040 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34043 * Countersignatory's HTLC Key
34045 struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
34048 * Countersignatory's HTLC Key
34050 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34053 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
34055 struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
34058 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
34060 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34063 * Constructs a new TxCreationKeys given each field
34065 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);
34068 * Checks if two TxCreationKeyss contain equal inner contents.
34069 * This ignores pointers and is_owned flags and looks at the values in fields.
34070 * Two objects with NULL inner values will be considered "equal" here.
34072 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
34075 * Creates a copy of the TxCreationKeys
34077 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
34080 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
34082 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
34085 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
34087 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
34090 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
34092 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
34095 * The public key which is used to sign all commitment transactions, as it appears in the
34096 * on-chain channel lock-in 2-of-2 multisig output.
34098 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
34101 * The public key which is used to sign all commitment transactions, as it appears in the
34102 * on-chain channel lock-in 2-of-2 multisig output.
34104 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34107 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
34108 * revocation keys. This is combined with the per-commitment-secret generated by the
34109 * counterparty to create a secret which the counterparty can reveal to revoke previous
34112 struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
34115 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
34116 * revocation keys. This is combined with the per-commitment-secret generated by the
34117 * counterparty to create a secret which the counterparty can reveal to revoke previous
34120 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34123 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
34124 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
34125 * static across every commitment transaction.
34127 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
34130 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
34131 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
34132 * static across every commitment transaction.
34134 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34137 * The base point which is used (with derive_public_key) to derive a per-commitment payment
34138 * public key which receives non-HTLC-encumbered funds which are only available for spending
34139 * after some delay (or can be claimed via the revocation path).
34141 struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
34144 * The base point which is used (with derive_public_key) to derive a per-commitment payment
34145 * public key which receives non-HTLC-encumbered funds which are only available for spending
34146 * after some delay (or can be claimed via the revocation path).
34148 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34151 * The base point which is used (with derive_public_key) to derive a per-commitment public key
34152 * which is used to encumber HTLC-in-flight outputs.
34154 struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
34157 * The base point which is used (with derive_public_key) to derive a per-commitment public key
34158 * which is used to encumber HTLC-in-flight outputs.
34160 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34163 * Constructs a new ChannelPublicKeys given each field
34165 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);
34168 * Creates a copy of the ChannelPublicKeys
34170 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
34173 * Checks if two ChannelPublicKeyss contain equal inner contents.
34174 * This ignores pointers and is_owned flags and looks at the values in fields.
34175 * Two objects with NULL inner values will be considered "equal" here.
34177 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
34180 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
34182 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
34185 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
34187 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
34190 * Create per-state keys from channel base points and the per-commitment point.
34191 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
34193 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);
34196 * Generate per-state keys from channel static keys.
34197 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
34199 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);
34202 * A script either spendable by the revocation
34203 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
34204 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
34206 struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key);
34209 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
34211 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
34214 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
34215 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
34216 * need to compare this value to whether the commitment transaction in question is that of
34217 * the counterparty or our own.
34219 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
34222 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
34223 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
34224 * need to compare this value to whether the commitment transaction in question is that of
34225 * the counterparty or our own.
34227 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
34230 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
34231 * this divided by 1000.
34233 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
34236 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
34237 * this divided by 1000.
34239 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
34242 * The CLTV lock-time at which this HTLC expires.
34244 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
34247 * The CLTV lock-time at which this HTLC expires.
34249 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
34252 * The hash of the preimage which unlocks this HTLC.
34254 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
34257 * The hash of the preimage which unlocks this HTLC.
34259 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34262 * The position within the commitment transactions' outputs. This may be None if the value is
34263 * below the dust limit (in which case no output appears in the commitment transaction and the
34264 * value is spent to additional transaction fees).
34266 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
34269 * The position within the commitment transactions' outputs. This may be None if the value is
34270 * below the dust limit (in which case no output appears in the commitment transaction and the
34271 * value is spent to additional transaction fees).
34273 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
34276 * Constructs a new HTLCOutputInCommitment given each field
34278 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);
34281 * Creates a copy of the HTLCOutputInCommitment
34283 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
34286 * Checks if two HTLCOutputInCommitments contain equal inner contents.
34287 * This ignores pointers and is_owned flags and looks at the values in fields.
34288 * Two objects with NULL inner values will be considered "equal" here.
34290 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
34293 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
34295 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
34298 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
34300 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
34303 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
34304 * does not need to have its previous_output_index filled.
34306 struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, const struct LDKTxCreationKeys *NONNULL_PTR keys);
34309 * Gets the redeemscript for a funding output from the two funding public keys.
34310 * Note that the order of funding public keys does not matter.
34312 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
34315 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
34316 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
34317 * transaction which needs signing, and can be used to construct an HTLC transaction which is
34318 * broadcastable given a counterparty HTLC signature.
34320 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
34321 * commitment transaction).
34323 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, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key);
34326 * Returns the witness required to satisfy and spend a HTLC input.
34328 struct LDKWitness build_htlc_input_witness(struct LDKSignature local_sig, struct LDKSignature remote_sig, struct LDKCOption_PaymentPreimageZ preimage, struct LDKu8slice redeem_script, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
34331 * Gets the witnessScript for the to_remote output when anchors are enabled.
34333 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
34336 * Gets the witnessScript for an anchor output from the funding public key.
34337 * The witness in the spending input must be:
34338 * <BIP 143 funding_signature>
34339 * After 16 blocks of confirmation, an alternative satisfying witness could be:
34341 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
34343 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
34346 * Returns the witness required to satisfy and spend an anchor input.
34348 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKSignature funding_sig);
34351 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
34353 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
34356 * Holder public keys
34358 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
34361 * Holder public keys
34363 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
34366 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
34368 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
34371 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
34373 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
34376 * Whether the holder is the initiator of this channel.
34377 * This is an input to the commitment number obscure factor computation.
34379 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
34382 * Whether the holder is the initiator of this channel.
34383 * This is an input to the commitment number obscure factor computation.
34385 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
34388 * The late-bound counterparty channel transaction parameters.
34389 * These parameters are populated at the point in the protocol where the counterparty provides them.
34391 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
34393 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
34396 * The late-bound counterparty channel transaction parameters.
34397 * These parameters are populated at the point in the protocol where the counterparty provides them.
34399 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
34401 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
34404 * The late-bound funding outpoint
34406 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
34408 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
34411 * The late-bound funding outpoint
34413 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
34415 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
34418 * This channel's type, as negotiated during channel open. For old objects where this field
34419 * wasn't serialized, it will default to static_remote_key at deserialization.
34421 struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
34424 * This channel's type, as negotiated during channel open. For old objects where this field
34425 * wasn't serialized, it will default to static_remote_key at deserialization.
34427 void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
34430 * Constructs a new ChannelTransactionParameters given each field
34432 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, struct LDKChannelTypeFeatures channel_type_features_arg);
34435 * Creates a copy of the ChannelTransactionParameters
34437 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
34440 * Checks if two ChannelTransactionParameterss contain equal inner contents.
34441 * This ignores pointers and is_owned flags and looks at the values in fields.
34442 * Two objects with NULL inner values will be considered "equal" here.
34444 bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
34447 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
34449 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
34452 * Counter-party public keys
34454 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
34457 * Counter-party public keys
34459 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
34462 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
34464 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
34467 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
34469 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
34472 * Constructs a new CounterpartyChannelTransactionParameters given each field
34474 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
34477 * Creates a copy of the CounterpartyChannelTransactionParameters
34479 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
34482 * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents.
34483 * This ignores pointers and is_owned flags and looks at the values in fields.
34484 * Two objects with NULL inner values will be considered "equal" here.
34486 bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
34489 * Whether the late bound parameters are populated.
34491 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
34494 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
34495 * given that the holder is the broadcaster.
34497 * self.is_populated() must be true before calling this function.
34499 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
34502 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
34503 * given that the counterparty is the broadcaster.
34505 * self.is_populated() must be true before calling this function.
34507 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
34510 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
34512 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
34515 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
34517 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
34520 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
34522 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
34525 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
34527 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
34530 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
34532 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
34535 * Get the channel pubkeys for the broadcaster
34537 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
34540 * Get the channel pubkeys for the countersignatory
34542 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
34545 * Get the contest delay applicable to the transactions.
34546 * Note that the contest delay was selected by the countersignatory.
34548 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
34551 * Whether the channel is outbound from the broadcaster.
34553 * The boolean representing the side that initiated the channel is
34554 * an input to the commitment number obscure factor computation.
34556 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
34559 * The funding outpoint
34561 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
34564 * Whether to use anchors for this channel
34566 MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
34569 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
34571 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
34574 * Our counterparty's signature for the transaction
34576 struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
34579 * Our counterparty's signature for the transaction
34581 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val);
34584 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
34586 * Returns a copy of the field.
34588 struct LDKCVec_SignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
34591 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
34593 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val);
34596 * Creates a copy of the HolderCommitmentTransaction
34598 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
34601 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
34603 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
34606 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
34608 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
34611 * Create a new holder transaction with the given counterparty signatures.
34612 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
34614 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);
34617 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
34619 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
34622 * The commitment transaction
34624 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
34627 * The commitment transaction
34629 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
34632 * The txid for the commitment transaction.
34634 * This is provided as a performance optimization, instead of calling transaction.txid()
34637 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
34640 * The txid for the commitment transaction.
34642 * This is provided as a performance optimization, instead of calling transaction.txid()
34645 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34648 * Constructs a new BuiltCommitmentTransaction given each field
34650 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
34653 * Creates a copy of the BuiltCommitmentTransaction
34655 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
34658 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
34660 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
34663 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
34665 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
34668 * Get the SIGHASH_ALL sighash value of the transaction.
34670 * This can be used to verify a signature.
34672 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);
34675 * Signs the counterparty's commitment transaction.
34677 MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign_counterparty_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
34680 * Signs the holder commitment transaction because we are about to broadcast it.
34682 MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign_holder_commitment(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis, const struct LDKEntropySource *NONNULL_PTR entropy_source);
34685 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
34687 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
34690 * Creates a copy of the ClosingTransaction
34692 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
34695 * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
34697 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
34700 * Checks if two ClosingTransactions contain equal inner contents.
34701 * This ignores pointers and is_owned flags and looks at the values in fields.
34702 * Two objects with NULL inner values will be considered "equal" here.
34704 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
34707 * Construct an object of the class
34709 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);
34712 * Trust our pre-built transaction.
34714 * Applies a wrapper which allows access to the transaction.
34716 * This should only be used if you fully trust the builder of this object. It should not
34717 * be used by an external signer - instead use the verify function.
34719 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
34722 * Verify our pre-built transaction.
34724 * Applies a wrapper which allows access to the transaction.
34726 * An external validating signer must call this method before signing
34727 * or using the built transaction.
34729 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
34732 * The value to be sent to the holder, or zero if the output will be omitted
34734 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
34737 * The value to be sent to the counterparty, or zero if the output will be omitted
34739 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
34742 * The destination of the holder's output
34744 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
34747 * The destination of the counterparty's output
34749 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
34752 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
34754 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
34757 * The pre-built Bitcoin commitment transaction
34759 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
34762 * Get the SIGHASH_ALL sighash value of the transaction.
34764 * This can be used to verify a signature.
34766 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);
34769 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
34770 * because we are about to broadcast a holder transaction.
34772 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);
34775 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
34777 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
34780 * Creates a copy of the CommitmentTransaction
34782 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
34785 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
34787 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
34790 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
34792 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
34795 * The backwards-counting commitment number
34797 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
34800 * The value to be sent to the broadcaster
34802 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
34805 * The value to be sent to the counterparty
34807 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
34810 * The feerate paid per 1000-weight-unit in this commitment transaction.
34812 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
34815 * Trust our pre-built transaction and derived transaction creation public keys.
34817 * Applies a wrapper which allows access to these fields.
34819 * This should only be used if you fully trust the builder of this object. It should not
34820 * be used by an external signer - instead use the verify function.
34822 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
34825 * Verify our pre-built transaction and derived transaction creation public keys.
34827 * Applies a wrapper which allows access to these fields.
34829 * An external validating signer must call this method before signing
34830 * or using the built transaction.
34832 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);
34835 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
34837 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
34840 * The transaction ID of the built Bitcoin transaction
34842 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
34845 * The pre-built Bitcoin commitment transaction
34847 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
34850 * The pre-calculated transaction creation public keys.
34852 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
34855 * Should anchors be used.
34857 MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
34860 * Get a signature for each HTLC which was included in the commitment transaction (ie for
34861 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
34863 * The returned Vec has one entry for each HTLC, and in the same order.
34865 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
34867 MUST_USE_RES struct LDKCResult_CVec_SignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKEntropySource *NONNULL_PTR entropy_source);
34870 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
34871 * shared secret first. This prevents on-chain observers from discovering how many commitment
34872 * transactions occurred in a channel before it was closed.
34874 * This function gets the shared secret from relevant channel public keys and can be used to
34875 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
34877 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
34880 * Checks if two InitFeaturess contain equal inner contents.
34881 * This ignores pointers and is_owned flags and looks at the values in fields.
34882 * Two objects with NULL inner values will be considered "equal" here.
34884 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
34887 * Checks if two NodeFeaturess contain equal inner contents.
34888 * This ignores pointers and is_owned flags and looks at the values in fields.
34889 * Two objects with NULL inner values will be considered "equal" here.
34891 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
34894 * Checks if two ChannelFeaturess contain equal inner contents.
34895 * This ignores pointers and is_owned flags and looks at the values in fields.
34896 * Two objects with NULL inner values will be considered "equal" here.
34898 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
34901 * Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
34902 * This ignores pointers and is_owned flags and looks at the values in fields.
34903 * Two objects with NULL inner values will be considered "equal" here.
34905 bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
34908 * Checks if two OfferFeaturess contain equal inner contents.
34909 * This ignores pointers and is_owned flags and looks at the values in fields.
34910 * Two objects with NULL inner values will be considered "equal" here.
34912 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
34915 * Checks if two InvoiceRequestFeaturess contain equal inner contents.
34916 * This ignores pointers and is_owned flags and looks at the values in fields.
34917 * Two objects with NULL inner values will be considered "equal" here.
34919 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
34922 * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
34923 * This ignores pointers and is_owned flags and looks at the values in fields.
34924 * Two objects with NULL inner values will be considered "equal" here.
34926 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
34929 * Checks if two BlindedHopFeaturess contain equal inner contents.
34930 * This ignores pointers and is_owned flags and looks at the values in fields.
34931 * Two objects with NULL inner values will be considered "equal" here.
34933 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
34936 * Checks if two ChannelTypeFeaturess contain equal inner contents.
34937 * This ignores pointers and is_owned flags and looks at the values in fields.
34938 * Two objects with NULL inner values will be considered "equal" here.
34940 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
34943 * Creates a copy of the InitFeatures
34945 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
34948 * Creates a copy of the NodeFeatures
34950 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
34953 * Creates a copy of the ChannelFeatures
34955 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
34958 * Creates a copy of the Bolt11InvoiceFeatures
34960 struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
34963 * Creates a copy of the OfferFeatures
34965 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
34968 * Creates a copy of the InvoiceRequestFeatures
34970 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
34973 * Creates a copy of the Bolt12InvoiceFeatures
34975 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
34978 * Creates a copy of the BlindedHopFeatures
34980 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
34983 * Creates a copy of the ChannelTypeFeatures
34985 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
34988 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
34990 void InitFeatures_free(struct LDKInitFeatures this_obj);
34993 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
34995 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
34998 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
35000 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
35003 * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
35005 void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
35008 * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
35010 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
35013 * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
35015 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
35018 * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
35020 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
35023 * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
35025 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
35028 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
35030 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
35033 * Create a blank Features with no features set
35035 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
35038 * Returns true if this `Features` object contains required features unknown by `other`.
35040 MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
35043 * Returns true if this `Features` object contains unknown feature flags which are set as
35046 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35049 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
35050 * by [bLIP 2] or if it is a known `T` feature.
35052 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
35053 * be set instead (i.e., `bit - 1`).
35055 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35057 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35060 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
35061 * by [bLIP 2] or if it is a known `T` feature.
35063 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
35064 * set instead (i.e., `bit + 1`).
35066 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35068 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35071 * Create a blank Features with no features set
35073 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
35076 * Returns true if this `Features` object contains required features unknown by `other`.
35078 MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
35081 * Returns true if this `Features` object contains unknown feature flags which are set as
35084 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35087 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
35088 * by [bLIP 2] or if it is a known `T` feature.
35090 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
35091 * be set instead (i.e., `bit - 1`).
35093 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35095 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35098 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
35099 * by [bLIP 2] or if it is a known `T` feature.
35101 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
35102 * set instead (i.e., `bit + 1`).
35104 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35106 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35109 * Create a blank Features with no features set
35111 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
35114 * Returns true if this `Features` object contains required features unknown by `other`.
35116 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
35119 * Returns true if this `Features` object contains unknown feature flags which are set as
35122 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
35125 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
35126 * by [bLIP 2] or if it is a known `T` feature.
35128 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
35129 * be set instead (i.e., `bit - 1`).
35131 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35133 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35136 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
35137 * by [bLIP 2] or if it is a known `T` feature.
35139 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
35140 * set instead (i.e., `bit + 1`).
35142 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35144 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35147 * Create a blank Features with no features set
35149 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
35152 * Returns true if this `Features` object contains required features unknown by `other`.
35154 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
35157 * Returns true if this `Features` object contains unknown feature flags which are set as
35160 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
35163 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
35164 * by [bLIP 2] or if it is a known `T` feature.
35166 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
35167 * be set instead (i.e., `bit - 1`).
35169 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35171 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35174 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
35175 * by [bLIP 2] or if it is a known `T` feature.
35177 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
35178 * set instead (i.e., `bit + 1`).
35180 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35182 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35185 * Create a blank Features with no features set
35187 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
35190 * Returns true if this `Features` object contains required features unknown by `other`.
35192 MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
35195 * Returns true if this `Features` object contains unknown feature flags which are set as
35198 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
35201 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
35202 * by [bLIP 2] or if it is a known `T` feature.
35204 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
35205 * be set instead (i.e., `bit - 1`).
35207 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35209 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35212 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
35213 * by [bLIP 2] or if it is a known `T` feature.
35215 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
35216 * set instead (i.e., `bit + 1`).
35218 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35220 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35223 * Create a blank Features with no features set
35225 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
35228 * Returns true if this `Features` object contains required features unknown by `other`.
35230 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
35233 * Returns true if this `Features` object contains unknown feature flags which are set as
35236 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
35239 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
35240 * by [bLIP 2] or if it is a known `T` feature.
35242 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
35243 * be set instead (i.e., `bit - 1`).
35245 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35247 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35250 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
35251 * by [bLIP 2] or if it is a known `T` feature.
35253 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
35254 * set instead (i.e., `bit + 1`).
35256 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35258 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35261 * Create a blank Features with no features set
35263 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
35266 * Returns true if this `Features` object contains required features unknown by `other`.
35268 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
35271 * Returns true if this `Features` object contains unknown feature flags which are set as
35274 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
35277 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
35278 * by [bLIP 2] or if it is a known `T` feature.
35280 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
35281 * be set instead (i.e., `bit - 1`).
35283 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35285 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35288 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
35289 * by [bLIP 2] or if it is a known `T` feature.
35291 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
35292 * set instead (i.e., `bit + 1`).
35294 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35296 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35299 * Create a blank Features with no features set
35301 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
35304 * Returns true if this `Features` object contains required features unknown by `other`.
35306 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
35309 * Returns true if this `Features` object contains unknown feature flags which are set as
35312 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
35315 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
35316 * by [bLIP 2] or if it is a known `T` feature.
35318 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
35319 * be set instead (i.e., `bit - 1`).
35321 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35323 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35326 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
35327 * by [bLIP 2] or if it is a known `T` feature.
35329 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
35330 * set instead (i.e., `bit + 1`).
35332 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35334 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35337 * Create a blank Features with no features set
35339 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
35342 * Returns true if this `Features` object contains required features unknown by `other`.
35344 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
35347 * Returns true if this `Features` object contains unknown feature flags which are set as
35350 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
35353 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
35354 * by [bLIP 2] or if it is a known `T` feature.
35356 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
35357 * be set instead (i.e., `bit - 1`).
35359 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35361 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35364 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
35365 * by [bLIP 2] or if it is a known `T` feature.
35367 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
35368 * set instead (i.e., `bit + 1`).
35370 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
35372 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
35375 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
35377 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
35380 * Read a InitFeatures from a byte array, created by InitFeatures_write
35382 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
35385 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
35387 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
35390 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
35392 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
35395 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
35397 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
35400 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
35402 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
35405 * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
35407 struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
35410 * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
35412 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
35415 * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
35417 struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
35420 * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
35422 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
35425 * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
35427 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
35430 * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
35432 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
35435 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
35437 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
35440 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
35442 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
35445 * Set this feature as optional.
35447 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
35450 * Set this feature as required.
35452 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
35455 * Checks if this feature is supported.
35457 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35460 * Set this feature as optional.
35462 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35465 * Set this feature as required.
35467 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35470 * Checks if this feature is supported.
35472 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35475 * Checks if this feature is required.
35477 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35480 * Checks if this feature is required.
35482 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35485 * Set this feature as optional.
35487 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
35490 * Set this feature as required.
35492 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
35495 * Checks if this feature is supported.
35497 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35500 * Set this feature as optional.
35502 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
35505 * Set this feature as required.
35507 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
35510 * Checks if this feature is supported.
35512 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35515 * Set this feature as optional.
35517 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35520 * Set this feature as required.
35522 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35525 * Checks if this feature is supported.
35527 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35530 * Checks if this feature is required.
35532 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35535 * Checks if this feature is required.
35537 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35540 * Set this feature as optional.
35542 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
35545 * Set this feature as required.
35547 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
35550 * Checks if this feature is supported.
35552 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35555 * Set this feature as optional.
35557 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35560 * Set this feature as required.
35562 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35565 * Checks if this feature is supported.
35567 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35570 * Checks if this feature is required.
35572 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35575 * Checks if this feature is required.
35577 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35580 * Set this feature as optional.
35582 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
35585 * Set this feature as required.
35587 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
35590 * Checks if this feature is supported.
35592 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35595 * Set this feature as optional.
35597 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35600 * Set this feature as required.
35602 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35605 * Checks if this feature is supported.
35607 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35610 * Set this feature as optional.
35612 void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
35615 * Set this feature as required.
35617 void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
35620 * Checks if this feature is supported.
35622 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
35625 * Checks if this feature is required.
35627 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35630 * Checks if this feature is required.
35632 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35635 * Checks if this feature is required.
35637 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
35640 * Set this feature as optional.
35642 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
35645 * Set this feature as required.
35647 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
35650 * Checks if this feature is supported.
35652 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35655 * Set this feature as optional.
35657 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35660 * Set this feature as required.
35662 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35665 * Checks if this feature is supported.
35667 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35670 * Set this feature as optional.
35672 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
35675 * Set this feature as required.
35677 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
35680 * Checks if this feature is supported.
35682 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
35685 * Checks if this feature is required.
35687 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35690 * Checks if this feature is required.
35692 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35695 * Checks if this feature is required.
35697 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
35700 * Set this feature as optional.
35702 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
35705 * Set this feature as required.
35707 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
35710 * Checks if this feature is supported.
35712 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35715 * Set this feature as optional.
35717 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35720 * Set this feature as required.
35722 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35725 * Checks if this feature is supported.
35727 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35730 * Set this feature as optional.
35732 void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
35735 * Set this feature as required.
35737 void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
35740 * Checks if this feature is supported.
35742 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
35745 * Checks if this feature is required.
35747 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35750 * Checks if this feature is required.
35752 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35755 * Checks if this feature is required.
35757 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
35760 * Set this feature as optional.
35762 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
35765 * Set this feature as required.
35767 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
35770 * Checks if this feature is supported.
35772 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35775 * Set this feature as optional.
35777 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35780 * Set this feature as required.
35782 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35785 * Checks if this feature is supported.
35787 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35790 * Set this feature as optional.
35792 void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
35795 * Set this feature as required.
35797 void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
35800 * Checks if this feature is supported.
35802 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
35805 * Set this feature as optional.
35807 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
35810 * Set this feature as required.
35812 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
35815 * Checks if this feature is supported.
35817 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
35820 * Checks if this feature is required.
35822 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35825 * Checks if this feature is required.
35827 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35830 * Checks if this feature is required.
35832 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
35835 * Checks if this feature is required.
35837 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
35840 * Set this feature as optional.
35842 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
35845 * Set this feature as required.
35847 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
35850 * Checks if this feature is supported.
35852 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35855 * Set this feature as optional.
35857 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35860 * Set this feature as required.
35862 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35865 * Checks if this feature is supported.
35867 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35870 * Checks if this feature is required.
35872 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35875 * Checks if this feature is required.
35877 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35880 * Set this feature as optional.
35882 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
35885 * Set this feature as required.
35887 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
35890 * Checks if this feature is supported.
35892 MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35895 * Set this feature as optional.
35897 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35900 * Set this feature as required.
35902 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35905 * Checks if this feature is supported.
35907 MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35910 * Set this feature as optional.
35912 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
35915 * Set this feature as required.
35917 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
35920 * Checks if this feature is supported.
35922 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
35925 * Checks if this feature is required.
35927 MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35930 * Checks if this feature is required.
35932 MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35935 * Checks if this feature is required.
35937 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
35940 * Set this feature as optional.
35942 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
35945 * Set this feature as required.
35947 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
35950 * Checks if this feature is supported.
35952 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35955 * Set this feature as optional.
35957 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35960 * Set this feature as required.
35962 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
35965 * Checks if this feature is supported.
35967 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35970 * Set this feature as optional.
35972 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
35975 * Set this feature as required.
35977 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
35980 * Checks if this feature is supported.
35982 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
35985 * Checks if this feature is required.
35987 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
35990 * Checks if this feature is required.
35992 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
35995 * Checks if this feature is required.
35997 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
36000 * Set this feature as optional.
36002 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
36005 * Set this feature as required.
36007 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
36010 * Checks if this feature is supported.
36012 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
36015 * Set this feature as optional.
36017 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
36020 * Set this feature as required.
36022 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
36025 * Checks if this feature is supported.
36027 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
36030 * Checks if this feature is required.
36032 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
36035 * Checks if this feature is required.
36037 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
36040 * Set this feature as optional.
36042 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
36045 * Set this feature as required.
36047 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
36050 * Checks if this feature is supported.
36052 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
36055 * Set this feature as optional.
36057 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
36060 * Set this feature as required.
36062 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
36065 * Checks if this feature is supported.
36067 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
36070 * Checks if this feature is required.
36072 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
36075 * Checks if this feature is required.
36077 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
36080 * Set this feature as optional.
36082 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
36085 * Set this feature as required.
36087 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
36090 * Checks if this feature is supported.
36092 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
36095 * Set this feature as optional.
36097 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
36100 * Set this feature as required.
36102 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
36105 * Checks if this feature is supported.
36107 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
36110 * Checks if this feature is required.
36112 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
36115 * Checks if this feature is required.
36117 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
36120 * Set this feature as optional.
36122 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
36125 * Set this feature as required.
36127 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
36130 * Checks if this feature is supported.
36132 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
36135 * Set this feature as optional.
36137 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
36140 * Set this feature as required.
36142 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
36145 * Checks if this feature is supported.
36147 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
36150 * Set this feature as optional.
36152 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
36155 * Set this feature as required.
36157 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
36160 * Checks if this feature is supported.
36162 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
36165 * Checks if this feature is required.
36167 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
36170 * Checks if this feature is required.
36172 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
36175 * Checks if this feature is required.
36177 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
36180 * Set this feature as optional.
36182 void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
36185 * Set this feature as required.
36187 void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
36190 * Checks if this feature is supported.
36192 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
36195 * Checks if this feature is required.
36197 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
36200 * Set this feature as optional.
36202 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
36205 * Set this feature as required.
36207 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
36210 * Checks if this feature is supported.
36212 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
36215 * Set this feature as optional.
36217 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
36220 * Set this feature as required.
36222 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
36225 * Checks if this feature is supported.
36227 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
36230 * Set this feature as optional.
36232 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
36235 * Set this feature as required.
36237 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
36240 * Checks if this feature is supported.
36242 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
36245 * Checks if this feature is required.
36247 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
36250 * Checks if this feature is required.
36252 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
36255 * Checks if this feature is required.
36257 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
36260 * Set this feature as optional.
36262 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
36265 * Set this feature as required.
36267 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
36270 * Checks if this feature is supported.
36272 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
36275 * Checks if this feature is required.
36277 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
36280 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
36282 void ShutdownScript_free(struct LDKShutdownScript this_obj);
36285 * Creates a copy of the ShutdownScript
36287 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
36290 * Checks if two ShutdownScripts contain equal inner contents.
36291 * This ignores pointers and is_owned flags and looks at the values in fields.
36292 * Two objects with NULL inner values will be considered "equal" here.
36294 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
36297 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
36299 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
36302 * The script that did not meet the requirements from [BOLT #2].
36304 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
36306 struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
36309 * The script that did not meet the requirements from [BOLT #2].
36311 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
36313 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
36316 * Constructs a new InvalidShutdownScript given each field
36318 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
36321 * Creates a copy of the InvalidShutdownScript
36323 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
36326 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
36328 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
36331 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
36333 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
36336 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
36338 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
36341 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
36343 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
36346 * Generates a witness script pubkey from the given segwit version and program.
36348 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
36349 * [`ShutdownScript::new_p2wsh`] instead.
36353 * This function may return an error if `program` is invalid for the segwit `version`.
36355 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessVersion version, struct LDKu8slice program);
36358 * Converts the shutdown script into the underlying [`Script`].
36360 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
36363 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
36365 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36367 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
36370 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
36372 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
36374 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
36377 * Frees any resources used by the Retry
36379 void Retry_free(struct LDKRetry this_ptr);
36382 * Creates a copy of the Retry
36384 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
36387 * Utility method to constructs a new Attempts-variant Retry
36389 struct LDKRetry Retry_attempts(uintptr_t a);
36392 * Utility method to constructs a new Timeout-variant Retry
36394 struct LDKRetry Retry_timeout(uint64_t a);
36397 * Checks if two Retrys contain equal inner contents.
36398 * This ignores pointers and is_owned flags and looks at the values in fields.
36400 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
36403 * Generates a non-cryptographic 64-bit hash of the Retry.
36405 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
36408 * Creates a copy of the RetryableSendFailure
36410 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
36413 * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
36415 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
36418 * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
36420 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
36423 * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
36425 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
36428 * Checks if two RetryableSendFailures contain equal inner contents.
36429 * This ignores pointers and is_owned flags and looks at the values in fields.
36431 bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
36434 * Frees any resources used by the PaymentSendFailure
36436 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
36439 * Creates a copy of the PaymentSendFailure
36441 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
36444 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
36446 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
36449 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
36451 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
36454 * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
36456 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
36459 * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
36461 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
36464 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
36466 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
36469 * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
36471 void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
36474 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
36475 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
36476 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
36479 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
36480 * multi-path payments require a recipient-provided secret.
36482 * Some implementations may reject spontaneous payments with payment secrets, so you may only
36483 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
36484 * recipient will not reject it.
36486 struct LDKCOption_PaymentSecretZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
36489 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
36490 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
36491 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
36494 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
36495 * multi-path payments require a recipient-provided secret.
36497 * Some implementations may reject spontaneous payments with payment secrets, so you may only
36498 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
36499 * recipient will not reject it.
36501 void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_PaymentSecretZ val);
36504 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
36505 * arbitrary length. This gives recipients substantially more flexibility to receive
36508 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
36509 * scheme to authenticate received payments against expected payments and invoices, this field
36510 * is not used in LDK for received payments, and can be used to store arbitrary data in
36511 * invoices which will be received with the payment.
36513 * Note that this field was added to the lightning specification more recently than
36514 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
36515 * may not be supported as universally.
36517 * Returns a copy of the field.
36519 struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
36522 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
36523 * arbitrary length. This gives recipients substantially more flexibility to receive
36526 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
36527 * scheme to authenticate received payments against expected payments and invoices, this field
36528 * is not used in LDK for received payments, and can be used to store arbitrary data in
36529 * invoices which will be received with the payment.
36531 * Note that this field was added to the lightning specification more recently than
36532 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
36533 * may not be supported as universally.
36535 void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
36538 * Constructs a new RecipientOnionFields given each field
36540 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_new(struct LDKCOption_PaymentSecretZ payment_secret_arg, struct LDKCOption_CVec_u8ZZ payment_metadata_arg);
36543 * Creates a copy of the RecipientOnionFields
36545 struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
36548 * Checks if two RecipientOnionFieldss contain equal inner contents.
36549 * This ignores pointers and is_owned flags and looks at the values in fields.
36550 * Two objects with NULL inner values will be considered "equal" here.
36552 bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
36555 * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
36557 struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
36560 * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
36562 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
36565 * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
36566 * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
36567 * but do not require or provide any further data.
36569 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
36572 * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
36573 * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
36574 * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
36575 * a spontaneous MPP this will not work as all MPP require payment secrets; you may
36576 * instead want to use [`RecipientOnionFields::secret_only`].
36578 * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
36579 * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
36581 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
36584 * Calls the free function if one is set
36586 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
36589 * Calls the free function if one is set
36591 void Type_free(struct LDKType this_ptr);
36594 * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
36596 void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
36599 * The public key corresponding to the key needed to sign the invoice.
36601 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
36604 * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
36606 void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
36609 * Creates a copy of the Bolt12Invoice
36611 struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
36614 * A complete description of the purpose of the originating offer or refund. Intended to be
36615 * displayed to the user but with the caveat that it has not been verified in any way.
36617 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
36620 * Duration since the Unix epoch when the invoice was created.
36622 MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
36625 * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
36626 * should no longer be paid.
36628 MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
36631 * Whether the invoice has expired.
36633 MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
36636 * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
36638 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
36641 * The minimum amount required for a successful payment of the invoice.
36643 MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
36646 * Features pertaining to paying an invoice.
36648 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
36651 * The public key corresponding to the key used to sign the invoice.
36653 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
36656 * Hash that was used for signing the invoice.
36658 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
36661 * Verifies that the invoice was for a request or refund created using the given key.
36663 MUST_USE_RES bool Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
36666 * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
36668 struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
36671 * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
36673 void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
36676 * Base fee charged (in millisatoshi) for the entire blinded path.
36678 uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
36681 * Base fee charged (in millisatoshi) for the entire blinded path.
36683 void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
36686 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
36687 * (i.e., 10,000 is 1%).
36689 uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
36692 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
36693 * (i.e., 10,000 is 1%).
36695 void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
36698 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
36701 uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
36704 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
36707 void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
36710 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
36711 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
36712 * seen by the recipient.
36714 uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
36717 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
36718 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
36719 * seen by the recipient.
36721 void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
36724 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
36725 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
36726 * seen by the recipient.
36728 uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
36731 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
36732 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
36733 * seen by the recipient.
36735 void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
36738 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
36741 struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
36744 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
36747 void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
36750 * Constructs a new BlindedPayInfo given each field
36752 MUST_USE_RES struct LDKBlindedPayInfo BlindedPayInfo_new(uint32_t fee_base_msat_arg, uint32_t fee_proportional_millionths_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg, uint64_t htlc_maximum_msat_arg, struct LDKBlindedHopFeatures features_arg);
36755 * Creates a copy of the BlindedPayInfo
36757 struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
36760 * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
36762 uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
36765 * Checks if two BlindedPayInfos contain equal inner contents.
36766 * This ignores pointers and is_owned flags and looks at the values in fields.
36767 * Two objects with NULL inner values will be considered "equal" here.
36769 bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
36772 * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
36774 struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
36777 * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
36779 struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
36782 * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
36784 void InvoiceError_free(struct LDKInvoiceError this_obj);
36787 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
36789 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
36790 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
36792 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36794 struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
36797 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
36799 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
36800 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
36802 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36804 void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
36807 * An explanation of the error.
36809 struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
36812 * An explanation of the error.
36814 void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
36817 * Constructs a new InvoiceError given each field
36819 MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
36822 * Creates a copy of the InvoiceError
36824 struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
36827 * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
36829 void ErroneousField_free(struct LDKErroneousField this_obj);
36832 * The type number of the TLV field containing the error.
36834 uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
36837 * The type number of the TLV field containing the error.
36839 void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
36842 * A value to use for the TLV field to avoid the error.
36844 * Returns a copy of the field.
36846 struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
36849 * A value to use for the TLV field to avoid the error.
36851 void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
36854 * Constructs a new ErroneousField given each field
36856 MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
36859 * Creates a copy of the ErroneousField
36861 struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
36864 * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
36866 struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
36869 * Read a InvoiceError from a byte array, created by InvoiceError_write
36871 struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
36874 * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
36876 void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
36879 * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
36881 void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
36884 * Creates a copy of the InvoiceRequest
36886 struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
36889 * An unpredictable series of bytes, typically containing information about the derivation of
36892 * [`payer_id`]: Self::payer_id
36894 MUST_USE_RES struct LDKu8slice InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
36897 * A chain from [`Offer::chains`] that the offer is valid for.
36899 MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
36902 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
36903 * must be greater than or equal to [`Offer::amount`], converted if necessary.
36905 * [`chain`]: Self::chain
36907 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
36910 * Features pertaining to requesting an invoice.
36912 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
36915 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
36917 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
36920 * A possibly transient pubkey used to sign the invoice request.
36922 MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
36925 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
36928 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36930 MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
36933 * Verifies that the request was for an offer created using the given key. Returns the derived
36934 * keys need to sign an [`Bolt12Invoice`] for the request if they could be extracted from the
36937 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
36939 MUST_USE_RES struct LDKCResult_COption_KeyPairZNoneZ InvoiceRequest_verify(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
36942 * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
36944 struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
36947 * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
36949 void Offer_free(struct LDKOffer this_obj);
36952 * Creates a copy of the Offer
36954 struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
36957 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
36958 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
36959 * for the selected chain.
36961 MUST_USE_RES struct LDKCVec_ChainHashZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
36964 * Returns whether the given chain is supported by the offer.
36966 MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
36969 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
36970 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
36972 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
36975 * The minimum amount required for a successful payment of a single item.
36977 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36979 MUST_USE_RES struct LDKAmount Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
36982 * A complete description of the purpose of the payment. Intended to be displayed to the user
36983 * but with the caveat that it has not been verified in any way.
36985 MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
36988 * Features pertaining to the offer.
36990 MUST_USE_RES struct LDKOfferFeatures Offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
36993 * Duration since the Unix epoch when an invoice should no longer be requested.
36995 * If `None`, the offer does not expire.
36997 MUST_USE_RES struct LDKCOption_DurationZ Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
37000 * Whether the offer has expired.
37002 MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
37005 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
37006 * displayed to the user but with the caveat that it has not been verified in any way.
37008 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
37010 MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
37013 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
37014 * recipient privacy by obfuscating its node id.
37016 MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
37019 * The quantity of items supported.
37021 MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
37024 * Returns whether the given quantity is valid for the offer.
37026 MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
37029 * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
37031 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
37033 MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
37036 * The public key used by the recipient to sign invoices.
37038 MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
37041 * Serialize the Offer object into a byte array which can be read by Offer_read
37043 struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
37046 * Frees any resources used by the Amount, if is_owned is set and inner is non-NULL.
37048 void Amount_free(struct LDKAmount this_obj);
37051 * Creates a copy of the Amount
37053 struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
37056 * Frees any resources used by the Quantity, if is_owned is set and inner is non-NULL.
37058 void Quantity_free(struct LDKQuantity this_obj);
37061 * Creates a copy of the Quantity
37063 struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
37066 * Read a Offer object from a string
37068 struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
37071 * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
37073 void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
37076 * Creates a copy of the Bolt12ParseError
37078 struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
37081 * Creates a copy of the Bolt12SemanticError
37083 enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
37086 * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
37088 enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
37091 * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
37093 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
37096 * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
37098 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
37101 * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
37103 enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
37106 * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
37108 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
37111 * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
37113 enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
37116 * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
37118 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
37121 * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
37123 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
37126 * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
37128 enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
37131 * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
37133 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
37136 * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
37138 enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
37141 * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
37143 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
37146 * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
37148 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
37151 * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
37153 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
37156 * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
37158 enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
37161 * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
37163 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
37166 * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
37168 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
37171 * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
37173 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
37176 * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
37178 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
37181 * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
37183 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
37186 * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
37188 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
37191 * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
37193 enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
37196 * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
37198 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
37201 * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
37203 enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
37206 * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
37208 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
37211 * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
37213 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
37216 * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
37218 void Refund_free(struct LDKRefund this_obj);
37221 * Creates a copy of the Refund
37223 struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
37226 * A complete description of the purpose of the refund. Intended to be displayed to the user
37227 * but with the caveat that it has not been verified in any way.
37229 MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
37232 * Duration since the Unix epoch when an invoice should no longer be sent.
37234 * If `None`, the refund does not expire.
37236 MUST_USE_RES struct LDKCOption_DurationZ Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
37239 * Whether the refund has expired.
37241 MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
37244 * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
37245 * displayed to the user but with the caveat that it has not been verified in any way.
37247 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
37249 MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
37252 * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
37253 * privacy by obfuscating its node id.
37255 MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
37258 * An unpredictable series of bytes, typically containing information about the derivation of
37261 * [`payer_id`]: Self::payer_id
37263 MUST_USE_RES struct LDKu8slice Refund_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
37266 * A chain that the refund is valid for.
37268 MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
37271 * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
37273 * [`chain`]: Self::chain
37275 MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
37278 * Features pertaining to requesting an invoice.
37280 MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
37283 * The quantity of an item that refund is for.
37285 MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
37288 * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
37289 * transient pubkey.
37291 * [`paths`]: Self::paths
37293 MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
37296 * Payer provided note to include in the invoice.
37298 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
37300 MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
37303 * Serialize the Refund object into a byte array which can be read by Refund_read
37305 struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
37308 * Read a Refund object from a string
37310 struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
37313 * Creates a copy of the UtxoLookupError
37315 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
37318 * Utility method to constructs a new UnknownChain-variant UtxoLookupError
37320 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
37323 * Utility method to constructs a new UnknownTx-variant UtxoLookupError
37325 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
37328 * Frees any resources used by the UtxoResult
37330 void UtxoResult_free(struct LDKUtxoResult this_ptr);
37333 * Creates a copy of the UtxoResult
37335 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
37338 * Utility method to constructs a new Sync-variant UtxoResult
37340 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
37343 * Utility method to constructs a new Async-variant UtxoResult
37345 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
37348 * Calls the free function if one is set
37350 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
37353 * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
37355 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
37358 * Creates a copy of the UtxoFuture
37360 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
37363 * Builds a new future for later resolution.
37365 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
37368 * Resolves this future against the given `graph` and with the given `result`.
37370 * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
37371 * forwarding the validated gossip message onwards to peers.
37373 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
37374 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
37377 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
37378 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
37380 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
37383 * Resolves this future against the given `graph` and with the given `result`.
37385 * The given `gossip` is used to broadcast any validated messages onwards to all peers which
37386 * have available buffer space.
37388 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
37389 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
37392 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
37393 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
37395 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);
37398 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
37400 void NodeId_free(struct LDKNodeId this_obj);
37403 * Creates a copy of the NodeId
37405 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
37408 * Create a new NodeId from a public key
37410 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
37413 * Get the public key slice from this NodeId
37415 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
37418 * Get the public key from this NodeId
37420 MUST_USE_RES struct LDKCResult_PublicKeyErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
37423 * Generates a non-cryptographic 64-bit hash of the NodeId.
37425 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
37428 * Serialize the NodeId object into a byte array which can be read by NodeId_read
37430 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
37433 * Read a NodeId from a byte array, created by NodeId_write
37435 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
37438 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
37440 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
37443 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
37445 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
37448 * Frees any resources used by the NetworkUpdate
37450 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
37453 * Creates a copy of the NetworkUpdate
37455 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
37458 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
37460 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
37463 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
37465 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
37468 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
37470 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
37473 * Checks if two NetworkUpdates contain equal inner contents.
37474 * This ignores pointers and is_owned flags and looks at the values in fields.
37476 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
37479 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
37481 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
37484 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
37486 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
37489 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
37491 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
37494 * Creates a new tracker of the actual state of the network of channels and nodes,
37495 * assuming an existing [`NetworkGraph`].
37496 * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
37497 * correct, and the announcement is signed with channel owners' keys.
37499 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
37502 * Adds a provider used to check new announcements. Does not affect
37503 * existing announcements unless they are updated.
37504 * Add, update or remove the provider would replace the current one.
37506 void P2PGossipSync_add_utxo_lookup(struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
37509 * Handles any network updates originating from [`Event`]s.
37511 * [`Event`]: crate::events::Event
37513 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
37516 * Gets the genesis hash for this network graph.
37518 MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_genesis_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
37521 * Verifies the signature of a [`NodeAnnouncement`].
37523 * Returns an error if it is invalid.
37525 struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
37528 * Verifies all signatures included in a [`ChannelAnnouncement`].
37530 * Returns an error if one of the signatures is invalid.
37532 struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
37535 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
37536 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
37538 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
37541 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
37542 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
37544 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
37547 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
37549 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
37552 * When the last update to the channel direction was issued.
37553 * Value is opaque, as set in the announcement.
37555 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
37558 * When the last update to the channel direction was issued.
37559 * Value is opaque, as set in the announcement.
37561 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
37564 * Whether the channel can be currently used for payments (in this one direction).
37566 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
37569 * Whether the channel can be currently used for payments (in this one direction).
37571 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
37574 * The difference in CLTV values that you must have when routing through this channel.
37576 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
37579 * The difference in CLTV values that you must have when routing through this channel.
37581 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
37584 * The minimum value, which must be relayed to the next hop via the channel
37586 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
37589 * The minimum value, which must be relayed to the next hop via the channel
37591 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
37594 * The maximum value which may be relayed to the next hop via the channel.
37596 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
37599 * The maximum value which may be relayed to the next hop via the channel.
37601 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
37604 * Fees charged when the channel is used for routing
37606 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
37609 * Fees charged when the channel is used for routing
37611 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
37614 * Most recent update for the channel received from the network
37615 * Mostly redundant with the data we store in fields explicitly.
37616 * Everything else is useful only for sending out for initial routing sync.
37617 * Not stored if contains excess data to prevent DoS.
37619 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
37621 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
37624 * Most recent update for the channel received from the network
37625 * Mostly redundant with the data we store in fields explicitly.
37626 * Everything else is useful only for sending out for initial routing sync.
37627 * Not stored if contains excess data to prevent DoS.
37629 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
37631 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
37634 * Constructs a new ChannelUpdateInfo given each field
37636 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);
37639 * Creates a copy of the ChannelUpdateInfo
37641 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
37644 * Checks if two ChannelUpdateInfos contain equal inner contents.
37645 * This ignores pointers and is_owned flags and looks at the values in fields.
37646 * Two objects with NULL inner values will be considered "equal" here.
37648 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
37651 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
37653 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
37656 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
37658 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
37661 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
37663 void ChannelInfo_free(struct LDKChannelInfo this_obj);
37666 * Protocol features of a channel communicated during its announcement
37668 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
37671 * Protocol features of a channel communicated during its announcement
37673 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
37676 * Source node of the first direction of a channel
37678 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
37681 * Source node of the first direction of a channel
37683 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
37686 * Details about the first direction of a channel
37688 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
37690 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
37693 * Details about the first direction of a channel
37695 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
37697 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
37700 * Source node of the second direction of a channel
37702 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
37705 * Source node of the second direction of a channel
37707 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
37710 * Details about the second direction of a channel
37712 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
37714 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
37717 * Details about the second direction of a channel
37719 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
37721 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
37724 * The channel capacity as seen on-chain, if chain lookup is available.
37726 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
37729 * The channel capacity as seen on-chain, if chain lookup is available.
37731 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
37734 * An initial announcement of the channel
37735 * Mostly redundant with the data we store in fields explicitly.
37736 * Everything else is useful only for sending out for initial routing sync.
37737 * Not stored if contains excess data to prevent DoS.
37739 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
37741 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
37744 * An initial announcement of the channel
37745 * Mostly redundant with the data we store in fields explicitly.
37746 * Everything else is useful only for sending out for initial routing sync.
37747 * Not stored if contains excess data to prevent DoS.
37749 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
37751 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
37754 * Creates a copy of the ChannelInfo
37756 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
37759 * Checks if two ChannelInfos contain equal inner contents.
37760 * This ignores pointers and is_owned flags and looks at the values in fields.
37761 * Two objects with NULL inner values will be considered "equal" here.
37763 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
37766 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
37768 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
37770 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
37773 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
37775 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
37778 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
37780 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
37783 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
37785 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
37788 * Creates a copy of the DirectedChannelInfo
37790 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
37793 * Returns information for the channel.
37795 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
37798 * Returns the maximum HTLC amount allowed over the channel in the direction.
37800 MUST_USE_RES uint64_t DirectedChannelInfo_htlc_maximum_msat(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
37803 * Returns the [`EffectiveCapacity`] of the channel in the direction.
37805 * This is either the total capacity from the funding transaction, if known, or the
37806 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
37809 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
37812 * Frees any resources used by the EffectiveCapacity
37814 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
37817 * Creates a copy of the EffectiveCapacity
37819 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
37822 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
37824 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
37827 * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
37829 struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
37832 * Utility method to constructs a new Total-variant EffectiveCapacity
37834 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
37837 * Utility method to constructs a new Infinite-variant EffectiveCapacity
37839 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
37842 * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
37844 struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
37847 * Utility method to constructs a new Unknown-variant EffectiveCapacity
37849 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
37852 * Returns the effective capacity denominated in millisatoshi.
37854 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
37857 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
37859 void RoutingFees_free(struct LDKRoutingFees this_obj);
37862 * Flat routing fee in millisatoshis.
37864 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
37867 * Flat routing fee in millisatoshis.
37869 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
37872 * Liquidity-based routing fee in millionths of a routed amount.
37873 * In other words, 10000 is 1%.
37875 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
37878 * Liquidity-based routing fee in millionths of a routed amount.
37879 * In other words, 10000 is 1%.
37881 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
37884 * Constructs a new RoutingFees given each field
37886 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
37889 * Checks if two RoutingFeess contain equal inner contents.
37890 * This ignores pointers and is_owned flags and looks at the values in fields.
37891 * Two objects with NULL inner values will be considered "equal" here.
37893 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
37896 * Creates a copy of the RoutingFees
37898 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
37901 * Generates a non-cryptographic 64-bit hash of the RoutingFees.
37903 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
37906 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
37908 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
37911 * Read a RoutingFees from a byte array, created by RoutingFees_write
37913 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
37916 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
37918 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
37921 * Protocol features the node announced support for
37923 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
37926 * Protocol features the node announced support for
37928 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
37931 * When the last known update to the node state was issued.
37932 * Value is opaque, as set in the announcement.
37934 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
37937 * When the last known update to the node state was issued.
37938 * Value is opaque, as set in the announcement.
37940 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
37943 * Color assigned to the node
37945 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
37948 * Color assigned to the node
37950 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
37953 * Moniker assigned to the node.
37954 * May be invalid or malicious (eg control chars),
37955 * should not be exposed to the user.
37957 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
37960 * Moniker assigned to the node.
37961 * May be invalid or malicious (eg control chars),
37962 * should not be exposed to the user.
37964 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
37967 * An initial announcement of the node
37968 * Mostly redundant with the data we store in fields explicitly.
37969 * Everything else is useful only for sending out for initial routing sync.
37970 * Not stored if contains excess data to prevent DoS.
37972 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
37974 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
37977 * An initial announcement of the node
37978 * Mostly redundant with the data we store in fields explicitly.
37979 * Everything else is useful only for sending out for initial routing sync.
37980 * Not stored if contains excess data to prevent DoS.
37982 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
37984 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
37987 * Constructs a new NodeAnnouncementInfo given each field
37989 MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKNodeAnnouncement announcement_message_arg);
37992 * Creates a copy of the NodeAnnouncementInfo
37994 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
37997 * Checks if two NodeAnnouncementInfos contain equal inner contents.
37998 * This ignores pointers and is_owned flags and looks at the values in fields.
37999 * Two objects with NULL inner values will be considered "equal" here.
38001 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
38004 * Internet-level addresses via which one can connect to the node
38006 MUST_USE_RES struct LDKCVec_NetAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
38009 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
38011 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
38014 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
38016 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
38019 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
38021 void NodeAlias_free(struct LDKNodeAlias this_obj);
38023 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
38025 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38028 * Constructs a new NodeAlias given each field
38030 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
38033 * Creates a copy of the NodeAlias
38035 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
38038 * Checks if two NodeAliass contain equal inner contents.
38039 * This ignores pointers and is_owned flags and looks at the values in fields.
38040 * Two objects with NULL inner values will be considered "equal" here.
38042 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
38045 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
38047 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
38050 * Read a NodeAlias from a byte array, created by NodeAlias_write
38052 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
38055 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
38057 void NodeInfo_free(struct LDKNodeInfo this_obj);
38060 * All valid channels a node has announced
38062 * Returns a copy of the field.
38064 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
38067 * All valid channels a node has announced
38069 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
38072 * More information about a node from node_announcement.
38073 * Optional because we store a Node entry after learning about it from
38074 * a channel announcement, but before receiving a node announcement.
38076 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38078 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
38081 * More information about a node from node_announcement.
38082 * Optional because we store a Node entry after learning about it from
38083 * a channel announcement, but before receiving a node announcement.
38085 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
38087 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
38090 * Constructs a new NodeInfo given each field
38092 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
38095 * Creates a copy of the NodeInfo
38097 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
38100 * Checks if two NodeInfos contain equal inner contents.
38101 * This ignores pointers and is_owned flags and looks at the values in fields.
38102 * Two objects with NULL inner values will be considered "equal" here.
38104 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
38107 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
38109 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
38112 * Read a NodeInfo from a byte array, created by NodeInfo_write
38114 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
38117 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
38119 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
38122 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
38124 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
38127 * Creates a new, empty, network graph.
38129 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
38132 * Returns a read-only view of the network graph.
38134 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
38137 * The unix timestamp provided by the most recent rapid gossip sync.
38138 * It will be set by the rapid sync process after every sync completion.
38140 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
38143 * Update the unix timestamp provided by the most recent rapid gossip sync.
38144 * This should be done automatically by the rapid sync process after every sync completion.
38146 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
38149 * For an already known node (from channel announcements), update its stored properties from a
38150 * given node announcement.
38152 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
38153 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
38154 * routing messages from a source using a protocol other than the lightning P2P protocol.
38156 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
38159 * For an already known node (from channel announcements), update its stored properties from a
38160 * given node announcement without verifying the associated signatures. Because we aren't
38161 * given the associated signatures here we cannot relay the node announcement to any of our
38164 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);
38167 * Store or update channel info from a channel announcement.
38169 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
38170 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
38171 * routing messages from a source using a protocol other than the lightning P2P protocol.
38173 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
38174 * the corresponding UTXO exists on chain and is correctly-formatted.
38176 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);
38179 * Store or update channel info from a channel announcement.
38181 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
38182 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
38183 * routing messages from a source using a protocol other than the lightning P2P protocol.
38185 * This will skip verification of if the channel is actually on-chain.
38187 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement_no_lookup(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
38190 * Store or update channel info from a channel announcement without verifying the associated
38191 * signatures. Because we aren't given the associated signatures here we cannot relay the
38192 * channel announcement to any of our peers.
38194 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
38195 * the corresponding UTXO exists on chain and is correctly-formatted.
38197 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);
38200 * Update channel from partial announcement data received via rapid gossip sync
38202 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
38203 * rapid gossip sync server)
38205 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
38207 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);
38210 * Marks a channel in the graph as failed permanently.
38212 * The channel and any node for which this was their last channel are removed from the graph.
38214 void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
38217 * Marks a node in the graph as permanently failed, effectively removing it and its channels
38218 * from local storage.
38220 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
38223 * Removes information about channels that we haven't heard any updates about in some time.
38224 * This can be used regularly to prune the network graph of channels that likely no longer
38227 * While there is no formal requirement that nodes regularly re-broadcast their channel
38228 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
38229 * pruning occur for updates which are at least two weeks old, which we implement here.
38231 * Note that for users of the `lightning-background-processor` crate this method may be
38232 * automatically called regularly for you.
38234 * This method will also cause us to stop tracking removed nodes and channels if they have been
38235 * in the map for a while so that these can be resynced from gossip in the future.
38237 * This method is only available with the `std` feature. See
38238 * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
38240 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
38243 * Removes information about channels that we haven't heard any updates about in some time.
38244 * This can be used regularly to prune the network graph of channels that likely no longer
38247 * While there is no formal requirement that nodes regularly re-broadcast their channel
38248 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
38249 * pruning occur for updates which are at least two weeks old, which we implement here.
38251 * This method will also cause us to stop tracking removed nodes and channels if they have been
38252 * in the map for a while so that these can be resynced from gossip in the future.
38254 * This function takes the current unix time as an argument. For users with the `std` feature
38255 * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
38257 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
38260 * For an already known (from announcement) channel, update info about one of the directions
38263 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
38264 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
38265 * routing messages from a source using a protocol other than the lightning P2P protocol.
38267 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
38268 * materially in the future will be rejected.
38270 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
38273 * For an already known (from announcement) channel, update info about one of the directions
38274 * of the channel without verifying the associated signatures. Because we aren't given the
38275 * associated signatures here we cannot relay the channel update to any of our peers.
38277 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
38278 * materially in the future will be rejected.
38280 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
38283 * Returns information on a channel with the given id.
38285 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38287 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
38290 * Returns the list of channels in the graph
38292 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
38295 * Returns information on a node with the given id.
38297 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38299 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
38302 * Returns the list of nodes in the graph
38304 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
38307 * Get network addresses by node id.
38308 * Returns None if the requested node is completely unknown,
38309 * or if node announcement for the node was never received.
38311 MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
38314 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
38316 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
38319 * Creates a new router.
38321 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, struct LDKProbabilisticScoringFeeParameters score_params);
38324 * Constructs a new Router which calls the relevant methods on this_arg.
38325 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
38327 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
38330 * Calls the free function if one is set
38332 void Router_free(struct LDKRouter this_ptr);
38335 * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
38337 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
38340 * Initialize a new `ScorerAccountingForInFlightHtlcs`.
38342 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScore scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
38345 * Serialize the ScorerAccountingForInFlightHtlcs object into a byte array which can be read by ScorerAccountingForInFlightHtlcs_read
38347 struct LDKCVec_u8Z ScorerAccountingForInFlightHtlcs_write(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR obj);
38350 * Constructs a new Score which calls the relevant methods on this_arg.
38351 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
38353 struct LDKScore ScorerAccountingForInFlightHtlcs_as_Score(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
38356 * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
38358 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
38361 * Creates a copy of the InFlightHtlcs
38363 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
38366 * Constructs an empty `InFlightHtlcs`.
38368 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
38371 * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
38373 void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
38376 * Adds a known HTLC given the public key of the HTLC source, target, and short channel
38379 void InFlightHtlcs_add_inflight_htlc(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid, uint64_t used_msat);
38382 * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
38385 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);
38388 * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
38390 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
38393 * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
38395 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
38398 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
38400 void RouteHop_free(struct LDKRouteHop this_obj);
38403 * The node_id of the node at this hop.
38405 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
38408 * The node_id of the node at this hop.
38410 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38413 * The node_announcement features of the node at this hop. For the last hop, these may be
38414 * amended to match the features present in the invoice this node generated.
38416 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
38419 * The node_announcement features of the node at this hop. For the last hop, these may be
38420 * amended to match the features present in the invoice this node generated.
38422 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
38425 * The channel that should be used from the previous hop to reach this node.
38427 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
38430 * The channel that should be used from the previous hop to reach this node.
38432 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
38435 * The channel_announcement features of the channel that should be used from the previous hop
38436 * to reach this node.
38438 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
38441 * The channel_announcement features of the channel that should be used from the previous hop
38442 * to reach this node.
38444 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
38447 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
38448 * If this is the last hop in [`Path::hops`]:
38449 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
38450 * * otherwise, this is the full value of this [`Path`]'s part of the payment
38452 * [`BlindedPath`]: crate::blinded_path::BlindedPath
38454 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
38457 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
38458 * If this is the last hop in [`Path::hops`]:
38459 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
38460 * * otherwise, this is the full value of this [`Path`]'s part of the payment
38462 * [`BlindedPath`]: crate::blinded_path::BlindedPath
38464 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
38467 * The CLTV delta added for this hop.
38468 * If this is the last hop in [`Path::hops`]:
38469 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
38470 * * otherwise, this is the CLTV delta expected at the destination
38472 * [`BlindedPath`]: crate::blinded_path::BlindedPath
38474 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
38477 * The CLTV delta added for this hop.
38478 * If this is the last hop in [`Path::hops`]:
38479 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
38480 * * otherwise, this is the CLTV delta expected at the destination
38482 * [`BlindedPath`]: crate::blinded_path::BlindedPath
38484 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
38487 * Constructs a new RouteHop given each field
38489 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);
38492 * Creates a copy of the RouteHop
38494 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
38497 * Generates a non-cryptographic 64-bit hash of the RouteHop.
38499 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
38502 * Checks if two RouteHops contain equal inner contents.
38503 * This ignores pointers and is_owned flags and looks at the values in fields.
38504 * Two objects with NULL inner values will be considered "equal" here.
38506 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
38509 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
38511 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
38514 * Read a RouteHop from a byte array, created by RouteHop_write
38516 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
38519 * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
38521 void BlindedTail_free(struct LDKBlindedTail this_obj);
38524 * The hops of the [`BlindedPath`] provided by the recipient.
38526 * [`BlindedPath`]: crate::blinded_path::BlindedPath
38528 struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
38531 * The hops of the [`BlindedPath`] provided by the recipient.
38533 * [`BlindedPath`]: crate::blinded_path::BlindedPath
38535 void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
38538 * The blinding point of the [`BlindedPath`] provided by the recipient.
38540 * [`BlindedPath`]: crate::blinded_path::BlindedPath
38542 struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
38545 * The blinding point of the [`BlindedPath`] provided by the recipient.
38547 * [`BlindedPath`]: crate::blinded_path::BlindedPath
38549 void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
38552 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
38553 * inferring the destination. May be 0.
38555 uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
38558 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
38559 * inferring the destination. May be 0.
38561 void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
38564 * The total amount paid on this [`Path`], excluding the fees.
38566 uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
38569 * The total amount paid on this [`Path`], excluding the fees.
38571 void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
38574 * Constructs a new BlindedTail given each field
38576 MUST_USE_RES struct LDKBlindedTail BlindedTail_new(struct LDKCVec_BlindedHopZ hops_arg, struct LDKPublicKey blinding_point_arg, uint32_t excess_final_cltv_expiry_delta_arg, uint64_t final_value_msat_arg);
38579 * Creates a copy of the BlindedTail
38581 struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
38584 * Generates a non-cryptographic 64-bit hash of the BlindedTail.
38586 uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
38589 * Checks if two BlindedTails contain equal inner contents.
38590 * This ignores pointers and is_owned flags and looks at the values in fields.
38591 * Two objects with NULL inner values will be considered "equal" here.
38593 bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
38596 * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
38598 struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
38601 * Read a BlindedTail from a byte array, created by BlindedTail_write
38603 struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
38606 * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
38608 void Path_free(struct LDKPath this_obj);
38611 * The list of unblinded hops in this [`Path`]. Must be at least length one.
38613 struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
38616 * The list of unblinded hops in this [`Path`]. Must be at least length one.
38618 void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
38621 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
38623 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38625 struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
38628 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
38630 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
38632 void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
38635 * Constructs a new Path given each field
38637 MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
38640 * Creates a copy of the Path
38642 struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
38645 * Generates a non-cryptographic 64-bit hash of the Path.
38647 uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
38650 * Checks if two Paths contain equal inner contents.
38651 * This ignores pointers and is_owned flags and looks at the values in fields.
38652 * Two objects with NULL inner values will be considered "equal" here.
38654 bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
38657 * Gets the fees for a given path, excluding any excess paid to the recipient.
38659 MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
38662 * Gets the total amount paid on this [`Path`], excluding the fees.
38664 MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
38667 * Gets the final hop's CLTV expiry delta.
38669 MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
38672 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
38674 void Route_free(struct LDKRoute this_obj);
38677 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
38678 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
38681 struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
38684 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
38685 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
38688 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
38691 * The `payment_params` parameter passed via [`RouteParameters`] to [`find_route`].
38693 * This is used by `ChannelManager` to track information which may be required for retries.
38695 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38697 struct LDKPaymentParameters Route_get_payment_params(const struct LDKRoute *NONNULL_PTR this_ptr);
38700 * The `payment_params` parameter passed via [`RouteParameters`] to [`find_route`].
38702 * This is used by `ChannelManager` to track information which may be required for retries.
38704 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
38706 void Route_set_payment_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
38709 * Constructs a new Route given each field
38711 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKPaymentParameters payment_params_arg);
38714 * Creates a copy of the Route
38716 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
38719 * Generates a non-cryptographic 64-bit hash of the Route.
38721 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
38724 * Checks if two Routes contain equal inner contents.
38725 * This ignores pointers and is_owned flags and looks at the values in fields.
38726 * Two objects with NULL inner values will be considered "equal" here.
38728 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
38731 * Returns the total amount of fees paid on this [`Route`].
38733 * This doesn't include any extra payment made to the recipient, which can happen in excess of
38734 * the amount passed to [`find_route`]'s `route_params.final_value_msat`.
38736 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
38739 * Returns the total amount paid on this [`Route`], excluding the fees. Might be more than
38740 * requested if we had to reach htlc_minimum_msat.
38742 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
38745 * Serialize the Route object into a byte array which can be read by Route_read
38747 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
38750 * Read a Route from a byte array, created by Route_write
38752 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
38755 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
38757 void RouteParameters_free(struct LDKRouteParameters this_obj);
38760 * The parameters of the failed payment path.
38762 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
38765 * The parameters of the failed payment path.
38767 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
38770 * The amount in msats sent on the failed payment path.
38772 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
38775 * The amount in msats sent on the failed payment path.
38777 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
38780 * Constructs a new RouteParameters given each field
38782 MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPaymentParameters payment_params_arg, uint64_t final_value_msat_arg);
38785 * Creates a copy of the RouteParameters
38787 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
38790 * Checks if two RouteParameterss contain equal inner contents.
38791 * This ignores pointers and is_owned flags and looks at the values in fields.
38792 * Two objects with NULL inner values will be considered "equal" here.
38794 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
38797 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
38799 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
38802 * Read a RouteParameters from a byte array, created by RouteParameters_write
38804 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
38807 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
38809 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
38812 * Information about the payee, such as their features and route hints for their channels.
38814 struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
38817 * Information about the payee, such as their features and route hints for their channels.
38819 void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
38822 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
38824 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
38827 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
38829 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
38832 * The maximum total CLTV delta we accept for the route.
38833 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
38835 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
38838 * The maximum total CLTV delta we accept for the route.
38839 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
38841 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
38844 * The maximum number of paths that may be used by (MPP) payments.
38845 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
38847 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
38850 * The maximum number of paths that may be used by (MPP) payments.
38851 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
38853 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
38856 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
38857 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
38858 * a lower value prefers to send larger MPP parts, potentially saturating channels and
38859 * increasing failure probability for those paths.
38861 * Note that this restriction will be relaxed during pathfinding after paths which meet this
38862 * restriction have been found. While paths which meet this criteria will be searched for, it
38863 * is ultimately up to the scorer to select them over other paths.
38865 * A value of 0 will allow payments up to and including a channel's total announced usable
38866 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
38870 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
38873 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
38874 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
38875 * a lower value prefers to send larger MPP parts, potentially saturating channels and
38876 * increasing failure probability for those paths.
38878 * Note that this restriction will be relaxed during pathfinding after paths which meet this
38879 * restriction have been found. While paths which meet this criteria will be searched for, it
38880 * is ultimately up to the scorer to select them over other paths.
38882 * A value of 0 will allow payments up to and including a channel's total announced usable
38883 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
38887 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
38890 * A list of SCIDs which this payment was previously attempted over and which caused the
38891 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
38894 * Returns a copy of the field.
38896 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
38899 * A list of SCIDs which this payment was previously attempted over and which caused the
38900 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
38903 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
38906 * Constructs a new PaymentParameters given each field
38908 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_new(struct LDKPayee payee_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);
38911 * Creates a copy of the PaymentParameters
38913 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
38916 * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
38918 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
38921 * Checks if two PaymentParameterss contain equal inner contents.
38922 * This ignores pointers and is_owned flags and looks at the values in fields.
38923 * Two objects with NULL inner values will be considered "equal" here.
38925 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
38928 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
38930 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
38933 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
38935 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
38938 * Creates a payee with the node id of the given `pubkey`.
38940 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
38943 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
38946 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
38948 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
38951 * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
38952 * whether your router will be allowed to find a multi-part route for this payment. If you
38953 * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
38954 * [`RecipientOnionFields::secret_only`].
38956 * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
38958 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
38961 * Creates parameters for paying to a blinded payee from the provided invoice. Sets
38962 * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
38963 * [`PaymentParameters::expiry_time`].
38965 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
38968 * Frees any resources used by the Payee
38970 void Payee_free(struct LDKPayee this_ptr);
38973 * Creates a copy of the Payee
38975 struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
38978 * Utility method to constructs a new Blinded-variant Payee
38980 struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features);
38983 * Utility method to constructs a new Clear-variant Payee
38985 struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
38988 * Generates a non-cryptographic 64-bit hash of the Payee.
38990 uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
38993 * Checks if two Payees contain equal inner contents.
38994 * This ignores pointers and is_owned flags and looks at the values in fields.
38996 bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
38999 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
39001 void RouteHint_free(struct LDKRouteHint this_obj);
39003 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
39005 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
39008 * Constructs a new RouteHint given each field
39010 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
39013 * Creates a copy of the RouteHint
39015 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
39018 * Generates a non-cryptographic 64-bit hash of the RouteHint.
39020 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
39023 * Checks if two RouteHints contain equal inner contents.
39024 * This ignores pointers and is_owned flags and looks at the values in fields.
39025 * Two objects with NULL inner values will be considered "equal" here.
39027 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
39030 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
39032 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
39035 * Read a RouteHint from a byte array, created by RouteHint_write
39037 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
39040 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
39042 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
39045 * The node_id of the non-target end of the route
39047 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
39050 * The node_id of the non-target end of the route
39052 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39055 * The short_channel_id of this channel
39057 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
39060 * The short_channel_id of this channel
39062 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
39065 * The fees which must be paid to use this channel
39067 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
39070 * The fees which must be paid to use this channel
39072 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
39075 * The difference in CLTV values between this node and the next node.
39077 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
39080 * The difference in CLTV values between this node and the next node.
39082 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
39085 * The minimum value, in msat, which must be relayed to the next hop.
39087 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
39090 * The minimum value, in msat, which must be relayed to the next hop.
39092 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39095 * The maximum value in msat available for routing with a single HTLC.
39097 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
39100 * The maximum value in msat available for routing with a single HTLC.
39102 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
39105 * Constructs a new RouteHintHop given each field
39107 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);
39110 * Creates a copy of the RouteHintHop
39112 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
39115 * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
39117 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
39120 * Checks if two RouteHintHops contain equal inner contents.
39121 * This ignores pointers and is_owned flags and looks at the values in fields.
39122 * Two objects with NULL inner values will be considered "equal" here.
39124 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
39127 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
39129 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
39132 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
39134 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
39137 * Finds a route from us (payer) to the given target node (payee).
39139 * If the payee provided features in their invoice, they should be provided via the `payee` field
39140 * in the given [`RouteParameters::payment_params`].
39141 * Without this, MPP will only be used if the payee's features are available in the network graph.
39143 * Private routing paths between a public node and the target may be included in the `payee` field
39144 * of [`RouteParameters::payment_params`].
39146 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
39147 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
39148 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
39150 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
39151 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
39152 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
39156 * Panics if first_hops contains channels without `short_channel_id`s;
39157 * [`ChannelManager::list_usable_channels`] will never include such channels.
39159 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
39160 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
39161 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
39163 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
39165 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 struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params, const uint8_t (*random_seed_bytes)[32]);
39168 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
39169 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
39171 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
39173 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]);
39176 * Calls the free function if one is set
39178 void Score_free(struct LDKScore this_ptr);
39181 * Calls the free function if one is set
39183 void LockableScore_free(struct LDKLockableScore this_ptr);
39186 * Calls the free function if one is set
39188 void WriteableScore_free(struct LDKWriteableScore this_ptr);
39191 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
39193 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
39196 * Constructs a new LockableScore which calls the relevant methods on this_arg.
39197 * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
39199 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
39202 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
39204 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
39207 * Constructs a new WriteableScore which calls the relevant methods on this_arg.
39208 * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
39210 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
39213 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
39215 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
39218 * Frees any resources used by the MultiThreadedScoreLock, if is_owned is set and inner is non-NULL.
39220 void MultiThreadedScoreLock_free(struct LDKMultiThreadedScoreLock this_obj);
39223 * Serialize the MultiThreadedScoreLock object into a byte array which can be read by MultiThreadedScoreLock_read
39225 struct LDKCVec_u8Z MultiThreadedScoreLock_write(const struct LDKMultiThreadedScoreLock *NONNULL_PTR obj);
39228 * Constructs a new Score which calls the relevant methods on this_arg.
39229 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
39231 struct LDKScore MultiThreadedScoreLock_as_Score(const struct LDKMultiThreadedScoreLock *NONNULL_PTR this_arg);
39234 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
39236 void ChannelUsage_free(struct LDKChannelUsage this_obj);
39239 * The amount to send through the channel, denominated in millisatoshis.
39241 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
39244 * The amount to send through the channel, denominated in millisatoshis.
39246 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
39249 * Total amount, denominated in millisatoshis, already allocated to send through the channel
39250 * as part of a multi-path payment.
39252 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
39255 * Total amount, denominated in millisatoshis, already allocated to send through the channel
39256 * as part of a multi-path payment.
39258 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
39261 * The effective capacity of the channel.
39263 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
39266 * The effective capacity of the channel.
39268 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
39271 * Constructs a new ChannelUsage given each field
39273 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
39276 * Creates a copy of the ChannelUsage
39278 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
39281 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
39283 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
39286 * Creates a copy of the FixedPenaltyScorer
39288 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
39291 * Creates a new scorer using `penalty_msat`.
39293 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
39296 * Constructs a new Score which calls the relevant methods on this_arg.
39297 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
39299 struct LDKScore FixedPenaltyScorer_as_Score(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
39302 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
39304 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
39307 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
39309 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
39312 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
39314 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
39317 * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
39319 void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
39322 * A fixed penalty in msats to apply to each channel.
39324 * Default value: 500 msat
39326 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
39329 * A fixed penalty in msats to apply to each channel.
39331 * Default value: 500 msat
39333 void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
39336 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
39337 * channel, in excess of the [`base_penalty_msat`].
39339 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
39340 * fees plus penalty) for large payments. The penalty is computed as the product of this
39341 * multiplier and `2^30`ths of the payment amount.
39343 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
39345 * Default value: 8,192 msat
39347 * [`base_penalty_msat`]: Self::base_penalty_msat
39349 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
39352 * A multiplier used with the payment amount to calculate a fixed penalty applied to each
39353 * channel, in excess of the [`base_penalty_msat`].
39355 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
39356 * fees plus penalty) for large payments. The penalty is computed as the product of this
39357 * multiplier and `2^30`ths of the payment amount.
39359 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
39361 * Default value: 8,192 msat
39363 * [`base_penalty_msat`]: Self::base_penalty_msat
39365 void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
39368 * A multiplier used in conjunction with the negative `log10` of the channel's success
39369 * probability for a payment, as determined by our latest estimates of the channel's
39370 * liquidity, to determine the liquidity penalty.
39372 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
39373 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
39374 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
39375 * lower bounding the success probability to `0.01`) when the amount falls within the
39376 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
39377 * result in a `u64::max_value` penalty, however.
39379 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
39381 * Default value: 30,000 msat
39383 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
39385 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
39388 * A multiplier used in conjunction with the negative `log10` of the channel's success
39389 * probability for a payment, as determined by our latest estimates of the channel's
39390 * liquidity, to determine the liquidity penalty.
39392 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
39393 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
39394 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
39395 * lower bounding the success probability to `0.01`) when the amount falls within the
39396 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
39397 * result in a `u64::max_value` penalty, however.
39399 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
39401 * Default value: 30,000 msat
39403 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
39405 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
39408 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
39409 * channel's success probability for the payment, as determined by our latest estimates of the
39410 * channel's liquidity, to determine the amount penalty.
39412 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
39413 * fees plus penalty) for large payments. The penalty is computed as the product of this
39414 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
39415 * success probability.
39417 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
39419 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
39420 * the amount will result in a penalty of the multiplier. And, as the success probability
39421 * decreases, the negative `log10` weighting will increase dramatically. For higher success
39422 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
39425 * Default value: 192 msat
39427 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
39430 * A multiplier used in conjunction with a payment amount and the negative `log10` of the
39431 * channel's success probability for the payment, as determined by our latest estimates of the
39432 * channel's liquidity, to determine the amount penalty.
39434 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
39435 * fees plus penalty) for large payments. The penalty is computed as the product of this
39436 * multiplier and `2^20`ths of the payment amount, weighted by the negative `log10` of the
39437 * success probability.
39439 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
39441 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
39442 * the amount will result in a penalty of the multiplier. And, as the success probability
39443 * decreases, the negative `log10` weighting will increase dramatically. For higher success
39444 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
39447 * Default value: 192 msat
39449 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
39452 * A multiplier used in conjunction with the negative `log10` of the channel's success
39453 * probability for the payment, as determined based on the history of our estimates of the
39454 * channel's available liquidity, to determine a penalty.
39456 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
39457 * only our latest estimate for the current liquidity available in the channel, it estimates
39458 * success probability based on the estimated liquidity available in the channel through
39459 * history. Specifically, every time we update our liquidity bounds on a given channel, we
39460 * track which of several buckets those bounds fall into, exponentially decaying the
39461 * probability of each bucket as new samples are added.
39463 * Default value: 10,000 msat
39465 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
39467 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
39470 * A multiplier used in conjunction with the negative `log10` of the channel's success
39471 * probability for the payment, as determined based on the history of our estimates of the
39472 * channel's available liquidity, to determine a penalty.
39474 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
39475 * only our latest estimate for the current liquidity available in the channel, it estimates
39476 * success probability based on the estimated liquidity available in the channel through
39477 * history. Specifically, every time we update our liquidity bounds on a given channel, we
39478 * track which of several buckets those bounds fall into, exponentially decaying the
39479 * probability of each bucket as new samples are added.
39481 * Default value: 10,000 msat
39483 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
39485 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
39488 * A multiplier used in conjunction with the payment amount and the negative `log10` of the
39489 * channel's success probability for the payment, as determined based on the history of our
39490 * estimates of the channel's available liquidity, to determine a penalty.
39492 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
39493 * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths
39494 * of the payment amount, weighted by the negative `log10` of the success probability.
39496 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
39497 * of using only our latest estimate for the current liquidity available in the channel, it
39498 * estimates success probability based on the estimated liquidity available in the channel
39499 * through history. Specifically, every time we update our liquidity bounds on a given
39500 * channel, we track which of several buckets those bounds fall into, exponentially decaying
39501 * the probability of each bucket as new samples are added.
39503 * Default value: 64 msat
39505 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
39507 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
39510 * A multiplier used in conjunction with the payment amount and the negative `log10` of the
39511 * channel's success probability for the payment, as determined based on the history of our
39512 * estimates of the channel's available liquidity, to determine a penalty.
39514 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
39515 * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths
39516 * of the payment amount, weighted by the negative `log10` of the success probability.
39518 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
39519 * of using only our latest estimate for the current liquidity available in the channel, it
39520 * estimates success probability based on the estimated liquidity available in the channel
39521 * through history. Specifically, every time we update our liquidity bounds on a given
39522 * channel, we track which of several buckets those bounds fall into, exponentially decaying
39523 * the probability of each bucket as new samples are added.
39525 * Default value: 64 msat
39527 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
39529 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
39532 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
39533 * channel's capacity, (ie. htlc_maximum_msat ≥ 0.5 * channel_capacity) which makes us
39534 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
39535 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
39536 * to restrict `htlc_maximum_msat` and improve privacy.
39538 * Default value: 250 msat
39540 uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
39543 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
39544 * channel's capacity, (ie. htlc_maximum_msat ≥ 0.5 * channel_capacity) which makes us
39545 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
39546 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
39547 * to restrict `htlc_maximum_msat` and improve privacy.
39549 * Default value: 250 msat
39551 void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
39554 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
39555 * current estimate of the channel's available liquidity.
39557 * Note that in this case all other penalties, including the
39558 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
39559 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
39560 * applicable, are still included in the overall penalty.
39562 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
39563 * `u64::max_value()` will guarantee that.
39565 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
39567 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
39568 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
39569 * [`base_penalty_msat`]: Self::base_penalty_msat
39570 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
39572 uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
39575 * This penalty is applied when the amount we're attempting to send over a channel exceeds our
39576 * current estimate of the channel's available liquidity.
39578 * Note that in this case all other penalties, including the
39579 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
39580 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
39581 * applicable, are still included in the overall penalty.
39583 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
39584 * `u64::max_value()` will guarantee that.
39586 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
39588 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
39589 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
39590 * [`base_penalty_msat`]: Self::base_penalty_msat
39591 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
39593 void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
39596 * Creates a copy of the ProbabilisticScoringFeeParameters
39598 struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
39601 * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
39603 MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
39606 * Marks the node with the given `node_id` as banned,
39607 * i.e it will be avoided during path finding.
39609 void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
39612 * Marks all nodes in the given list as banned, i.e.,
39613 * they will be avoided during path finding.
39615 void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
39618 * Removes the node with the given `node_id` from the list of nodes to avoid.
39620 void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
39623 * Sets a manual penalty for the given node.
39625 void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
39628 * Removes the node with the given `node_id` from the list of manual penalties.
39630 void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
39633 * Clears the list of manual penalties that are applied during path finding.
39635 void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
39638 * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
39640 void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
39643 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
39644 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
39645 * seen a liquidity estimate update for this amount of time, the historical datapoints are
39647 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
39649 * Note that after 16 or more half lives all historical data will be completely gone.
39651 * Default value: 14 days
39653 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorerUsingTime::historical_estimated_channel_liquidity_probabilities
39655 uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
39658 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
39659 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
39660 * seen a liquidity estimate update for this amount of time, the historical datapoints are
39662 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
39664 * Note that after 16 or more half lives all historical data will be completely gone.
39666 * Default value: 14 days
39668 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorerUsingTime::historical_estimated_channel_liquidity_probabilities
39670 void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
39673 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
39674 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
39675 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
39678 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
39679 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
39680 * struct documentation for more info on the way the liquidity bounds are used.
39682 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
39683 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
39684 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
39686 * Default value: 6 hours
39690 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
39691 * liquidity knowledge will never decay except when the bounds cross.
39693 uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
39696 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
39697 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
39698 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
39701 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
39702 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
39703 * struct documentation for more info on the way the liquidity bounds are used.
39705 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
39706 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
39707 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
39709 * Default value: 6 hours
39713 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
39714 * liquidity knowledge will never decay except when the bounds cross.
39716 void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
39719 * Constructs a new ProbabilisticScoringDecayParameters given each field
39721 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
39724 * Creates a copy of the ProbabilisticScoringDecayParameters
39726 struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
39729 * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
39731 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
39734 * Creates a new scorer using the given scoring parameters for sending payments from a node
39735 * through a network graph.
39737 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
39740 * Dump the contents of this scorer into the configured logger.
39742 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
39743 * which may be a substantial amount of log output.
39745 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
39748 * Query the estimated minimum and maximum liquidity available for sending a payment over the
39749 * channel with `scid` towards the given `target` node.
39751 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);
39754 * Query the historical estimated minimum and maximum liquidity available for sending a
39755 * payment over the channel with `scid` towards the given `target` node.
39757 * Returns two sets of 8 buckets. The first set describes the octiles for lower-bound
39758 * liquidity estimates, the second set describes the octiles for upper-bound liquidity
39759 * estimates. Each bucket describes the relative frequency at which we've seen a liquidity
39760 * bound in the octile relative to the channel's total capacity, on an arbitrary scale.
39761 * Because the values are slowly decayed, more recent data points are weighted more heavily
39762 * than older datapoints.
39764 * When scoring, the estimated probability that an upper-/lower-bound lies in a given octile
39765 * relative to the channel's total capacity is calculated by dividing that bucket's value with
39766 * the total of all buckets for the given bound.
39768 * For example, a value of `[0, 0, 0, 0, 0, 0, 32]` indicates that we believe the probability
39769 * of a bound being in the top octile to be 100%, and have never (recently) seen it in any
39770 * other octiles. A value of `[31, 0, 0, 0, 0, 0, 0, 32]` indicates we've seen the bound being
39771 * both in the top and bottom octile, and roughly with similar (recent) frequency.
39773 * Because the datapoints are decayed slowly over time, values will eventually return to
39774 * `Some(([0; 8], [0; 8]))`.
39776 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);
39779 * Constructs a new Score which calls the relevant methods on this_arg.
39780 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
39782 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
39785 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
39787 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
39790 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
39792 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
39795 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
39797 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
39800 * The outpoint which is spendable.
39802 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
39805 * The outpoint which is spendable.
39807 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
39810 * Per commitment point to derive the delayed payment key by key holder.
39812 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
39815 * Per commitment point to derive the delayed payment key by key holder.
39817 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39820 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
39821 * the witness_script.
39823 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
39826 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
39827 * the witness_script.
39829 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
39832 * The output which is referenced by the given outpoint.
39834 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
39837 * The output which is referenced by the given outpoint.
39839 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
39842 * The revocation point specific to the commitment transaction which was broadcast. Used to
39843 * derive the witnessScript for this output.
39845 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
39848 * The revocation point specific to the commitment transaction which was broadcast. Used to
39849 * derive the witnessScript for this output.
39851 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39854 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
39855 * This may be useful in re-deriving keys used in the channel to spend the output.
39857 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
39860 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
39861 * This may be useful in re-deriving keys used in the channel to spend the output.
39863 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
39866 * The value of the channel which this output originated from, possibly indirectly.
39868 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
39871 * The value of the channel which this output originated from, possibly indirectly.
39873 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
39876 * Constructs a new DelayedPaymentOutputDescriptor given each field
39878 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);
39881 * Creates a copy of the DelayedPaymentOutputDescriptor
39883 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
39886 * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
39887 * This ignores pointers and is_owned flags and looks at the values in fields.
39888 * Two objects with NULL inner values will be considered "equal" here.
39890 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
39893 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
39895 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
39898 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
39900 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
39903 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
39905 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
39908 * The outpoint which is spendable.
39910 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
39913 * The outpoint which is spendable.
39915 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
39918 * The output which is referenced by the given outpoint.
39920 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
39923 * The output which is referenced by the given outpoint.
39925 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
39928 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
39929 * This may be useful in re-deriving keys used in the channel to spend the output.
39931 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
39934 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
39935 * This may be useful in re-deriving keys used in the channel to spend the output.
39937 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
39940 * The value of the channel which this transactions spends.
39942 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
39945 * The value of the channel which this transactions spends.
39947 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
39950 * Constructs a new StaticPaymentOutputDescriptor given each field
39952 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);
39955 * Creates a copy of the StaticPaymentOutputDescriptor
39957 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
39960 * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
39961 * This ignores pointers and is_owned flags and looks at the values in fields.
39962 * Two objects with NULL inner values will be considered "equal" here.
39964 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
39967 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
39969 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
39972 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
39974 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
39977 * Frees any resources used by the SpendableOutputDescriptor
39979 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
39982 * Creates a copy of the SpendableOutputDescriptor
39984 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
39987 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
39989 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
39992 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
39994 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
39997 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
39999 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
40002 * Checks if two SpendableOutputDescriptors contain equal inner contents.
40003 * This ignores pointers and is_owned flags and looks at the values in fields.
40005 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
40008 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
40010 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
40013 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
40015 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
40018 * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
40019 * the given outputs, plus an output to the given change destination (if sufficient
40020 * change value remains). The PSBT will have a feerate, at least, of the given value.
40022 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
40023 * transaction will have a locktime of 0. It it recommended to set this to the current block
40024 * height to avoid fee sniping, unless you have some specific reason to use a different
40027 * Returns the PSBT and expected max transaction weight.
40029 * Returns `Err(())` if the output value is greater than the input value minus required fee,
40030 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
40031 * does not match the one we can spend.
40033 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
40035 MUST_USE_RES struct LDKCResult_C2Tuple_PartiallySignedTransactionusizeZNoneZ SpendableOutputDescriptor_create_spendable_outputs_psbt(struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_PackedLockTimeZ locktime);
40038 * Calls the free function if one is set
40040 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
40043 * Calls the free function if one is set
40045 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
40048 * Calls the free function if one is set
40050 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
40053 * Creates a copy of the Recipient
40055 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
40058 * Utility method to constructs a new Node-variant Recipient
40060 enum LDKRecipient Recipient_node(void);
40063 * Utility method to constructs a new PhantomNode-variant Recipient
40065 enum LDKRecipient Recipient_phantom_node(void);
40068 * Calls the free function if one is set
40070 void EntropySource_free(struct LDKEntropySource this_ptr);
40073 * Calls the free function if one is set
40075 void NodeSigner_free(struct LDKNodeSigner this_ptr);
40078 * Calls the free function if one is set
40080 void SignerProvider_free(struct LDKSignerProvider this_ptr);
40083 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
40085 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
40088 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
40089 * holder's anchor output in a commitment transaction, if one is present.
40091 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
40094 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
40095 * holder's anchor output in a commitment transaction, if one is present.
40097 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
40100 * Holder secret key for blinded revocation pubkey.
40102 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
40105 * Holder secret key for blinded revocation pubkey.
40107 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
40110 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
40112 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
40115 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
40117 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
40120 * Holder secret key used in an HTLC transaction.
40122 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
40125 * Holder secret key used in an HTLC transaction.
40127 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
40130 * Holder HTLC secret key used in commitment transaction HTLC outputs.
40132 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
40135 * Holder HTLC secret key used in commitment transaction HTLC outputs.
40137 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
40142 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
40147 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40150 * Creates a copy of the InMemorySigner
40152 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
40155 * Creates a new [`InMemorySigner`].
40157 MUST_USE_RES struct LDKInMemorySigner InMemorySigner_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id, struct LDKThirtyTwoBytes rand_bytes_unique_start);
40160 * Returns the counterparty's pubkeys.
40162 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
40164 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
40167 * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
40168 * transactions, i.e., the amount of time that we have to wait to recover our funds if we
40169 * broadcast a transaction.
40171 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
40173 MUST_USE_RES uint16_t InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
40176 * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
40177 * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
40178 * if they broadcast a transaction.
40180 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
40182 MUST_USE_RES uint16_t InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
40185 * Returns whether the holder is the initiator.
40187 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
40189 MUST_USE_RES bool InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
40194 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
40196 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
40199 * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
40200 * building transactions.
40202 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
40204 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
40207 * Returns the channel type features of the channel parameters. Should be helpful for
40208 * determining a channel's category, i. e. legacy/anchors/taproot/etc.
40210 * Will panic if [`ChannelSigner::provide_channel_parameters`] has not been called before.
40212 MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
40215 * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
40216 * by `descriptor`, returning the witness stack for the input.
40218 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
40219 * is not spending the outpoint described by [`descriptor.outpoint`],
40220 * or if an output descriptor `script_pubkey` does not match the one we can spend.
40222 * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
40224 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);
40227 * Sign the single input of `spend_tx` at index `input_idx` which spends the output
40228 * described by `descriptor`, returning the witness stack for the input.
40230 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
40231 * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
40232 * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
40233 * `script_pubkey` does not match the one we can spend.
40235 * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
40236 * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
40238 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);
40241 * Constructs a new EntropySource which calls the relevant methods on this_arg.
40242 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
40244 struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
40247 * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
40248 * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
40250 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
40253 * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
40254 * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
40256 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
40259 * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
40260 * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
40262 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
40265 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
40267 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
40270 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
40272 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
40275 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
40277 void KeysManager_free(struct LDKKeysManager this_obj);
40280 * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
40281 * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
40282 * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
40283 * without a doubt, be unique to this instance. ie if you start multiple times with the same
40284 * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
40285 * is to simply use the current time (with very high precision).
40287 * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
40288 * obviously, `starting_time` should be unique every time you reload the library - it is only
40289 * used to generate new ephemeral key data (which will be stored by the individual channel if
40292 * Note that the seed is required to recover certain on-chain funds independent of
40293 * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
40294 * for any channel, and some on-chain during-closing funds.
40296 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
40298 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
40301 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
40303 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
40306 * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
40308 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]);
40311 * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s.
40312 * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
40313 * are no other inputs that need signing.
40315 * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
40317 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
40318 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
40320 MUST_USE_RES struct LDKCResult_PartiallySignedTransactionNoneZ KeysManager_sign_spendable_outputs_psbt(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_u8Z psbt);
40323 * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
40324 * output to the given change destination (if sufficient change value remains). The
40325 * transaction will have a feerate, at least, of the given value.
40327 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
40328 * transaction will have a locktime of 0. It it recommended to set this to the current block
40329 * height to avoid fee sniping, unless you have some specific reason to use a different
40332 * Returns `Err(())` if the output value is greater than the input value minus required fee,
40333 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
40334 * does not match the one we can spend.
40336 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
40338 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
40339 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
40341 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, struct LDKCOption_PackedLockTimeZ locktime);
40344 * Constructs a new EntropySource which calls the relevant methods on this_arg.
40345 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
40347 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
40350 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
40351 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
40353 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
40356 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
40357 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
40359 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
40362 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
40364 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
40367 * Constructs a new EntropySource which calls the relevant methods on this_arg.
40368 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
40370 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
40373 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
40374 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
40376 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
40379 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
40380 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
40382 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
40385 * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
40386 * that is shared across all nodes that intend to participate in [phantom node payments]
40389 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
40390 * `starting_time_nanos`.
40392 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
40393 * same across restarts, or else inbound payments may fail.
40395 * [phantom node payments]: PhantomKeysManager
40397 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]);
40400 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
40402 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, struct LDKCOption_PackedLockTimeZ locktime);
40405 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
40407 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]);
40410 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
40412 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
40415 * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
40416 * last-hop onion data, etc.
40418 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
40421 * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
40423 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
40426 * Calls the free function if one is set
40428 void MessageRouter_free(struct LDKMessageRouter this_ptr);
40431 * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
40433 void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
40436 * Constructs a new DefaultMessageRouter given each field
40438 MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(void);
40441 * Constructs a new MessageRouter which calls the relevant methods on this_arg.
40442 * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
40444 struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
40447 * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
40449 void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
40452 * Nodes on the path between the sender and the destination.
40454 * Returns a copy of the field.
40456 struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
40459 * Nodes on the path between the sender and the destination.
40461 void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
40464 * The recipient of the message.
40466 struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
40469 * The recipient of the message.
40471 void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
40474 * Constructs a new OnionMessagePath given each field
40476 MUST_USE_RES struct LDKOnionMessagePath OnionMessagePath_new(struct LDKCVec_PublicKeyZ intermediate_nodes_arg, struct LDKDestination destination_arg);
40479 * Creates a copy of the OnionMessagePath
40481 struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
40484 * Frees any resources used by the Destination
40486 void Destination_free(struct LDKDestination this_ptr);
40489 * Creates a copy of the Destination
40491 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
40494 * Utility method to constructs a new Node-variant Destination
40496 struct LDKDestination Destination_node(struct LDKPublicKey a);
40499 * Utility method to constructs a new BlindedPath-variant Destination
40501 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
40504 * Frees any resources used by the SendError
40506 void SendError_free(struct LDKSendError this_ptr);
40509 * Creates a copy of the SendError
40511 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
40514 * Utility method to constructs a new Secp256k1-variant SendError
40516 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
40519 * Utility method to constructs a new TooBigPacket-variant SendError
40521 struct LDKSendError SendError_too_big_packet(void);
40524 * Utility method to constructs a new TooFewBlindedHops-variant SendError
40526 struct LDKSendError SendError_too_few_blinded_hops(void);
40529 * Utility method to constructs a new InvalidFirstHop-variant SendError
40531 struct LDKSendError SendError_invalid_first_hop(void);
40534 * Utility method to constructs a new InvalidMessage-variant SendError
40536 struct LDKSendError SendError_invalid_message(void);
40539 * Utility method to constructs a new BufferFull-variant SendError
40541 struct LDKSendError SendError_buffer_full(void);
40544 * Utility method to constructs a new GetNodeIdFailed-variant SendError
40546 struct LDKSendError SendError_get_node_id_failed(void);
40549 * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
40551 struct LDKSendError SendError_blinded_path_advance_failed(void);
40554 * Checks if two SendErrors contain equal inner contents.
40555 * This ignores pointers and is_owned flags and looks at the values in fields.
40557 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
40560 * Calls the free function if one is set
40562 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
40565 * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
40566 * their respective handlers.
40568 MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKMessageRouter message_router, struct LDKOffersMessageHandler offers_handler, struct LDKCustomOnionMessageHandler custom_handler);
40571 * Send an onion message with contents `message` to the destination of `path`.
40573 * See [`OnionMessenger`] for example usage.
40575 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
40577 MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessagePath path, struct LDKOnionMessageContents message, struct LDKBlindedPath reply_path);
40580 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
40581 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
40583 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
40586 * Constructs a new OnionMessageProvider which calls the relevant methods on this_arg.
40587 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageProvider must be freed before this_arg is
40589 struct LDKOnionMessageProvider OnionMessenger_as_OnionMessageProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
40592 * Calls the free function if one is set
40594 void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
40597 * Frees any resources used by the OffersMessage
40599 void OffersMessage_free(struct LDKOffersMessage this_ptr);
40602 * Creates a copy of the OffersMessage
40604 struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
40607 * Utility method to constructs a new InvoiceRequest-variant OffersMessage
40609 struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
40612 * Utility method to constructs a new Invoice-variant OffersMessage
40614 struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
40617 * Utility method to constructs a new InvoiceError-variant OffersMessage
40619 struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
40622 * Returns whether `tlv_type` corresponds to a TLV record for Offers.
40624 MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
40627 * The TLV record type for the message as used in an `onionmsg_tlv` TLV stream.
40629 MUST_USE_RES uint64_t OffersMessage_tlv_type(const struct LDKOffersMessage *NONNULL_PTR this_arg);
40632 * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
40634 struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
40637 * Read a OffersMessage from a byte array, created by OffersMessage_write
40639 struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
40642 * Frees any resources used by the OnionMessageContents
40644 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
40647 * Utility method to constructs a new Offers-variant OnionMessageContents
40649 struct LDKOnionMessageContents OnionMessageContents_offers(struct LDKOffersMessage a);
40652 * Utility method to constructs a new Custom-variant OnionMessageContents
40654 struct LDKOnionMessageContents OnionMessageContents_custom(struct LDKCustomOnionMessageContents a);
40657 * Calls the free function if one is set
40659 void CustomOnionMessageContents_free(struct LDKCustomOnionMessageContents this_ptr);
40662 * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
40664 void BlindedPath_free(struct LDKBlindedPath this_obj);
40667 * Creates a copy of the BlindedPath
40669 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
40672 * Generates a non-cryptographic 64-bit hash of the BlindedPath.
40674 uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
40677 * Checks if two BlindedPaths contain equal inner contents.
40678 * This ignores pointers and is_owned flags and looks at the values in fields.
40679 * Two objects with NULL inner values will be considered "equal" here.
40681 bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
40684 * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
40686 void BlindedHop_free(struct LDKBlindedHop this_obj);
40689 * Creates a copy of the BlindedHop
40691 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
40694 * Generates a non-cryptographic 64-bit hash of the BlindedHop.
40696 uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
40699 * Checks if two BlindedHops contain equal inner contents.
40700 * This ignores pointers and is_owned flags and looks at the values in fields.
40701 * Two objects with NULL inner values will be considered "equal" here.
40703 bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
40706 * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
40707 * pubkey in `node_pks` will be the destination node.
40709 * Errors if less than two hops are provided or if `node_pk`(s) are invalid.
40711 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, const struct LDKEntropySource *NONNULL_PTR entropy_source);
40714 * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
40716 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
40719 * Read a BlindedPath from a byte array, created by BlindedPath_write
40721 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
40724 * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
40726 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
40729 * Read a BlindedHop from a byte array, created by BlindedHop_write
40731 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
40734 * Frees any resources used by the PaymentPurpose
40736 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
40739 * Creates a copy of the PaymentPurpose
40741 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
40744 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
40746 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKCOption_PaymentPreimageZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
40749 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
40751 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
40754 * Checks if two PaymentPurposes contain equal inner contents.
40755 * This ignores pointers and is_owned flags and looks at the values in fields.
40757 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
40760 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
40762 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
40765 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
40767 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
40770 * Frees any resources used by the PathFailure
40772 void PathFailure_free(struct LDKPathFailure this_ptr);
40775 * Creates a copy of the PathFailure
40777 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
40780 * Utility method to constructs a new InitialSend-variant PathFailure
40782 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
40785 * Utility method to constructs a new OnPath-variant PathFailure
40787 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
40790 * Checks if two PathFailures contain equal inner contents.
40791 * This ignores pointers and is_owned flags and looks at the values in fields.
40793 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
40796 * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
40798 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
40801 * Read a PathFailure from a byte array, created by PathFailure_write
40803 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
40806 * Frees any resources used by the ClosureReason
40808 void ClosureReason_free(struct LDKClosureReason this_ptr);
40811 * Creates a copy of the ClosureReason
40813 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
40816 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
40818 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
40821 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
40823 struct LDKClosureReason ClosureReason_holder_force_closed(void);
40826 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
40828 struct LDKClosureReason ClosureReason_cooperative_closure(void);
40831 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
40833 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
40836 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
40838 struct LDKClosureReason ClosureReason_funding_timed_out(void);
40841 * Utility method to constructs a new ProcessingError-variant ClosureReason
40843 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
40846 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
40848 struct LDKClosureReason ClosureReason_disconnected_peer(void);
40851 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
40853 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
40856 * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
40858 struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
40861 * Checks if two ClosureReasons contain equal inner contents.
40862 * This ignores pointers and is_owned flags and looks at the values in fields.
40864 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
40867 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
40869 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
40872 * Read a ClosureReason from a byte array, created by ClosureReason_write
40874 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
40877 * Frees any resources used by the HTLCDestination
40879 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
40882 * Creates a copy of the HTLCDestination
40884 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
40887 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
40889 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
40892 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
40894 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
40897 * Utility method to constructs a new InvalidForward-variant HTLCDestination
40899 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
40902 * Utility method to constructs a new FailedPayment-variant HTLCDestination
40904 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
40907 * Checks if two HTLCDestinations contain equal inner contents.
40908 * This ignores pointers and is_owned flags and looks at the values in fields.
40910 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
40913 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
40915 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
40918 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
40920 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
40923 * Creates a copy of the PaymentFailureReason
40925 enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
40928 * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
40930 enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
40933 * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
40935 enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
40938 * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
40940 enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
40943 * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
40945 enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
40948 * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
40950 enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
40953 * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
40955 enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
40958 * Checks if two PaymentFailureReasons contain equal inner contents.
40959 * This ignores pointers and is_owned flags and looks at the values in fields.
40961 bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
40964 * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
40966 struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
40969 * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
40971 struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
40974 * Frees any resources used by the Event
40976 void Event_free(struct LDKEvent this_ptr);
40979 * Creates a copy of the Event
40981 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
40984 * Utility method to constructs a new FundingGenerationReady-variant Event
40986 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);
40989 * Utility method to constructs a new PaymentClaimable-variant Event
40991 struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields onion_fields, uint64_t amount_msat, uint64_t counterparty_skimmed_fee_msat, struct LDKPaymentPurpose purpose, struct LDKThirtyTwoBytes via_channel_id, struct LDKCOption_u128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline);
40994 * Utility method to constructs a new PaymentClaimed-variant Event
40996 struct LDKEvent Event_payment_claimed(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose);
40999 * Utility method to constructs a new PaymentSent-variant Event
41001 struct LDKEvent Event_payment_sent(struct LDKCOption_PaymentIdZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
41004 * Utility method to constructs a new PaymentFailed-variant Event
41006 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
41009 * Utility method to constructs a new PaymentPathSuccessful-variant Event
41011 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_PaymentHashZ payment_hash, struct LDKPath path);
41014 * Utility method to constructs a new PaymentPathFailed-variant Event
41016 struct LDKEvent Event_payment_path_failed(struct LDKCOption_PaymentIdZ payment_id, struct LDKThirtyTwoBytes payment_hash, bool payment_failed_permanently, struct LDKPathFailure failure, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
41019 * Utility method to constructs a new ProbeSuccessful-variant Event
41021 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
41024 * Utility method to constructs a new ProbeFailed-variant Event
41026 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
41029 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
41031 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
41034 * Utility method to constructs a new HTLCIntercepted-variant Event
41036 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);
41039 * Utility method to constructs a new SpendableOutputs-variant Event
41041 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
41044 * Utility method to constructs a new PaymentForwarded-variant Event
41046 struct LDKEvent Event_payment_forwarded(struct LDKThirtyTwoBytes prev_channel_id, struct LDKThirtyTwoBytes next_channel_id, struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat);
41049 * Utility method to constructs a new ChannelPending-variant Event
41051 struct LDKEvent Event_channel_pending(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKThirtyTwoBytes former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo);
41054 * Utility method to constructs a new ChannelReady-variant Event
41056 struct LDKEvent Event_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
41059 * Utility method to constructs a new ChannelClosed-variant Event
41061 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason);
41064 * Utility method to constructs a new DiscardFunding-variant Event
41066 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
41069 * Utility method to constructs a new OpenChannelRequest-variant Event
41071 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);
41074 * Utility method to constructs a new HTLCHandlingFailed-variant Event
41076 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
41079 * Utility method to constructs a new BumpTransaction-variant Event
41081 struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
41084 * Checks if two Events contain equal inner contents.
41085 * This ignores pointers and is_owned flags and looks at the values in fields.
41087 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
41090 * Serialize the Event object into a byte array which can be read by Event_read
41092 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
41095 * Read a Event from a byte array, created by Event_write
41097 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
41100 * Frees any resources used by the MessageSendEvent
41102 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
41105 * Creates a copy of the MessageSendEvent
41107 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
41110 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
41112 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
41115 * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
41117 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
41120 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
41122 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
41125 * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
41127 struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
41130 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
41132 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
41135 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
41137 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
41140 * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
41142 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
41145 * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
41147 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
41150 * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
41152 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
41155 * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
41157 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
41160 * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
41162 struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
41165 * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
41167 struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
41170 * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
41172 struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
41175 * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
41177 struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
41180 * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
41182 struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
41185 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
41187 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
41190 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
41192 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
41195 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
41197 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
41200 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
41202 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
41205 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
41207 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
41210 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
41212 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
41215 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
41217 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
41220 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
41222 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
41225 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
41227 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
41230 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
41232 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
41235 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
41237 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
41240 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
41242 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
41245 * Utility method to constructs a new HandleError-variant MessageSendEvent
41247 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
41250 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
41252 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
41255 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
41257 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
41260 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
41262 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
41265 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
41267 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
41270 * Calls the free function if one is set
41272 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
41275 * Calls the free function if one is set
41277 void OnionMessageProvider_free(struct LDKOnionMessageProvider this_ptr);
41280 * Calls the free function if one is set
41282 void EventsProvider_free(struct LDKEventsProvider this_ptr);
41285 * Calls the free function if one is set
41287 void EventHandler_free(struct LDKEventHandler this_ptr);
41290 * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
41292 void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
41295 * The value in satoshis of the channel we're attempting to spend the anchor output of.
41297 uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
41300 * The value in satoshis of the channel we're attempting to spend the anchor output of.
41302 void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
41305 * The unique identifier to re-derive the signer for the associated channel.
41307 const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
41310 * The unique identifier to re-derive the signer for the associated channel.
41312 void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
41315 * The necessary channel parameters that need to be provided to the re-derived signer through
41316 * [`ChannelSigner::provide_channel_parameters`].
41318 * [`ChannelSigner::provide_channel_parameters`]: crate::sign::ChannelSigner::provide_channel_parameters
41320 struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
41323 * The necessary channel parameters that need to be provided to the re-derived signer through
41324 * [`ChannelSigner::provide_channel_parameters`].
41326 * [`ChannelSigner::provide_channel_parameters`]: crate::sign::ChannelSigner::provide_channel_parameters
41328 void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
41331 * Constructs a new ChannelDerivationParameters given each field
41333 MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
41336 * Creates a copy of the ChannelDerivationParameters
41338 struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
41341 * Checks if two ChannelDerivationParameterss contain equal inner contents.
41342 * This ignores pointers and is_owned flags and looks at the values in fields.
41343 * Two objects with NULL inner values will be considered "equal" here.
41345 bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
41348 * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
41350 void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
41353 * The parameters required to derive the signer for the anchor input.
41355 struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
41358 * The parameters required to derive the signer for the anchor input.
41360 void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
41363 * The transaction input's outpoint corresponding to the commitment transaction's anchor
41366 struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
41369 * The transaction input's outpoint corresponding to the commitment transaction's anchor
41372 void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
41375 * Constructs a new AnchorDescriptor given each field
41377 MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
41380 * Creates a copy of the AnchorDescriptor
41382 struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
41385 * Checks if two AnchorDescriptors contain equal inner contents.
41386 * This ignores pointers and is_owned flags and looks at the values in fields.
41387 * Two objects with NULL inner values will be considered "equal" here.
41389 bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
41392 * Returns the UTXO to be spent by the anchor input, which can be obtained via
41393 * [`Self::unsigned_tx_input`].
41395 MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
41398 * Returns the unsigned transaction input spending the anchor output in the commitment
41401 MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
41404 * Returns the witness script of the anchor output in the commitment transaction.
41406 MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
41409 * Returns the fully signed witness required to spend the anchor output in the commitment
41412 MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKSignature signature);
41415 * Derives the channel signer required to sign the anchor input.
41417 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
41420 * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
41422 void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
41425 * The parameters required to derive the signer for the HTLC input.
41427 struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
41430 * The parameters required to derive the signer for the HTLC input.
41432 void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
41435 * The number of the commitment transaction in which the HTLC output lives.
41437 uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
41440 * The number of the commitment transaction in which the HTLC output lives.
41442 void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
41445 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
41446 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
41447 * arrive at unique keys per commitment.
41449 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
41451 struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
41454 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
41455 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
41456 * arrive at unique keys per commitment.
41458 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
41460 void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
41463 * The details of the HTLC as it appears in the commitment transaction.
41465 struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
41468 * The details of the HTLC as it appears in the commitment transaction.
41470 void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
41473 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
41476 struct LDKCOption_PaymentPreimageZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
41479 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
41482 void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_PaymentPreimageZ val);
41485 * The counterparty's signature required to spend the HTLC output.
41487 struct LDKSignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
41490 * The counterparty's signature required to spend the HTLC output.
41492 void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKSignature val);
41495 * Creates a copy of the HTLCDescriptor
41497 struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
41500 * Checks if two HTLCDescriptors contain equal inner contents.
41501 * This ignores pointers and is_owned flags and looks at the values in fields.
41502 * Two objects with NULL inner values will be considered "equal" here.
41504 bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
41507 * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
41508 * being spent by the HTLC input in the HTLC transaction.
41510 MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
41513 * Returns the UTXO to be spent by the HTLC input, which can be obtained via
41514 * [`Self::unsigned_tx_input`].
41516 MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
41519 * Returns the unsigned transaction input spending the HTLC output in the commitment
41522 MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
41525 * Returns the delayed output created as a result of spending the HTLC output in the commitment
41528 MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
41531 * Returns the witness script of the HTLC output in the commitment transaction.
41533 MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
41536 * Returns the fully signed witness required to spend the HTLC output in the commitment
41539 MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKSignature signature, struct LDKu8slice witness_script);
41542 * Derives the channel signer required to sign the HTLC input.
41544 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
41547 * Frees any resources used by the BumpTransactionEvent
41549 void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
41552 * Creates a copy of the BumpTransactionEvent
41554 struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
41557 * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
41559 struct LDKBumpTransactionEvent BumpTransactionEvent_channel_close(struct LDKThirtyTwoBytes claim_id, uint32_t package_target_feerate_sat_per_1000_weight, struct LDKTransaction commitment_tx, uint64_t commitment_tx_fee_satoshis, struct LDKAnchorDescriptor anchor_descriptor, struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs);
41562 * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
41564 struct LDKBumpTransactionEvent BumpTransactionEvent_htlcresolution(struct LDKThirtyTwoBytes claim_id, uint32_t target_feerate_sat_per_1000_weight, struct LDKCVec_HTLCDescriptorZ htlc_descriptors, uint32_t tx_lock_time);
41567 * Checks if two BumpTransactionEvents contain equal inner contents.
41568 * This ignores pointers and is_owned flags and looks at the values in fields.
41570 bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
41573 * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
41575 void Input_free(struct LDKInput this_obj);
41578 * The unique identifier of the input.
41580 struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
41583 * The unique identifier of the input.
41585 void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
41588 * The UTXO being spent by the input.
41590 struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
41593 * The UTXO being spent by the input.
41595 void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
41598 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
41599 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
41602 uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
41605 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
41606 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
41609 void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
41612 * Constructs a new Input given each field
41614 MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
41617 * Creates a copy of the Input
41619 struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
41622 * Generates a non-cryptographic 64-bit hash of the Input.
41624 uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
41627 * Checks if two Inputs contain equal inner contents.
41628 * This ignores pointers and is_owned flags and looks at the values in fields.
41629 * Two objects with NULL inner values will be considered "equal" here.
41631 bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
41634 * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
41636 void Utxo_free(struct LDKUtxo this_obj);
41639 * The unique identifier of the output.
41641 struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
41644 * The unique identifier of the output.
41646 void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
41649 * The output to spend.
41651 struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
41654 * The output to spend.
41656 void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
41659 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
41660 * with their lengths included, required to satisfy the output's script. The weight consumed by
41661 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
41663 uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
41666 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
41667 * with their lengths included, required to satisfy the output's script. The weight consumed by
41668 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
41670 void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
41673 * Constructs a new Utxo given each field
41675 MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
41678 * Creates a copy of the Utxo
41680 struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
41683 * Generates a non-cryptographic 64-bit hash of the Utxo.
41685 uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
41688 * Checks if two Utxos contain equal inner contents.
41689 * This ignores pointers and is_owned flags and looks at the values in fields.
41690 * Two objects with NULL inner values will be considered "equal" here.
41692 bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
41695 * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
41697 MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
41700 * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
41702 void CoinSelection_free(struct LDKCoinSelection this_obj);
41705 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
41706 * requiring additional fees.
41708 struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
41711 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
41712 * requiring additional fees.
41714 void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
41717 * An additional output tracking whether any change remained after coin selection. This output
41718 * should always have a value above dust for its given `script_pubkey`. It should not be
41719 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
41720 * not met. This implies no other party should be able to spend it except us.
41722 struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
41725 * An additional output tracking whether any change remained after coin selection. This output
41726 * should always have a value above dust for its given `script_pubkey`. It should not be
41727 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
41728 * not met. This implies no other party should be able to spend it except us.
41730 void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
41733 * Constructs a new CoinSelection given each field
41735 MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
41738 * Creates a copy of the CoinSelection
41740 struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
41743 * Calls the free function if one is set
41745 void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
41748 * Calls the free function if one is set
41750 void WalletSource_free(struct LDKWalletSource this_ptr);
41753 * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
41755 void Wallet_free(struct LDKWallet this_obj);
41758 * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
41759 * of [`CoinSelectionSource`].
41761 MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
41764 * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
41765 * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
41767 struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
41770 * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
41772 void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
41775 * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
41777 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
41779 MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
41782 * Handles all variants of [`BumpTransactionEvent`].
41784 void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
41787 * Frees any resources used by the FilesystemPersister, if is_owned is set and inner is non-NULL.
41789 void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
41792 * Initialize a new FilesystemPersister and set the path to the individual channels'
41795 MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
41798 * Get the directory which was provided when this persister was initialized.
41800 MUST_USE_RES struct LDKStr FilesystemPersister_get_data_dir(const struct LDKFilesystemPersister *NONNULL_PTR this_arg);
41803 * Read `ChannelMonitor`s from disk.
41805 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);
41808 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
41810 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
41813 * Frees any resources used by the GossipSync
41815 void GossipSync_free(struct LDKGossipSync this_ptr);
41818 * Utility method to constructs a new P2P-variant GossipSync
41820 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
41823 * Utility method to constructs a new Rapid-variant GossipSync
41825 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
41828 * Utility method to constructs a new None-variant GossipSync
41830 struct LDKGossipSync GossipSync_none(void);
41833 * Start a background thread that takes care of responsibilities enumerated in the [top-level
41836 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
41837 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
41838 * either [`join`] or [`stop`].
41840 * # Data Persistence
41842 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
41843 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
41844 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
41845 * provided implementation.
41847 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
41848 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
41849 * See the `lightning-persister` crate for LDK's provided implementation.
41851 * Typically, users should either implement [`Persister::persist_manager`] to never return an
41852 * error or call [`join`] and handle any error that may arise. For the latter case,
41853 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
41857 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
41858 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
41859 * functionality implemented by other handlers.
41860 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
41862 * # Rapid Gossip Sync
41864 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
41865 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
41866 * until the [`RapidGossipSync`] instance completes its first sync.
41868 * [top-level documentation]: BackgroundProcessor
41869 * [`join`]: Self::join
41870 * [`stop`]: Self::stop
41871 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
41872 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
41873 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
41874 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
41875 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
41876 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
41878 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);
41881 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
41882 * [`ChannelManager`].
41886 * This function panics if the background thread has panicked such as while persisting or
41889 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
41891 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
41894 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
41895 * [`ChannelManager`].
41899 * This function panics if the background thread has panicked such as while persisting or
41902 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
41904 MUST_USE_RES struct LDKCResult_NoneErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
41907 * Frees any resources used by the Bolt11ParseError
41909 void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr);
41912 * Creates a copy of the Bolt11ParseError
41914 struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig);
41917 * Utility method to constructs a new Bech32Error-variant Bolt11ParseError
41919 struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a);
41922 * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError
41924 struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a);
41927 * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError
41929 struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a);
41932 * Utility method to constructs a new BadPrefix-variant Bolt11ParseError
41934 struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void);
41937 * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError
41939 struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void);
41942 * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError
41944 struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void);
41947 * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError
41949 struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void);
41952 * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError
41954 struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void);
41957 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError
41959 struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void);
41962 * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError
41964 struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a);
41967 * Utility method to constructs a new PaddingError-variant Bolt11ParseError
41969 struct LDKBolt11ParseError Bolt11ParseError_padding_error(void);
41972 * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError
41974 struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void);
41977 * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError
41979 struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void);
41982 * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError
41984 struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void);
41987 * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError
41989 struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void);
41992 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError
41994 struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void);
41997 * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError
41999 struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a);
42002 * Utility method to constructs a new Skip-variant Bolt11ParseError
42004 struct LDKBolt11ParseError Bolt11ParseError_skip(void);
42007 * Checks if two Bolt11ParseErrors contain equal inner contents.
42008 * This ignores pointers and is_owned flags and looks at the values in fields.
42010 bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b);
42013 * Frees any resources used by the ParseOrSemanticError
42015 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
42018 * Creates a copy of the ParseOrSemanticError
42020 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
42023 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
42025 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKBolt11ParseError a);
42028 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
42030 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKBolt11SemanticError a);
42033 * Checks if two ParseOrSemanticErrors contain equal inner contents.
42034 * This ignores pointers and is_owned flags and looks at the values in fields.
42036 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
42039 * Frees any resources used by the Bolt11Invoice, if is_owned is set and inner is non-NULL.
42041 void Bolt11Invoice_free(struct LDKBolt11Invoice this_obj);
42044 * Checks if two Bolt11Invoices contain equal inner contents.
42045 * This ignores pointers and is_owned flags and looks at the values in fields.
42046 * Two objects with NULL inner values will be considered "equal" here.
42048 bool Bolt11Invoice_eq(const struct LDKBolt11Invoice *NONNULL_PTR a, const struct LDKBolt11Invoice *NONNULL_PTR b);
42051 * Creates a copy of the Bolt11Invoice
42053 struct LDKBolt11Invoice Bolt11Invoice_clone(const struct LDKBolt11Invoice *NONNULL_PTR orig);
42056 * Generates a non-cryptographic 64-bit hash of the Bolt11Invoice.
42058 uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o);
42061 * Frees any resources used by the SignedRawBolt11Invoice, if is_owned is set and inner is non-NULL.
42063 void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj);
42066 * Checks if two SignedRawBolt11Invoices contain equal inner contents.
42067 * This ignores pointers and is_owned flags and looks at the values in fields.
42068 * Two objects with NULL inner values will be considered "equal" here.
42070 bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b);
42073 * Creates a copy of the SignedRawBolt11Invoice
42075 struct LDKSignedRawBolt11Invoice SignedRawBolt11Invoice_clone(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR orig);
42078 * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice.
42080 uint64_t SignedRawBolt11Invoice_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
42083 * Frees any resources used by the RawBolt11Invoice, if is_owned is set and inner is non-NULL.
42085 void RawBolt11Invoice_free(struct LDKRawBolt11Invoice this_obj);
42090 struct LDKRawDataPart RawBolt11Invoice_get_data(const struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr);
42095 void RawBolt11Invoice_set_data(struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
42098 * Checks if two RawBolt11Invoices contain equal inner contents.
42099 * This ignores pointers and is_owned flags and looks at the values in fields.
42100 * Two objects with NULL inner values will be considered "equal" here.
42102 bool RawBolt11Invoice_eq(const struct LDKRawBolt11Invoice *NONNULL_PTR a, const struct LDKRawBolt11Invoice *NONNULL_PTR b);
42105 * Creates a copy of the RawBolt11Invoice
42107 struct LDKRawBolt11Invoice RawBolt11Invoice_clone(const struct LDKRawBolt11Invoice *NONNULL_PTR orig);
42110 * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice.
42112 uint64_t RawBolt11Invoice_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR o);
42115 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
42117 void RawDataPart_free(struct LDKRawDataPart this_obj);
42120 * generation time of the invoice
42122 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
42125 * generation time of the invoice
42127 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
42130 * Checks if two RawDataParts contain equal inner contents.
42131 * This ignores pointers and is_owned flags and looks at the values in fields.
42132 * Two objects with NULL inner values will be considered "equal" here.
42134 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
42137 * Creates a copy of the RawDataPart
42139 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
42142 * Generates a non-cryptographic 64-bit hash of the RawDataPart.
42144 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
42147 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
42149 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
42152 * Checks if two PositiveTimestamps contain equal inner contents.
42153 * This ignores pointers and is_owned flags and looks at the values in fields.
42154 * Two objects with NULL inner values will be considered "equal" here.
42156 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
42159 * Creates a copy of the PositiveTimestamp
42161 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
42164 * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp.
42166 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
42169 * Creates a copy of the SiPrefix
42171 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
42174 * Utility method to constructs a new Milli-variant SiPrefix
42176 enum LDKSiPrefix SiPrefix_milli(void);
42179 * Utility method to constructs a new Micro-variant SiPrefix
42181 enum LDKSiPrefix SiPrefix_micro(void);
42184 * Utility method to constructs a new Nano-variant SiPrefix
42186 enum LDKSiPrefix SiPrefix_nano(void);
42189 * Utility method to constructs a new Pico-variant SiPrefix
42191 enum LDKSiPrefix SiPrefix_pico(void);
42194 * Checks if two SiPrefixs contain equal inner contents.
42195 * This ignores pointers and is_owned flags and looks at the values in fields.
42197 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
42200 * Generates a non-cryptographic 64-bit hash of the SiPrefix.
42202 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
42205 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
42206 * This is effectively 10^12 * the prefix multiplier
42208 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
42211 * Creates a copy of the Currency
42213 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
42216 * Utility method to constructs a new Bitcoin-variant Currency
42218 enum LDKCurrency Currency_bitcoin(void);
42221 * Utility method to constructs a new BitcoinTestnet-variant Currency
42223 enum LDKCurrency Currency_bitcoin_testnet(void);
42226 * Utility method to constructs a new Regtest-variant Currency
42228 enum LDKCurrency Currency_regtest(void);
42231 * Utility method to constructs a new Simnet-variant Currency
42233 enum LDKCurrency Currency_simnet(void);
42236 * Utility method to constructs a new Signet-variant Currency
42238 enum LDKCurrency Currency_signet(void);
42241 * Generates a non-cryptographic 64-bit hash of the Currency.
42243 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
42246 * Checks if two Currencys contain equal inner contents.
42247 * This ignores pointers and is_owned flags and looks at the values in fields.
42249 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
42252 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
42254 void Sha256_free(struct LDKSha256 this_obj);
42257 * Creates a copy of the Sha256
42259 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
42262 * Generates a non-cryptographic 64-bit hash of the Sha256.
42264 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
42267 * Checks if two Sha256s contain equal inner contents.
42268 * This ignores pointers and is_owned flags and looks at the values in fields.
42269 * Two objects with NULL inner values will be considered "equal" here.
42271 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
42274 * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a
42275 * single sha256 hash.
42277 MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]);
42280 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
42282 void Description_free(struct LDKDescription this_obj);
42285 * Creates a copy of the Description
42287 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
42290 * Generates a non-cryptographic 64-bit hash of the Description.
42292 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
42295 * Checks if two Descriptions contain equal inner contents.
42296 * This ignores pointers and is_owned flags and looks at the values in fields.
42297 * Two objects with NULL inner values will be considered "equal" here.
42299 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
42302 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
42304 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
42306 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
42308 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
42311 * Constructs a new PayeePubKey given each field
42313 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
42316 * Creates a copy of the PayeePubKey
42318 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
42321 * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
42323 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
42326 * Checks if two PayeePubKeys contain equal inner contents.
42327 * This ignores pointers and is_owned flags and looks at the values in fields.
42328 * Two objects with NULL inner values will be considered "equal" here.
42330 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
42333 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
42335 void ExpiryTime_free(struct LDKExpiryTime this_obj);
42338 * Creates a copy of the ExpiryTime
42340 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
42343 * Generates a non-cryptographic 64-bit hash of the ExpiryTime.
42345 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
42348 * Checks if two ExpiryTimes contain equal inner contents.
42349 * This ignores pointers and is_owned flags and looks at the values in fields.
42350 * Two objects with NULL inner values will be considered "equal" here.
42352 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
42355 * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
42357 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
42359 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
42361 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
42364 * Constructs a new MinFinalCltvExpiryDelta given each field
42366 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
42369 * Creates a copy of the MinFinalCltvExpiryDelta
42371 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
42374 * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
42376 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
42379 * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
42380 * This ignores pointers and is_owned flags and looks at the values in fields.
42381 * Two objects with NULL inner values will be considered "equal" here.
42383 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
42386 * Frees any resources used by the Fallback
42388 void Fallback_free(struct LDKFallback this_ptr);
42391 * Creates a copy of the Fallback
42393 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
42396 * Utility method to constructs a new SegWitProgram-variant Fallback
42398 struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
42401 * Utility method to constructs a new PubKeyHash-variant Fallback
42403 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
42406 * Utility method to constructs a new ScriptHash-variant Fallback
42408 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
42411 * Generates a non-cryptographic 64-bit hash of the Fallback.
42413 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
42416 * Checks if two Fallbacks contain equal inner contents.
42417 * This ignores pointers and is_owned flags and looks at the values in fields.
42419 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
42422 * Frees any resources used by the Bolt11InvoiceSignature, if is_owned is set and inner is non-NULL.
42424 void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj);
42427 * Creates a copy of the Bolt11InvoiceSignature
42429 struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig);
42432 * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
42434 uint64_t Bolt11InvoiceSignature_hash(const struct LDKBolt11InvoiceSignature *NONNULL_PTR o);
42437 * Checks if two Bolt11InvoiceSignatures contain equal inner contents.
42438 * This ignores pointers and is_owned flags and looks at the values in fields.
42439 * Two objects with NULL inner values will be considered "equal" here.
42441 bool Bolt11InvoiceSignature_eq(const struct LDKBolt11InvoiceSignature *NONNULL_PTR a, const struct LDKBolt11InvoiceSignature *NONNULL_PTR b);
42444 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
42446 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
42449 * Creates a copy of the PrivateRoute
42451 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
42454 * Generates a non-cryptographic 64-bit hash of the PrivateRoute.
42456 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
42459 * Checks if two PrivateRoutes contain equal inner contents.
42460 * This ignores pointers and is_owned flags and looks at the values in fields.
42461 * Two objects with NULL inner values will be considered "equal" here.
42463 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
42466 * Disassembles the `SignedRawBolt11Invoice` into its three parts:
42468 * 2. hash of the raw invoice
42471 MUST_USE_RES struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ SignedRawBolt11Invoice_into_parts(struct LDKSignedRawBolt11Invoice this_arg);
42474 * The [`RawBolt11Invoice`] which was signed.
42476 MUST_USE_RES struct LDKRawBolt11Invoice SignedRawBolt11Invoice_raw_invoice(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
42479 * The hash of the [`RawBolt11Invoice`] that was signed.
42481 MUST_USE_RES const uint8_t (*SignedRawBolt11Invoice_signable_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg))[32];
42484 * Signature for the invoice.
42486 MUST_USE_RES struct LDKBolt11InvoiceSignature SignedRawBolt11Invoice_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
42489 * Recovers the public key used for signing the invoice from the recoverable signature.
42491 MUST_USE_RES struct LDKCResult_PayeePubKeyErrorZ SignedRawBolt11Invoice_recover_payee_pub_key(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
42494 * Checks if the signature is valid for the included payee public key or if none exists if it's
42495 * valid for the recovered signature (which should always be true?).
42497 MUST_USE_RES bool SignedRawBolt11Invoice_check_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
42500 * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed.
42502 MUST_USE_RES struct LDKThirtyTwoBytes RawBolt11Invoice_signable_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
42506 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42508 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_payment_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
42512 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42514 MUST_USE_RES struct LDKDescription RawBolt11Invoice_description(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
42518 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42520 MUST_USE_RES struct LDKPayeePubKey RawBolt11Invoice_payee_pub_key(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
42524 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42526 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_description_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
42530 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42532 MUST_USE_RES struct LDKExpiryTime RawBolt11Invoice_expiry_time(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
42536 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42538 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawBolt11Invoice_min_final_cltv_expiry_delta(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
42540 MUST_USE_RES struct LDKCOption_PaymentSecretZ RawBolt11Invoice_payment_secret(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
42542 MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawBolt11Invoice_payment_metadata(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
42546 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42548 MUST_USE_RES struct LDKBolt11InvoiceFeatures RawBolt11Invoice_features(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
42550 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawBolt11Invoice_private_routes(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
42552 MUST_USE_RES struct LDKCOption_u64Z RawBolt11Invoice_amount_pico_btc(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
42554 MUST_USE_RES enum LDKCurrency RawBolt11Invoice_currency(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
42557 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
42559 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
42561 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
42564 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
42565 * the range `0..=MAX_TIMESTAMP`.
42567 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
42569 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
42571 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
42574 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
42575 * `0..=MAX_TIMESTAMP`.
42577 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
42579 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
42581 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
42584 * Returns the Unix timestamp representing the stored time
42586 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
42589 * Returns the duration of the stored time since the Unix epoch
42591 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
42594 * Returns the [`SystemTime`] representing the stored time
42596 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
42599 * The hash of the [`RawBolt11Invoice`] that was signed.
42601 MUST_USE_RES struct LDKThirtyTwoBytes Bolt11Invoice_signable_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42604 * Transform the `Bolt11Invoice` into its unchecked version.
42606 MUST_USE_RES struct LDKSignedRawBolt11Invoice Bolt11Invoice_into_signed_raw(struct LDKBolt11Invoice this_arg);
42609 * Check that the invoice is signed correctly and that key recovery works
42611 MUST_USE_RES struct LDKCResult_NoneBolt11SemanticErrorZ Bolt11Invoice_check_signature(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42614 * Constructs a `Bolt11Invoice` from a [`SignedRawBolt11Invoice`] by checking all its invariants.
42616 * use lightning_invoice::*;
42618 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
42619 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
42620 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
42621 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
42622 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
42623 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
42624 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
42625 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
42626 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
42627 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
42628 * j5r6drg6k6zcqj0fcwg\";
42630 * let signed = invoice.parse::<SignedRawBolt11Invoice>().unwrap();
42632 * assert!(Bolt11Invoice::from_signed(signed).is_ok());
42635 MUST_USE_RES struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ Bolt11Invoice_from_signed(struct LDKSignedRawBolt11Invoice signed_invoice);
42638 * Returns the `Bolt11Invoice`'s timestamp (should equal its creation time)
42640 MUST_USE_RES uint64_t Bolt11Invoice_timestamp(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42643 * Returns the `Bolt11Invoice`'s timestamp as a duration since the Unix epoch
42645 MUST_USE_RES uint64_t Bolt11Invoice_duration_since_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42648 * Returns the hash to which we will receive the preimage on completion of the payment
42650 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
42653 * Get the payee's public key if one was included in the invoice
42655 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42657 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42660 * Get the payment secret if one was included in the invoice
42662 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_secret(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
42665 * Get the payment metadata blob if one was included in the invoice
42667 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt11Invoice_payment_metadata(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42670 * Get the invoice features if they were included in the invoice
42672 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42674 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11Invoice_features(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42677 * Recover the payee's public key (only to be used if none was included in the invoice)
42679 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42682 * Returns the Duration since the Unix epoch at which the invoice expires.
42683 * Returning None if overflow occurred.
42685 MUST_USE_RES struct LDKCOption_DurationZ Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42688 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
42690 MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42693 * Returns whether the invoice has expired.
42695 MUST_USE_RES bool Bolt11Invoice_is_expired(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42698 * Returns the Duration remaining until the invoice expires.
42700 MUST_USE_RES uint64_t Bolt11Invoice_duration_until_expiry(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42703 * Returns the Duration remaining until the invoice expires given the current time.
42704 * `time` is the timestamp as a duration since the Unix epoch.
42706 MUST_USE_RES uint64_t Bolt11Invoice_expiration_remaining_from_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t time);
42709 * Returns whether the expiry time would pass at the given point in time.
42710 * `at_time` is the timestamp as a duration since the Unix epoch.
42712 MUST_USE_RES bool Bolt11Invoice_would_expire(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t at_time);
42715 * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
42716 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
42718 MUST_USE_RES uint64_t Bolt11Invoice_min_final_cltv_expiry_delta(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42721 * Returns a list of all fallback addresses as [`Address`]es
42723 MUST_USE_RES struct LDKCVec_AddressZ Bolt11Invoice_fallback_addresses(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42726 * Returns a list of all routes included in the invoice
42728 MUST_USE_RES struct LDKCVec_PrivateRouteZ Bolt11Invoice_private_routes(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42731 * Returns a list of all routes included in the invoice as the underlying hints
42733 MUST_USE_RES struct LDKCVec_RouteHintZ Bolt11Invoice_route_hints(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42736 * Returns the currency for which the invoice was issued
42738 MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42741 * Returns the amount if specified in the invoice as millisatoshis.
42743 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
42746 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
42747 * returns [`CreationError::DescriptionTooLong`] otherwise
42749 * Please note that single characters may use more than one byte due to UTF8 encoding.
42751 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
42754 * Returns the underlying description [`String`]
42756 MUST_USE_RES struct LDKStr Description_into_inner(struct LDKDescription this_arg);
42759 * Construct an `ExpiryTime` from seconds.
42761 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
42764 * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part.
42766 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
42769 * Returns the expiry time in seconds
42771 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
42774 * Returns a reference to the underlying [`Duration`] (=expiry time)
42776 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
42779 * Creates a new (partial) route from a list of hops
42781 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
42784 * Returns the underlying list of hops
42786 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
42789 * Creates a copy of the CreationError
42791 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
42794 * Utility method to constructs a new DescriptionTooLong-variant CreationError
42796 enum LDKCreationError CreationError_description_too_long(void);
42799 * Utility method to constructs a new RouteTooLong-variant CreationError
42801 enum LDKCreationError CreationError_route_too_long(void);
42804 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
42806 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
42809 * Utility method to constructs a new InvalidAmount-variant CreationError
42811 enum LDKCreationError CreationError_invalid_amount(void);
42814 * Utility method to constructs a new MissingRouteHints-variant CreationError
42816 enum LDKCreationError CreationError_missing_route_hints(void);
42819 * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
42821 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
42824 * Checks if two CreationErrors contain equal inner contents.
42825 * This ignores pointers and is_owned flags and looks at the values in fields.
42827 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
42830 * Get the string representation of a CreationError object
42832 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
42835 * Creates a copy of the Bolt11SemanticError
42837 enum LDKBolt11SemanticError Bolt11SemanticError_clone(const enum LDKBolt11SemanticError *NONNULL_PTR orig);
42840 * Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
42842 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_hash(void);
42845 * Utility method to constructs a new MultiplePaymentHashes-variant Bolt11SemanticError
42847 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(void);
42850 * Utility method to constructs a new NoDescription-variant Bolt11SemanticError
42852 enum LDKBolt11SemanticError Bolt11SemanticError_no_description(void);
42855 * Utility method to constructs a new MultipleDescriptions-variant Bolt11SemanticError
42857 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_descriptions(void);
42860 * Utility method to constructs a new NoPaymentSecret-variant Bolt11SemanticError
42862 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_secret(void);
42865 * Utility method to constructs a new MultiplePaymentSecrets-variant Bolt11SemanticError
42867 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(void);
42870 * Utility method to constructs a new InvalidFeatures-variant Bolt11SemanticError
42872 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_features(void);
42875 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11SemanticError
42877 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_recovery_id(void);
42880 * Utility method to constructs a new InvalidSignature-variant Bolt11SemanticError
42882 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_signature(void);
42885 * Utility method to constructs a new ImpreciseAmount-variant Bolt11SemanticError
42887 enum LDKBolt11SemanticError Bolt11SemanticError_imprecise_amount(void);
42890 * Checks if two Bolt11SemanticErrors contain equal inner contents.
42891 * This ignores pointers and is_owned flags and looks at the values in fields.
42893 bool Bolt11SemanticError_eq(const enum LDKBolt11SemanticError *NONNULL_PTR a, const enum LDKBolt11SemanticError *NONNULL_PTR b);
42896 * Get the string representation of a Bolt11SemanticError object
42898 struct LDKStr Bolt11SemanticError_to_str(const enum LDKBolt11SemanticError *NONNULL_PTR o);
42901 * Frees any resources used by the SignOrCreationError
42903 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
42906 * Creates a copy of the SignOrCreationError
42908 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
42911 * Utility method to constructs a new SignError-variant SignOrCreationError
42913 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
42916 * Utility method to constructs a new CreationError-variant SignOrCreationError
42918 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
42921 * Checks if two SignOrCreationErrors contain equal inner contents.
42922 * This ignores pointers and is_owned flags and looks at the values in fields.
42924 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
42927 * Get the string representation of a SignOrCreationError object
42929 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
42932 * Pays the given [`Bolt11Invoice`], retrying if needed based on [`Retry`].
42934 * [`Bolt11Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
42935 * as the payment is still pending. If the payment succeeds, you must ensure that a second payment
42936 * with the same [`PaymentHash`] is never sent.
42938 * If you wish to use a different payment idempotency token, see [`pay_invoice_with_id`].
42940 struct LDKCResult_PaymentIdPaymentErrorZ pay_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
42943 * Pays the given [`Bolt11Invoice`] with a custom idempotency key, retrying if needed based on
42946 * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
42947 * payment completes or fails, no idempotency guarantees are made.
42949 * You should ensure that the [`Bolt11Invoice::payment_hash`] is unique and the same
42950 * [`PaymentHash`] has never been paid before.
42952 * See [`pay_invoice`] for a variant which uses the [`PaymentHash`] for the idempotency token.
42954 struct LDKCResult_NonePaymentErrorZ pay_invoice_with_id(const struct LDKBolt11Invoice *NONNULL_PTR invoice, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
42957 * Pays the given zero-value [`Bolt11Invoice`] using the given amount, retrying if needed based on
42960 * [`Bolt11Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long
42961 * as the payment is still pending. If the payment succeeds, you must ensure that a second payment
42962 * with the same [`PaymentHash`] is never sent.
42964 * If you wish to use a different payment idempotency token, see
42965 * [`pay_zero_value_invoice_with_id`].
42967 struct LDKCResult_PaymentIdPaymentErrorZ pay_zero_value_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
42970 * Pays the given zero-value [`Bolt11Invoice`] using the given amount and custom idempotency key,
42971 * retrying if needed based on [`Retry`].
42973 * Note that idempotency is only guaranteed as long as the payment is still pending. Once the
42974 * payment completes or fails, no idempotency guarantees are made.
42976 * You should ensure that the [`Bolt11Invoice::payment_hash`] is unique and the same
42977 * [`PaymentHash`] has never been paid before.
42979 * See [`pay_zero_value_invoice`] for a variant which uses the [`PaymentHash`] for the
42980 * idempotency token.
42982 struct LDKCResult_NonePaymentErrorZ pay_zero_value_invoice_with_id(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, const struct LDKChannelManager *NONNULL_PTR channelmanager);
42985 * Frees any resources used by the PaymentError
42987 void PaymentError_free(struct LDKPaymentError this_ptr);
42990 * Creates a copy of the PaymentError
42992 struct LDKPaymentError PaymentError_clone(const struct LDKPaymentError *NONNULL_PTR orig);
42995 * Utility method to constructs a new Invoice-variant PaymentError
42997 struct LDKPaymentError PaymentError_invoice(struct LDKStr a);
43000 * Utility method to constructs a new Sending-variant PaymentError
43002 struct LDKPaymentError PaymentError_sending(enum LDKRetryableSendFailure a);
43005 * Checks if two PaymentErrors contain equal inner contents.
43006 * This ignores pointers and is_owned flags and looks at the values in fields.
43008 bool PaymentError_eq(const struct LDKPaymentError *NONNULL_PTR a, const struct LDKPaymentError *NONNULL_PTR b);
43011 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
43012 * See [`PhantomKeysManager`] for more information on phantom node payments.
43014 * `phantom_route_hints` parameter:
43015 * * Contains channel info for all nodes participating in the phantom invoice
43016 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
43017 * participating node
43018 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
43019 * updated when a channel becomes disabled or closes
43020 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
43021 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
43024 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
43025 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
43026 * If `None` is provided for `payment_hash`, then one will be created.
43028 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
43029 * in excess of the current time.
43031 * `duration_since_epoch` is the current time since epoch in seconds.
43033 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
43034 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
43035 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
43036 * confirmations during routing.
43038 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
43039 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
43042 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
43043 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
43044 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
43045 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
43046 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
43047 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
43049 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
43050 * available and the current time is supplied by the caller.
43052 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKCOption_PaymentHashZ 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);
43055 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
43056 * See [`PhantomKeysManager`] for more information on phantom node payments.
43058 * `phantom_route_hints` parameter:
43059 * * Contains channel info for all nodes participating in the phantom invoice
43060 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
43061 * participating node
43062 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
43063 * updated when a channel becomes disabled or closes
43064 * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
43065 * of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
43066 * in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
43067 * until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
43068 * desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
43070 * `description_hash` is a SHA-256 hash of the description text
43072 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
43073 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
43074 * If `None` is provided for `payment_hash`, then one will be created.
43076 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
43077 * in excess of the current time.
43079 * `duration_since_epoch` is the current time since epoch in seconds.
43081 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
43082 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
43085 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
43086 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
43087 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
43088 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
43089 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
43091 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
43092 * available and the current time is supplied by the caller.
43094 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKCOption_PaymentHashZ 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);
43097 * Utility to construct an invoice. Generally, unless you want to do something like a custom
43098 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
43099 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
43100 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
43101 * that the payment secret is valid when the invoice is paid.
43103 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
43104 * in excess of the current time.
43106 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
43107 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
43108 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
43109 * confirmations during routing.
43111 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
43113 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ 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);
43116 * Utility to construct an invoice. Generally, unless you want to do something like a custom
43117 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
43118 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
43119 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
43120 * that the payment secret is valid when the invoice is paid.
43121 * Use this variant if you want to pass the `description_hash` to the invoice.
43123 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
43124 * in excess of the current time.
43126 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
43127 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
43128 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
43129 * confirmations during routing.
43131 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
43133 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ 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);
43136 * See [`create_invoice_from_channelmanager_with_description_hash`]
43137 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
43138 * available and the current time is supplied by the caller.
43140 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ 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);
43143 * See [`create_invoice_from_channelmanager`]
43144 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
43145 * available and the current time is supplied by the caller.
43147 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ 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);
43150 * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
43151 * This version allows for providing a custom [`PaymentHash`] for the invoice.
43152 * This may be useful if you're building an on-chain swap or involving another protocol where
43153 * the payment hash is also involved outside the scope of lightning.
43155 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ 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);
43158 * Read a SiPrefix object from a string
43160 struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s);
43163 * Read a Bolt11Invoice object from a string
43165 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s);
43168 * Read a SignedRawBolt11Invoice object from a string
43170 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ SignedRawBolt11Invoice_from_str(struct LDKStr s);
43173 * Get the string representation of a Bolt11ParseError object
43175 struct LDKStr Bolt11ParseError_to_str(const struct LDKBolt11ParseError *NONNULL_PTR o);
43178 * Get the string representation of a ParseOrSemanticError object
43180 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
43183 * Get the string representation of a Bolt11Invoice object
43185 struct LDKStr Bolt11Invoice_to_str(const struct LDKBolt11Invoice *NONNULL_PTR o);
43188 * Get the string representation of a SignedRawBolt11Invoice object
43190 struct LDKStr SignedRawBolt11Invoice_to_str(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
43193 * Get the string representation of a Currency object
43195 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
43198 * Get the string representation of a SiPrefix object
43200 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
43203 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
43205 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
43208 * Instantiate a new [`RapidGossipSync`] instance.
43210 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
43213 * Sync gossip data from a file.
43214 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
43216 * `network_graph`: The network graph to apply the updates to
43218 * `sync_path`: Path to the file where the gossip update data is located
43221 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
43224 * Update network graph from binary data.
43225 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
43227 * `update_data`: `&[u8]` binary stream that comprises the update data
43229 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
43232 * Update network graph from binary data.
43233 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
43235 * `update_data`: `&[u8]` binary stream that comprises the update data
43236 * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
43238 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);
43241 * Returns whether a rapid gossip sync has completed at least once.
43243 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
43246 * Frees any resources used by the GraphSyncError
43248 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
43251 * Creates a copy of the GraphSyncError
43253 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
43256 * Utility method to constructs a new DecodeError-variant GraphSyncError
43258 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
43261 * Utility method to constructs a new LightningError-variant GraphSyncError
43263 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
43265 #endif /* LDK_C_BINDINGS_H */
43267 #include "ldk_ver.h"