1 #ifndef LDK_C_BINDINGS_H
2 #define LDK_C_BINDINGS_H
4 /* Generated with cbindgen:0.24.5 */
6 /* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
11 #include "ldk_rust_types.h"
14 * Whether this blinded HTLC is being failed backwards by the introduction node or a blinded node,
15 * which determines the failure message that should be used.
17 typedef enum LDKBlindedFailure {
19 * This HTLC is being failed backwards by the introduction node, and thus should be failed with
20 * [`msgs::UpdateFailHTLC`] and error code `0x8000|0x4000|24`.
22 LDKBlindedFailure_FromIntroductionNode,
24 * This HTLC is being failed backwards by a blinded node within the path, and thus should be
25 * failed with [`msgs::UpdateFailMalformedHTLC`] and error code `0x8000|0x4000|24`.
27 LDKBlindedFailure_FromBlindedNode,
29 * Must be last for serialization purposes
31 LDKBlindedFailure_Sentinel,
35 * Errors that may occur when converting a [`RawBolt11Invoice`] to a [`Bolt11Invoice`]. They relate to
36 * the requirements sections in BOLT #11
38 typedef enum LDKBolt11SemanticError {
40 * The invoice is missing the mandatory payment hash
42 LDKBolt11SemanticError_NoPaymentHash,
44 * The invoice has multiple payment hashes which isn't allowed
46 LDKBolt11SemanticError_MultiplePaymentHashes,
48 * No description or description hash are part of the invoice
50 LDKBolt11SemanticError_NoDescription,
52 * The invoice contains multiple descriptions and/or description hashes which isn't allowed
54 LDKBolt11SemanticError_MultipleDescriptions,
56 * The invoice is missing the mandatory payment secret, which all modern lightning nodes
59 LDKBolt11SemanticError_NoPaymentSecret,
61 * The invoice contains multiple payment secrets
63 LDKBolt11SemanticError_MultiplePaymentSecrets,
65 * The invoice's features are invalid
67 LDKBolt11SemanticError_InvalidFeatures,
69 * The recovery id doesn't fit the signature/pub key
71 LDKBolt11SemanticError_InvalidRecoveryId,
73 * The invoice's signature is invalid
75 LDKBolt11SemanticError_InvalidSignature,
77 * The invoice's amount was not a whole number of millisatoshis
79 LDKBolt11SemanticError_ImpreciseAmount,
81 * Must be last for serialization purposes
83 LDKBolt11SemanticError_Sentinel,
84 } LDKBolt11SemanticError;
87 * Error when interpreting a TLV stream as a specific type.
89 typedef enum LDKBolt12SemanticError {
91 * The current [`std::time::SystemTime`] is past the offer or invoice's expiration.
93 LDKBolt12SemanticError_AlreadyExpired,
95 * The provided chain hash does not correspond to a supported chain.
97 LDKBolt12SemanticError_UnsupportedChain,
99 * A chain was provided but was not expected.
101 LDKBolt12SemanticError_UnexpectedChain,
103 * An amount was expected but was missing.
105 LDKBolt12SemanticError_MissingAmount,
107 * The amount exceeded the total bitcoin supply.
109 LDKBolt12SemanticError_InvalidAmount,
111 * An amount was provided but was not sufficient in value.
113 LDKBolt12SemanticError_InsufficientAmount,
115 * An amount was provided but was not expected.
117 LDKBolt12SemanticError_UnexpectedAmount,
119 * A currency was provided that is not supported.
121 LDKBolt12SemanticError_UnsupportedCurrency,
123 * A feature was required but is unknown.
125 LDKBolt12SemanticError_UnknownRequiredFeatures,
127 * Features were provided but were not expected.
129 LDKBolt12SemanticError_UnexpectedFeatures,
131 * A required description was not provided.
133 LDKBolt12SemanticError_MissingDescription,
135 * A signing pubkey was not provided.
137 LDKBolt12SemanticError_MissingSigningPubkey,
139 * A signing pubkey was provided but a different one was expected.
141 LDKBolt12SemanticError_InvalidSigningPubkey,
143 * A signing pubkey was provided but was not expected.
145 LDKBolt12SemanticError_UnexpectedSigningPubkey,
147 * A quantity was expected but was missing.
149 LDKBolt12SemanticError_MissingQuantity,
151 * An unsupported quantity was provided.
153 LDKBolt12SemanticError_InvalidQuantity,
155 * A quantity or quantity bounds was provided but was not expected.
157 LDKBolt12SemanticError_UnexpectedQuantity,
159 * Metadata could not be used to verify the offers message.
161 LDKBolt12SemanticError_InvalidMetadata,
163 * Metadata was provided but was not expected.
165 LDKBolt12SemanticError_UnexpectedMetadata,
167 * Payer metadata was expected but was missing.
169 LDKBolt12SemanticError_MissingPayerMetadata,
171 * A payer id was expected but was missing.
173 LDKBolt12SemanticError_MissingPayerId,
175 * The payment id for a refund or request is already in use.
177 LDKBolt12SemanticError_DuplicatePaymentId,
179 * Blinded paths were expected but were missing.
181 LDKBolt12SemanticError_MissingPaths,
183 * The blinded payinfo given does not match the number of blinded path hops.
185 LDKBolt12SemanticError_InvalidPayInfo,
187 * An invoice creation time was expected but was missing.
189 LDKBolt12SemanticError_MissingCreationTime,
191 * An invoice payment hash was expected but was missing.
193 LDKBolt12SemanticError_MissingPaymentHash,
195 * A signature was expected but was missing.
197 LDKBolt12SemanticError_MissingSignature,
199 * Must be last for serialization purposes
201 LDKBolt12SemanticError_Sentinel,
202 } LDKBolt12SemanticError;
205 * An enum which can either contain a or not
207 typedef enum LDKCOption_NoneZ {
209 * When we're in this state, this COption_NoneZ contains a
211 LDKCOption_NoneZ_Some,
213 * When we're in this state, this COption_NoneZ contains nothing
215 LDKCOption_NoneZ_None,
217 * Must be last for serialization purposes
219 LDKCOption_NoneZ_Sentinel,
223 * An enum representing the status of a channel monitor update persistence.
225 * These are generally used as the return value for an implementation of [`Persist`] which is used
226 * as the storage layer for a [`ChainMonitor`]. See the docs on [`Persist`] for a high-level
227 * explanation of how to handle different cases.
229 * While `UnrecoverableError` is provided as a failure variant, it is not truly \"handled\" on the
230 * calling side, and generally results in an immediate panic. For those who prefer to avoid
231 * panics, `InProgress` can be used and you can retry the update operation in the background or
234 * Note that channels should generally *not* be force-closed after a persistence failure.
235 * Force-closing with the latest [`ChannelMonitorUpdate`] applied may result in a transaction
236 * being broadcast which can only be spent by the latest [`ChannelMonitor`]! Thus, if the
237 * latest [`ChannelMonitor`] is not durably persisted anywhere and exists only in memory, naively
238 * calling [`ChannelManager::force_close_broadcasting_latest_txn`] *may result in loss of funds*!
240 * [`Persist`]: chainmonitor::Persist
241 * [`ChainMonitor`]: chainmonitor::ChainMonitor
242 * [`ChannelManager::force_close_broadcasting_latest_txn`]: crate::ln::channelmanager::ChannelManager::force_close_broadcasting_latest_txn
244 typedef enum LDKChannelMonitorUpdateStatus {
246 * The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
249 * This includes performing any `fsync()` calls required to ensure the update is guaranteed to
250 * be available on restart even if the application crashes.
252 LDKChannelMonitorUpdateStatus_Completed,
254 * Indicates that the update will happen asynchronously in the background or that a transient
255 * failure occurred which is being retried in the background and will eventually complete.
257 * This will \"freeze\" a channel, preventing us from revoking old states or submitting a new
258 * commitment transaction to the counterparty. Once the update(s) which are `InProgress` have
259 * been completed, a [`MonitorEvent::Completed`] can be used to restore the channel to an
262 * Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
263 * occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
264 * attempting to claim it on this channel) and those updates must still be persisted.
266 * No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
267 * until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
268 * monitor update for the same channel.
270 * For deployments where a copy of [`ChannelMonitor`]s and other local state are backed up in
271 * a remote location (with local copies persisted immediately), it is anticipated that all
272 * updates will return [`InProgress`] until the remote copies could be updated.
274 * Note that while fully asynchronous persistence of [`ChannelMonitor`] data is generally
275 * reliable, this feature is considered beta, and a handful of edge-cases remain. Until the
276 * remaining cases are fixed, in rare cases, *using this feature may lead to funds loss*.
278 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
280 LDKChannelMonitorUpdateStatus_InProgress,
282 * Indicates that an update has failed and will not complete at any point in the future.
284 * Currently returning this variant will cause LDK to immediately panic to encourage immediate
285 * shutdown. In the future this may be updated to disconnect peers and refuse to continue
286 * normal operation without a panic.
288 * Applications which wish to perform an orderly shutdown after failure should consider
289 * returning [`InProgress`] instead and simply shut down without ever marking the update
292 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
294 LDKChannelMonitorUpdateStatus_UnrecoverableError,
296 * Must be last for serialization purposes
298 LDKChannelMonitorUpdateStatus_Sentinel,
299 } LDKChannelMonitorUpdateStatus;
302 * Further information on the details of the channel shutdown.
303 * Upon channels being forced closed (i.e. commitment transaction confirmation detected
304 * by `ChainMonitor`), ChannelShutdownState will be set to `ShutdownComplete` or
305 * the channel will be removed shortly.
306 * Also note, that in normal operation, peers could disconnect at any of these states
307 * and require peer re-connection before making progress onto other states
309 typedef enum LDKChannelShutdownState {
311 * Channel has not sent or received a shutdown message.
313 LDKChannelShutdownState_NotShuttingDown,
315 * Local node has sent a shutdown message for this channel.
317 LDKChannelShutdownState_ShutdownInitiated,
319 * Shutdown message exchanges have concluded and the channels are in the midst of
320 * resolving all existing open HTLCs before closing can continue.
322 LDKChannelShutdownState_ResolvingHTLCs,
324 * All HTLCs have been resolved, nodes are currently negotiating channel close onchain fee rates.
326 LDKChannelShutdownState_NegotiatingClosingFee,
328 * We've successfully negotiated a closing_signed dance. At this point `ChannelManager` is about
329 * to drop the channel.
331 LDKChannelShutdownState_ShutdownComplete,
333 * Must be last for serialization purposes
335 LDKChannelShutdownState_Sentinel,
336 } LDKChannelShutdownState;
339 * An enum that represents the priority at which we want a transaction to confirm used for feerate
342 typedef enum LDKConfirmationTarget {
344 * We have some funds available on chain which we need to spend prior to some expiry time at
345 * which point our counterparty may be able to steal them. Generally we have in the high tens
346 * to low hundreds of blocks to get our transaction on-chain, but we shouldn't risk too low a
347 * fee - this should be a relatively high priority feerate.
349 LDKConfirmationTarget_OnChainSweep,
351 * This is the lowest feerate we will allow our channel counterparty to have in an anchor
352 * channel in order to close the channel if a channel party goes away.
354 * This needs to be sufficient to get into the mempool when the channel needs to
355 * be force-closed. Setting too high may result in force-closures if our counterparty attempts
356 * to use a lower feerate. Because this is for anchor channels, we can always bump the feerate
357 * later; the feerate here only needs to be sufficient to enter the mempool.
359 * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
360 * is not an estimate which is very easy to calculate because we do not know the future. Using
361 * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
362 * ensure you can always close the channel. A future change to Bitcoin's P2P network
363 * (package relay) may obviate the need for this entirely.
365 LDKConfirmationTarget_MinAllowedAnchorChannelRemoteFee,
367 * The lowest feerate we will allow our channel counterparty to have in a non-anchor channel.
369 * This is the feerate on the transaction which we (or our counterparty) will broadcast in
370 * order to close the channel if a channel party goes away. Setting this value too high will
371 * cause immediate force-closures in order to avoid having an unbroadcastable state.
373 * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
374 * arbitrary time in the future. Obviously this is not an estimate which is very easy to
375 * calculate. This can leave channels subject to being unable to close if feerates rise, and in
376 * general you should prefer anchor channels to ensure you can increase the feerate when the
377 * transactions need broadcasting.
379 * Do note some fee estimators round up to the next full sat/vbyte (ie 250 sats per kw),
380 * causing occasional issues with feerate disagreements between an initiator that wants a
381 * feerate of 1.1 sat/vbyte and a receiver that wants 1.1 rounded up to 2. If your fee
382 * estimator rounds subtracting 250 to your desired feerate here can help avoid this issue.
384 * [`ChannelConfig::max_dust_htlc_exposure`]: crate::util::config::ChannelConfig::max_dust_htlc_exposure
386 LDKConfirmationTarget_MinAllowedNonAnchorChannelRemoteFee,
388 * This is the feerate on the transaction which we (or our counterparty) will broadcast in
389 * order to close the channel if a channel party goes away.
391 * This needs to be sufficient to get into the mempool when the channel needs to
392 * be force-closed. Setting too low may result in force-closures. Because this is for anchor
393 * channels, it can be a low value as we can always bump the feerate later.
395 * A good estimate is the expected mempool minimum at the time of force-closure. Obviously this
396 * is not an estimate which is very easy to calculate because we do not know the future. Using
397 * a simple long-term fee estimate or tracking of the mempool minimum is a good approach to
398 * ensure you can always close the channel. A future change to Bitcoin's P2P network
399 * (package relay) may obviate the need for this entirely.
401 LDKConfirmationTarget_AnchorChannelFee,
403 * Lightning is built around the ability to broadcast a transaction in the future to close our
404 * channel and claim all pending funds. In order to do so, non-anchor channels are built with
405 * transactions which we need to be able to broadcast at some point in the future.
407 * This feerate represents the fee we pick now, which must be sufficient to enter a block at an
408 * arbitrary time in the future. Obviously this is not an estimate which is very easy to
409 * calculate, so most lightning nodes use some relatively high-priority feerate using the
410 * current mempool. This leaves channels subject to being unable to close if feerates rise, and
411 * in general you should prefer anchor channels to ensure you can increase the feerate when the
412 * transactions need broadcasting.
414 * Since this should represent the feerate of a channel close that does not need fee
415 * bumping, this is also used as an upper bound for our attempted feerate when doing cooperative
416 * closure of any channel.
418 LDKConfirmationTarget_NonAnchorChannelFee,
420 * When cooperatively closing a channel, this is the minimum feerate we will accept.
421 * Recommended at least within a day or so worth of blocks.
423 * This will also be used when initiating a cooperative close of a channel. When closing a
424 * channel you can override this fee by using
425 * [`ChannelManager::close_channel_with_feerate_and_script`].
427 * [`ChannelManager::close_channel_with_feerate_and_script`]: crate::ln::channelmanager::ChannelManager::close_channel_with_feerate_and_script
429 LDKConfirmationTarget_ChannelCloseMinimum,
431 * Must be last for serialization purposes
433 LDKConfirmationTarget_Sentinel,
434 } LDKConfirmationTarget;
437 * Errors that may occur when constructing a new [`RawBolt11Invoice`] or [`Bolt11Invoice`]
439 typedef enum LDKCreationError {
441 * The supplied description string was longer than 639 __bytes__ (see [`Description::new`])
443 LDKCreationError_DescriptionTooLong,
445 * The specified route has too many hops and can't be encoded
447 LDKCreationError_RouteTooLong,
449 * The Unix timestamp of the supplied date is less than zero or greater than 35-bits
451 LDKCreationError_TimestampOutOfBounds,
453 * The supplied millisatoshi amount was greater than the total bitcoin supply.
455 LDKCreationError_InvalidAmount,
457 * Route hints were required for this invoice and were missing. Applies to
458 * [phantom invoices].
460 * [phantom invoices]: crate::utils::create_phantom_invoice
462 LDKCreationError_MissingRouteHints,
464 * The provided `min_final_cltv_expiry_delta` was less than [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
466 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
468 LDKCreationError_MinFinalCltvExpiryDeltaTooShort,
470 * Must be last for serialization purposes
472 LDKCreationError_Sentinel,
476 * Enum representing the crypto currencies (or networks) supported by this library
478 typedef enum LDKCurrency {
486 LDKCurrency_BitcoinTestnet,
500 * Must be last for serialization purposes
502 LDKCurrency_Sentinel,
506 * Describes the type of HTLC claim as determined by analyzing the witness.
508 typedef enum LDKHTLCClaim {
510 * Claims an offered output on a commitment transaction through the timeout path.
512 LDKHTLCClaim_OfferedTimeout,
514 * Claims an offered output on a commitment transaction through the success path.
516 LDKHTLCClaim_OfferedPreimage,
518 * Claims an accepted output on a commitment transaction through the timeout path.
520 LDKHTLCClaim_AcceptedTimeout,
522 * Claims an accepted output on a commitment transaction through the success path.
524 LDKHTLCClaim_AcceptedPreimage,
526 * Claims an offered/accepted output on a commitment transaction through the revocation path.
528 LDKHTLCClaim_Revocation,
530 * Must be last for serialization purposes
532 LDKHTLCClaim_Sentinel,
536 * Represents an IO Error. Note that some information is lost in the conversion from Rust.
538 typedef enum LDKIOError {
540 LDKIOError_PermissionDenied,
541 LDKIOError_ConnectionRefused,
542 LDKIOError_ConnectionReset,
543 LDKIOError_ConnectionAborted,
544 LDKIOError_NotConnected,
545 LDKIOError_AddrInUse,
546 LDKIOError_AddrNotAvailable,
547 LDKIOError_BrokenPipe,
548 LDKIOError_AlreadyExists,
549 LDKIOError_WouldBlock,
550 LDKIOError_InvalidInput,
551 LDKIOError_InvalidData,
553 LDKIOError_WriteZero,
554 LDKIOError_Interrupted,
556 LDKIOError_UnexpectedEof,
558 * Must be last for serialization purposes
564 * An enum representing the available verbosity levels of the logger.
566 typedef enum LDKLevel {
568 * Designates extremely verbose information, including gossip-induced messages
572 * Designates very low priority, often extremely verbose, information
576 * Designates lower priority information
580 * Designates useful information
584 * Designates hazardous situations
588 * Designates very serious errors
592 * Must be last for serialization purposes
598 * An enum representing the possible Bitcoin or test networks which we can run on
600 typedef enum LDKNetwork {
602 * The main Bitcoin blockchain.
606 * The testnet3 blockchain.
610 * A local test blockchain.
614 * A blockchain on which blocks are signed instead of mined.
618 * Must be last for serialization purposes
624 * The reason the payment failed. Used in [`Event::PaymentFailed`].
626 typedef enum LDKPaymentFailureReason {
628 * The intended recipient rejected our payment.
630 LDKPaymentFailureReason_RecipientRejected,
632 * The user chose to abandon this payment by calling [`ChannelManager::abandon_payment`].
634 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
636 LDKPaymentFailureReason_UserAbandoned,
638 * We exhausted all of our retry attempts while trying to send the payment, or we
639 * exhausted the [`Retry::Timeout`] if the user set one. If at any point a retry
640 * attempt failed while being forwarded along the path, an [`Event::PaymentPathFailed`] will
641 * have come before this.
643 * [`Retry::Timeout`]: crate::ln::channelmanager::Retry::Timeout
645 LDKPaymentFailureReason_RetriesExhausted,
647 * The payment expired while retrying, based on the provided
648 * [`PaymentParameters::expiry_time`].
650 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
652 LDKPaymentFailureReason_PaymentExpired,
654 * We failed to find a route while retrying the payment.
656 LDKPaymentFailureReason_RouteNotFound,
658 * This error should generally never happen. This likely means that there is a problem with
661 LDKPaymentFailureReason_UnexpectedError,
663 * Must be last for serialization purposes
665 LDKPaymentFailureReason_Sentinel,
666 } LDKPaymentFailureReason;
669 * Specifies the recipient of an invoice.
671 * This indicates to [`NodeSigner::sign_invoice`] what node secret key should be used to sign
674 typedef enum LDKRecipient {
676 * The invoice should be signed with the local node secret key.
680 * The invoice should be signed with the phantom node secret key. This secret key must be the
681 * same for all nodes participating in the [phantom node payment].
683 * [phantom node payment]: PhantomKeysManager
685 LDKRecipient_PhantomNode,
687 * Must be last for serialization purposes
689 LDKRecipient_Sentinel,
693 * Indicates an immediate error on [`ChannelManager::send_payment`]. Further errors may be
694 * surfaced later via [`Event::PaymentPathFailed`] and [`Event::PaymentFailed`].
696 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
697 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
698 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
700 typedef enum LDKRetryableSendFailure {
702 * The provided [`PaymentParameters::expiry_time`] indicated that the payment has expired. Note
703 * that this error is *not* caused by [`Retry::Timeout`].
705 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
707 LDKRetryableSendFailure_PaymentExpired,
709 * We were unable to find a route to the destination.
711 LDKRetryableSendFailure_RouteNotFound,
713 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
714 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
716 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
717 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
718 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
720 LDKRetryableSendFailure_DuplicatePayment,
722 * Must be last for serialization purposes
724 LDKRetryableSendFailure_Sentinel,
725 } LDKRetryableSendFailure;
728 * Represents an error returned from libsecp256k1 during validation of some secp256k1 data
730 typedef enum LDKSecp256k1Error {
732 * Signature failed verification
734 LDKSecp256k1Error_IncorrectSignature,
736 * Badly sized message ("messages" are actually fixed-sized digests; see the MESSAGE_SIZE constant)
738 LDKSecp256k1Error_InvalidMessage,
742 LDKSecp256k1Error_InvalidPublicKey,
746 LDKSecp256k1Error_InvalidSignature,
750 LDKSecp256k1Error_InvalidSecretKey,
754 LDKSecp256k1Error_InvalidSharedSecret,
758 LDKSecp256k1Error_InvalidRecoveryId,
760 * Invalid tweak for add_assign or mul_assign
762 LDKSecp256k1Error_InvalidTweak,
764 * Didn't pass enough memory to context creation with preallocated memory
766 LDKSecp256k1Error_NotEnoughMemory,
768 * Bad set of public keys.
770 LDKSecp256k1Error_InvalidPublicKeySum,
772 * The only valid parity values are 0 or 1.
774 LDKSecp256k1Error_InvalidParityValue,
776 * Must be last for serialization purposes
778 LDKSecp256k1Error_Sentinel,
782 * SI prefixes for the human readable part
784 typedef enum LDKSiPrefix {
802 * Must be last for serialization purposes
804 LDKSiPrefix_Sentinel,
808 * [`SocketAddress`] error variants
810 typedef enum LDKSocketAddressParseError {
812 * Socket address (IPv4/IPv6) parsing error
814 LDKSocketAddressParseError_SocketAddrParse,
816 * Invalid input format
818 LDKSocketAddressParseError_InvalidInput,
822 LDKSocketAddressParseError_InvalidPort,
824 * Invalid onion v3 address
826 LDKSocketAddressParseError_InvalidOnionV3,
828 * Must be last for serialization purposes
830 LDKSocketAddressParseError_Sentinel,
831 } LDKSocketAddressParseError;
834 * An error when accessing the chain via [`UtxoLookup`].
836 typedef enum LDKUtxoLookupError {
838 * The requested chain is unknown.
840 LDKUtxoLookupError_UnknownChain,
842 * The requested transaction doesn't exist or hasn't confirmed.
844 LDKUtxoLookupError_UnknownTx,
846 * Must be last for serialization purposes
848 LDKUtxoLookupError_Sentinel,
849 } LDKUtxoLookupError;
852 * A Rust str object, ie a reference to a UTF8-valid string.
853 * This is *not* null-terminated so cannot be used directly as a C string!
855 typedef struct LDKStr {
857 * A pointer to the string's bytes, in UTF8 encoding
859 const uint8_t *chars;
861 * The number of bytes (not characters!) pointed to by `chars`
865 * Whether the data pointed to by `chars` should be freed or not.
871 * A 16-byte byte array.
873 typedef struct LDKSixteenBytes {
881 * Unsigned, 128-bit integer.
883 * Because LLVM implements an incorrect ABI for 128-bit integers, a wrapper type is defined here.
884 * See https://github.com/rust-lang/rust/issues/54341 for more details.
886 typedef struct LDKU128 {
888 * The 128-bit integer, as 16 little-endian bytes
890 uint8_t le_bytes[16];
894 * Integer in the range `0..=16`
896 typedef struct LDKWitnessVersion {
901 * A dynamically-allocated array of u8s of arbitrary size.
902 * This corresponds to std::vector in C++
904 typedef struct LDKCVec_u8Z {
906 * The elements in the array.
907 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
911 * The number of elements pointed to by `data`.
917 * A segregated witness version byte and script bytes
919 typedef struct LDKWitnessProgram {
920 struct LDKWitnessVersion version;
921 struct LDKCVec_u8Z program;
925 * A "slice" referencing some byte array. This is simply a length-tagged pointer which does not
926 * own the memory pointed to by data.
928 typedef struct LDKu8slice {
930 * A pointer to the byte buffer
934 * The number of bytes pointed to by `data`.
940 * Represents a scalar value between zero and the secp256k1 curve order, in big endian.
942 typedef struct LDKBigEndianScalar {
944 * The bytes of the scalar value.
946 uint8_t big_endian_bytes[32];
947 } LDKBigEndianScalar;
950 * Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
951 * look up the corresponding function in rust-lightning's docs.
953 typedef struct LDKThirtyTwoBytes {
955 * The thirty-two bytes
961 * Represents an error returned from the bech32 library during validation of some bech32 data
963 typedef enum LDKBech32Error_Tag {
965 * String does not contain the separator character
967 LDKBech32Error_MissingSeparator,
969 * The checksum does not match the rest of the data
971 LDKBech32Error_InvalidChecksum,
973 * The data or human-readable part is too long or too short
975 LDKBech32Error_InvalidLength,
977 * Some part of the string contains an invalid character
979 LDKBech32Error_InvalidChar,
981 * Some part of the data has an invalid value
983 LDKBech32Error_InvalidData,
985 * The bit conversion failed due to a padding issue
987 LDKBech32Error_InvalidPadding,
989 * The whole string must be of one case
991 LDKBech32Error_MixedCase,
993 * Must be last for serialization purposes
995 LDKBech32Error_Sentinel,
996 } LDKBech32Error_Tag;
998 typedef struct LDKBech32Error {
999 LDKBech32Error_Tag tag;
1002 uint32_t invalid_char;
1005 uint8_t invalid_data;
1011 * A serialized transaction, in (pointer, length) form.
1013 * This type optionally owns its own memory, and thus the semantics around access change based on
1014 * the `data_is_owned` flag. If `data_is_owned` is set, you must call `Transaction_free` to free
1015 * the underlying buffer before the object goes out of scope. If `data_is_owned` is not set, any
1016 * access to the buffer after the scope in which the object was provided to you is invalid. eg,
1017 * access after you return from the call in which a `!data_is_owned` `Transaction` is provided to
1018 * you would be invalid.
1020 * Note that, while it may change in the future, because transactions on the Rust side are stored
1021 * in a deserialized form, all `Transaction`s generated on the Rust side will have `data_is_owned`
1022 * set. Similarly, while it may change in the future, all `Transaction`s you pass to Rust may have
1023 * `data_is_owned` either set or unset at your discretion.
1025 typedef struct LDKTransaction {
1027 * The serialized transaction data.
1029 * This is non-const for your convenience, an object passed to Rust is never written to.
1033 * The length of the serialized transaction
1037 * Whether the data pointed to by `data` should be freed or not.
1043 * A serialized witness.
1045 typedef struct LDKWitness {
1047 * The serialized transaction data.
1049 * This is non-const for your convenience, an object passed to Rust is never written to.
1053 * The length of the serialized transaction
1057 * Whether the data pointed to by `data` should be freed or not.
1063 * An input to a transaction.
1065 * This contains the witness, the scriptSig and the previous outpoint and represents a single
1066 * input to a transaction
1068 typedef struct LDKTxIn {
1070 * The witness which includes any signatures required to spend a segwit output.
1072 struct LDKWitness witness;
1074 * The script_sig which includes signatures requires to spend a pre-segwit output (or a
1075 * P2SH-wrapped segwit output).
1077 struct LDKCVec_u8Z script_sig;
1079 * The sequence number of the transaction input
1083 * The txid of the transaction being spent.
1085 struct LDKThirtyTwoBytes previous_txid;
1087 * The output index of the transaction being spent.
1089 uint32_t previous_vout;
1093 * A transaction output including a scriptPubKey and value.
1094 * This type *does* own its own memory, so must be free'd appropriately.
1096 typedef struct LDKTxOut {
1098 * The script_pubkey in this output
1100 struct LDKCVec_u8Z script_pubkey;
1102 * The value, in satoshis, of this output
1108 * An enum which can either contain a u64 or not
1110 typedef enum LDKCOption_u64Z_Tag {
1112 * When we're in this state, this COption_u64Z contains a u64
1114 LDKCOption_u64Z_Some,
1116 * When we're in this state, this COption_u64Z contains nothing
1118 LDKCOption_u64Z_None,
1120 * Must be last for serialization purposes
1122 LDKCOption_u64Z_Sentinel,
1123 } LDKCOption_u64Z_Tag;
1125 typedef struct LDKCOption_u64Z {
1126 LDKCOption_u64Z_Tag tag;
1137 * Onion messages and payments can be sent and received to blinded paths, which serve to hide the
1138 * identity of the recipient.
1140 typedef struct MUST_USE_STRUCT LDKBlindedPath {
1142 * A pointer to the opaque Rust object.
1143 * Nearly everywhere, inner must be non-null, however in places where
1144 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1146 LDKnativeBlindedPath *inner;
1148 * Indicates that this is the only struct which contains the same pointer.
1149 * Rust functions which take ownership of an object provided via an argument require
1150 * this to be true and invalidate the object pointed to by inner.
1156 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedPaths of arbitrary size.
1157 * This corresponds to std::vector in C++
1159 typedef struct LDKCVec_BlindedPathZ {
1161 * The elements in the array.
1162 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1164 struct LDKBlindedPath *data;
1166 * The number of elements pointed to by `data`.
1169 } LDKCVec_BlindedPathZ;
1174 * A `Refund` is a request to send an [`Bolt12Invoice`] without a preceding [`Offer`].
1176 * Typically, after an invoice is paid, the recipient may publish a refund allowing the sender to
1177 * recoup their funds. A refund may be used more generally as an \"offer for money\", such as with a
1180 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
1181 * [`Offer`]: crate::offers::offer::Offer
1183 typedef struct MUST_USE_STRUCT LDKRefund {
1185 * A pointer to the opaque Rust object.
1186 * Nearly everywhere, inner must be non-null, however in places where
1187 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1189 LDKnativeRefund *inner;
1191 * Indicates that this is the only struct which contains the same pointer.
1192 * Rust functions which take ownership of an object provided via an argument require
1193 * this to be true and invalidate the object pointed to by inner.
1201 * Error when parsing a bech32 encoded message using [`str::parse`].
1203 typedef struct MUST_USE_STRUCT LDKBolt12ParseError {
1205 * A pointer to the opaque Rust object.
1206 * Nearly everywhere, inner must be non-null, however in places where
1207 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1209 LDKnativeBolt12ParseError *inner;
1211 * Indicates that this is the only struct which contains the same pointer.
1212 * Rust functions which take ownership of an object provided via an argument require
1213 * this to be true and invalidate the object pointed to by inner.
1216 } LDKBolt12ParseError;
1219 * The contents of CResult_RefundBolt12ParseErrorZ
1221 typedef union LDKCResult_RefundBolt12ParseErrorZPtr {
1223 * A pointer to the contents in the success state.
1224 * Reading from this pointer when `result_ok` is not set is undefined.
1226 struct LDKRefund *result;
1228 * A pointer to the contents in the error state.
1229 * Reading from this pointer when `result_ok` is set is undefined.
1231 struct LDKBolt12ParseError *err;
1232 } LDKCResult_RefundBolt12ParseErrorZPtr;
1235 * A CResult_RefundBolt12ParseErrorZ represents the result of a fallible operation,
1236 * containing a crate::lightning::offers::refund::Refund on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
1237 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1239 typedef struct LDKCResult_RefundBolt12ParseErrorZ {
1241 * The contents of this CResult_RefundBolt12ParseErrorZ, accessible via either
1242 * `err` or `result` depending on the state of `result_ok`.
1244 union LDKCResult_RefundBolt12ParseErrorZPtr contents;
1246 * Whether this CResult_RefundBolt12ParseErrorZ represents a success state.
1249 } LDKCResult_RefundBolt12ParseErrorZ;
1252 * Strategies available to retry payment path failures.
1254 typedef enum LDKRetry_Tag {
1256 * Max number of attempts to retry payment.
1258 * Each attempt may be multiple HTLCs along multiple paths if the router decides to split up a
1259 * retry, and may retry multiple failed HTLCs at once if they failed around the same time and
1260 * were retried along a route from a single call to [`Router::find_route_with_id`].
1264 * Time elapsed before abandoning retries for a payment. At least one attempt at payment is made;
1265 * see [`PaymentParameters::expiry_time`] to avoid any attempt at payment after a specific time.
1267 * [`PaymentParameters::expiry_time`]: crate::routing::router::PaymentParameters::expiry_time
1271 * Must be last for serialization purposes
1276 typedef struct MUST_USE_STRUCT LDKRetry {
1289 * An error in decoding a message or struct.
1291 typedef enum LDKDecodeError_Tag {
1293 * A version byte specified something we don't know how to handle.
1295 * Includes unknown realm byte in an onion hop data packet.
1297 LDKDecodeError_UnknownVersion,
1299 * Unknown feature mandating we fail to parse message (e.g., TLV with an even, unknown type)
1301 LDKDecodeError_UnknownRequiredFeature,
1303 * Value was invalid.
1305 * For example, a byte which was supposed to be a bool was something other than a 0
1306 * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
1307 * syntactically incorrect, etc.
1309 LDKDecodeError_InvalidValue,
1311 * The buffer to be read was too short.
1313 LDKDecodeError_ShortRead,
1315 * A length descriptor in the packet didn't describe the later data correctly.
1317 LDKDecodeError_BadLengthDescriptor,
1319 * Error from [`std::io`].
1323 * The message included zlib-compressed values, which we don't support.
1325 LDKDecodeError_UnsupportedCompression,
1327 * Must be last for serialization purposes
1329 LDKDecodeError_Sentinel,
1330 } LDKDecodeError_Tag;
1332 typedef struct MUST_USE_STRUCT LDKDecodeError {
1333 LDKDecodeError_Tag tag;
1342 * The contents of CResult_RetryDecodeErrorZ
1344 typedef union LDKCResult_RetryDecodeErrorZPtr {
1346 * A pointer to the contents in the success state.
1347 * Reading from this pointer when `result_ok` is not set is undefined.
1349 struct LDKRetry *result;
1351 * A pointer to the contents in the error state.
1352 * Reading from this pointer when `result_ok` is set is undefined.
1354 struct LDKDecodeError *err;
1355 } LDKCResult_RetryDecodeErrorZPtr;
1358 * A CResult_RetryDecodeErrorZ represents the result of a fallible operation,
1359 * containing a crate::lightning::ln::outbound_payment::Retry on success and a crate::lightning::ln::msgs::DecodeError on failure.
1360 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1362 typedef struct LDKCResult_RetryDecodeErrorZ {
1364 * The contents of this CResult_RetryDecodeErrorZ, accessible via either
1365 * `err` or `result` depending on the state of `result_ok`.
1367 union LDKCResult_RetryDecodeErrorZPtr contents;
1369 * Whether this CResult_RetryDecodeErrorZ represents a success state.
1372 } LDKCResult_RetryDecodeErrorZ;
1377 * A script pubkey for shutting down a channel as defined by [BOLT #2].
1379 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
1381 typedef struct MUST_USE_STRUCT LDKShutdownScript {
1383 * A pointer to the opaque Rust object.
1384 * Nearly everywhere, inner must be non-null, however in places where
1385 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1387 LDKnativeShutdownScript *inner;
1389 * Indicates that this is the only struct which contains the same pointer.
1390 * Rust functions which take ownership of an object provided via an argument require
1391 * this to be true and invalidate the object pointed to by inner.
1394 } LDKShutdownScript;
1397 * Indicates an error on the client's part (usually some variant of attempting to use too-low or
1400 typedef enum LDKAPIError_Tag {
1402 * Indicates the API was wholly misused (see err for more). Cases where these can be returned
1403 * are documented, but generally indicates some precondition of a function was violated.
1405 LDKAPIError_APIMisuseError,
1407 * Due to a high feerate, we were unable to complete the request.
1408 * For example, this may be returned if the feerate implies we cannot open a channel at the
1409 * requested value, but opening a larger channel would succeed.
1411 LDKAPIError_FeeRateTooHigh,
1413 * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route,
1414 * too-many-hops, etc).
1416 LDKAPIError_InvalidRoute,
1418 * We were unable to complete the request as the Channel required to do so is unable to
1419 * complete the request (or was not found). This can take many forms, including disconnected
1420 * peer, channel at capacity, channel shutting down, etc.
1422 LDKAPIError_ChannelUnavailable,
1424 * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
1425 * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
1426 * monitor update is awaiting async resolution. Once it resolves the attempted action should
1427 * complete automatically.
1429 * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
1430 * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
1431 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
1433 LDKAPIError_MonitorUpdateInProgress,
1435 * [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
1436 * with the channel counterparty as negotiated in [`InitFeatures`].
1438 * Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
1439 * a channel or cooperatively close one with this peer (and will have to force-close instead).
1441 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
1442 * [`InitFeatures`]: crate::ln::features::InitFeatures
1444 LDKAPIError_IncompatibleShutdownScript,
1446 * Must be last for serialization purposes
1448 LDKAPIError_Sentinel,
1451 typedef struct LDKAPIError_LDKAPIMisuseError_Body {
1453 * A human-readable error message
1456 } LDKAPIError_LDKAPIMisuseError_Body;
1458 typedef struct LDKAPIError_LDKFeeRateTooHigh_Body {
1460 * A human-readable error message
1464 * The feerate which was too high.
1467 } LDKAPIError_LDKFeeRateTooHigh_Body;
1469 typedef struct LDKAPIError_LDKInvalidRoute_Body {
1471 * A human-readable error message
1474 } LDKAPIError_LDKInvalidRoute_Body;
1476 typedef struct LDKAPIError_LDKChannelUnavailable_Body {
1478 * A human-readable error message
1481 } LDKAPIError_LDKChannelUnavailable_Body;
1483 typedef struct LDKAPIError_LDKIncompatibleShutdownScript_Body {
1485 * The incompatible shutdown script.
1487 struct LDKShutdownScript script;
1488 } LDKAPIError_LDKIncompatibleShutdownScript_Body;
1490 typedef struct MUST_USE_STRUCT LDKAPIError {
1491 LDKAPIError_Tag tag;
1493 LDKAPIError_LDKAPIMisuseError_Body api_misuse_error;
1494 LDKAPIError_LDKFeeRateTooHigh_Body fee_rate_too_high;
1495 LDKAPIError_LDKInvalidRoute_Body invalid_route;
1496 LDKAPIError_LDKChannelUnavailable_Body channel_unavailable;
1497 LDKAPIError_LDKIncompatibleShutdownScript_Body incompatible_shutdown_script;
1502 * The contents of CResult_NoneAPIErrorZ
1504 typedef union LDKCResult_NoneAPIErrorZPtr {
1506 * Note that this value is always NULL, as there are no contents in the OK variant
1510 * A pointer to the contents in the error state.
1511 * Reading from this pointer when `result_ok` is set is undefined.
1513 struct LDKAPIError *err;
1514 } LDKCResult_NoneAPIErrorZPtr;
1517 * A CResult_NoneAPIErrorZ represents the result of a fallible operation,
1518 * containing a () on success and a crate::lightning::util::errors::APIError on failure.
1519 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1521 typedef struct LDKCResult_NoneAPIErrorZ {
1523 * The contents of this CResult_NoneAPIErrorZ, accessible via either
1524 * `err` or `result` depending on the state of `result_ok`.
1526 union LDKCResult_NoneAPIErrorZPtr contents;
1528 * Whether this CResult_NoneAPIErrorZ represents a success state.
1531 } LDKCResult_NoneAPIErrorZ;
1534 * A dynamically-allocated array of crate::c_types::derived::CResult_NoneAPIErrorZs of arbitrary size.
1535 * This corresponds to std::vector in C++
1537 typedef struct LDKCVec_CResult_NoneAPIErrorZZ {
1539 * The elements in the array.
1540 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1542 struct LDKCResult_NoneAPIErrorZ *data;
1544 * The number of elements pointed to by `data`.
1547 } LDKCVec_CResult_NoneAPIErrorZZ;
1550 * A dynamically-allocated array of crate::lightning::util::errors::APIErrors of arbitrary size.
1551 * This corresponds to std::vector in C++
1553 typedef struct LDKCVec_APIErrorZ {
1555 * The elements in the array.
1556 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1558 struct LDKAPIError *data;
1560 * The number of elements pointed to by `data`.
1563 } LDKCVec_APIErrorZ;
1566 * An enum which can either contain a crate::c_types::ThirtyTwoBytes or not
1568 typedef enum LDKCOption_ThirtyTwoBytesZ_Tag {
1570 * When we're in this state, this COption_ThirtyTwoBytesZ contains a crate::c_types::ThirtyTwoBytes
1572 LDKCOption_ThirtyTwoBytesZ_Some,
1574 * When we're in this state, this COption_ThirtyTwoBytesZ contains nothing
1576 LDKCOption_ThirtyTwoBytesZ_None,
1578 * Must be last for serialization purposes
1580 LDKCOption_ThirtyTwoBytesZ_Sentinel,
1581 } LDKCOption_ThirtyTwoBytesZ_Tag;
1583 typedef struct LDKCOption_ThirtyTwoBytesZ {
1584 LDKCOption_ThirtyTwoBytesZ_Tag tag;
1587 struct LDKThirtyTwoBytes some;
1590 } LDKCOption_ThirtyTwoBytesZ;
1593 * An enum which can either contain a crate::c_types::derived::CVec_u8Z or not
1595 typedef enum LDKCOption_CVec_u8ZZ_Tag {
1597 * When we're in this state, this COption_CVec_u8ZZ contains a crate::c_types::derived::CVec_u8Z
1599 LDKCOption_CVec_u8ZZ_Some,
1601 * When we're in this state, this COption_CVec_u8ZZ contains nothing
1603 LDKCOption_CVec_u8ZZ_None,
1605 * Must be last for serialization purposes
1607 LDKCOption_CVec_u8ZZ_Sentinel,
1608 } LDKCOption_CVec_u8ZZ_Tag;
1610 typedef struct LDKCOption_CVec_u8ZZ {
1611 LDKCOption_CVec_u8ZZ_Tag tag;
1614 struct LDKCVec_u8Z some;
1617 } LDKCOption_CVec_u8ZZ;
1622 * Information which is provided, encrypted, to the payment recipient when sending HTLCs.
1624 * This should generally be constructed with data communicated to us from the recipient (via a
1625 * BOLT11 or BOLT12 invoice).
1627 typedef struct MUST_USE_STRUCT LDKRecipientOnionFields {
1629 * A pointer to the opaque Rust object.
1630 * Nearly everywhere, inner must be non-null, however in places where
1631 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1633 LDKnativeRecipientOnionFields *inner;
1635 * Indicates that this is the only struct which contains the same pointer.
1636 * Rust functions which take ownership of an object provided via an argument require
1637 * this to be true and invalidate the object pointed to by inner.
1640 } LDKRecipientOnionFields;
1643 * The contents of CResult_RecipientOnionFieldsDecodeErrorZ
1645 typedef union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr {
1647 * A pointer to the contents in the success state.
1648 * Reading from this pointer when `result_ok` is not set is undefined.
1650 struct LDKRecipientOnionFields *result;
1652 * A pointer to the contents in the error state.
1653 * Reading from this pointer when `result_ok` is set is undefined.
1655 struct LDKDecodeError *err;
1656 } LDKCResult_RecipientOnionFieldsDecodeErrorZPtr;
1659 * A CResult_RecipientOnionFieldsDecodeErrorZ represents the result of a fallible operation,
1660 * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a crate::lightning::ln::msgs::DecodeError on failure.
1661 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1663 typedef struct LDKCResult_RecipientOnionFieldsDecodeErrorZ {
1665 * The contents of this CResult_RecipientOnionFieldsDecodeErrorZ, accessible via either
1666 * `err` or `result` depending on the state of `result_ok`.
1668 union LDKCResult_RecipientOnionFieldsDecodeErrorZPtr contents;
1670 * Whether this CResult_RecipientOnionFieldsDecodeErrorZ represents a success state.
1673 } LDKCResult_RecipientOnionFieldsDecodeErrorZ;
1676 * A tuple of 2 elements. See the individual fields for the types contained.
1678 typedef struct LDKC2Tuple_u64CVec_u8ZZ {
1680 * The element at position 0
1684 * The element at position 1
1686 struct LDKCVec_u8Z b;
1687 } LDKC2Tuple_u64CVec_u8ZZ;
1690 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u64CVec_u8ZZs of arbitrary size.
1691 * This corresponds to std::vector in C++
1693 typedef struct LDKCVec_C2Tuple_u64CVec_u8ZZZ {
1695 * The elements in the array.
1696 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1698 struct LDKC2Tuple_u64CVec_u8ZZ *data;
1700 * The number of elements pointed to by `data`.
1703 } LDKCVec_C2Tuple_u64CVec_u8ZZZ;
1706 * The contents of CResult_RecipientOnionFieldsNoneZ
1708 typedef union LDKCResult_RecipientOnionFieldsNoneZPtr {
1710 * A pointer to the contents in the success state.
1711 * Reading from this pointer when `result_ok` is not set is undefined.
1713 struct LDKRecipientOnionFields *result;
1715 * Note that this value is always NULL, as there are no contents in the Err variant
1718 } LDKCResult_RecipientOnionFieldsNoneZPtr;
1721 * A CResult_RecipientOnionFieldsNoneZ represents the result of a fallible operation,
1722 * containing a crate::lightning::ln::outbound_payment::RecipientOnionFields on success and a () on failure.
1723 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1725 typedef struct LDKCResult_RecipientOnionFieldsNoneZ {
1727 * The contents of this CResult_RecipientOnionFieldsNoneZ, accessible via either
1728 * `err` or `result` depending on the state of `result_ok`.
1730 union LDKCResult_RecipientOnionFieldsNoneZPtr contents;
1732 * Whether this CResult_RecipientOnionFieldsNoneZ represents a success state.
1735 } LDKCResult_RecipientOnionFieldsNoneZ;
1738 * A dynamically-allocated array of crate::c_types::ThirtyTwoBytess of arbitrary size.
1739 * This corresponds to std::vector in C++
1741 typedef struct LDKCVec_ThirtyTwoBytesZ {
1743 * The elements in the array.
1744 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
1746 struct LDKThirtyTwoBytes *data;
1748 * The number of elements pointed to by `data`.
1751 } LDKCVec_ThirtyTwoBytesZ;
1754 * An enum which can either contain a crate::c_types::derived::CVec_ThirtyTwoBytesZ or not
1756 typedef enum LDKCOption_CVec_ThirtyTwoBytesZZ_Tag {
1758 * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains a crate::c_types::derived::CVec_ThirtyTwoBytesZ
1760 LDKCOption_CVec_ThirtyTwoBytesZZ_Some,
1762 * When we're in this state, this COption_CVec_ThirtyTwoBytesZZ contains nothing
1764 LDKCOption_CVec_ThirtyTwoBytesZZ_None,
1766 * Must be last for serialization purposes
1768 LDKCOption_CVec_ThirtyTwoBytesZZ_Sentinel,
1769 } LDKCOption_CVec_ThirtyTwoBytesZZ_Tag;
1771 typedef struct LDKCOption_CVec_ThirtyTwoBytesZZ {
1772 LDKCOption_CVec_ThirtyTwoBytesZZ_Tag tag;
1775 struct LDKCVec_ThirtyTwoBytesZ some;
1778 } LDKCOption_CVec_ThirtyTwoBytesZZ;
1781 * The contents of CResult_ThirtyTwoBytesNoneZ
1783 typedef union LDKCResult_ThirtyTwoBytesNoneZPtr {
1785 * A pointer to the contents in the success state.
1786 * Reading from this pointer when `result_ok` is not set is undefined.
1788 struct LDKThirtyTwoBytes *result;
1790 * Note that this value is always NULL, as there are no contents in the Err variant
1793 } LDKCResult_ThirtyTwoBytesNoneZPtr;
1796 * A CResult_ThirtyTwoBytesNoneZ represents the result of a fallible operation,
1797 * containing a crate::c_types::ThirtyTwoBytes on success and a () on failure.
1798 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1800 typedef struct LDKCResult_ThirtyTwoBytesNoneZ {
1802 * The contents of this CResult_ThirtyTwoBytesNoneZ, accessible via either
1803 * `err` or `result` depending on the state of `result_ok`.
1805 union LDKCResult_ThirtyTwoBytesNoneZPtr contents;
1807 * Whether this CResult_ThirtyTwoBytesNoneZ represents a success state.
1810 } LDKCResult_ThirtyTwoBytesNoneZ;
1815 * Information needed to route a payment across a [`BlindedPath`].
1817 typedef struct MUST_USE_STRUCT LDKBlindedPayInfo {
1819 * A pointer to the opaque Rust object.
1820 * Nearly everywhere, inner must be non-null, however in places where
1821 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1823 LDKnativeBlindedPayInfo *inner;
1825 * Indicates that this is the only struct which contains the same pointer.
1826 * Rust functions which take ownership of an object provided via an argument require
1827 * this to be true and invalidate the object pointed to by inner.
1830 } LDKBlindedPayInfo;
1833 * The contents of CResult_BlindedPayInfoDecodeErrorZ
1835 typedef union LDKCResult_BlindedPayInfoDecodeErrorZPtr {
1837 * A pointer to the contents in the success state.
1838 * Reading from this pointer when `result_ok` is not set is undefined.
1840 struct LDKBlindedPayInfo *result;
1842 * A pointer to the contents in the error state.
1843 * Reading from this pointer when `result_ok` is set is undefined.
1845 struct LDKDecodeError *err;
1846 } LDKCResult_BlindedPayInfoDecodeErrorZPtr;
1849 * A CResult_BlindedPayInfoDecodeErrorZ represents the result of a fallible operation,
1850 * containing a crate::lightning::offers::invoice::BlindedPayInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
1851 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1853 typedef struct LDKCResult_BlindedPayInfoDecodeErrorZ {
1855 * The contents of this CResult_BlindedPayInfoDecodeErrorZ, accessible via either
1856 * `err` or `result` depending on the state of `result_ok`.
1858 union LDKCResult_BlindedPayInfoDecodeErrorZPtr contents;
1860 * Whether this CResult_BlindedPayInfoDecodeErrorZ represents a success state.
1863 } LDKCResult_BlindedPayInfoDecodeErrorZ;
1868 * Information about a spendable output to a P2WSH script.
1870 * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this.
1872 typedef struct MUST_USE_STRUCT LDKDelayedPaymentOutputDescriptor {
1874 * A pointer to the opaque Rust object.
1875 * Nearly everywhere, inner must be non-null, however in places where
1876 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1878 LDKnativeDelayedPaymentOutputDescriptor *inner;
1880 * Indicates that this is the only struct which contains the same pointer.
1881 * Rust functions which take ownership of an object provided via an argument require
1882 * this to be true and invalidate the object pointed to by inner.
1885 } LDKDelayedPaymentOutputDescriptor;
1888 * The contents of CResult_DelayedPaymentOutputDescriptorDecodeErrorZ
1890 typedef union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr {
1892 * A pointer to the contents in the success state.
1893 * Reading from this pointer when `result_ok` is not set is undefined.
1895 struct LDKDelayedPaymentOutputDescriptor *result;
1897 * A pointer to the contents in the error state.
1898 * Reading from this pointer when `result_ok` is set is undefined.
1900 struct LDKDecodeError *err;
1901 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr;
1904 * A CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1905 * containing a crate::lightning::sign::DelayedPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1906 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1908 typedef struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ {
1910 * The contents of this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ, accessible via either
1911 * `err` or `result` depending on the state of `result_ok`.
1913 union LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZPtr contents;
1915 * Whether this CResult_DelayedPaymentOutputDescriptorDecodeErrorZ represents a success state.
1918 } LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ;
1923 * Information about a spendable output to our \"payment key\".
1925 * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this.
1927 typedef struct MUST_USE_STRUCT LDKStaticPaymentOutputDescriptor {
1929 * A pointer to the opaque Rust object.
1930 * Nearly everywhere, inner must be non-null, however in places where
1931 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1933 LDKnativeStaticPaymentOutputDescriptor *inner;
1935 * Indicates that this is the only struct which contains the same pointer.
1936 * Rust functions which take ownership of an object provided via an argument require
1937 * this to be true and invalidate the object pointed to by inner.
1940 } LDKStaticPaymentOutputDescriptor;
1943 * The contents of CResult_StaticPaymentOutputDescriptorDecodeErrorZ
1945 typedef union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr {
1947 * A pointer to the contents in the success state.
1948 * Reading from this pointer when `result_ok` is not set is undefined.
1950 struct LDKStaticPaymentOutputDescriptor *result;
1952 * A pointer to the contents in the error state.
1953 * Reading from this pointer when `result_ok` is set is undefined.
1955 struct LDKDecodeError *err;
1956 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr;
1959 * A CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
1960 * containing a crate::lightning::sign::StaticPaymentOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
1961 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
1963 typedef struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ {
1965 * The contents of this CResult_StaticPaymentOutputDescriptorDecodeErrorZ, accessible via either
1966 * `err` or `result` depending on the state of `result_ok`.
1968 union LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZPtr contents;
1970 * Whether this CResult_StaticPaymentOutputDescriptorDecodeErrorZ represents a success state.
1973 } LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ;
1978 * A reference to a transaction output.
1980 * Differs from bitcoin::blockdata::transaction::OutPoint as the index is a u16 instead of u32
1981 * due to LN's restrictions on index values. Should reduce (possibly) unsafe conversions this way.
1983 typedef struct MUST_USE_STRUCT LDKOutPoint {
1985 * A pointer to the opaque Rust object.
1986 * Nearly everywhere, inner must be non-null, however in places where
1987 * the Rust equivalent takes an Option, it may be set to null to indicate None.
1989 LDKnativeOutPoint *inner;
1991 * Indicates that this is the only struct which contains the same pointer.
1992 * Rust functions which take ownership of an object provided via an argument require
1993 * this to be true and invalidate the object pointed to by inner.
1999 * Describes the necessary information to spend a spendable output.
2001 * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any
2002 * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able
2003 * to spend on-chain. The information needed to do this is provided in this enum, including the
2004 * outpoint describing which `txid` and output `index` is available, the full output which exists
2005 * at that `txid`/`index`, and any keys or other information required to sign.
2007 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
2009 typedef enum LDKSpendableOutputDescriptor_Tag {
2011 * An output to a script which was provided via [`SignerProvider`] directly, either from
2012 * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already
2013 * know how to spend it. No secret keys are provided as LDK was never given any key.
2014 * These may include outputs from a transaction punishing our counterparty or claiming an HTLC
2015 * on-chain using the payment preimage or after it has timed out.
2017 * [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
2018 * [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
2020 LDKSpendableOutputDescriptor_StaticOutput,
2022 * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
2025 * The witness in the spending input should be:
2027 * <BIP 143 signature> <empty vector> (MINIMALIF standard rule) <provided witnessScript>
2030 * Note that the `nSequence` field in the spending input must be set to
2031 * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not
2032 * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after
2033 * the outpoint confirms, see [BIP
2034 * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK
2035 * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height
2038 * These are generally the result of a \"revocable\" output to us, spendable only by us unless
2039 * it is an output from an old state which we broadcast (which should never happen).
2041 * To derive the delayed payment key which is used to sign this input, you must pass the
2042 * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the
2043 * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`ChannelSigner::pubkeys`]) and the provided
2044 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The DelayedPaymentKey can be
2045 * generated without the secret key using [`DelayedPaymentKey::from_basepoint`] and only the
2046 * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`ChannelSigner::pubkeys`].
2048 * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is
2049 * used in the witness script generation), you must pass the counterparty
2050 * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to
2051 * [`ChannelSigner::provide_channel_parameters`]) and the provided
2052 * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to
2053 * [`RevocationKey`].
2055 * The witness script which is hashed and included in the output `script_pubkey` may be
2056 * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived
2057 * as explained above), our delayed payment pubkey (derived as explained above), and the
2058 * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to
2059 * [`chan_utils::get_revokeable_redeemscript`].
2061 LDKSpendableOutputDescriptor_DelayedPaymentOutput,
2063 * An output spendable exclusively by our payment key (i.e., the private key that corresponds
2064 * to the `payment_point` in [`ChannelSigner::pubkeys`]). The output type depends on the
2065 * channel type negotiated.
2067 * On an anchor outputs channel, the witness in the spending input is:
2069 * <BIP 143 signature> <witness script>
2074 * <BIP 143 signature> <payment key>
2077 * These are generally the result of our counterparty having broadcast the current state,
2078 * allowing us to claim the non-HTLC-encumbered outputs immediately, or after one confirmation
2079 * in the case of anchor outputs channels.
2081 LDKSpendableOutputDescriptor_StaticPaymentOutput,
2083 * Must be last for serialization purposes
2085 LDKSpendableOutputDescriptor_Sentinel,
2086 } LDKSpendableOutputDescriptor_Tag;
2088 typedef struct LDKSpendableOutputDescriptor_LDKStaticOutput_Body {
2090 * The outpoint which is spendable.
2092 struct LDKOutPoint outpoint;
2094 * The output which is referenced by the given outpoint.
2096 struct LDKTxOut output;
2098 * The `channel_keys_id` for the channel which this output came from.
2100 * For channels which were generated on LDK 0.0.119 or later, this is the value which was
2101 * passed to the [`SignerProvider::get_destination_script`] call which provided this
2104 * For channels which were generated prior to LDK 0.0.119, no such argument existed,
2105 * however this field may still be filled in if such data is available.
2107 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
2109 struct LDKThirtyTwoBytes channel_keys_id;
2110 } LDKSpendableOutputDescriptor_LDKStaticOutput_Body;
2112 typedef struct MUST_USE_STRUCT LDKSpendableOutputDescriptor {
2113 LDKSpendableOutputDescriptor_Tag tag;
2115 LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output;
2117 struct LDKDelayedPaymentOutputDescriptor delayed_payment_output;
2120 struct LDKStaticPaymentOutputDescriptor static_payment_output;
2123 } LDKSpendableOutputDescriptor;
2126 * The contents of CResult_SpendableOutputDescriptorDecodeErrorZ
2128 typedef union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr {
2130 * A pointer to the contents in the success state.
2131 * Reading from this pointer when `result_ok` is not set is undefined.
2133 struct LDKSpendableOutputDescriptor *result;
2135 * A pointer to the contents in the error state.
2136 * Reading from this pointer when `result_ok` is set is undefined.
2138 struct LDKDecodeError *err;
2139 } LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr;
2142 * A CResult_SpendableOutputDescriptorDecodeErrorZ represents the result of a fallible operation,
2143 * containing a crate::lightning::sign::SpendableOutputDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2144 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2146 typedef struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ {
2148 * The contents of this CResult_SpendableOutputDescriptorDecodeErrorZ, accessible via either
2149 * `err` or `result` depending on the state of `result_ok`.
2151 union LDKCResult_SpendableOutputDescriptorDecodeErrorZPtr contents;
2153 * Whether this CResult_SpendableOutputDescriptorDecodeErrorZ represents a success state.
2156 } LDKCResult_SpendableOutputDescriptorDecodeErrorZ;
2159 * A dynamically-allocated array of crate::lightning::sign::SpendableOutputDescriptors of arbitrary size.
2160 * This corresponds to std::vector in C++
2162 typedef struct LDKCVec_SpendableOutputDescriptorZ {
2164 * The elements in the array.
2165 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2167 struct LDKSpendableOutputDescriptor *data;
2169 * The number of elements pointed to by `data`.
2172 } LDKCVec_SpendableOutputDescriptorZ;
2175 * A dynamically-allocated array of crate::c_types::TxOuts of arbitrary size.
2176 * This corresponds to std::vector in C++
2178 typedef struct LDKCVec_TxOutZ {
2180 * The elements in the array.
2181 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2183 struct LDKTxOut *data;
2185 * The number of elements pointed to by `data`.
2191 * An enum which can either contain a u32 or not
2193 typedef enum LDKCOption_u32Z_Tag {
2195 * When we're in this state, this COption_u32Z contains a u32
2197 LDKCOption_u32Z_Some,
2199 * When we're in this state, this COption_u32Z contains nothing
2201 LDKCOption_u32Z_None,
2203 * Must be last for serialization purposes
2205 LDKCOption_u32Z_Sentinel,
2206 } LDKCOption_u32Z_Tag;
2208 typedef struct LDKCOption_u32Z {
2209 LDKCOption_u32Z_Tag tag;
2218 * A tuple of 2 elements. See the individual fields for the types contained.
2220 typedef struct LDKC2Tuple_CVec_u8Zu64Z {
2222 * The element at position 0
2224 struct LDKCVec_u8Z a;
2226 * The element at position 1
2229 } LDKC2Tuple_CVec_u8Zu64Z;
2232 * The contents of CResult_C2Tuple_CVec_u8Zu64ZNoneZ
2234 typedef union LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr {
2236 * A pointer to the contents in the success state.
2237 * Reading from this pointer when `result_ok` is not set is undefined.
2239 struct LDKC2Tuple_CVec_u8Zu64Z *result;
2241 * Note that this value is always NULL, as there are no contents in the Err variant
2244 } LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr;
2247 * A CResult_C2Tuple_CVec_u8Zu64ZNoneZ represents the result of a fallible operation,
2248 * containing a crate::c_types::derived::C2Tuple_CVec_u8Zu64Z on success and a () on failure.
2249 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2251 typedef struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ {
2253 * The contents of this CResult_C2Tuple_CVec_u8Zu64ZNoneZ, accessible via either
2254 * `err` or `result` depending on the state of `result_ok`.
2256 union LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZPtr contents;
2258 * Whether this CResult_C2Tuple_CVec_u8Zu64ZNoneZ represents a success state.
2261 } LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ;
2266 * The parameters required to derive a channel signer via [`SignerProvider`].
2268 typedef struct MUST_USE_STRUCT LDKChannelDerivationParameters {
2270 * A pointer to the opaque Rust object.
2271 * Nearly everywhere, inner must be non-null, however in places where
2272 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2274 LDKnativeChannelDerivationParameters *inner;
2276 * Indicates that this is the only struct which contains the same pointer.
2277 * Rust functions which take ownership of an object provided via an argument require
2278 * this to be true and invalidate the object pointed to by inner.
2281 } LDKChannelDerivationParameters;
2284 * The contents of CResult_ChannelDerivationParametersDecodeErrorZ
2286 typedef union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr {
2288 * A pointer to the contents in the success state.
2289 * Reading from this pointer when `result_ok` is not set is undefined.
2291 struct LDKChannelDerivationParameters *result;
2293 * A pointer to the contents in the error state.
2294 * Reading from this pointer when `result_ok` is set is undefined.
2296 struct LDKDecodeError *err;
2297 } LDKCResult_ChannelDerivationParametersDecodeErrorZPtr;
2300 * A CResult_ChannelDerivationParametersDecodeErrorZ represents the result of a fallible operation,
2301 * containing a crate::lightning::sign::ChannelDerivationParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
2302 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2304 typedef struct LDKCResult_ChannelDerivationParametersDecodeErrorZ {
2306 * The contents of this CResult_ChannelDerivationParametersDecodeErrorZ, accessible via either
2307 * `err` or `result` depending on the state of `result_ok`.
2309 union LDKCResult_ChannelDerivationParametersDecodeErrorZPtr contents;
2311 * Whether this CResult_ChannelDerivationParametersDecodeErrorZ represents a success state.
2314 } LDKCResult_ChannelDerivationParametersDecodeErrorZ;
2319 * A descriptor used to sign for a commitment transaction's HTLC output.
2321 typedef struct MUST_USE_STRUCT LDKHTLCDescriptor {
2323 * A pointer to the opaque Rust object.
2324 * Nearly everywhere, inner must be non-null, however in places where
2325 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2327 LDKnativeHTLCDescriptor *inner;
2329 * Indicates that this is the only struct which contains the same pointer.
2330 * Rust functions which take ownership of an object provided via an argument require
2331 * this to be true and invalidate the object pointed to by inner.
2334 } LDKHTLCDescriptor;
2337 * The contents of CResult_HTLCDescriptorDecodeErrorZ
2339 typedef union LDKCResult_HTLCDescriptorDecodeErrorZPtr {
2341 * A pointer to the contents in the success state.
2342 * Reading from this pointer when `result_ok` is not set is undefined.
2344 struct LDKHTLCDescriptor *result;
2346 * A pointer to the contents in the error state.
2347 * Reading from this pointer when `result_ok` is set is undefined.
2349 struct LDKDecodeError *err;
2350 } LDKCResult_HTLCDescriptorDecodeErrorZPtr;
2353 * A CResult_HTLCDescriptorDecodeErrorZ represents the result of a fallible operation,
2354 * containing a crate::lightning::sign::HTLCDescriptor on success and a crate::lightning::ln::msgs::DecodeError on failure.
2355 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2357 typedef struct LDKCResult_HTLCDescriptorDecodeErrorZ {
2359 * The contents of this CResult_HTLCDescriptorDecodeErrorZ, accessible via either
2360 * `err` or `result` depending on the state of `result_ok`.
2362 union LDKCResult_HTLCDescriptorDecodeErrorZPtr contents;
2364 * Whether this CResult_HTLCDescriptorDecodeErrorZ represents a success state.
2367 } LDKCResult_HTLCDescriptorDecodeErrorZ;
2370 * The contents of CResult_NoneNoneZ
2372 typedef union LDKCResult_NoneNoneZPtr {
2374 * Note that this value is always NULL, as there are no contents in the OK variant
2378 * Note that this value is always NULL, as there are no contents in the Err variant
2381 } LDKCResult_NoneNoneZPtr;
2384 * A CResult_NoneNoneZ represents the result of a fallible operation,
2385 * containing a () on success and a () on failure.
2386 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2388 typedef struct LDKCResult_NoneNoneZ {
2390 * The contents of this CResult_NoneNoneZ, accessible via either
2391 * `err` or `result` depending on the state of `result_ok`.
2393 union LDKCResult_NoneNoneZPtr contents;
2395 * Whether this CResult_NoneNoneZ represents a success state.
2398 } LDKCResult_NoneNoneZ;
2401 * Represents a valid secp256k1 public key serialized in "compressed form" as a 33 byte array.
2403 typedef struct LDKPublicKey {
2405 * The bytes of the public key
2407 uint8_t compressed_form[33];
2411 * The contents of CResult_PublicKeyNoneZ
2413 typedef union LDKCResult_PublicKeyNoneZPtr {
2415 * A pointer to the contents in the success state.
2416 * Reading from this pointer when `result_ok` is not set is undefined.
2418 struct LDKPublicKey *result;
2420 * Note that this value is always NULL, as there are no contents in the Err variant
2423 } LDKCResult_PublicKeyNoneZPtr;
2426 * A CResult_PublicKeyNoneZ represents the result of a fallible operation,
2427 * containing a crate::c_types::PublicKey on success and a () on failure.
2428 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2430 typedef struct LDKCResult_PublicKeyNoneZ {
2432 * The contents of this CResult_PublicKeyNoneZ, accessible via either
2433 * `err` or `result` depending on the state of `result_ok`.
2435 union LDKCResult_PublicKeyNoneZPtr contents;
2437 * Whether this CResult_PublicKeyNoneZ represents a success state.
2440 } LDKCResult_PublicKeyNoneZ;
2443 * An enum which can either contain a crate::c_types::BigEndianScalar or not
2445 typedef enum LDKCOption_BigEndianScalarZ_Tag {
2447 * When we're in this state, this COption_BigEndianScalarZ contains a crate::c_types::BigEndianScalar
2449 LDKCOption_BigEndianScalarZ_Some,
2451 * When we're in this state, this COption_BigEndianScalarZ contains nothing
2453 LDKCOption_BigEndianScalarZ_None,
2455 * Must be last for serialization purposes
2457 LDKCOption_BigEndianScalarZ_Sentinel,
2458 } LDKCOption_BigEndianScalarZ_Tag;
2460 typedef struct LDKCOption_BigEndianScalarZ {
2461 LDKCOption_BigEndianScalarZ_Tag tag;
2464 struct LDKBigEndianScalar some;
2467 } LDKCOption_BigEndianScalarZ;
2470 * Integer in the range `0..32`
2472 typedef struct LDKU5 {
2477 * A dynamically-allocated array of crate::c_types::U5s of arbitrary size.
2478 * This corresponds to std::vector in C++
2480 typedef struct LDKCVec_U5Z {
2482 * The elements in the array.
2483 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2487 * The number of elements pointed to by `data`.
2493 * Represents a secp256k1 signature serialized as two 32-byte numbers as well as a tag which
2494 * allows recovering the exact public key which created the signature given the message.
2496 typedef struct LDKRecoverableSignature {
2498 * The bytes of the signature in "compact" form plus a "Recovery ID" which allows for
2501 uint8_t serialized_form[68];
2502 } LDKRecoverableSignature;
2505 * The contents of CResult_RecoverableSignatureNoneZ
2507 typedef union LDKCResult_RecoverableSignatureNoneZPtr {
2509 * A pointer to the contents in the success state.
2510 * Reading from this pointer when `result_ok` is not set is undefined.
2512 struct LDKRecoverableSignature *result;
2514 * Note that this value is always NULL, as there are no contents in the Err variant
2517 } LDKCResult_RecoverableSignatureNoneZPtr;
2520 * A CResult_RecoverableSignatureNoneZ represents the result of a fallible operation,
2521 * containing a crate::c_types::RecoverableSignature on success and a () on failure.
2522 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2524 typedef struct LDKCResult_RecoverableSignatureNoneZ {
2526 * The contents of this CResult_RecoverableSignatureNoneZ, accessible via either
2527 * `err` or `result` depending on the state of `result_ok`.
2529 union LDKCResult_RecoverableSignatureNoneZPtr contents;
2531 * Whether this CResult_RecoverableSignatureNoneZ represents a success state.
2534 } LDKCResult_RecoverableSignatureNoneZ;
2537 * Represents a secp256k1 Schnorr signature serialized as two 32-byte numbers
2539 typedef struct LDKSchnorrSignature {
2541 * The bytes of the signature as two 32-byte numbers
2543 uint8_t compact_form[64];
2544 } LDKSchnorrSignature;
2547 * The contents of CResult_SchnorrSignatureNoneZ
2549 typedef union LDKCResult_SchnorrSignatureNoneZPtr {
2551 * A pointer to the contents in the success state.
2552 * Reading from this pointer when `result_ok` is not set is undefined.
2554 struct LDKSchnorrSignature *result;
2556 * Note that this value is always NULL, as there are no contents in the Err variant
2559 } LDKCResult_SchnorrSignatureNoneZPtr;
2562 * A CResult_SchnorrSignatureNoneZ represents the result of a fallible operation,
2563 * containing a crate::c_types::SchnorrSignature on success and a () on failure.
2564 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2566 typedef struct LDKCResult_SchnorrSignatureNoneZ {
2568 * The contents of this CResult_SchnorrSignatureNoneZ, accessible via either
2569 * `err` or `result` depending on the state of `result_ok`.
2571 union LDKCResult_SchnorrSignatureNoneZPtr contents;
2573 * Whether this CResult_SchnorrSignatureNoneZ represents a success state.
2576 } LDKCResult_SchnorrSignatureNoneZ;
2579 * Represents a secp256k1 ECDSA signature serialized as two 32-byte numbers
2581 typedef struct LDKECDSASignature {
2583 * The bytes of the signature in "compact" form
2585 uint8_t compact_form[64];
2586 } LDKECDSASignature;
2589 * The contents of CResult_ECDSASignatureNoneZ
2591 typedef union LDKCResult_ECDSASignatureNoneZPtr {
2593 * A pointer to the contents in the success state.
2594 * Reading from this pointer when `result_ok` is not set is undefined.
2596 struct LDKECDSASignature *result;
2598 * Note that this value is always NULL, as there are no contents in the Err variant
2601 } LDKCResult_ECDSASignatureNoneZPtr;
2604 * A CResult_ECDSASignatureNoneZ represents the result of a fallible operation,
2605 * containing a crate::c_types::ECDSASignature on success and a () on failure.
2606 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2608 typedef struct LDKCResult_ECDSASignatureNoneZ {
2610 * The contents of this CResult_ECDSASignatureNoneZ, accessible via either
2611 * `err` or `result` depending on the state of `result_ok`.
2613 union LDKCResult_ECDSASignatureNoneZPtr contents;
2615 * Whether this CResult_ECDSASignatureNoneZ represents a success state.
2618 } LDKCResult_ECDSASignatureNoneZ;
2621 * A dynamically-allocated array of crate::c_types::ECDSASignatures of arbitrary size.
2622 * This corresponds to std::vector in C++
2624 typedef struct LDKCVec_ECDSASignatureZ {
2626 * The elements in the array.
2627 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
2629 struct LDKECDSASignature *data;
2631 * The number of elements pointed to by `data`.
2634 } LDKCVec_ECDSASignatureZ;
2637 * A tuple of 2 elements. See the individual fields for the types contained.
2639 typedef struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ {
2641 * The element at position 0
2643 struct LDKECDSASignature a;
2645 * The element at position 1
2647 struct LDKCVec_ECDSASignatureZ b;
2648 } LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ;
2651 * The contents of CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ
2653 typedef union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr {
2655 * A pointer to the contents in the success state.
2656 * Reading from this pointer when `result_ok` is not set is undefined.
2658 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *result;
2660 * Note that this value is always NULL, as there are no contents in the Err variant
2663 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr;
2666 * A CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents the result of a fallible operation,
2667 * containing a crate::c_types::derived::C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ on success and a () on failure.
2668 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
2670 typedef struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ {
2672 * The contents of this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ, accessible via either
2673 * `err` or `result` depending on the state of `result_ok`.
2675 union LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZPtr contents;
2677 * Whether this CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ represents a success state.
2680 } LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ;
2685 * This class tracks the per-transaction information needed to build a commitment transaction and will
2686 * actually build it and sign. It is used for holder transactions that we sign only when needed
2687 * and for transactions we sign for the counterparty.
2689 * This class can be used inside a signer implementation to generate a signature given the relevant
2692 typedef struct MUST_USE_STRUCT LDKCommitmentTransaction {
2694 * A pointer to the opaque Rust object.
2695 * Nearly everywhere, inner must be non-null, however in places where
2696 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2698 LDKnativeCommitmentTransaction *inner;
2700 * Indicates that this is the only struct which contains the same pointer.
2701 * Rust functions which take ownership of an object provided via an argument require
2702 * this to be true and invalidate the object pointed to by inner.
2705 } LDKCommitmentTransaction;
2710 * Information needed to build and sign a holder's commitment transaction.
2712 * The transaction is only signed once we are ready to broadcast.
2714 typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
2716 * A pointer to the opaque Rust object.
2717 * Nearly everywhere, inner must be non-null, however in places where
2718 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2720 LDKnativeHolderCommitmentTransaction *inner;
2722 * Indicates that this is the only struct which contains the same pointer.
2723 * Rust functions which take ownership of an object provided via an argument require
2724 * this to be true and invalidate the object pointed to by inner.
2727 } LDKHolderCommitmentTransaction;
2732 * Information about an HTLC as it appears in a commitment transaction
2734 typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
2736 * A pointer to the opaque Rust object.
2737 * Nearly everywhere, inner must be non-null, however in places where
2738 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2740 LDKnativeHTLCOutputInCommitment *inner;
2742 * Indicates that this is the only struct which contains the same pointer.
2743 * Rust functions which take ownership of an object provided via an argument require
2744 * this to be true and invalidate the object pointed to by inner.
2747 } LDKHTLCOutputInCommitment;
2752 * This class tracks the per-transaction information needed to build a closing transaction and will
2753 * actually build it and sign.
2755 * This class can be used inside a signer implementation to generate a signature given the relevant
2758 typedef struct MUST_USE_STRUCT LDKClosingTransaction {
2760 * A pointer to the opaque Rust object.
2761 * Nearly everywhere, inner must be non-null, however in places where
2762 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2764 LDKnativeClosingTransaction *inner;
2766 * Indicates that this is the only struct which contains the same pointer.
2767 * Rust functions which take ownership of an object provided via an argument require
2768 * this to be true and invalidate the object pointed to by inner.
2771 } LDKClosingTransaction;
2776 * The unsigned part of a [`channel_announcement`] message.
2778 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
2780 typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
2782 * A pointer to the opaque Rust object.
2783 * Nearly everywhere, inner must be non-null, however in places where
2784 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2786 LDKnativeUnsignedChannelAnnouncement *inner;
2788 * Indicates that this is the only struct which contains the same pointer.
2789 * Rust functions which take ownership of an object provided via an argument require
2790 * this to be true and invalidate the object pointed to by inner.
2793 } LDKUnsignedChannelAnnouncement;
2798 * One counterparty's public keys which do not change over the life of a channel.
2800 typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
2802 * A pointer to the opaque Rust object.
2803 * Nearly everywhere, inner must be non-null, however in places where
2804 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2806 LDKnativeChannelPublicKeys *inner;
2808 * Indicates that this is the only struct which contains the same pointer.
2809 * Rust functions which take ownership of an object provided via an argument require
2810 * this to be true and invalidate the object pointed to by inner.
2813 } LDKChannelPublicKeys;
2818 * Per-channel data used to build transactions in conjunction with the per-commitment data (CommitmentTransaction).
2819 * The fields are organized by holder/counterparty.
2821 * Normally, this is converted to the broadcaster/countersignatory-organized DirectedChannelTransactionParameters
2822 * before use, via the as_holder_broadcastable and as_counterparty_broadcastable functions.
2824 typedef struct MUST_USE_STRUCT LDKChannelTransactionParameters {
2826 * A pointer to the opaque Rust object.
2827 * Nearly everywhere, inner must be non-null, however in places where
2828 * the Rust equivalent takes an Option, it may be set to null to indicate None.
2830 LDKnativeChannelTransactionParameters *inner;
2832 * Indicates that this is the only struct which contains the same pointer.
2833 * Rust functions which take ownership of an object provided via an argument require
2834 * this to be true and invalidate the object pointed to by inner.
2837 } LDKChannelTransactionParameters;
2840 * A trait to handle Lightning channel key material without concretizing the channel type or
2841 * the signature mechanism.
2843 typedef struct LDKChannelSigner {
2845 * An opaque pointer which is passed to your function implementations as an argument.
2846 * This has no meaning in the LDK, and can be NULL or any other value.
2850 * Gets the per-commitment point for a specific commitment number
2852 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2854 struct LDKPublicKey (*get_per_commitment_point)(const void *this_arg, uint64_t idx);
2856 * Gets the commitment secret for a specific commitment number as part of the revocation process
2858 * An external signer implementation should error here if the commitment was already signed
2859 * and should refuse to sign it in the future.
2861 * May be called more than once for the same index.
2863 * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards.
2865 struct LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx);
2867 * Validate the counterparty's signatures on the holder commitment transaction and HTLCs.
2869 * This is required in order for the signer to make sure that releasing a commitment
2870 * secret won't leave us without a broadcastable holder transaction.
2871 * Policy checks should be implemented in this function, including checking the amount
2872 * sent to us and checking the HTLCs.
2874 * The preimages of outbound HTLCs that were fulfilled since the last commitment are provided.
2875 * A validating signer should ensure that an HTLC output is removed only when the matching
2876 * preimage is provided, or when the value to holder is restored.
2878 * Note that all the relevant preimages will be provided, but there may also be additional
2879 * irrelevant or duplicate preimages.
2881 struct LDKCResult_NoneNoneZ (*validate_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR holder_tx, struct LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages);
2883 * Validate the counterparty's revocation.
2885 * This is required in order for the signer to make sure that the state has moved
2886 * forward and it is safe to sign the next counterparty commitment.
2888 struct LDKCResult_NoneNoneZ (*validate_counterparty_revocation)(const void *this_arg, uint64_t idx, const uint8_t (*secret)[32]);
2890 * Returns the holder's channel public keys and basepoints.
2892 struct LDKChannelPublicKeys pubkeys;
2894 * Fill in the pubkeys field as a reference to it will be given to Rust after this returns
2895 * Note that this takes a pointer to this object, not the this_ptr like other methods do
2896 * This function pointer may be NULL if pubkeys is filled in when this object is created and never needs updating.
2898 void (*set_pubkeys)(const struct LDKChannelSigner*NONNULL_PTR );
2900 * Returns an arbitrary identifier describing the set of keys which are provided back to you in
2901 * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this
2902 * [`EcdsaChannelSigner`] object uniquely and lookup or re-derive its keys.
2904 struct LDKThirtyTwoBytes (*channel_keys_id)(const void *this_arg);
2906 * Set the counterparty static channel data, including basepoints,
2907 * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
2909 * This data is static, and will never change for a channel once set. For a given [`ChannelSigner`]
2910 * instance, LDK will call this method exactly once - either immediately after construction
2911 * (not including if done via [`SignerProvider::read_chan_signer`]) or when the funding
2912 * information has been generated.
2914 * channel_parameters.is_populated() MUST be true.
2916 void (*provide_channel_parameters)(void *this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters);
2918 * Frees any resources associated with this object given its this_arg pointer.
2919 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
2921 void (*free)(void *this_arg);
2925 * A trait to sign Lightning channel transactions as described in
2926 * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md).
2928 * Signing services could be implemented on a hardware wallet and should implement signing
2929 * policies in order to be secure. Please refer to the [VLS Policy
2930 * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md)
2931 * for an example of such policies.
2933 typedef struct LDKEcdsaChannelSigner {
2935 * An opaque pointer which is passed to your function implementations as an argument.
2936 * This has no meaning in the LDK, and can be NULL or any other value.
2940 * Create a signature for a counterparty's commitment transaction and associated HTLC transactions.
2942 * Note that if signing fails or is rejected, the channel will be force-closed.
2944 * Policy checks should be implemented in this function, including checking the amount
2945 * sent to us and checking the HTLCs.
2947 * The preimages of outbound and inbound HTLCs that were fulfilled since the last commitment
2948 * are provided. A validating signer should ensure that an outbound HTLC output is removed
2949 * only when the matching preimage is provided and after the corresponding inbound HTLC has
2950 * been removed for forwarded payments.
2952 * Note that all the relevant preimages will be provided, but there may also be additional
2953 * irrelevant or duplicate preimages.
2955 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx, struct LDKCVec_ThirtyTwoBytesZ inbound_htlc_preimages, struct LDKCVec_ThirtyTwoBytesZ outbound_htlc_preimages);
2957 * Creates a signature for a holder's commitment transaction.
2959 * This will be called
2960 * - with a non-revoked `commitment_tx`.
2961 * - with the latest `commitment_tx` when we initiate a force-close.
2963 * This may be called multiple times for the same transaction.
2965 * An external signer implementation should check that the commitment has not been revoked.
2967 struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_commitment)(const void *this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx);
2969 * Create a signature for the given input in a transaction spending an HTLC transaction output
2970 * or a commitment transaction `to_local` output when our counterparty broadcasts an old state.
2972 * A justice transaction may claim multiple outputs at the same time if timelocks are
2973 * similar, but only a signature for the input at index `input` should be signed for here.
2974 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2975 * to an upcoming timelock expiration.
2977 * Amount is value of the output spent by this input, committed to in the BIP 143 signature.
2979 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2980 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2981 * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do
2984 struct LDKCResult_ECDSASignatureNoneZ (*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]);
2986 * Create a signature for the given input in a transaction spending a commitment transaction
2987 * HTLC output when our counterparty broadcasts an old state.
2989 * A justice transaction may claim multiple outputs at the same time if timelocks are
2990 * similar, but only a signature for the input at index `input` should be signed for here.
2991 * It may be called multiple times for same output(s) if a fee-bump is needed with regards
2992 * to an upcoming timelock expiration.
2994 * `amount` is the value of the output spent by this input, committed to in the BIP 143
2997 * `per_commitment_key` is revocation secret which was provided by our counterparty when they
2998 * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does
2999 * not allow the spending of any funds by itself (you need our holder revocation_secret to do
3002 * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script
3003 * (which is committed to in the BIP 143 signatures).
3005 struct LDKCResult_ECDSASignatureNoneZ (*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);
3007 * Computes the signature for a commitment transaction's HTLC output used as an input within
3008 * `htlc_tx`, which spends the commitment transaction at index `input`. The signature returned
3009 * must be be computed using [`EcdsaSighashType::All`].
3011 * Note that this may be called for HTLCs in the penultimate commitment transaction if a
3012 * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas)
3013 * broadcasts it before receiving the update for the latest commitment transaction.
3015 * [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All
3016 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3018 struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_htlc_transaction)(const void *this_arg, struct LDKTransaction htlc_tx, uintptr_t input, const struct LDKHTLCDescriptor *NONNULL_PTR htlc_descriptor);
3020 * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment
3021 * transaction, either offered or received.
3023 * Such a transaction may claim multiples offered outputs at same time if we know the
3024 * preimage for each when we create it, but only the input at index `input` should be
3025 * signed for here. It may be called multiple times for same output(s) if a fee-bump is
3026 * needed with regards to an upcoming timelock expiration.
3028 * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC
3031 * `amount` is value of the output spent by this input, committed to in the BIP 143 signature.
3033 * `per_commitment_point` is the dynamic point corresponding to the channel state
3034 * detected onchain. It has been generated by our counterparty and is used to derive
3035 * channel state keys, which are then included in the witness script and committed to in the
3036 * BIP 143 signature.
3038 struct LDKCResult_ECDSASignatureNoneZ (*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);
3040 * Create a signature for a (proposed) closing transaction.
3042 * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have
3043 * chosen to forgo their output as dust.
3045 struct LDKCResult_ECDSASignatureNoneZ (*sign_closing_transaction)(const void *this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx);
3047 * Computes the signature for a commitment transaction's anchor output used as an
3048 * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
3050 struct LDKCResult_ECDSASignatureNoneZ (*sign_holder_anchor_input)(const void *this_arg, struct LDKTransaction anchor_tx, uintptr_t input);
3052 * Signs a channel announcement message with our funding key proving it comes from one of the
3053 * channel participants.
3055 * Channel announcements also require a signature from each node's network key. Our node
3056 * signature is computed through [`NodeSigner::sign_gossip_message`].
3058 * Note that if this fails or is rejected, the channel will not be publicly announced and
3059 * our counterparty may (though likely will not) close the channel on us for violating the
3062 * [`NodeSigner::sign_gossip_message`]: crate::sign::NodeSigner::sign_gossip_message
3064 struct LDKCResult_ECDSASignatureNoneZ (*sign_channel_announcement_with_funding_key)(const void *this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg);
3066 * Implementation of ChannelSigner for this object.
3068 struct LDKChannelSigner ChannelSigner;
3070 * Frees any resources associated with this object given its this_arg pointer.
3071 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3073 void (*free)(void *this_arg);
3074 } LDKEcdsaChannelSigner;
3077 * A writeable signer.
3079 * There will always be two instances of a signer per channel, one occupied by the
3080 * [`ChannelManager`] and another by the channel's [`ChannelMonitor`].
3082 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
3083 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
3085 typedef struct LDKWriteableEcdsaChannelSigner {
3087 * An opaque pointer which is passed to your function implementations as an argument.
3088 * This has no meaning in the LDK, and can be NULL or any other value.
3092 * Implementation of EcdsaChannelSigner for this object.
3094 struct LDKEcdsaChannelSigner EcdsaChannelSigner;
3096 * Serialize the object into a byte array
3098 struct LDKCVec_u8Z (*write)(const void *this_arg);
3100 * Called, if set, after this WriteableEcdsaChannelSigner has been cloned into a duplicate object.
3101 * The new WriteableEcdsaChannelSigner is provided, and should be mutated as needed to perform a
3102 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
3104 void (*cloned)(struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR new_WriteableEcdsaChannelSigner);
3106 * Frees any resources associated with this object given its this_arg pointer.
3107 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3109 void (*free)(void *this_arg);
3110 } LDKWriteableEcdsaChannelSigner;
3113 * The contents of CResult_WriteableEcdsaChannelSignerDecodeErrorZ
3115 typedef union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr {
3117 * A pointer to the contents in the success state.
3118 * Reading from this pointer when `result_ok` is not set is undefined.
3120 struct LDKWriteableEcdsaChannelSigner *result;
3122 * A pointer to the contents in the error state.
3123 * Reading from this pointer when `result_ok` is set is undefined.
3125 struct LDKDecodeError *err;
3126 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr;
3129 * A CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents the result of a fallible operation,
3130 * containing a crate::lightning::sign::ecdsa::WriteableEcdsaChannelSigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3131 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3133 typedef struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ {
3135 * The contents of this CResult_WriteableEcdsaChannelSignerDecodeErrorZ, accessible via either
3136 * `err` or `result` depending on the state of `result_ok`.
3138 union LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZPtr contents;
3140 * Whether this CResult_WriteableEcdsaChannelSignerDecodeErrorZ represents a success state.
3143 } LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ;
3146 * The contents of CResult_CVec_u8ZNoneZ
3148 typedef union LDKCResult_CVec_u8ZNoneZPtr {
3150 * A pointer to the contents in the success state.
3151 * Reading from this pointer when `result_ok` is not set is undefined.
3153 struct LDKCVec_u8Z *result;
3155 * Note that this value is always NULL, as there are no contents in the Err variant
3158 } LDKCResult_CVec_u8ZNoneZPtr;
3161 * A CResult_CVec_u8ZNoneZ represents the result of a fallible operation,
3162 * containing a crate::c_types::derived::CVec_u8Z on success and a () on failure.
3163 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3165 typedef struct LDKCResult_CVec_u8ZNoneZ {
3167 * The contents of this CResult_CVec_u8ZNoneZ, accessible via either
3168 * `err` or `result` depending on the state of `result_ok`.
3170 union LDKCResult_CVec_u8ZNoneZPtr contents;
3172 * Whether this CResult_CVec_u8ZNoneZ represents a success state.
3175 } LDKCResult_CVec_u8ZNoneZ;
3178 * The contents of CResult_ShutdownScriptNoneZ
3180 typedef union LDKCResult_ShutdownScriptNoneZPtr {
3182 * A pointer to the contents in the success state.
3183 * Reading from this pointer when `result_ok` is not set is undefined.
3185 struct LDKShutdownScript *result;
3187 * Note that this value is always NULL, as there are no contents in the Err variant
3190 } LDKCResult_ShutdownScriptNoneZPtr;
3193 * A CResult_ShutdownScriptNoneZ represents the result of a fallible operation,
3194 * containing a crate::lightning::ln::script::ShutdownScript on success and a () on failure.
3195 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3197 typedef struct LDKCResult_ShutdownScriptNoneZ {
3199 * The contents of this CResult_ShutdownScriptNoneZ, accessible via either
3200 * `err` or `result` depending on the state of `result_ok`.
3202 union LDKCResult_ShutdownScriptNoneZPtr contents;
3204 * Whether this CResult_ShutdownScriptNoneZ represents a success state.
3207 } LDKCResult_ShutdownScriptNoneZ;
3210 * An enum which can either contain a u16 or not
3212 typedef enum LDKCOption_u16Z_Tag {
3214 * When we're in this state, this COption_u16Z contains a u16
3216 LDKCOption_u16Z_Some,
3218 * When we're in this state, this COption_u16Z contains nothing
3220 LDKCOption_u16Z_None,
3222 * Must be last for serialization purposes
3224 LDKCOption_u16Z_Sentinel,
3225 } LDKCOption_u16Z_Tag;
3227 typedef struct LDKCOption_u16Z {
3228 LDKCOption_u16Z_Tag tag;
3237 * An enum which can either contain a bool or not
3239 typedef enum LDKCOption_boolZ_Tag {
3241 * When we're in this state, this COption_boolZ contains a bool
3243 LDKCOption_boolZ_Some,
3245 * When we're in this state, this COption_boolZ contains nothing
3247 LDKCOption_boolZ_None,
3249 * Must be last for serialization purposes
3251 LDKCOption_boolZ_Sentinel,
3252 } LDKCOption_boolZ_Tag;
3254 typedef struct LDKCOption_boolZ {
3255 LDKCOption_boolZ_Tag tag;
3264 * The contents of CResult_WitnessNoneZ
3266 typedef union LDKCResult_WitnessNoneZPtr {
3268 * A pointer to the contents in the success state.
3269 * Reading from this pointer when `result_ok` is not set is undefined.
3271 struct LDKWitness *result;
3273 * Note that this value is always NULL, as there are no contents in the Err variant
3276 } LDKCResult_WitnessNoneZPtr;
3279 * A CResult_WitnessNoneZ represents the result of a fallible operation,
3280 * containing a crate::c_types::Witness on success and a () on failure.
3281 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3283 typedef struct LDKCResult_WitnessNoneZ {
3285 * The contents of this CResult_WitnessNoneZ, accessible via either
3286 * `err` or `result` depending on the state of `result_ok`.
3288 union LDKCResult_WitnessNoneZPtr contents;
3290 * Whether this CResult_WitnessNoneZ represents a success state.
3293 } LDKCResult_WitnessNoneZ;
3298 * A simple implementation of [`WriteableEcdsaChannelSigner`] that just keeps the private keys in memory.
3300 * This implementation performs no policy checks and is insufficient by itself as
3301 * a secure external signer.
3303 typedef struct MUST_USE_STRUCT LDKInMemorySigner {
3305 * A pointer to the opaque Rust object.
3306 * Nearly everywhere, inner must be non-null, however in places where
3307 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3309 LDKnativeInMemorySigner *inner;
3311 * Indicates that this is the only struct which contains the same pointer.
3312 * Rust functions which take ownership of an object provided via an argument require
3313 * this to be true and invalidate the object pointed to by inner.
3316 } LDKInMemorySigner;
3319 * The contents of CResult_InMemorySignerDecodeErrorZ
3321 typedef union LDKCResult_InMemorySignerDecodeErrorZPtr {
3323 * A pointer to the contents in the success state.
3324 * Reading from this pointer when `result_ok` is not set is undefined.
3326 struct LDKInMemorySigner *result;
3328 * A pointer to the contents in the error state.
3329 * Reading from this pointer when `result_ok` is set is undefined.
3331 struct LDKDecodeError *err;
3332 } LDKCResult_InMemorySignerDecodeErrorZPtr;
3335 * A CResult_InMemorySignerDecodeErrorZ represents the result of a fallible operation,
3336 * containing a crate::lightning::sign::InMemorySigner on success and a crate::lightning::ln::msgs::DecodeError on failure.
3337 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3339 typedef struct LDKCResult_InMemorySignerDecodeErrorZ {
3341 * The contents of this CResult_InMemorySignerDecodeErrorZ, accessible via either
3342 * `err` or `result` depending on the state of `result_ok`.
3344 union LDKCResult_InMemorySignerDecodeErrorZPtr contents;
3346 * Whether this CResult_InMemorySignerDecodeErrorZ represents a success state.
3349 } LDKCResult_InMemorySignerDecodeErrorZ;
3352 * The contents of CResult_TransactionNoneZ
3354 typedef union LDKCResult_TransactionNoneZPtr {
3356 * A pointer to the contents in the success state.
3357 * Reading from this pointer when `result_ok` is not set is undefined.
3359 struct LDKTransaction *result;
3361 * Note that this value is always NULL, as there are no contents in the Err variant
3364 } LDKCResult_TransactionNoneZPtr;
3367 * A CResult_TransactionNoneZ represents the result of a fallible operation,
3368 * containing a crate::c_types::Transaction on success and a () on failure.
3369 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3371 typedef struct LDKCResult_TransactionNoneZ {
3373 * The contents of this CResult_TransactionNoneZ, accessible via either
3374 * `err` or `result` depending on the state of `result_ok`.
3376 union LDKCResult_TransactionNoneZPtr contents;
3378 * Whether this CResult_TransactionNoneZ represents a success state.
3381 } LDKCResult_TransactionNoneZ;
3386 * A [`CandidateRouteHop::FirstHop`] entry.
3388 typedef struct MUST_USE_STRUCT LDKFirstHopCandidate {
3390 * A pointer to the opaque Rust object.
3391 * Nearly everywhere, inner must be non-null, however in places where
3392 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3394 LDKnativeFirstHopCandidate *inner;
3396 * Indicates that this is the only struct which contains the same pointer.
3397 * Rust functions which take ownership of an object provided via an argument require
3398 * this to be true and invalidate the object pointed to by inner.
3401 } LDKFirstHopCandidate;
3406 * A [`CandidateRouteHop::PublicHop`] entry.
3408 typedef struct MUST_USE_STRUCT LDKPublicHopCandidate {
3410 * A pointer to the opaque Rust object.
3411 * Nearly everywhere, inner must be non-null, however in places where
3412 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3414 LDKnativePublicHopCandidate *inner;
3416 * Indicates that this is the only struct which contains the same pointer.
3417 * Rust functions which take ownership of an object provided via an argument require
3418 * this to be true and invalidate the object pointed to by inner.
3421 } LDKPublicHopCandidate;
3426 * A [`CandidateRouteHop::PrivateHop`] entry.
3428 typedef struct MUST_USE_STRUCT LDKPrivateHopCandidate {
3430 * A pointer to the opaque Rust object.
3431 * Nearly everywhere, inner must be non-null, however in places where
3432 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3434 LDKnativePrivateHopCandidate *inner;
3436 * Indicates that this is the only struct which contains the same pointer.
3437 * Rust functions which take ownership of an object provided via an argument require
3438 * this to be true and invalidate the object pointed to by inner.
3441 } LDKPrivateHopCandidate;
3446 * A [`CandidateRouteHop::Blinded`] entry.
3448 typedef struct MUST_USE_STRUCT LDKBlindedPathCandidate {
3450 * A pointer to the opaque Rust object.
3451 * Nearly everywhere, inner must be non-null, however in places where
3452 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3454 LDKnativeBlindedPathCandidate *inner;
3456 * Indicates that this is the only struct which contains the same pointer.
3457 * Rust functions which take ownership of an object provided via an argument require
3458 * this to be true and invalidate the object pointed to by inner.
3461 } LDKBlindedPathCandidate;
3466 * A [`CandidateRouteHop::OneHopBlinded`] entry.
3468 typedef struct MUST_USE_STRUCT LDKOneHopBlindedPathCandidate {
3470 * A pointer to the opaque Rust object.
3471 * Nearly everywhere, inner must be non-null, however in places where
3472 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3474 LDKnativeOneHopBlindedPathCandidate *inner;
3476 * Indicates that this is the only struct which contains the same pointer.
3477 * Rust functions which take ownership of an object provided via an argument require
3478 * this to be true and invalidate the object pointed to by inner.
3481 } LDKOneHopBlindedPathCandidate;
3484 * A wrapper around the various hop representations.
3486 * Can be used to examine the properties of a hop,
3487 * potentially to decide whether to include it in a route.
3489 typedef enum LDKCandidateRouteHop_Tag {
3491 * A hop from the payer, where the outbound liquidity is known.
3493 LDKCandidateRouteHop_FirstHop,
3495 * A hop found in the [`ReadOnlyNetworkGraph`].
3497 LDKCandidateRouteHop_PublicHop,
3499 * A private hop communicated by the payee, generally via a BOLT 11 invoice.
3501 * Because BOLT 11 route hints can take multiple hops to get to the destination, this may not
3502 * terminate at the payee.
3504 LDKCandidateRouteHop_PrivateHop,
3506 * A blinded path which starts with an introduction point and ultimately terminates with the
3509 * Because we don't know the payee's identity, [`CandidateRouteHop::target`] will return
3510 * `None` in this state.
3512 * Because blinded paths are \"all or nothing\", and we cannot use just one part of a blinded
3513 * path, the full path is treated as a single [`CandidateRouteHop`].
3515 LDKCandidateRouteHop_Blinded,
3517 * Similar to [`Self::Blinded`], but the path here only has one hop.
3519 * While we treat this similarly to [`CandidateRouteHop::Blinded`] in many respects (e.g.
3520 * returning `None` from [`CandidateRouteHop::target`]), in this case we do actually know the
3521 * payee's identity - it's the introduction point!
3523 * [`BlindedPayInfo`] provided for 1-hop blinded paths is ignored because it is meant to apply
3524 * to the hops *between* the introduction node and the destination.
3526 * This primarily exists to track that we need to included a blinded path at the end of our
3527 * [`Route`], even though it doesn't actually add an additional hop in the payment.
3529 LDKCandidateRouteHop_OneHopBlinded,
3531 * Must be last for serialization purposes
3533 LDKCandidateRouteHop_Sentinel,
3534 } LDKCandidateRouteHop_Tag;
3536 typedef struct MUST_USE_STRUCT LDKCandidateRouteHop {
3537 LDKCandidateRouteHop_Tag tag;
3540 struct LDKFirstHopCandidate first_hop;
3543 struct LDKPublicHopCandidate public_hop;
3546 struct LDKPrivateHopCandidate private_hop;
3549 struct LDKBlindedPathCandidate blinded;
3552 struct LDKOneHopBlindedPathCandidate one_hop_blinded;
3555 } LDKCandidateRouteHop;
3560 * Proposed use of a channel passed as a parameter to [`ScoreLookUp::channel_penalty_msat`].
3562 typedef struct MUST_USE_STRUCT LDKChannelUsage {
3564 * A pointer to the opaque Rust object.
3565 * Nearly everywhere, inner must be non-null, however in places where
3566 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3568 LDKnativeChannelUsage *inner;
3570 * Indicates that this is the only struct which contains the same pointer.
3571 * Rust functions which take ownership of an object provided via an argument require
3572 * this to be true and invalidate the object pointed to by inner.
3580 * Parameters for configuring [`ProbabilisticScorer`].
3582 * Used to configure base, liquidity, and amount penalties, the sum of which comprises the channel
3583 * penalty (i.e., the amount in msats willing to be paid to avoid routing through the channel).
3585 * The penalty applied to any channel by the [`ProbabilisticScorer`] is the sum of each of the
3588 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringFeeParameters {
3590 * A pointer to the opaque Rust object.
3591 * Nearly everywhere, inner must be non-null, however in places where
3592 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3594 LDKnativeProbabilisticScoringFeeParameters *inner;
3596 * Indicates that this is the only struct which contains the same pointer.
3597 * Rust functions which take ownership of an object provided via an argument require
3598 * this to be true and invalidate the object pointed to by inner.
3601 } LDKProbabilisticScoringFeeParameters;
3604 * An interface used to score payment channels for path finding.
3606 * `ScoreLookUp` is used to determine the penalty for a given channel.
3608 * Scoring is in terms of fees willing to be paid in order to avoid routing through a channel.
3610 typedef struct LDKScoreLookUp {
3612 * An opaque pointer which is passed to your function implementations as an argument.
3613 * This has no meaning in the LDK, and can be NULL or any other value.
3617 * Returns the fee in msats willing to be paid to avoid routing `send_amt_msat` through the
3618 * given channel in the direction from `source` to `target`.
3620 * The channel's capacity (less any other MPP parts that are also being considered for use in
3621 * the same payment) is given by `capacity_msat`. It may be determined from various sources
3622 * such as a chain data, network gossip, or invoice hints. For invoice hints, a capacity near
3623 * [`u64::max_value`] is given to indicate sufficient capacity for the invoice's full amount.
3624 * Thus, implementations should be overflow-safe.
3626 uint64_t (*channel_penalty_msat)(const void *this_arg, const struct LDKCandidateRouteHop *NONNULL_PTR candidate, struct LDKChannelUsage usage, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params);
3628 * Frees any resources associated with this object given its this_arg pointer.
3629 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3631 void (*free)(void *this_arg);
3637 * A path in a [`Route`] to the payment recipient. Must always be at least length one.
3638 * If no [`Path::blinded_tail`] is present, then [`Path::hops`] length may be up to 19.
3640 typedef struct MUST_USE_STRUCT LDKPath {
3642 * A pointer to the opaque Rust object.
3643 * Nearly everywhere, inner must be non-null, however in places where
3644 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3646 LDKnativePath *inner;
3648 * Indicates that this is the only struct which contains the same pointer.
3649 * Rust functions which take ownership of an object provided via an argument require
3650 * this to be true and invalidate the object pointed to by inner.
3656 * `ScoreUpdate` is used to update the scorer's internal state after a payment attempt.
3658 typedef struct LDKScoreUpdate {
3660 * An opaque pointer which is passed to your function implementations as an argument.
3661 * This has no meaning in the LDK, and can be NULL or any other value.
3665 * Handles updating channel penalties after failing to route through a channel.
3667 void (*payment_path_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id, uint64_t duration_since_epoch);
3669 * Handles updating channel penalties after successfully routing along a path.
3671 void (*payment_path_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t duration_since_epoch);
3673 * Handles updating channel penalties after a probe over the given path failed.
3675 void (*probe_failed)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t short_channel_id, uint64_t duration_since_epoch);
3677 * Handles updating channel penalties after a probe over the given path succeeded.
3679 void (*probe_successful)(void *this_arg, const struct LDKPath *NONNULL_PTR path, uint64_t duration_since_epoch);
3681 * Scorers may wish to reduce their certainty of channel liquidity information over time.
3682 * Thus, this method is provided to allow scorers to observe the passage of time - the holder
3683 * of this object should call this method regularly (generally via the
3684 * `lightning-background-processor` crate).
3686 void (*time_passed)(void *this_arg, uint64_t duration_since_epoch);
3688 * Frees any resources associated with this object given its this_arg pointer.
3689 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3691 void (*free)(void *this_arg);
3695 * A scorer that is accessed under a lock.
3697 * Needed so that calls to [`ScoreLookUp::channel_penalty_msat`] in [`find_route`] can be made while
3698 * having shared ownership of a scorer but without requiring internal locking in [`ScoreUpdate`]
3699 * implementations. Internal locking would be detrimental to route finding performance and could
3700 * result in [`ScoreLookUp::channel_penalty_msat`] returning a different value for the same channel.
3702 * [`find_route`]: crate::routing::router::find_route
3704 typedef struct LDKLockableScore {
3706 * An opaque pointer which is passed to your function implementations as an argument.
3707 * This has no meaning in the LDK, and can be NULL or any other value.
3711 * Returns read locked scorer.
3713 struct LDKScoreLookUp (*read_lock)(const void *this_arg);
3715 * Returns write locked scorer.
3717 struct LDKScoreUpdate (*write_lock)(const void *this_arg);
3719 * Frees any resources associated with this object given its this_arg pointer.
3720 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3722 void (*free)(void *this_arg);
3726 * Refers to a scorer that is accessible under lock and also writeable to disk
3728 * We need this trait to be able to pass in a scorer to `lightning-background-processor` that will enable us to
3729 * use the Persister to persist it.
3731 typedef struct LDKWriteableScore {
3733 * An opaque pointer which is passed to your function implementations as an argument.
3734 * This has no meaning in the LDK, and can be NULL or any other value.
3738 * Implementation of LockableScore for this object.
3740 struct LDKLockableScore LockableScore;
3742 * Serialize the object into a byte array
3744 struct LDKCVec_u8Z (*write)(const void *this_arg);
3746 * Frees any resources associated with this object given its this_arg pointer.
3747 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
3749 void (*free)(void *this_arg);
3750 } LDKWriteableScore;
3753 * An enum which can either contain a crate::lightning::routing::scoring::WriteableScore or not
3755 typedef enum LDKCOption_WriteableScoreZ_Tag {
3757 * When we're in this state, this COption_WriteableScoreZ contains a crate::lightning::routing::scoring::WriteableScore
3759 LDKCOption_WriteableScoreZ_Some,
3761 * When we're in this state, this COption_WriteableScoreZ contains nothing
3763 LDKCOption_WriteableScoreZ_None,
3765 * Must be last for serialization purposes
3767 LDKCOption_WriteableScoreZ_Sentinel,
3768 } LDKCOption_WriteableScoreZ_Tag;
3770 typedef struct LDKCOption_WriteableScoreZ {
3771 LDKCOption_WriteableScoreZ_Tag tag;
3774 struct LDKWriteableScore some;
3777 } LDKCOption_WriteableScoreZ;
3780 * The contents of CResult_NoneIOErrorZ
3782 typedef union LDKCResult_NoneIOErrorZPtr {
3784 * Note that this value is always NULL, as there are no contents in the OK variant
3788 * A pointer to the contents in the error state.
3789 * Reading from this pointer when `result_ok` is set is undefined.
3791 enum LDKIOError *err;
3792 } LDKCResult_NoneIOErrorZPtr;
3795 * A CResult_NoneIOErrorZ represents the result of a fallible operation,
3796 * containing a () on success and a crate::c_types::IOError on failure.
3797 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3799 typedef struct LDKCResult_NoneIOErrorZ {
3801 * The contents of this CResult_NoneIOErrorZ, accessible via either
3802 * `err` or `result` depending on the state of `result_ok`.
3804 union LDKCResult_NoneIOErrorZPtr contents;
3806 * Whether this CResult_NoneIOErrorZ represents a success state.
3809 } LDKCResult_NoneIOErrorZ;
3814 * Details of a channel, as returned by [`ChannelManager::list_channels`] and [`ChannelManager::list_usable_channels`]
3816 typedef struct MUST_USE_STRUCT LDKChannelDetails {
3818 * A pointer to the opaque Rust object.
3819 * Nearly everywhere, inner must be non-null, however in places where
3820 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3822 LDKnativeChannelDetails *inner;
3824 * Indicates that this is the only struct which contains the same pointer.
3825 * Rust functions which take ownership of an object provided via an argument require
3826 * this to be true and invalidate the object pointed to by inner.
3829 } LDKChannelDetails;
3832 * A dynamically-allocated array of crate::lightning::ln::channelmanager::ChannelDetailss of arbitrary size.
3833 * This corresponds to std::vector in C++
3835 typedef struct LDKCVec_ChannelDetailsZ {
3837 * The elements in the array.
3838 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3840 struct LDKChannelDetails *data;
3842 * The number of elements pointed to by `data`.
3845 } LDKCVec_ChannelDetailsZ;
3850 * A route directs a payment from the sender (us) to the recipient. If the recipient supports MPP,
3851 * it can take multiple paths. Each path is composed of one or more hops through the network.
3853 typedef struct MUST_USE_STRUCT LDKRoute {
3855 * A pointer to the opaque Rust object.
3856 * Nearly everywhere, inner must be non-null, however in places where
3857 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3859 LDKnativeRoute *inner;
3861 * Indicates that this is the only struct which contains the same pointer.
3862 * Rust functions which take ownership of an object provided via an argument require
3863 * this to be true and invalidate the object pointed to by inner.
3871 * An Err type for failure to process messages.
3873 typedef struct MUST_USE_STRUCT LDKLightningError {
3875 * A pointer to the opaque Rust object.
3876 * Nearly everywhere, inner must be non-null, however in places where
3877 * the Rust equivalent takes an Option, it may be set to null to indicate None.
3879 LDKnativeLightningError *inner;
3881 * Indicates that this is the only struct which contains the same pointer.
3882 * Rust functions which take ownership of an object provided via an argument require
3883 * this to be true and invalidate the object pointed to by inner.
3886 } LDKLightningError;
3889 * The contents of CResult_RouteLightningErrorZ
3891 typedef union LDKCResult_RouteLightningErrorZPtr {
3893 * A pointer to the contents in the success state.
3894 * Reading from this pointer when `result_ok` is not set is undefined.
3896 struct LDKRoute *result;
3898 * A pointer to the contents in the error state.
3899 * Reading from this pointer when `result_ok` is set is undefined.
3901 struct LDKLightningError *err;
3902 } LDKCResult_RouteLightningErrorZPtr;
3905 * A CResult_RouteLightningErrorZ represents the result of a fallible operation,
3906 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::LightningError on failure.
3907 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3909 typedef struct LDKCResult_RouteLightningErrorZ {
3911 * The contents of this CResult_RouteLightningErrorZ, accessible via either
3912 * `err` or `result` depending on the state of `result_ok`.
3914 union LDKCResult_RouteLightningErrorZPtr contents;
3916 * Whether this CResult_RouteLightningErrorZ represents a success state.
3919 } LDKCResult_RouteLightningErrorZ;
3922 * A tuple of 2 elements. See the individual fields for the types contained.
3924 typedef struct LDKC2Tuple_BlindedPayInfoBlindedPathZ {
3926 * The element at position 0
3928 struct LDKBlindedPayInfo a;
3930 * The element at position 1
3932 struct LDKBlindedPath b;
3933 } LDKC2Tuple_BlindedPayInfoBlindedPathZ;
3936 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZs of arbitrary size.
3937 * This corresponds to std::vector in C++
3939 typedef struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ {
3941 * The elements in the array.
3942 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3944 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *data;
3946 * The number of elements pointed to by `data`.
3949 } LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ;
3952 * The contents of CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ
3954 typedef union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr {
3956 * A pointer to the contents in the success state.
3957 * Reading from this pointer when `result_ok` is not set is undefined.
3959 struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ *result;
3961 * Note that this value is always NULL, as there are no contents in the Err variant
3964 } LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr;
3967 * A CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents the result of a fallible operation,
3968 * containing a crate::c_types::derived::CVec_C2Tuple_BlindedPayInfoBlindedPathZZ on success and a () on failure.
3969 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
3971 typedef struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ {
3973 * The contents of this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ, accessible via either
3974 * `err` or `result` depending on the state of `result_ok`.
3976 union LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZPtr contents;
3978 * Whether this CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ represents a success state.
3981 } LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ;
3984 * A dynamically-allocated array of crate::c_types::PublicKeys of arbitrary size.
3985 * This corresponds to std::vector in C++
3987 typedef struct LDKCVec_PublicKeyZ {
3989 * The elements in the array.
3990 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
3992 struct LDKPublicKey *data;
3994 * The number of elements pointed to by `data`.
3997 } LDKCVec_PublicKeyZ;
4002 * A path for sending an [`OnionMessage`].
4004 typedef struct MUST_USE_STRUCT LDKOnionMessagePath {
4006 * A pointer to the opaque Rust object.
4007 * Nearly everywhere, inner must be non-null, however in places where
4008 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4010 LDKnativeOnionMessagePath *inner;
4012 * Indicates that this is the only struct which contains the same pointer.
4013 * Rust functions which take ownership of an object provided via an argument require
4014 * this to be true and invalidate the object pointed to by inner.
4017 } LDKOnionMessagePath;
4020 * The contents of CResult_OnionMessagePathNoneZ
4022 typedef union LDKCResult_OnionMessagePathNoneZPtr {
4024 * A pointer to the contents in the success state.
4025 * Reading from this pointer when `result_ok` is not set is undefined.
4027 struct LDKOnionMessagePath *result;
4029 * Note that this value is always NULL, as there are no contents in the Err variant
4032 } LDKCResult_OnionMessagePathNoneZPtr;
4035 * A CResult_OnionMessagePathNoneZ represents the result of a fallible operation,
4036 * containing a crate::lightning::onion_message::messenger::OnionMessagePath on success and a () on failure.
4037 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4039 typedef struct LDKCResult_OnionMessagePathNoneZ {
4041 * The contents of this CResult_OnionMessagePathNoneZ, accessible via either
4042 * `err` or `result` depending on the state of `result_ok`.
4044 union LDKCResult_OnionMessagePathNoneZPtr contents;
4046 * Whether this CResult_OnionMessagePathNoneZ represents a success state.
4049 } LDKCResult_OnionMessagePathNoneZ;
4052 * The contents of CResult_CVec_BlindedPathZNoneZ
4054 typedef union LDKCResult_CVec_BlindedPathZNoneZPtr {
4056 * A pointer to the contents in the success state.
4057 * Reading from this pointer when `result_ok` is not set is undefined.
4059 struct LDKCVec_BlindedPathZ *result;
4061 * Note that this value is always NULL, as there are no contents in the Err variant
4064 } LDKCResult_CVec_BlindedPathZNoneZPtr;
4067 * A CResult_CVec_BlindedPathZNoneZ represents the result of a fallible operation,
4068 * containing a crate::c_types::derived::CVec_BlindedPathZ on success and a () on failure.
4069 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4071 typedef struct LDKCResult_CVec_BlindedPathZNoneZ {
4073 * The contents of this CResult_CVec_BlindedPathZNoneZ, accessible via either
4074 * `err` or `result` depending on the state of `result_ok`.
4076 union LDKCResult_CVec_BlindedPathZNoneZPtr contents;
4078 * Whether this CResult_CVec_BlindedPathZNoneZ represents a success state.
4081 } LDKCResult_CVec_BlindedPathZNoneZ;
4086 * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for
4087 * in-use channel liquidity.
4089 typedef struct MUST_USE_STRUCT LDKInFlightHtlcs {
4091 * A pointer to the opaque Rust object.
4092 * Nearly everywhere, inner must be non-null, however in places where
4093 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4095 LDKnativeInFlightHtlcs *inner;
4097 * Indicates that this is the only struct which contains the same pointer.
4098 * Rust functions which take ownership of an object provided via an argument require
4099 * this to be true and invalidate the object pointed to by inner.
4105 * The contents of CResult_InFlightHtlcsDecodeErrorZ
4107 typedef union LDKCResult_InFlightHtlcsDecodeErrorZPtr {
4109 * A pointer to the contents in the success state.
4110 * Reading from this pointer when `result_ok` is not set is undefined.
4112 struct LDKInFlightHtlcs *result;
4114 * A pointer to the contents in the error state.
4115 * Reading from this pointer when `result_ok` is set is undefined.
4117 struct LDKDecodeError *err;
4118 } LDKCResult_InFlightHtlcsDecodeErrorZPtr;
4121 * A CResult_InFlightHtlcsDecodeErrorZ represents the result of a fallible operation,
4122 * containing a crate::lightning::routing::router::InFlightHtlcs on success and a crate::lightning::ln::msgs::DecodeError on failure.
4123 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4125 typedef struct LDKCResult_InFlightHtlcsDecodeErrorZ {
4127 * The contents of this CResult_InFlightHtlcsDecodeErrorZ, accessible via either
4128 * `err` or `result` depending on the state of `result_ok`.
4130 union LDKCResult_InFlightHtlcsDecodeErrorZPtr contents;
4132 * Whether this CResult_InFlightHtlcsDecodeErrorZ represents a success state.
4135 } LDKCResult_InFlightHtlcsDecodeErrorZ;
4140 * A hop in a route, and additional metadata about it. \"Hop\" is defined as a node and the channel
4143 typedef struct MUST_USE_STRUCT LDKRouteHop {
4145 * A pointer to the opaque Rust object.
4146 * Nearly everywhere, inner must be non-null, however in places where
4147 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4149 LDKnativeRouteHop *inner;
4151 * Indicates that this is the only struct which contains the same pointer.
4152 * Rust functions which take ownership of an object provided via an argument require
4153 * this to be true and invalidate the object pointed to by inner.
4159 * The contents of CResult_RouteHopDecodeErrorZ
4161 typedef union LDKCResult_RouteHopDecodeErrorZPtr {
4163 * A pointer to the contents in the success state.
4164 * Reading from this pointer when `result_ok` is not set is undefined.
4166 struct LDKRouteHop *result;
4168 * A pointer to the contents in the error state.
4169 * Reading from this pointer when `result_ok` is set is undefined.
4171 struct LDKDecodeError *err;
4172 } LDKCResult_RouteHopDecodeErrorZPtr;
4175 * A CResult_RouteHopDecodeErrorZ represents the result of a fallible operation,
4176 * containing a crate::lightning::routing::router::RouteHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
4177 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4179 typedef struct LDKCResult_RouteHopDecodeErrorZ {
4181 * The contents of this CResult_RouteHopDecodeErrorZ, accessible via either
4182 * `err` or `result` depending on the state of `result_ok`.
4184 union LDKCResult_RouteHopDecodeErrorZPtr contents;
4186 * Whether this CResult_RouteHopDecodeErrorZ represents a success state.
4189 } LDKCResult_RouteHopDecodeErrorZ;
4194 * An encrypted payload and node id corresponding to a hop in a payment or onion message path, to
4195 * be encoded in the sender's onion packet. These hops cannot be identified by outside observers
4196 * and thus can be used to hide the identity of the recipient.
4198 typedef struct MUST_USE_STRUCT LDKBlindedHop {
4200 * A pointer to the opaque Rust object.
4201 * Nearly everywhere, inner must be non-null, however in places where
4202 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4204 LDKnativeBlindedHop *inner;
4206 * Indicates that this is the only struct which contains the same pointer.
4207 * Rust functions which take ownership of an object provided via an argument require
4208 * this to be true and invalidate the object pointed to by inner.
4214 * A dynamically-allocated array of crate::lightning::blinded_path::BlindedHops of arbitrary size.
4215 * This corresponds to std::vector in C++
4217 typedef struct LDKCVec_BlindedHopZ {
4219 * The elements in the array.
4220 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4222 struct LDKBlindedHop *data;
4224 * The number of elements pointed to by `data`.
4227 } LDKCVec_BlindedHopZ;
4232 * The blinded portion of a [`Path`], if we're routing to a recipient who provided blinded paths in
4233 * their [`Bolt12Invoice`].
4235 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
4237 typedef struct MUST_USE_STRUCT LDKBlindedTail {
4239 * A pointer to the opaque Rust object.
4240 * Nearly everywhere, inner must be non-null, however in places where
4241 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4243 LDKnativeBlindedTail *inner;
4245 * Indicates that this is the only struct which contains the same pointer.
4246 * Rust functions which take ownership of an object provided via an argument require
4247 * this to be true and invalidate the object pointed to by inner.
4253 * The contents of CResult_BlindedTailDecodeErrorZ
4255 typedef union LDKCResult_BlindedTailDecodeErrorZPtr {
4257 * A pointer to the contents in the success state.
4258 * Reading from this pointer when `result_ok` is not set is undefined.
4260 struct LDKBlindedTail *result;
4262 * A pointer to the contents in the error state.
4263 * Reading from this pointer when `result_ok` is set is undefined.
4265 struct LDKDecodeError *err;
4266 } LDKCResult_BlindedTailDecodeErrorZPtr;
4269 * A CResult_BlindedTailDecodeErrorZ represents the result of a fallible operation,
4270 * containing a crate::lightning::routing::router::BlindedTail on success and a crate::lightning::ln::msgs::DecodeError on failure.
4271 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4273 typedef struct LDKCResult_BlindedTailDecodeErrorZ {
4275 * The contents of this CResult_BlindedTailDecodeErrorZ, accessible via either
4276 * `err` or `result` depending on the state of `result_ok`.
4278 union LDKCResult_BlindedTailDecodeErrorZPtr contents;
4280 * Whether this CResult_BlindedTailDecodeErrorZ represents a success state.
4283 } LDKCResult_BlindedTailDecodeErrorZ;
4286 * A dynamically-allocated array of crate::lightning::routing::router::RouteHops of arbitrary size.
4287 * This corresponds to std::vector in C++
4289 typedef struct LDKCVec_RouteHopZ {
4291 * The elements in the array.
4292 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4294 struct LDKRouteHop *data;
4296 * The number of elements pointed to by `data`.
4299 } LDKCVec_RouteHopZ;
4302 * A dynamically-allocated array of crate::lightning::routing::router::Paths of arbitrary size.
4303 * This corresponds to std::vector in C++
4305 typedef struct LDKCVec_PathZ {
4307 * The elements in the array.
4308 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4310 struct LDKPath *data;
4312 * The number of elements pointed to by `data`.
4318 * The contents of CResult_RouteDecodeErrorZ
4320 typedef union LDKCResult_RouteDecodeErrorZPtr {
4322 * A pointer to the contents in the success state.
4323 * Reading from this pointer when `result_ok` is not set is undefined.
4325 struct LDKRoute *result;
4327 * A pointer to the contents in the error state.
4328 * Reading from this pointer when `result_ok` is set is undefined.
4330 struct LDKDecodeError *err;
4331 } LDKCResult_RouteDecodeErrorZPtr;
4334 * A CResult_RouteDecodeErrorZ represents the result of a fallible operation,
4335 * containing a crate::lightning::routing::router::Route on success and a crate::lightning::ln::msgs::DecodeError on failure.
4336 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4338 typedef struct LDKCResult_RouteDecodeErrorZ {
4340 * The contents of this CResult_RouteDecodeErrorZ, accessible via either
4341 * `err` or `result` depending on the state of `result_ok`.
4343 union LDKCResult_RouteDecodeErrorZPtr contents;
4345 * Whether this CResult_RouteDecodeErrorZ represents a success state.
4348 } LDKCResult_RouteDecodeErrorZ;
4353 * Parameters needed to find a [`Route`].
4355 * Passed to [`find_route`] and [`build_route_from_hops`].
4357 typedef struct MUST_USE_STRUCT LDKRouteParameters {
4359 * A pointer to the opaque Rust object.
4360 * Nearly everywhere, inner must be non-null, however in places where
4361 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4363 LDKnativeRouteParameters *inner;
4365 * Indicates that this is the only struct which contains the same pointer.
4366 * Rust functions which take ownership of an object provided via an argument require
4367 * this to be true and invalidate the object pointed to by inner.
4370 } LDKRouteParameters;
4373 * The contents of CResult_RouteParametersDecodeErrorZ
4375 typedef union LDKCResult_RouteParametersDecodeErrorZPtr {
4377 * A pointer to the contents in the success state.
4378 * Reading from this pointer when `result_ok` is not set is undefined.
4380 struct LDKRouteParameters *result;
4382 * A pointer to the contents in the error state.
4383 * Reading from this pointer when `result_ok` is set is undefined.
4385 struct LDKDecodeError *err;
4386 } LDKCResult_RouteParametersDecodeErrorZPtr;
4389 * A CResult_RouteParametersDecodeErrorZ represents the result of a fallible operation,
4390 * containing a crate::lightning::routing::router::RouteParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4391 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4393 typedef struct LDKCResult_RouteParametersDecodeErrorZ {
4395 * The contents of this CResult_RouteParametersDecodeErrorZ, accessible via either
4396 * `err` or `result` depending on the state of `result_ok`.
4398 union LDKCResult_RouteParametersDecodeErrorZPtr contents;
4400 * Whether this CResult_RouteParametersDecodeErrorZ represents a success state.
4403 } LDKCResult_RouteParametersDecodeErrorZ;
4406 * A dynamically-allocated array of u64s of arbitrary size.
4407 * This corresponds to std::vector in C++
4409 typedef struct LDKCVec_u64Z {
4411 * The elements in the array.
4412 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4416 * The number of elements pointed to by `data`.
4424 * Information used to route a payment.
4426 typedef struct MUST_USE_STRUCT LDKPaymentParameters {
4428 * A pointer to the opaque Rust object.
4429 * Nearly everywhere, inner must be non-null, however in places where
4430 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4432 LDKnativePaymentParameters *inner;
4434 * Indicates that this is the only struct which contains the same pointer.
4435 * Rust functions which take ownership of an object provided via an argument require
4436 * this to be true and invalidate the object pointed to by inner.
4439 } LDKPaymentParameters;
4442 * The contents of CResult_PaymentParametersDecodeErrorZ
4444 typedef union LDKCResult_PaymentParametersDecodeErrorZPtr {
4446 * A pointer to the contents in the success state.
4447 * Reading from this pointer when `result_ok` is not set is undefined.
4449 struct LDKPaymentParameters *result;
4451 * A pointer to the contents in the error state.
4452 * Reading from this pointer when `result_ok` is set is undefined.
4454 struct LDKDecodeError *err;
4455 } LDKCResult_PaymentParametersDecodeErrorZPtr;
4458 * A CResult_PaymentParametersDecodeErrorZ represents the result of a fallible operation,
4459 * containing a crate::lightning::routing::router::PaymentParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
4460 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4462 typedef struct LDKCResult_PaymentParametersDecodeErrorZ {
4464 * The contents of this CResult_PaymentParametersDecodeErrorZ, accessible via either
4465 * `err` or `result` depending on the state of `result_ok`.
4467 union LDKCResult_PaymentParametersDecodeErrorZPtr contents;
4469 * Whether this CResult_PaymentParametersDecodeErrorZ represents a success state.
4472 } LDKCResult_PaymentParametersDecodeErrorZ;
4477 * A list of hops along a payment path terminating with a channel to the recipient.
4479 typedef struct MUST_USE_STRUCT LDKRouteHint {
4481 * A pointer to the opaque Rust object.
4482 * Nearly everywhere, inner must be non-null, however in places where
4483 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4485 LDKnativeRouteHint *inner;
4487 * Indicates that this is the only struct which contains the same pointer.
4488 * Rust functions which take ownership of an object provided via an argument require
4489 * this to be true and invalidate the object pointed to by inner.
4495 * A dynamically-allocated array of crate::lightning::routing::router::RouteHints of arbitrary size.
4496 * This corresponds to std::vector in C++
4498 typedef struct LDKCVec_RouteHintZ {
4500 * The elements in the array.
4501 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4503 struct LDKRouteHint *data;
4505 * The number of elements pointed to by `data`.
4508 } LDKCVec_RouteHintZ;
4513 * A channel descriptor for a hop along a payment path.
4515 * While this generally comes from BOLT 11's `r` field, this struct includes more fields than are
4516 * available in BOLT 11. Thus, encoding and decoding this via `lightning-invoice` is lossy, as
4517 * fields not supported in BOLT 11 will be stripped.
4519 typedef struct MUST_USE_STRUCT LDKRouteHintHop {
4521 * A pointer to the opaque Rust object.
4522 * Nearly everywhere, inner must be non-null, however in places where
4523 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4525 LDKnativeRouteHintHop *inner;
4527 * Indicates that this is the only struct which contains the same pointer.
4528 * Rust functions which take ownership of an object provided via an argument require
4529 * this to be true and invalidate the object pointed to by inner.
4535 * A dynamically-allocated array of crate::lightning::routing::router::RouteHintHops of arbitrary size.
4536 * This corresponds to std::vector in C++
4538 typedef struct LDKCVec_RouteHintHopZ {
4540 * The elements in the array.
4541 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4543 struct LDKRouteHintHop *data;
4545 * The number of elements pointed to by `data`.
4548 } LDKCVec_RouteHintHopZ;
4551 * The contents of CResult_RouteHintDecodeErrorZ
4553 typedef union LDKCResult_RouteHintDecodeErrorZPtr {
4555 * A pointer to the contents in the success state.
4556 * Reading from this pointer when `result_ok` is not set is undefined.
4558 struct LDKRouteHint *result;
4560 * A pointer to the contents in the error state.
4561 * Reading from this pointer when `result_ok` is set is undefined.
4563 struct LDKDecodeError *err;
4564 } LDKCResult_RouteHintDecodeErrorZPtr;
4567 * A CResult_RouteHintDecodeErrorZ represents the result of a fallible operation,
4568 * containing a crate::lightning::routing::router::RouteHint on success and a crate::lightning::ln::msgs::DecodeError on failure.
4569 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4571 typedef struct LDKCResult_RouteHintDecodeErrorZ {
4573 * The contents of this CResult_RouteHintDecodeErrorZ, accessible via either
4574 * `err` or `result` depending on the state of `result_ok`.
4576 union LDKCResult_RouteHintDecodeErrorZPtr contents;
4578 * Whether this CResult_RouteHintDecodeErrorZ represents a success state.
4581 } LDKCResult_RouteHintDecodeErrorZ;
4584 * The contents of CResult_RouteHintHopDecodeErrorZ
4586 typedef union LDKCResult_RouteHintHopDecodeErrorZPtr {
4588 * A pointer to the contents in the success state.
4589 * Reading from this pointer when `result_ok` is not set is undefined.
4591 struct LDKRouteHintHop *result;
4593 * A pointer to the contents in the error state.
4594 * Reading from this pointer when `result_ok` is set is undefined.
4596 struct LDKDecodeError *err;
4597 } LDKCResult_RouteHintHopDecodeErrorZPtr;
4600 * A CResult_RouteHintHopDecodeErrorZ represents the result of a fallible operation,
4601 * containing a crate::lightning::routing::router::RouteHintHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
4602 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4604 typedef struct LDKCResult_RouteHintHopDecodeErrorZ {
4606 * The contents of this CResult_RouteHintHopDecodeErrorZ, accessible via either
4607 * `err` or `result` depending on the state of `result_ok`.
4609 union LDKCResult_RouteHintHopDecodeErrorZPtr contents;
4611 * Whether this CResult_RouteHintHopDecodeErrorZ represents a success state.
4614 } LDKCResult_RouteHintHopDecodeErrorZ;
4619 * [`ScoreLookUp`] implementation that uses a fixed penalty.
4621 typedef struct MUST_USE_STRUCT LDKFixedPenaltyScorer {
4623 * A pointer to the opaque Rust object.
4624 * Nearly everywhere, inner must be non-null, however in places where
4625 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4627 LDKnativeFixedPenaltyScorer *inner;
4629 * Indicates that this is the only struct which contains the same pointer.
4630 * Rust functions which take ownership of an object provided via an argument require
4631 * this to be true and invalidate the object pointed to by inner.
4634 } LDKFixedPenaltyScorer;
4637 * The contents of CResult_FixedPenaltyScorerDecodeErrorZ
4639 typedef union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr {
4641 * A pointer to the contents in the success state.
4642 * Reading from this pointer when `result_ok` is not set is undefined.
4644 struct LDKFixedPenaltyScorer *result;
4646 * A pointer to the contents in the error state.
4647 * Reading from this pointer when `result_ok` is set is undefined.
4649 struct LDKDecodeError *err;
4650 } LDKCResult_FixedPenaltyScorerDecodeErrorZPtr;
4653 * A CResult_FixedPenaltyScorerDecodeErrorZ represents the result of a fallible operation,
4654 * containing a crate::lightning::routing::scoring::FixedPenaltyScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4655 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4657 typedef struct LDKCResult_FixedPenaltyScorerDecodeErrorZ {
4659 * The contents of this CResult_FixedPenaltyScorerDecodeErrorZ, accessible via either
4660 * `err` or `result` depending on the state of `result_ok`.
4662 union LDKCResult_FixedPenaltyScorerDecodeErrorZPtr contents;
4664 * Whether this CResult_FixedPenaltyScorerDecodeErrorZ represents a success state.
4667 } LDKCResult_FixedPenaltyScorerDecodeErrorZ;
4672 * Represents the compressed public key of a node
4674 typedef struct MUST_USE_STRUCT LDKNodeId {
4676 * A pointer to the opaque Rust object.
4677 * Nearly everywhere, inner must be non-null, however in places where
4678 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4680 LDKnativeNodeId *inner;
4682 * Indicates that this is the only struct which contains the same pointer.
4683 * Rust functions which take ownership of an object provided via an argument require
4684 * this to be true and invalidate the object pointed to by inner.
4690 * A dynamically-allocated array of crate::lightning::routing::gossip::NodeIds of arbitrary size.
4691 * This corresponds to std::vector in C++
4693 typedef struct LDKCVec_NodeIdZ {
4695 * The elements in the array.
4696 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
4698 struct LDKNodeId *data;
4700 * The number of elements pointed to by `data`.
4706 * A tuple of 2 elements. See the individual fields for the types contained.
4708 typedef struct LDKC2Tuple_u64u64Z {
4710 * The element at position 0
4714 * The element at position 1
4717 } LDKC2Tuple_u64u64Z;
4720 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u64Z or not
4722 typedef enum LDKCOption_C2Tuple_u64u64ZZ_Tag {
4724 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains a crate::c_types::derived::C2Tuple_u64u64Z
4726 LDKCOption_C2Tuple_u64u64ZZ_Some,
4728 * When we're in this state, this COption_C2Tuple_u64u64ZZ contains nothing
4730 LDKCOption_C2Tuple_u64u64ZZ_None,
4732 * Must be last for serialization purposes
4734 LDKCOption_C2Tuple_u64u64ZZ_Sentinel,
4735 } LDKCOption_C2Tuple_u64u64ZZ_Tag;
4737 typedef struct LDKCOption_C2Tuple_u64u64ZZ {
4738 LDKCOption_C2Tuple_u64u64ZZ_Tag tag;
4741 struct LDKC2Tuple_u64u64Z some;
4744 } LDKCOption_C2Tuple_u64u64ZZ;
4749 typedef struct LDKThirtyTwoU16s {
4751 * The thirty-two 16-bit integers
4757 * A tuple of 2 elements. See the individual fields for the types contained.
4759 typedef struct LDKC2Tuple_Z {
4761 * The element at position 0
4763 struct LDKThirtyTwoU16s a;
4765 * The element at position 1
4767 struct LDKThirtyTwoU16s b;
4771 * A tuple of 2 elements. See the individual fields for the types contained.
4773 typedef struct LDKC2Tuple__u1632_u1632Z {
4775 * The element at position 0
4777 struct LDKThirtyTwoU16s a;
4779 * The element at position 1
4781 struct LDKThirtyTwoU16s b;
4782 } LDKC2Tuple__u1632_u1632Z;
4785 * An enum which can either contain a crate::c_types::derived::C2Tuple__u1632_u1632Z or not
4787 typedef enum LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag {
4789 * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains a crate::c_types::derived::C2Tuple__u1632_u1632Z
4791 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Some,
4793 * When we're in this state, this COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ contains nothing
4795 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_None,
4797 * Must be last for serialization purposes
4799 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Sentinel,
4800 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag;
4802 typedef struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ {
4803 LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_Tag tag;
4806 struct LDKC2Tuple__u1632_u1632Z some;
4809 } LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ;
4812 * An enum which can either contain a f64 or not
4814 typedef enum LDKCOption_f64Z_Tag {
4816 * When we're in this state, this COption_f64Z contains a f64
4818 LDKCOption_f64Z_Some,
4820 * When we're in this state, this COption_f64Z contains nothing
4822 LDKCOption_f64Z_None,
4824 * Must be last for serialization purposes
4826 LDKCOption_f64Z_Sentinel,
4827 } LDKCOption_f64Z_Tag;
4829 typedef struct LDKCOption_f64Z {
4830 LDKCOption_f64Z_Tag tag;
4841 * A Record, unit of logging output with Metadata to enable filtering
4842 * Module_path, file, line to inform on log's source
4844 typedef struct MUST_USE_STRUCT LDKRecord {
4846 * A pointer to the opaque Rust object.
4847 * Nearly everywhere, inner must be non-null, however in places where
4848 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4850 LDKnativeRecord *inner;
4852 * Indicates that this is the only struct which contains the same pointer.
4853 * Rust functions which take ownership of an object provided via an argument require
4854 * this to be true and invalidate the object pointed to by inner.
4860 * A trait encapsulating the operations required of a logger.
4862 typedef struct LDKLogger {
4864 * An opaque pointer which is passed to your function implementations as an argument.
4865 * This has no meaning in the LDK, and can be NULL or any other value.
4869 * Logs the [`Record`].
4871 void (*log)(const void *this_arg, struct LDKRecord record);
4873 * Frees any resources associated with this object given its this_arg pointer.
4874 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
4876 void (*free)(void *this_arg);
4882 * Represents the network as nodes and channels between them
4884 typedef struct MUST_USE_STRUCT LDKNetworkGraph {
4886 * A pointer to the opaque Rust object.
4887 * Nearly everywhere, inner must be non-null, however in places where
4888 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4890 LDKnativeNetworkGraph *inner;
4892 * Indicates that this is the only struct which contains the same pointer.
4893 * Rust functions which take ownership of an object provided via an argument require
4894 * this to be true and invalidate the object pointed to by inner.
4902 * [`ScoreLookUp`] implementation using channel success probability distributions.
4904 * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
4905 * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
4906 * When a payment is forwarded through a channel (but fails later in the route), we learn the
4907 * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
4909 * These bounds are then used to determine a success probability using the formula from
4910 * *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
4911 * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
4913 * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
4914 * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
4915 * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
4916 * terms of the entire path's success probability. This allows the router to directly compare
4917 * penalties for different paths. See the documentation of those parameters for the exact formulas.
4919 * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
4921 * Further, we track the history of our upper and lower liquidity bounds for each channel,
4922 * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
4923 * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
4924 * formula, but using the history of a channel rather than our latest estimates for the liquidity
4927 * [1]: https://arxiv.org/abs/2107.05322
4928 * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_multiplier_msat
4929 * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::liquidity_penalty_amount_multiplier_msat
4930 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
4931 * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_multiplier_msat
4932 * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringFeeParameters::historical_liquidity_penalty_amount_multiplier_msat
4934 typedef struct MUST_USE_STRUCT LDKProbabilisticScorer {
4936 * A pointer to the opaque Rust object.
4937 * Nearly everywhere, inner must be non-null, however in places where
4938 * the Rust equivalent takes an Option, it may be set to null to indicate None.
4940 LDKnativeProbabilisticScorer *inner;
4942 * Indicates that this is the only struct which contains the same pointer.
4943 * Rust functions which take ownership of an object provided via an argument require
4944 * this to be true and invalidate the object pointed to by inner.
4947 } LDKProbabilisticScorer;
4950 * The contents of CResult_ProbabilisticScorerDecodeErrorZ
4952 typedef union LDKCResult_ProbabilisticScorerDecodeErrorZPtr {
4954 * A pointer to the contents in the success state.
4955 * Reading from this pointer when `result_ok` is not set is undefined.
4957 struct LDKProbabilisticScorer *result;
4959 * A pointer to the contents in the error state.
4960 * Reading from this pointer when `result_ok` is set is undefined.
4962 struct LDKDecodeError *err;
4963 } LDKCResult_ProbabilisticScorerDecodeErrorZPtr;
4966 * A CResult_ProbabilisticScorerDecodeErrorZ represents the result of a fallible operation,
4967 * containing a crate::lightning::routing::scoring::ProbabilisticScorer on success and a crate::lightning::ln::msgs::DecodeError on failure.
4968 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
4970 typedef struct LDKCResult_ProbabilisticScorerDecodeErrorZ {
4972 * The contents of this CResult_ProbabilisticScorerDecodeErrorZ, accessible via either
4973 * `err` or `result` depending on the state of `result_ok`.
4975 union LDKCResult_ProbabilisticScorerDecodeErrorZPtr contents;
4977 * Whether this CResult_ProbabilisticScorerDecodeErrorZ represents a success state.
4980 } LDKCResult_ProbabilisticScorerDecodeErrorZ;
4983 * A tuple of 2 elements. See the individual fields for the types contained.
4985 typedef struct LDKC2Tuple_usizeTransactionZ {
4987 * The element at position 0
4991 * The element at position 1
4993 struct LDKTransaction b;
4994 } LDKC2Tuple_usizeTransactionZ;
4997 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_usizeTransactionZs of arbitrary size.
4998 * This corresponds to std::vector in C++
5000 typedef struct LDKCVec_C2Tuple_usizeTransactionZZ {
5002 * The elements in the array.
5003 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5005 struct LDKC2Tuple_usizeTransactionZ *data;
5007 * The number of elements pointed to by `data`.
5010 } LDKCVec_C2Tuple_usizeTransactionZZ;
5013 * A tuple of 3 elements. See the individual fields for the types contained.
5015 typedef struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ {
5017 * The element at position 0
5019 struct LDKThirtyTwoBytes a;
5021 * The element at position 1
5025 * The element at position 2
5027 struct LDKCOption_ThirtyTwoBytesZ c;
5028 } LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ;
5031 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZs of arbitrary size.
5032 * This corresponds to std::vector in C++
5034 typedef struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ {
5036 * The elements in the array.
5037 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5039 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *data;
5041 * The number of elements pointed to by `data`.
5044 } LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ;
5047 * The contents of CResult_ChannelMonitorUpdateStatusNoneZ
5049 typedef union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr {
5051 * A pointer to the contents in the success state.
5052 * Reading from this pointer when `result_ok` is not set is undefined.
5054 enum LDKChannelMonitorUpdateStatus *result;
5056 * Note that this value is always NULL, as there are no contents in the Err variant
5059 } LDKCResult_ChannelMonitorUpdateStatusNoneZPtr;
5062 * A CResult_ChannelMonitorUpdateStatusNoneZ represents the result of a fallible operation,
5063 * containing a crate::lightning::chain::ChannelMonitorUpdateStatus on success and a () on failure.
5064 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5066 typedef struct LDKCResult_ChannelMonitorUpdateStatusNoneZ {
5068 * The contents of this CResult_ChannelMonitorUpdateStatusNoneZ, accessible via either
5069 * `err` or `result` depending on the state of `result_ok`.
5071 union LDKCResult_ChannelMonitorUpdateStatusNoneZPtr contents;
5073 * Whether this CResult_ChannelMonitorUpdateStatusNoneZ represents a success state.
5076 } LDKCResult_ChannelMonitorUpdateStatusNoneZ;
5081 * Simple structure sent back by `chain::Watch` when an HTLC from a forward channel is detected on
5082 * chain. Used to update the corresponding HTLC in the backward channel. Failing to pass the
5083 * preimage claim backward will lead to loss of funds.
5085 typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
5087 * A pointer to the opaque Rust object.
5088 * Nearly everywhere, inner must be non-null, however in places where
5089 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5091 LDKnativeHTLCUpdate *inner;
5093 * Indicates that this is the only struct which contains the same pointer.
5094 * Rust functions which take ownership of an object provided via an argument require
5095 * this to be true and invalidate the object pointed to by inner.
5101 * An event to be processed by the ChannelManager.
5103 typedef enum LDKMonitorEvent_Tag {
5105 * A monitor event containing an HTLCUpdate.
5107 LDKMonitorEvent_HTLCEvent,
5109 * Indicates we broadcasted the channel's latest commitment transaction and thus closed the
5112 LDKMonitorEvent_HolderForceClosed,
5114 * Indicates a [`ChannelMonitor`] update has completed. See
5115 * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
5117 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
5119 LDKMonitorEvent_Completed,
5121 * Must be last for serialization purposes
5123 LDKMonitorEvent_Sentinel,
5124 } LDKMonitorEvent_Tag;
5126 typedef struct LDKMonitorEvent_LDKCompleted_Body {
5128 * The funding outpoint of the [`ChannelMonitor`] that was updated
5130 struct LDKOutPoint funding_txo;
5132 * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or
5133 * [`ChannelMonitor::get_latest_update_id`].
5135 * Note that this should only be set to a given update's ID if all previous updates for the
5136 * same [`ChannelMonitor`] have been applied and persisted.
5138 uint64_t monitor_update_id;
5139 } LDKMonitorEvent_LDKCompleted_Body;
5141 typedef struct MUST_USE_STRUCT LDKMonitorEvent {
5142 LDKMonitorEvent_Tag tag;
5145 struct LDKHTLCUpdate htlc_event;
5148 struct LDKOutPoint holder_force_closed;
5150 LDKMonitorEvent_LDKCompleted_Body completed;
5155 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::MonitorEvents of arbitrary size.
5156 * This corresponds to std::vector in C++
5158 typedef struct LDKCVec_MonitorEventZ {
5160 * The elements in the array.
5161 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5163 struct LDKMonitorEvent *data;
5165 * The number of elements pointed to by `data`.
5168 } LDKCVec_MonitorEventZ;
5171 * A tuple of 3 elements. See the individual fields for the types contained.
5173 typedef struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ {
5175 * The element at position 0
5177 struct LDKOutPoint a;
5179 * The element at position 1
5181 struct LDKCVec_MonitorEventZ b;
5183 * The element at position 2
5185 struct LDKPublicKey c;
5186 } LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ;
5189 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OutPointCVec_MonitorEventZPublicKeyZs of arbitrary size.
5190 * This corresponds to std::vector in C++
5192 typedef struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ {
5194 * The elements in the array.
5195 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
5197 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *data;
5199 * The number of elements pointed to by `data`.
5202 } LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ;
5207 * Features used within an `init` message.
5209 typedef struct MUST_USE_STRUCT LDKInitFeatures {
5211 * A pointer to the opaque Rust object.
5212 * Nearly everywhere, inner must be non-null, however in places where
5213 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5215 LDKnativeInitFeatures *inner;
5217 * Indicates that this is the only struct which contains the same pointer.
5218 * Rust functions which take ownership of an object provided via an argument require
5219 * this to be true and invalidate the object pointed to by inner.
5225 * The contents of CResult_InitFeaturesDecodeErrorZ
5227 typedef union LDKCResult_InitFeaturesDecodeErrorZPtr {
5229 * A pointer to the contents in the success state.
5230 * Reading from this pointer when `result_ok` is not set is undefined.
5232 struct LDKInitFeatures *result;
5234 * A pointer to the contents in the error state.
5235 * Reading from this pointer when `result_ok` is set is undefined.
5237 struct LDKDecodeError *err;
5238 } LDKCResult_InitFeaturesDecodeErrorZPtr;
5241 * A CResult_InitFeaturesDecodeErrorZ represents the result of a fallible operation,
5242 * containing a crate::lightning::ln::features::InitFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5243 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5245 typedef struct LDKCResult_InitFeaturesDecodeErrorZ {
5247 * The contents of this CResult_InitFeaturesDecodeErrorZ, accessible via either
5248 * `err` or `result` depending on the state of `result_ok`.
5250 union LDKCResult_InitFeaturesDecodeErrorZPtr contents;
5252 * Whether this CResult_InitFeaturesDecodeErrorZ represents a success state.
5255 } LDKCResult_InitFeaturesDecodeErrorZ;
5260 * Features used within a `channel_announcement` message.
5262 typedef struct MUST_USE_STRUCT LDKChannelFeatures {
5264 * A pointer to the opaque Rust object.
5265 * Nearly everywhere, inner must be non-null, however in places where
5266 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5268 LDKnativeChannelFeatures *inner;
5270 * Indicates that this is the only struct which contains the same pointer.
5271 * Rust functions which take ownership of an object provided via an argument require
5272 * this to be true and invalidate the object pointed to by inner.
5275 } LDKChannelFeatures;
5278 * The contents of CResult_ChannelFeaturesDecodeErrorZ
5280 typedef union LDKCResult_ChannelFeaturesDecodeErrorZPtr {
5282 * A pointer to the contents in the success state.
5283 * Reading from this pointer when `result_ok` is not set is undefined.
5285 struct LDKChannelFeatures *result;
5287 * A pointer to the contents in the error state.
5288 * Reading from this pointer when `result_ok` is set is undefined.
5290 struct LDKDecodeError *err;
5291 } LDKCResult_ChannelFeaturesDecodeErrorZPtr;
5294 * A CResult_ChannelFeaturesDecodeErrorZ represents the result of a fallible operation,
5295 * containing a crate::lightning::ln::features::ChannelFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5296 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5298 typedef struct LDKCResult_ChannelFeaturesDecodeErrorZ {
5300 * The contents of this CResult_ChannelFeaturesDecodeErrorZ, accessible via either
5301 * `err` or `result` depending on the state of `result_ok`.
5303 union LDKCResult_ChannelFeaturesDecodeErrorZPtr contents;
5305 * Whether this CResult_ChannelFeaturesDecodeErrorZ represents a success state.
5308 } LDKCResult_ChannelFeaturesDecodeErrorZ;
5313 * Features used within a `node_announcement` message.
5315 typedef struct MUST_USE_STRUCT LDKNodeFeatures {
5317 * A pointer to the opaque Rust object.
5318 * Nearly everywhere, inner must be non-null, however in places where
5319 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5321 LDKnativeNodeFeatures *inner;
5323 * Indicates that this is the only struct which contains the same pointer.
5324 * Rust functions which take ownership of an object provided via an argument require
5325 * this to be true and invalidate the object pointed to by inner.
5331 * The contents of CResult_NodeFeaturesDecodeErrorZ
5333 typedef union LDKCResult_NodeFeaturesDecodeErrorZPtr {
5335 * A pointer to the contents in the success state.
5336 * Reading from this pointer when `result_ok` is not set is undefined.
5338 struct LDKNodeFeatures *result;
5340 * A pointer to the contents in the error state.
5341 * Reading from this pointer when `result_ok` is set is undefined.
5343 struct LDKDecodeError *err;
5344 } LDKCResult_NodeFeaturesDecodeErrorZPtr;
5347 * A CResult_NodeFeaturesDecodeErrorZ represents the result of a fallible operation,
5348 * containing a crate::lightning::ln::features::NodeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5349 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5351 typedef struct LDKCResult_NodeFeaturesDecodeErrorZ {
5353 * The contents of this CResult_NodeFeaturesDecodeErrorZ, accessible via either
5354 * `err` or `result` depending on the state of `result_ok`.
5356 union LDKCResult_NodeFeaturesDecodeErrorZPtr contents;
5358 * Whether this CResult_NodeFeaturesDecodeErrorZ represents a success state.
5361 } LDKCResult_NodeFeaturesDecodeErrorZ;
5366 * Features used within an invoice.
5368 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceFeatures {
5370 * A pointer to the opaque Rust object.
5371 * Nearly everywhere, inner must be non-null, however in places where
5372 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5374 LDKnativeBolt11InvoiceFeatures *inner;
5376 * Indicates that this is the only struct which contains the same pointer.
5377 * Rust functions which take ownership of an object provided via an argument require
5378 * this to be true and invalidate the object pointed to by inner.
5381 } LDKBolt11InvoiceFeatures;
5384 * The contents of CResult_Bolt11InvoiceFeaturesDecodeErrorZ
5386 typedef union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr {
5388 * A pointer to the contents in the success state.
5389 * Reading from this pointer when `result_ok` is not set is undefined.
5391 struct LDKBolt11InvoiceFeatures *result;
5393 * A pointer to the contents in the error state.
5394 * Reading from this pointer when `result_ok` is set is undefined.
5396 struct LDKDecodeError *err;
5397 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr;
5400 * A CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5401 * containing a crate::lightning::ln::features::Bolt11InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5402 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5404 typedef struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ {
5406 * The contents of this CResult_Bolt11InvoiceFeaturesDecodeErrorZ, accessible via either
5407 * `err` or `result` depending on the state of `result_ok`.
5409 union LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZPtr contents;
5411 * Whether this CResult_Bolt11InvoiceFeaturesDecodeErrorZ represents a success state.
5414 } LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ;
5419 * Features used within an `invoice`.
5421 typedef struct MUST_USE_STRUCT LDKBolt12InvoiceFeatures {
5423 * A pointer to the opaque Rust object.
5424 * Nearly everywhere, inner must be non-null, however in places where
5425 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5427 LDKnativeBolt12InvoiceFeatures *inner;
5429 * Indicates that this is the only struct which contains the same pointer.
5430 * Rust functions which take ownership of an object provided via an argument require
5431 * this to be true and invalidate the object pointed to by inner.
5434 } LDKBolt12InvoiceFeatures;
5437 * The contents of CResult_Bolt12InvoiceFeaturesDecodeErrorZ
5439 typedef union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr {
5441 * A pointer to the contents in the success state.
5442 * Reading from this pointer when `result_ok` is not set is undefined.
5444 struct LDKBolt12InvoiceFeatures *result;
5446 * A pointer to the contents in the error state.
5447 * Reading from this pointer when `result_ok` is set is undefined.
5449 struct LDKDecodeError *err;
5450 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr;
5453 * A CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents the result of a fallible operation,
5454 * containing a crate::lightning::ln::features::Bolt12InvoiceFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5455 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5457 typedef struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ {
5459 * The contents of this CResult_Bolt12InvoiceFeaturesDecodeErrorZ, accessible via either
5460 * `err` or `result` depending on the state of `result_ok`.
5462 union LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZPtr contents;
5464 * Whether this CResult_Bolt12InvoiceFeaturesDecodeErrorZ represents a success state.
5467 } LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ;
5472 * Features used within BOLT 4 encrypted_data_tlv and BOLT 12 blinded_payinfo
5474 typedef struct MUST_USE_STRUCT LDKBlindedHopFeatures {
5476 * A pointer to the opaque Rust object.
5477 * Nearly everywhere, inner must be non-null, however in places where
5478 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5480 LDKnativeBlindedHopFeatures *inner;
5482 * Indicates that this is the only struct which contains the same pointer.
5483 * Rust functions which take ownership of an object provided via an argument require
5484 * this to be true and invalidate the object pointed to by inner.
5487 } LDKBlindedHopFeatures;
5490 * The contents of CResult_BlindedHopFeaturesDecodeErrorZ
5492 typedef union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr {
5494 * A pointer to the contents in the success state.
5495 * Reading from this pointer when `result_ok` is not set is undefined.
5497 struct LDKBlindedHopFeatures *result;
5499 * A pointer to the contents in the error state.
5500 * Reading from this pointer when `result_ok` is set is undefined.
5502 struct LDKDecodeError *err;
5503 } LDKCResult_BlindedHopFeaturesDecodeErrorZPtr;
5506 * A CResult_BlindedHopFeaturesDecodeErrorZ represents the result of a fallible operation,
5507 * containing a crate::lightning::ln::features::BlindedHopFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5508 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5510 typedef struct LDKCResult_BlindedHopFeaturesDecodeErrorZ {
5512 * The contents of this CResult_BlindedHopFeaturesDecodeErrorZ, accessible via either
5513 * `err` or `result` depending on the state of `result_ok`.
5515 union LDKCResult_BlindedHopFeaturesDecodeErrorZPtr contents;
5517 * Whether this CResult_BlindedHopFeaturesDecodeErrorZ represents a success state.
5520 } LDKCResult_BlindedHopFeaturesDecodeErrorZ;
5525 * Features used within the channel_type field in an OpenChannel message.
5527 * A channel is always of some known \"type\", describing the transaction formats used and the exact
5528 * semantics of our interaction with our peer.
5530 * Note that because a channel is a specific type which is proposed by the opener and accepted by
5531 * the counterparty, only required features are allowed here.
5533 * This is serialized differently from other feature types - it is not prefixed by a length, and
5534 * thus must only appear inside a TLV where its length is known in advance.
5536 typedef struct MUST_USE_STRUCT LDKChannelTypeFeatures {
5538 * A pointer to the opaque Rust object.
5539 * Nearly everywhere, inner must be non-null, however in places where
5540 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5542 LDKnativeChannelTypeFeatures *inner;
5544 * Indicates that this is the only struct which contains the same pointer.
5545 * Rust functions which take ownership of an object provided via an argument require
5546 * this to be true and invalidate the object pointed to by inner.
5549 } LDKChannelTypeFeatures;
5552 * The contents of CResult_ChannelTypeFeaturesDecodeErrorZ
5554 typedef union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr {
5556 * A pointer to the contents in the success state.
5557 * Reading from this pointer when `result_ok` is not set is undefined.
5559 struct LDKChannelTypeFeatures *result;
5561 * A pointer to the contents in the error state.
5562 * Reading from this pointer when `result_ok` is set is undefined.
5564 struct LDKDecodeError *err;
5565 } LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr;
5568 * A CResult_ChannelTypeFeaturesDecodeErrorZ represents the result of a fallible operation,
5569 * containing a crate::lightning::ln::features::ChannelTypeFeatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
5570 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5572 typedef struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ {
5574 * The contents of this CResult_ChannelTypeFeaturesDecodeErrorZ, accessible via either
5575 * `err` or `result` depending on the state of `result_ok`.
5577 union LDKCResult_ChannelTypeFeaturesDecodeErrorZPtr contents;
5579 * Whether this CResult_ChannelTypeFeaturesDecodeErrorZ represents a success state.
5582 } LDKCResult_ChannelTypeFeaturesDecodeErrorZ;
5587 * An `Offer` is a potentially long-lived proposal for payment of a good or service.
5589 * An offer is a precursor to an [`InvoiceRequest`]. A merchant publishes an offer from which a
5590 * customer may request an [`Bolt12Invoice`] for a specific quantity and using an amount sufficient
5591 * to cover that quantity (i.e., at least `quantity * amount`). See [`Offer::amount`].
5593 * Offers may be denominated in currency other than bitcoin but are ultimately paid using the
5596 * Through the use of [`BlindedPath`]s, offers provide recipient privacy.
5598 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
5599 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
5601 typedef struct MUST_USE_STRUCT LDKOffer {
5603 * A pointer to the opaque Rust object.
5604 * Nearly everywhere, inner must be non-null, however in places where
5605 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5607 LDKnativeOffer *inner;
5609 * Indicates that this is the only struct which contains the same pointer.
5610 * Rust functions which take ownership of an object provided via an argument require
5611 * this to be true and invalidate the object pointed to by inner.
5617 * The contents of CResult_OfferBolt12ParseErrorZ
5619 typedef union LDKCResult_OfferBolt12ParseErrorZPtr {
5621 * A pointer to the contents in the success state.
5622 * Reading from this pointer when `result_ok` is not set is undefined.
5624 struct LDKOffer *result;
5626 * A pointer to the contents in the error state.
5627 * Reading from this pointer when `result_ok` is set is undefined.
5629 struct LDKBolt12ParseError *err;
5630 } LDKCResult_OfferBolt12ParseErrorZPtr;
5633 * A CResult_OfferBolt12ParseErrorZ represents the result of a fallible operation,
5634 * containing a crate::lightning::offers::offer::Offer on success and a crate::lightning::offers::parse::Bolt12ParseError on failure.
5635 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5637 typedef struct LDKCResult_OfferBolt12ParseErrorZ {
5639 * The contents of this CResult_OfferBolt12ParseErrorZ, accessible via either
5640 * `err` or `result` depending on the state of `result_ok`.
5642 union LDKCResult_OfferBolt12ParseErrorZPtr contents;
5644 * Whether this CResult_OfferBolt12ParseErrorZ represents a success state.
5647 } LDKCResult_OfferBolt12ParseErrorZ;
5650 * The contents of CResult_PublicKeySecp256k1ErrorZ
5652 typedef union LDKCResult_PublicKeySecp256k1ErrorZPtr {
5654 * A pointer to the contents in the success state.
5655 * Reading from this pointer when `result_ok` is not set is undefined.
5657 struct LDKPublicKey *result;
5659 * A pointer to the contents in the error state.
5660 * Reading from this pointer when `result_ok` is set is undefined.
5662 enum LDKSecp256k1Error *err;
5663 } LDKCResult_PublicKeySecp256k1ErrorZPtr;
5666 * A CResult_PublicKeySecp256k1ErrorZ represents the result of a fallible operation,
5667 * containing a crate::c_types::PublicKey on success and a crate::c_types::Secp256k1Error on failure.
5668 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5670 typedef struct LDKCResult_PublicKeySecp256k1ErrorZ {
5672 * The contents of this CResult_PublicKeySecp256k1ErrorZ, accessible via either
5673 * `err` or `result` depending on the state of `result_ok`.
5675 union LDKCResult_PublicKeySecp256k1ErrorZPtr contents;
5677 * Whether this CResult_PublicKeySecp256k1ErrorZ represents a success state.
5680 } LDKCResult_PublicKeySecp256k1ErrorZ;
5683 * The contents of CResult_NodeIdDecodeErrorZ
5685 typedef union LDKCResult_NodeIdDecodeErrorZPtr {
5687 * A pointer to the contents in the success state.
5688 * Reading from this pointer when `result_ok` is not set is undefined.
5690 struct LDKNodeId *result;
5692 * A pointer to the contents in the error state.
5693 * Reading from this pointer when `result_ok` is set is undefined.
5695 struct LDKDecodeError *err;
5696 } LDKCResult_NodeIdDecodeErrorZPtr;
5699 * A CResult_NodeIdDecodeErrorZ represents the result of a fallible operation,
5700 * containing a crate::lightning::routing::gossip::NodeId on success and a crate::lightning::ln::msgs::DecodeError on failure.
5701 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5703 typedef struct LDKCResult_NodeIdDecodeErrorZ {
5705 * The contents of this CResult_NodeIdDecodeErrorZ, accessible via either
5706 * `err` or `result` depending on the state of `result_ok`.
5708 union LDKCResult_NodeIdDecodeErrorZPtr contents;
5710 * Whether this CResult_NodeIdDecodeErrorZ represents a success state.
5713 } LDKCResult_NodeIdDecodeErrorZ;
5718 * A [`channel_update`] message to be sent to or received from a peer.
5720 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
5722 typedef struct MUST_USE_STRUCT LDKChannelUpdate {
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 LDKnativeChannelUpdate *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.
5738 * Update to the [`NetworkGraph`] based on payment failure information conveyed via the Onion
5739 * return packet by a node along the route. See [BOLT #4] for details.
5741 * [BOLT #4]: https://github.com/lightning/bolts/blob/master/04-onion-routing.md
5743 typedef enum LDKNetworkUpdate_Tag {
5745 * An error indicating a `channel_update` messages should be applied via
5746 * [`NetworkGraph::update_channel`].
5748 LDKNetworkUpdate_ChannelUpdateMessage,
5750 * An error indicating that a channel failed to route a payment, which should be applied via
5751 * [`NetworkGraph::channel_failed_permanent`] if permanent.
5753 LDKNetworkUpdate_ChannelFailure,
5755 * An error indicating that a node failed to route a payment, which should be applied via
5756 * [`NetworkGraph::node_failed_permanent`] if permanent.
5758 LDKNetworkUpdate_NodeFailure,
5760 * Must be last for serialization purposes
5762 LDKNetworkUpdate_Sentinel,
5763 } LDKNetworkUpdate_Tag;
5765 typedef struct LDKNetworkUpdate_LDKChannelUpdateMessage_Body {
5767 * The update to apply via [`NetworkGraph::update_channel`].
5769 struct LDKChannelUpdate msg;
5770 } LDKNetworkUpdate_LDKChannelUpdateMessage_Body;
5772 typedef struct LDKNetworkUpdate_LDKChannelFailure_Body {
5774 * The short channel id of the closed channel.
5776 uint64_t short_channel_id;
5778 * Whether the channel should be permanently removed or temporarily disabled until a new
5779 * `channel_update` message is received.
5782 } LDKNetworkUpdate_LDKChannelFailure_Body;
5784 typedef struct LDKNetworkUpdate_LDKNodeFailure_Body {
5786 * The node id of the failed node.
5788 struct LDKPublicKey node_id;
5790 * Whether the node should be permanently removed from consideration or can be restored
5791 * when a new `channel_update` message is received.
5794 } LDKNetworkUpdate_LDKNodeFailure_Body;
5796 typedef struct MUST_USE_STRUCT LDKNetworkUpdate {
5797 LDKNetworkUpdate_Tag tag;
5799 LDKNetworkUpdate_LDKChannelUpdateMessage_Body channel_update_message;
5800 LDKNetworkUpdate_LDKChannelFailure_Body channel_failure;
5801 LDKNetworkUpdate_LDKNodeFailure_Body node_failure;
5806 * An enum which can either contain a crate::lightning::routing::gossip::NetworkUpdate or not
5808 typedef enum LDKCOption_NetworkUpdateZ_Tag {
5810 * When we're in this state, this COption_NetworkUpdateZ contains a crate::lightning::routing::gossip::NetworkUpdate
5812 LDKCOption_NetworkUpdateZ_Some,
5814 * When we're in this state, this COption_NetworkUpdateZ contains nothing
5816 LDKCOption_NetworkUpdateZ_None,
5818 * Must be last for serialization purposes
5820 LDKCOption_NetworkUpdateZ_Sentinel,
5821 } LDKCOption_NetworkUpdateZ_Tag;
5823 typedef struct LDKCOption_NetworkUpdateZ {
5824 LDKCOption_NetworkUpdateZ_Tag tag;
5827 struct LDKNetworkUpdate some;
5830 } LDKCOption_NetworkUpdateZ;
5833 * The contents of CResult_COption_NetworkUpdateZDecodeErrorZ
5835 typedef union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr {
5837 * A pointer to the contents in the success state.
5838 * Reading from this pointer when `result_ok` is not set is undefined.
5840 struct LDKCOption_NetworkUpdateZ *result;
5842 * A pointer to the contents in the error state.
5843 * Reading from this pointer when `result_ok` is set is undefined.
5845 struct LDKDecodeError *err;
5846 } LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr;
5849 * A CResult_COption_NetworkUpdateZDecodeErrorZ represents the result of a fallible operation,
5850 * containing a crate::c_types::derived::COption_NetworkUpdateZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
5851 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5853 typedef struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ {
5855 * The contents of this CResult_COption_NetworkUpdateZDecodeErrorZ, accessible via either
5856 * `err` or `result` depending on the state of `result_ok`.
5858 union LDKCResult_COption_NetworkUpdateZDecodeErrorZPtr contents;
5860 * Whether this CResult_COption_NetworkUpdateZDecodeErrorZ represents a success state.
5863 } LDKCResult_COption_NetworkUpdateZDecodeErrorZ;
5866 * The contents of CResult_TxOutUtxoLookupErrorZ
5868 typedef union LDKCResult_TxOutUtxoLookupErrorZPtr {
5870 * A pointer to the contents in the success state.
5871 * Reading from this pointer when `result_ok` is not set is undefined.
5873 struct LDKTxOut *result;
5875 * A pointer to the contents in the error state.
5876 * Reading from this pointer when `result_ok` is set is undefined.
5878 enum LDKUtxoLookupError *err;
5879 } LDKCResult_TxOutUtxoLookupErrorZPtr;
5882 * A CResult_TxOutUtxoLookupErrorZ represents the result of a fallible operation,
5883 * containing a crate::c_types::TxOut on success and a crate::lightning::routing::utxo::UtxoLookupError on failure.
5884 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
5886 typedef struct LDKCResult_TxOutUtxoLookupErrorZ {
5888 * The contents of this CResult_TxOutUtxoLookupErrorZ, accessible via either
5889 * `err` or `result` depending on the state of `result_ok`.
5891 union LDKCResult_TxOutUtxoLookupErrorZPtr contents;
5893 * Whether this CResult_TxOutUtxoLookupErrorZ represents a success state.
5896 } LDKCResult_TxOutUtxoLookupErrorZ;
5901 * Represents a future resolution of a [`UtxoLookup::get_utxo`] query resolving async.
5903 * See [`UtxoResult::Async`] and [`UtxoFuture::resolve`] for more info.
5905 typedef struct MUST_USE_STRUCT LDKUtxoFuture {
5907 * A pointer to the opaque Rust object.
5908 * Nearly everywhere, inner must be non-null, however in places where
5909 * the Rust equivalent takes an Option, it may be set to null to indicate None.
5911 LDKnativeUtxoFuture *inner;
5913 * Indicates that this is the only struct which contains the same pointer.
5914 * Rust functions which take ownership of an object provided via an argument require
5915 * this to be true and invalidate the object pointed to by inner.
5921 * The result of a [`UtxoLookup::get_utxo`] call. A call may resolve either synchronously,
5922 * returning the `Sync` variant, or asynchronously, returning an [`UtxoFuture`] in the `Async`
5925 typedef enum LDKUtxoResult_Tag {
5927 * A result which was resolved synchronously. It either includes a [`TxOut`] for the output
5928 * requested or a [`UtxoLookupError`].
5932 * A result which will be resolved asynchronously. It includes a [`UtxoFuture`], a `clone` of
5933 * which you must keep locally and call [`UtxoFuture::resolve`] on once the lookup completes.
5935 * Note that in order to avoid runaway memory usage, the number of parallel checks is limited,
5936 * but only fairly loosely. Because a pending checks block all message processing, leaving
5937 * checks pending for an extended time may cause DoS of other functions. It is recommended you
5938 * keep a tight timeout on lookups, on the order of a few seconds.
5940 LDKUtxoResult_Async,
5942 * Must be last for serialization purposes
5944 LDKUtxoResult_Sentinel,
5945 } LDKUtxoResult_Tag;
5947 typedef struct MUST_USE_STRUCT LDKUtxoResult {
5948 LDKUtxoResult_Tag tag;
5951 struct LDKCResult_TxOutUtxoLookupErrorZ sync;
5954 struct LDKUtxoFuture async;
5960 * The `UtxoLookup` trait defines behavior for accessing on-chain UTXOs.
5962 typedef struct LDKUtxoLookup {
5964 * An opaque pointer which is passed to your function implementations as an argument.
5965 * This has no meaning in the LDK, and can be NULL or any other value.
5969 * Returns the transaction output of a funding transaction encoded by [`short_channel_id`].
5970 * Returns an error if `chain_hash` is for a different chain or if such a transaction output is
5973 * [`short_channel_id`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#definition-of-short_channel_id
5975 struct LDKUtxoResult (*get_utxo)(const void *this_arg, const uint8_t (*chain_hash)[32], uint64_t short_channel_id);
5977 * Frees any resources associated with this object given its this_arg pointer.
5978 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
5980 void (*free)(void *this_arg);
5984 * An enum which can either contain a crate::lightning::routing::utxo::UtxoLookup or not
5986 typedef enum LDKCOption_UtxoLookupZ_Tag {
5988 * When we're in this state, this COption_UtxoLookupZ contains a crate::lightning::routing::utxo::UtxoLookup
5990 LDKCOption_UtxoLookupZ_Some,
5992 * When we're in this state, this COption_UtxoLookupZ contains nothing
5994 LDKCOption_UtxoLookupZ_None,
5996 * Must be last for serialization purposes
5998 LDKCOption_UtxoLookupZ_Sentinel,
5999 } LDKCOption_UtxoLookupZ_Tag;
6001 typedef struct LDKCOption_UtxoLookupZ {
6002 LDKCOption_UtxoLookupZ_Tag tag;
6005 struct LDKUtxoLookup some;
6008 } LDKCOption_UtxoLookupZ;
6011 * The contents of CResult_NoneLightningErrorZ
6013 typedef union LDKCResult_NoneLightningErrorZPtr {
6015 * Note that this value is always NULL, as there are no contents in the OK variant
6019 * A pointer to the contents in the error state.
6020 * Reading from this pointer when `result_ok` is set is undefined.
6022 struct LDKLightningError *err;
6023 } LDKCResult_NoneLightningErrorZPtr;
6026 * A CResult_NoneLightningErrorZ represents the result of a fallible operation,
6027 * containing a () on success and a crate::lightning::ln::msgs::LightningError on failure.
6028 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6030 typedef struct LDKCResult_NoneLightningErrorZ {
6032 * The contents of this CResult_NoneLightningErrorZ, accessible via either
6033 * `err` or `result` depending on the state of `result_ok`.
6035 union LDKCResult_NoneLightningErrorZPtr contents;
6037 * Whether this CResult_NoneLightningErrorZ represents a success state.
6040 } LDKCResult_NoneLightningErrorZ;
6043 * The contents of CResult_boolLightningErrorZ
6045 typedef union LDKCResult_boolLightningErrorZPtr {
6047 * A pointer to the contents in the success state.
6048 * Reading from this pointer when `result_ok` is not set is undefined.
6052 * A pointer to the contents in the error state.
6053 * Reading from this pointer when `result_ok` is set is undefined.
6055 struct LDKLightningError *err;
6056 } LDKCResult_boolLightningErrorZPtr;
6059 * A CResult_boolLightningErrorZ represents the result of a fallible operation,
6060 * containing a bool on success and a crate::lightning::ln::msgs::LightningError on failure.
6061 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
6063 typedef struct LDKCResult_boolLightningErrorZ {
6065 * The contents of this CResult_boolLightningErrorZ, accessible via either
6066 * `err` or `result` depending on the state of `result_ok`.
6068 union LDKCResult_boolLightningErrorZPtr contents;
6070 * Whether this CResult_boolLightningErrorZ represents a success state.
6073 } LDKCResult_boolLightningErrorZ;
6078 * A [`channel_announcement`] message to be sent to or received from a peer.
6080 * [`channel_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message
6082 typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
6084 * A pointer to the opaque Rust object.
6085 * Nearly everywhere, inner must be non-null, however in places where
6086 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6088 LDKnativeChannelAnnouncement *inner;
6090 * Indicates that this is the only struct which contains the same pointer.
6091 * Rust functions which take ownership of an object provided via an argument require
6092 * this to be true and invalidate the object pointed to by inner.
6095 } LDKChannelAnnouncement;
6098 * A tuple of 3 elements. See the individual fields for the types contained.
6100 typedef struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ {
6102 * The element at position 0
6104 struct LDKChannelAnnouncement a;
6106 * The element at position 1
6108 struct LDKChannelUpdate b;
6110 * The element at position 2
6112 struct LDKChannelUpdate c;
6113 } LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
6116 * An enum which can either contain a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ or not
6118 typedef enum LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag {
6120 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
6122 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Some,
6124 * When we're in this state, this COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ contains nothing
6126 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_None,
6128 * Must be last for serialization purposes
6130 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Sentinel,
6131 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag;
6133 typedef struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
6134 LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_Tag tag;
6137 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ some;
6140 } LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ;
6145 * An [`accept_channel`] message to be sent to or received from a peer.
6147 * Used in V1 channel establishment
6149 * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message
6151 typedef struct MUST_USE_STRUCT LDKAcceptChannel {
6153 * A pointer to the opaque Rust object.
6154 * Nearly everywhere, inner must be non-null, however in places where
6155 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6157 LDKnativeAcceptChannel *inner;
6159 * Indicates that this is the only struct which contains the same pointer.
6160 * Rust functions which take ownership of an object provided via an argument require
6161 * this to be true and invalidate the object pointed to by inner.
6169 * An accept_channel2 message to be sent by or received from the channel accepter.
6171 * Used in V2 channel establishment
6174 typedef struct MUST_USE_STRUCT LDKAcceptChannelV2 {
6176 * A pointer to the opaque Rust object.
6177 * Nearly everywhere, inner must be non-null, however in places where
6178 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6180 LDKnativeAcceptChannelV2 *inner;
6182 * Indicates that this is the only struct which contains the same pointer.
6183 * Rust functions which take ownership of an object provided via an argument require
6184 * this to be true and invalidate the object pointed to by inner.
6187 } LDKAcceptChannelV2;
6192 * An [`open_channel`] message to be sent to or received from a peer.
6194 * Used in V1 channel establishment
6196 * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message
6198 typedef struct MUST_USE_STRUCT LDKOpenChannel {
6200 * A pointer to the opaque Rust object.
6201 * Nearly everywhere, inner must be non-null, however in places where
6202 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6204 LDKnativeOpenChannel *inner;
6206 * Indicates that this is the only struct which contains the same pointer.
6207 * Rust functions which take ownership of an object provided via an argument require
6208 * this to be true and invalidate the object pointed to by inner.
6216 * An open_channel2 message to be sent by or received from the channel initiator.
6218 * Used in V2 channel establishment
6221 typedef struct MUST_USE_STRUCT LDKOpenChannelV2 {
6223 * A pointer to the opaque Rust object.
6224 * Nearly everywhere, inner must be non-null, however in places where
6225 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6227 LDKnativeOpenChannelV2 *inner;
6229 * Indicates that this is the only struct which contains the same pointer.
6230 * Rust functions which take ownership of an object provided via an argument require
6231 * this to be true and invalidate the object pointed to by inner.
6239 * A [`funding_created`] message to be sent to or received from a peer.
6241 * Used in V1 channel establishment
6243 * [`funding_created`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_created-message
6245 typedef struct MUST_USE_STRUCT LDKFundingCreated {
6247 * A pointer to the opaque Rust object.
6248 * Nearly everywhere, inner must be non-null, however in places where
6249 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6251 LDKnativeFundingCreated *inner;
6253 * Indicates that this is the only struct which contains the same pointer.
6254 * Rust functions which take ownership of an object provided via an argument require
6255 * this to be true and invalidate the object pointed to by inner.
6258 } LDKFundingCreated;
6263 * A [`funding_signed`] message to be sent to or received from a peer.
6265 * Used in V1 channel establishment
6267 * [`funding_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-funding_signed-message
6269 typedef struct MUST_USE_STRUCT LDKFundingSigned {
6271 * A pointer to the opaque Rust object.
6272 * Nearly everywhere, inner must be non-null, however in places where
6273 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6275 LDKnativeFundingSigned *inner;
6277 * Indicates that this is the only struct which contains the same pointer.
6278 * Rust functions which take ownership of an object provided via an argument require
6279 * this to be true and invalidate the object pointed to by inner.
6287 * An stfu (quiescence) message to be sent by or received from the stfu initiator.
6289 typedef struct MUST_USE_STRUCT LDKStfu {
6291 * A pointer to the opaque Rust object.
6292 * Nearly everywhere, inner must be non-null, however in places where
6293 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6295 LDKnativeStfu *inner;
6297 * Indicates that this is the only struct which contains the same pointer.
6298 * Rust functions which take ownership of an object provided via an argument require
6299 * this to be true and invalidate the object pointed to by inner.
6307 * A splice message to be sent by or received from the stfu initiator (splice initiator).
6309 typedef struct MUST_USE_STRUCT LDKSplice {
6311 * A pointer to the opaque Rust object.
6312 * Nearly everywhere, inner must be non-null, however in places where
6313 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6315 LDKnativeSplice *inner;
6317 * Indicates that this is the only struct which contains the same pointer.
6318 * Rust functions which take ownership of an object provided via an argument require
6319 * this to be true and invalidate the object pointed to by inner.
6327 * A splice_ack message to be received by or sent to the splice initiator.
6330 typedef struct MUST_USE_STRUCT LDKSpliceAck {
6332 * A pointer to the opaque Rust object.
6333 * Nearly everywhere, inner must be non-null, however in places where
6334 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6336 LDKnativeSpliceAck *inner;
6338 * Indicates that this is the only struct which contains the same pointer.
6339 * Rust functions which take ownership of an object provided via an argument require
6340 * this to be true and invalidate the object pointed to by inner.
6348 * A splice_locked message to be sent to or received from a peer.
6351 typedef struct MUST_USE_STRUCT LDKSpliceLocked {
6353 * A pointer to the opaque Rust object.
6354 * Nearly everywhere, inner must be non-null, however in places where
6355 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6357 LDKnativeSpliceLocked *inner;
6359 * Indicates that this is the only struct which contains the same pointer.
6360 * Rust functions which take ownership of an object provided via an argument require
6361 * this to be true and invalidate the object pointed to by inner.
6369 * A tx_add_input message for adding an input during interactive transaction construction
6372 typedef struct MUST_USE_STRUCT LDKTxAddInput {
6374 * A pointer to the opaque Rust object.
6375 * Nearly everywhere, inner must be non-null, however in places where
6376 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6378 LDKnativeTxAddInput *inner;
6380 * Indicates that this is the only struct which contains the same pointer.
6381 * Rust functions which take ownership of an object provided via an argument require
6382 * this to be true and invalidate the object pointed to by inner.
6390 * A tx_add_output message for adding an output during interactive transaction construction.
6393 typedef struct MUST_USE_STRUCT LDKTxAddOutput {
6395 * A pointer to the opaque Rust object.
6396 * Nearly everywhere, inner must be non-null, however in places where
6397 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6399 LDKnativeTxAddOutput *inner;
6401 * Indicates that this is the only struct which contains the same pointer.
6402 * Rust functions which take ownership of an object provided via an argument require
6403 * this to be true and invalidate the object pointed to by inner.
6411 * A tx_remove_input message for removing an input during interactive transaction construction.
6414 typedef struct MUST_USE_STRUCT LDKTxRemoveInput {
6416 * A pointer to the opaque Rust object.
6417 * Nearly everywhere, inner must be non-null, however in places where
6418 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6420 LDKnativeTxRemoveInput *inner;
6422 * Indicates that this is the only struct which contains the same pointer.
6423 * Rust functions which take ownership of an object provided via an argument require
6424 * this to be true and invalidate the object pointed to by inner.
6432 * A tx_remove_output message for removing an output during interactive transaction construction.
6435 typedef struct MUST_USE_STRUCT LDKTxRemoveOutput {
6437 * A pointer to the opaque Rust object.
6438 * Nearly everywhere, inner must be non-null, however in places where
6439 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6441 LDKnativeTxRemoveOutput *inner;
6443 * Indicates that this is the only struct which contains the same pointer.
6444 * Rust functions which take ownership of an object provided via an argument require
6445 * this to be true and invalidate the object pointed to by inner.
6448 } LDKTxRemoveOutput;
6453 * A tx_complete message signalling the conclusion of a peer's transaction contributions during
6454 * interactive transaction construction.
6457 typedef struct MUST_USE_STRUCT LDKTxComplete {
6459 * A pointer to the opaque Rust object.
6460 * Nearly everywhere, inner must be non-null, however in places where
6461 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6463 LDKnativeTxComplete *inner;
6465 * Indicates that this is the only struct which contains the same pointer.
6466 * Rust functions which take ownership of an object provided via an argument require
6467 * this to be true and invalidate the object pointed to by inner.
6475 * A tx_signatures message containing the sender's signatures for a transaction constructed with
6476 * interactive transaction construction.
6479 typedef struct MUST_USE_STRUCT LDKTxSignatures {
6481 * A pointer to the opaque Rust object.
6482 * Nearly everywhere, inner must be non-null, however in places where
6483 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6485 LDKnativeTxSignatures *inner;
6487 * Indicates that this is the only struct which contains the same pointer.
6488 * Rust functions which take ownership of an object provided via an argument require
6489 * this to be true and invalidate the object pointed to by inner.
6497 * A tx_init_rbf message which initiates a replacement of the transaction after it's been
6501 typedef struct MUST_USE_STRUCT LDKTxInitRbf {
6503 * A pointer to the opaque Rust object.
6504 * Nearly everywhere, inner must be non-null, however in places where
6505 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6507 LDKnativeTxInitRbf *inner;
6509 * Indicates that this is the only struct which contains the same pointer.
6510 * Rust functions which take ownership of an object provided via an argument require
6511 * this to be true and invalidate the object pointed to by inner.
6519 * A tx_ack_rbf message which acknowledges replacement of the transaction after it's been
6523 typedef struct MUST_USE_STRUCT LDKTxAckRbf {
6525 * A pointer to the opaque Rust object.
6526 * Nearly everywhere, inner must be non-null, however in places where
6527 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6529 LDKnativeTxAckRbf *inner;
6531 * Indicates that this is the only struct which contains the same pointer.
6532 * Rust functions which take ownership of an object provided via an argument require
6533 * this to be true and invalidate the object pointed to by inner.
6541 * A tx_abort message which signals the cancellation of an in-progress transaction negotiation.
6544 typedef struct MUST_USE_STRUCT LDKTxAbort {
6546 * A pointer to the opaque Rust object.
6547 * Nearly everywhere, inner must be non-null, however in places where
6548 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6550 LDKnativeTxAbort *inner;
6552 * Indicates that this is the only struct which contains the same pointer.
6553 * Rust functions which take ownership of an object provided via an argument require
6554 * this to be true and invalidate the object pointed to by inner.
6562 * A [`channel_ready`] message to be sent to or received from a peer.
6564 * [`channel_ready`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-channel_ready-message
6566 typedef struct MUST_USE_STRUCT LDKChannelReady {
6568 * A pointer to the opaque Rust object.
6569 * Nearly everywhere, inner must be non-null, however in places where
6570 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6572 LDKnativeChannelReady *inner;
6574 * Indicates that this is the only struct which contains the same pointer.
6575 * Rust functions which take ownership of an object provided via an argument require
6576 * this to be true and invalidate the object pointed to by inner.
6584 * An [`announcement_signatures`] message to be sent to or received from a peer.
6586 * [`announcement_signatures`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-announcement_signatures-message
6588 typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
6590 * A pointer to the opaque Rust object.
6591 * Nearly everywhere, inner must be non-null, however in places where
6592 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6594 LDKnativeAnnouncementSignatures *inner;
6596 * Indicates that this is the only struct which contains the same pointer.
6597 * Rust functions which take ownership of an object provided via an argument require
6598 * this to be true and invalidate the object pointed to by inner.
6601 } LDKAnnouncementSignatures;
6606 * Struct used to return values from [`RevokeAndACK`] messages, containing a bunch of commitment
6607 * transaction updates if they were pending.
6609 typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
6611 * A pointer to the opaque Rust object.
6612 * Nearly everywhere, inner must be non-null, however in places where
6613 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6615 LDKnativeCommitmentUpdate *inner;
6617 * Indicates that this is the only struct which contains the same pointer.
6618 * Rust functions which take ownership of an object provided via an argument require
6619 * this to be true and invalidate the object pointed to by inner.
6622 } LDKCommitmentUpdate;
6627 * A [`revoke_and_ack`] message to be sent to or received from a peer.
6629 * [`revoke_and_ack`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#completing-the-transition-to-the-updated-state-revoke_and_ack
6631 typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
6633 * A pointer to the opaque Rust object.
6634 * Nearly everywhere, inner must be non-null, however in places where
6635 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6637 LDKnativeRevokeAndACK *inner;
6639 * Indicates that this is the only struct which contains the same pointer.
6640 * Rust functions which take ownership of an object provided via an argument require
6641 * this to be true and invalidate the object pointed to by inner.
6649 * A [`closing_signed`] message to be sent to or received from a peer.
6651 * [`closing_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-negotiation-closing_signed
6653 typedef struct MUST_USE_STRUCT LDKClosingSigned {
6655 * A pointer to the opaque Rust object.
6656 * Nearly everywhere, inner must be non-null, however in places where
6657 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6659 LDKnativeClosingSigned *inner;
6661 * Indicates that this is the only struct which contains the same pointer.
6662 * Rust functions which take ownership of an object provided via an argument require
6663 * this to be true and invalidate the object pointed to by inner.
6671 * A [`shutdown`] message to be sent to or received from a peer.
6673 * [`shutdown`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#closing-initiation-shutdown
6675 typedef struct MUST_USE_STRUCT LDKShutdown {
6677 * A pointer to the opaque Rust object.
6678 * Nearly everywhere, inner must be non-null, however in places where
6679 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6681 LDKnativeShutdown *inner;
6683 * Indicates that this is the only struct which contains the same pointer.
6684 * Rust functions which take ownership of an object provided via an argument require
6685 * this to be true and invalidate the object pointed to by inner.
6693 * A [`channel_reestablish`] message to be sent to or received from a peer.
6695 * [`channel_reestablish`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#message-retransmission
6697 typedef struct MUST_USE_STRUCT LDKChannelReestablish {
6699 * A pointer to the opaque Rust object.
6700 * Nearly everywhere, inner must be non-null, however in places where
6701 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6703 LDKnativeChannelReestablish *inner;
6705 * Indicates that this is the only struct which contains the same pointer.
6706 * Rust functions which take ownership of an object provided via an argument require
6707 * this to be true and invalidate the object pointed to by inner.
6710 } LDKChannelReestablish;
6715 * A [`node_announcement`] message to be sent to or received from a peer.
6717 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
6719 typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
6721 * A pointer to the opaque Rust object.
6722 * Nearly everywhere, inner must be non-null, however in places where
6723 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6725 LDKnativeNodeAnnouncement *inner;
6727 * Indicates that this is the only struct which contains the same pointer.
6728 * Rust functions which take ownership of an object provided via an argument require
6729 * this to be true and invalidate the object pointed to by inner.
6732 } LDKNodeAnnouncement;
6737 * An [`error`] message to be sent to or received from a peer.
6739 * [`error`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
6741 typedef struct MUST_USE_STRUCT LDKErrorMessage {
6743 * A pointer to the opaque Rust object.
6744 * Nearly everywhere, inner must be non-null, however in places where
6745 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6747 LDKnativeErrorMessage *inner;
6749 * Indicates that this is the only struct which contains the same pointer.
6750 * Rust functions which take ownership of an object provided via an argument require
6751 * this to be true and invalidate the object pointed to by inner.
6759 * A [`warning`] message to be sent to or received from a peer.
6761 * [`warning`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-error-and-warning-messages
6763 typedef struct MUST_USE_STRUCT LDKWarningMessage {
6765 * A pointer to the opaque Rust object.
6766 * Nearly everywhere, inner must be non-null, however in places where
6767 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6769 LDKnativeWarningMessage *inner;
6771 * Indicates that this is the only struct which contains the same pointer.
6772 * Rust functions which take ownership of an object provided via an argument require
6773 * this to be true and invalidate the object pointed to by inner.
6776 } LDKWarningMessage;
6779 * Used to put an error message in a [`LightningError`].
6781 typedef enum LDKErrorAction_Tag {
6783 * The peer took some action which made us think they were useless. Disconnect them.
6785 LDKErrorAction_DisconnectPeer,
6787 * The peer did something incorrect. Tell them without closing any channels and disconnect them.
6789 LDKErrorAction_DisconnectPeerWithWarning,
6791 * The peer did something harmless that we weren't able to process, just log and ignore
6793 LDKErrorAction_IgnoreError,
6795 * The peer did something harmless that we weren't able to meaningfully process.
6796 * If the error is logged, log it at the given level.
6798 LDKErrorAction_IgnoreAndLog,
6800 * The peer provided us with a gossip message which we'd already seen. In most cases this
6801 * should be ignored, but it may result in the message being forwarded if it is a duplicate of
6802 * our own channel announcements.
6804 LDKErrorAction_IgnoreDuplicateGossip,
6806 * The peer did something incorrect. Tell them.
6808 LDKErrorAction_SendErrorMessage,
6810 * The peer did something incorrect. Tell them without closing any channels.
6812 LDKErrorAction_SendWarningMessage,
6814 * Must be last for serialization purposes
6816 LDKErrorAction_Sentinel,
6817 } LDKErrorAction_Tag;
6819 typedef struct LDKErrorAction_LDKDisconnectPeer_Body {
6821 * An error message which we should make an effort to send before we disconnect.
6823 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
6825 struct LDKErrorMessage msg;
6826 } LDKErrorAction_LDKDisconnectPeer_Body;
6828 typedef struct LDKErrorAction_LDKDisconnectPeerWithWarning_Body {
6830 * A warning message which we should make an effort to send before we disconnect.
6832 struct LDKWarningMessage msg;
6833 } LDKErrorAction_LDKDisconnectPeerWithWarning_Body;
6835 typedef struct LDKErrorAction_LDKSendErrorMessage_Body {
6837 * The message to send.
6839 struct LDKErrorMessage msg;
6840 } LDKErrorAction_LDKSendErrorMessage_Body;
6842 typedef struct LDKErrorAction_LDKSendWarningMessage_Body {
6844 * The message to send.
6846 struct LDKWarningMessage msg;
6848 * The peer may have done something harmless that we weren't able to meaningfully process,
6849 * though we should still tell them about it.
6850 * If this event is logged, log it at the given level.
6852 enum LDKLevel log_level;
6853 } LDKErrorAction_LDKSendWarningMessage_Body;
6855 typedef struct MUST_USE_STRUCT LDKErrorAction {
6856 LDKErrorAction_Tag tag;
6858 LDKErrorAction_LDKDisconnectPeer_Body disconnect_peer;
6859 LDKErrorAction_LDKDisconnectPeerWithWarning_Body disconnect_peer_with_warning;
6861 enum LDKLevel ignore_and_log;
6863 LDKErrorAction_LDKSendErrorMessage_Body send_error_message;
6864 LDKErrorAction_LDKSendWarningMessage_Body send_warning_message;
6871 * A [`query_channel_range`] message is used to query a peer for channel
6872 * UTXOs in a range of blocks. The recipient of a query makes a best
6873 * effort to reply to the query using one or more [`ReplyChannelRange`]
6876 * [`query_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6878 typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
6880 * A pointer to the opaque Rust object.
6881 * Nearly everywhere, inner must be non-null, however in places where
6882 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6884 LDKnativeQueryChannelRange *inner;
6886 * Indicates that this is the only struct which contains the same pointer.
6887 * Rust functions which take ownership of an object provided via an argument require
6888 * this to be true and invalidate the object pointed to by inner.
6891 } LDKQueryChannelRange;
6896 * A [`query_short_channel_ids`] message is used to query a peer for
6897 * routing gossip messages related to one or more `short_channel_id`s.
6899 * The query recipient will reply with the latest, if available,
6900 * [`ChannelAnnouncement`], [`ChannelUpdate`] and [`NodeAnnouncement`] messages
6901 * it maintains for the requested `short_channel_id`s followed by a
6902 * [`ReplyShortChannelIdsEnd`] message. The `short_channel_id`s sent in
6903 * this query are encoded. We only support `encoding_type=0` uncompressed
6904 * serialization and do not support `encoding_type=1` zlib serialization.
6906 * [`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
6908 typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
6910 * A pointer to the opaque Rust object.
6911 * Nearly everywhere, inner must be non-null, however in places where
6912 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6914 LDKnativeQueryShortChannelIds *inner;
6916 * Indicates that this is the only struct which contains the same pointer.
6917 * Rust functions which take ownership of an object provided via an argument require
6918 * this to be true and invalidate the object pointed to by inner.
6921 } LDKQueryShortChannelIds;
6926 * A [`reply_channel_range`] message is a reply to a [`QueryChannelRange`]
6929 * Multiple `reply_channel_range` messages can be sent in reply
6930 * to a single [`QueryChannelRange`] message. The query recipient makes a
6931 * best effort to respond based on their local network view which may
6932 * not be a perfect view of the network. The `short_channel_id`s in the
6933 * reply are encoded. We only support `encoding_type=0` uncompressed
6934 * serialization and do not support `encoding_type=1` zlib serialization.
6936 * [`reply_channel_range`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-query_channel_range-and-reply_channel_range-messages
6938 typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
6940 * A pointer to the opaque Rust object.
6941 * Nearly everywhere, inner must be non-null, however in places where
6942 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6944 LDKnativeReplyChannelRange *inner;
6946 * Indicates that this is the only struct which contains the same pointer.
6947 * Rust functions which take ownership of an object provided via an argument require
6948 * this to be true and invalidate the object pointed to by inner.
6951 } LDKReplyChannelRange;
6956 * A [`gossip_timestamp_filter`] message is used by a node to request
6957 * gossip relay for messages in the requested time range when the
6958 * `gossip_queries` feature has been negotiated.
6960 * [`gossip_timestamp_filter`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-gossip_timestamp_filter-message
6962 typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
6964 * A pointer to the opaque Rust object.
6965 * Nearly everywhere, inner must be non-null, however in places where
6966 * the Rust equivalent takes an Option, it may be set to null to indicate None.
6968 LDKnativeGossipTimestampFilter *inner;
6970 * Indicates that this is the only struct which contains the same pointer.
6971 * Rust functions which take ownership of an object provided via an argument require
6972 * this to be true and invalidate the object pointed to by inner.
6975 } LDKGossipTimestampFilter;
6978 * An event generated by ChannelManager which indicates a message should be sent to a peer (or
6979 * broadcast to most peers).
6980 * These events are handled by PeerManager::process_events if you are using a PeerManager.
6982 typedef enum LDKMessageSendEvent_Tag {
6984 * Used to indicate that we've accepted a channel open and should send the accept_channel
6985 * message provided to the given peer.
6987 LDKMessageSendEvent_SendAcceptChannel,
6989 * Used to indicate that we've accepted a V2 channel open and should send the accept_channel2
6990 * message provided to the given peer.
6992 LDKMessageSendEvent_SendAcceptChannelV2,
6994 * Used to indicate that we've initiated a channel open and should send the open_channel
6995 * message provided to the given peer.
6997 LDKMessageSendEvent_SendOpenChannel,
6999 * Used to indicate that we've initiated a V2 channel open and should send the open_channel2
7000 * message provided to the given peer.
7002 LDKMessageSendEvent_SendOpenChannelV2,
7004 * Used to indicate that a funding_created message should be sent to the peer with the given node_id.
7006 LDKMessageSendEvent_SendFundingCreated,
7008 * Used to indicate that a funding_signed message should be sent to the peer with the given node_id.
7010 LDKMessageSendEvent_SendFundingSigned,
7012 * Used to indicate that a stfu message should be sent to the peer with the given node id.
7014 LDKMessageSendEvent_SendStfu,
7016 * Used to indicate that a splice message should be sent to the peer with the given node id.
7018 LDKMessageSendEvent_SendSplice,
7020 * Used to indicate that a splice_ack message should be sent to the peer with the given node id.
7022 LDKMessageSendEvent_SendSpliceAck,
7024 * Used to indicate that a splice_locked message should be sent to the peer with the given node id.
7026 LDKMessageSendEvent_SendSpliceLocked,
7028 * Used to indicate that a tx_add_input message should be sent to the peer with the given node_id.
7030 LDKMessageSendEvent_SendTxAddInput,
7032 * Used to indicate that a tx_add_output message should be sent to the peer with the given node_id.
7034 LDKMessageSendEvent_SendTxAddOutput,
7036 * Used to indicate that a tx_remove_input message should be sent to the peer with the given node_id.
7038 LDKMessageSendEvent_SendTxRemoveInput,
7040 * Used to indicate that a tx_remove_output message should be sent to the peer with the given node_id.
7042 LDKMessageSendEvent_SendTxRemoveOutput,
7044 * Used to indicate that a tx_complete message should be sent to the peer with the given node_id.
7046 LDKMessageSendEvent_SendTxComplete,
7048 * Used to indicate that a tx_signatures message should be sent to the peer with the given node_id.
7050 LDKMessageSendEvent_SendTxSignatures,
7052 * Used to indicate that a tx_init_rbf message should be sent to the peer with the given node_id.
7054 LDKMessageSendEvent_SendTxInitRbf,
7056 * Used to indicate that a tx_ack_rbf message should be sent to the peer with the given node_id.
7058 LDKMessageSendEvent_SendTxAckRbf,
7060 * Used to indicate that a tx_abort message should be sent to the peer with the given node_id.
7062 LDKMessageSendEvent_SendTxAbort,
7064 * Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
7066 LDKMessageSendEvent_SendChannelReady,
7068 * Used to indicate that an announcement_signatures message should be sent to the peer with the given node_id.
7070 LDKMessageSendEvent_SendAnnouncementSignatures,
7072 * Used to indicate that a series of HTLC update messages, as well as a commitment_signed
7073 * message should be sent to the peer with the given node_id.
7075 LDKMessageSendEvent_UpdateHTLCs,
7077 * Used to indicate that a revoke_and_ack message should be sent to the peer with the given node_id.
7079 LDKMessageSendEvent_SendRevokeAndACK,
7081 * Used to indicate that a closing_signed message should be sent to the peer with the given node_id.
7083 LDKMessageSendEvent_SendClosingSigned,
7085 * Used to indicate that a shutdown message should be sent to the peer with the given node_id.
7087 LDKMessageSendEvent_SendShutdown,
7089 * Used to indicate that a channel_reestablish message should be sent to the peer with the given node_id.
7091 LDKMessageSendEvent_SendChannelReestablish,
7093 * Used to send a channel_announcement and channel_update to a specific peer, likely on
7094 * initial connection to ensure our peers know about our channels.
7096 LDKMessageSendEvent_SendChannelAnnouncement,
7098 * Used to indicate that a channel_announcement and channel_update should be broadcast to all
7099 * peers (except the peer with node_id either msg.contents.node_id_1 or msg.contents.node_id_2).
7101 * Note that after doing so, you very likely (unless you did so very recently) want to
7102 * broadcast a node_announcement (e.g. via [`PeerManager::broadcast_node_announcement`]). This
7103 * ensures that any nodes which see our channel_announcement also have a relevant
7104 * node_announcement, including relevant feature flags which may be important for routing
7107 * [`PeerManager::broadcast_node_announcement`]: crate::ln::peer_handler::PeerManager::broadcast_node_announcement
7109 LDKMessageSendEvent_BroadcastChannelAnnouncement,
7111 * Used to indicate that a channel_update should be broadcast to all peers.
7113 LDKMessageSendEvent_BroadcastChannelUpdate,
7115 * Used to indicate that a node_announcement should be broadcast to all peers.
7117 LDKMessageSendEvent_BroadcastNodeAnnouncement,
7119 * Used to indicate that a channel_update should be sent to a single peer.
7120 * In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
7121 * private channel and we shouldn't be informing all of our peers of channel parameters.
7123 LDKMessageSendEvent_SendChannelUpdate,
7125 * Broadcast an error downstream to be handled
7127 LDKMessageSendEvent_HandleError,
7129 * Query a peer for channels with funding transaction UTXOs in a block range.
7131 LDKMessageSendEvent_SendChannelRangeQuery,
7133 * Request routing gossip messages from a peer for a list of channels identified by
7134 * their short_channel_ids.
7136 LDKMessageSendEvent_SendShortIdsQuery,
7138 * Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
7139 * emitted during processing of the query.
7141 LDKMessageSendEvent_SendReplyChannelRange,
7143 * Sends a timestamp filter for inbound gossip. This should be sent on each new connection to
7144 * enable receiving gossip messages from the peer.
7146 LDKMessageSendEvent_SendGossipTimestampFilter,
7148 * Must be last for serialization purposes
7150 LDKMessageSendEvent_Sentinel,
7151 } LDKMessageSendEvent_Tag;
7153 typedef struct LDKMessageSendEvent_LDKSendAcceptChannel_Body {
7155 * The node_id of the node which should receive this message
7157 struct LDKPublicKey node_id;
7159 * The message which should be sent.
7161 struct LDKAcceptChannel msg;
7162 } LDKMessageSendEvent_LDKSendAcceptChannel_Body;
7164 typedef struct LDKMessageSendEvent_LDKSendAcceptChannelV2_Body {
7166 * The node_id of the node which should receive this message
7168 struct LDKPublicKey node_id;
7170 * The message which should be sent.
7172 struct LDKAcceptChannelV2 msg;
7173 } LDKMessageSendEvent_LDKSendAcceptChannelV2_Body;
7175 typedef struct LDKMessageSendEvent_LDKSendOpenChannel_Body {
7177 * The node_id of the node which should receive this message
7179 struct LDKPublicKey node_id;
7181 * The message which should be sent.
7183 struct LDKOpenChannel msg;
7184 } LDKMessageSendEvent_LDKSendOpenChannel_Body;
7186 typedef struct LDKMessageSendEvent_LDKSendOpenChannelV2_Body {
7188 * The node_id of the node which should receive this message
7190 struct LDKPublicKey node_id;
7192 * The message which should be sent.
7194 struct LDKOpenChannelV2 msg;
7195 } LDKMessageSendEvent_LDKSendOpenChannelV2_Body;
7197 typedef struct LDKMessageSendEvent_LDKSendFundingCreated_Body {
7199 * The node_id of the node which should receive this message
7201 struct LDKPublicKey node_id;
7203 * The message which should be sent.
7205 struct LDKFundingCreated msg;
7206 } LDKMessageSendEvent_LDKSendFundingCreated_Body;
7208 typedef struct LDKMessageSendEvent_LDKSendFundingSigned_Body {
7210 * The node_id of the node which should receive this message
7212 struct LDKPublicKey node_id;
7214 * The message which should be sent.
7216 struct LDKFundingSigned msg;
7217 } LDKMessageSendEvent_LDKSendFundingSigned_Body;
7219 typedef struct LDKMessageSendEvent_LDKSendStfu_Body {
7221 * The node_id of the node which should receive this message
7223 struct LDKPublicKey node_id;
7225 * The message which should be sent.
7228 } LDKMessageSendEvent_LDKSendStfu_Body;
7230 typedef struct LDKMessageSendEvent_LDKSendSplice_Body {
7232 * The node_id of the node which should receive this message
7234 struct LDKPublicKey node_id;
7236 * The message which should be sent.
7238 struct LDKSplice msg;
7239 } LDKMessageSendEvent_LDKSendSplice_Body;
7241 typedef struct LDKMessageSendEvent_LDKSendSpliceAck_Body {
7243 * The node_id of the node which should receive this message
7245 struct LDKPublicKey node_id;
7247 * The message which should be sent.
7249 struct LDKSpliceAck msg;
7250 } LDKMessageSendEvent_LDKSendSpliceAck_Body;
7252 typedef struct LDKMessageSendEvent_LDKSendSpliceLocked_Body {
7254 * The node_id of the node which should receive this message
7256 struct LDKPublicKey node_id;
7258 * The message which should be sent.
7260 struct LDKSpliceLocked msg;
7261 } LDKMessageSendEvent_LDKSendSpliceLocked_Body;
7263 typedef struct LDKMessageSendEvent_LDKSendTxAddInput_Body {
7265 * The node_id of the node which should receive this message
7267 struct LDKPublicKey node_id;
7269 * The message which should be sent.
7271 struct LDKTxAddInput msg;
7272 } LDKMessageSendEvent_LDKSendTxAddInput_Body;
7274 typedef struct LDKMessageSendEvent_LDKSendTxAddOutput_Body {
7276 * The node_id of the node which should receive this message
7278 struct LDKPublicKey node_id;
7280 * The message which should be sent.
7282 struct LDKTxAddOutput msg;
7283 } LDKMessageSendEvent_LDKSendTxAddOutput_Body;
7285 typedef struct LDKMessageSendEvent_LDKSendTxRemoveInput_Body {
7287 * The node_id of the node which should receive this message
7289 struct LDKPublicKey node_id;
7291 * The message which should be sent.
7293 struct LDKTxRemoveInput msg;
7294 } LDKMessageSendEvent_LDKSendTxRemoveInput_Body;
7296 typedef struct LDKMessageSendEvent_LDKSendTxRemoveOutput_Body {
7298 * The node_id of the node which should receive this message
7300 struct LDKPublicKey node_id;
7302 * The message which should be sent.
7304 struct LDKTxRemoveOutput msg;
7305 } LDKMessageSendEvent_LDKSendTxRemoveOutput_Body;
7307 typedef struct LDKMessageSendEvent_LDKSendTxComplete_Body {
7309 * The node_id of the node which should receive this message
7311 struct LDKPublicKey node_id;
7313 * The message which should be sent.
7315 struct LDKTxComplete msg;
7316 } LDKMessageSendEvent_LDKSendTxComplete_Body;
7318 typedef struct LDKMessageSendEvent_LDKSendTxSignatures_Body {
7320 * The node_id of the node which should receive this message
7322 struct LDKPublicKey node_id;
7324 * The message which should be sent.
7326 struct LDKTxSignatures msg;
7327 } LDKMessageSendEvent_LDKSendTxSignatures_Body;
7329 typedef struct LDKMessageSendEvent_LDKSendTxInitRbf_Body {
7331 * The node_id of the node which should receive this message
7333 struct LDKPublicKey node_id;
7335 * The message which should be sent.
7337 struct LDKTxInitRbf msg;
7338 } LDKMessageSendEvent_LDKSendTxInitRbf_Body;
7340 typedef struct LDKMessageSendEvent_LDKSendTxAckRbf_Body {
7342 * The node_id of the node which should receive this message
7344 struct LDKPublicKey node_id;
7346 * The message which should be sent.
7348 struct LDKTxAckRbf msg;
7349 } LDKMessageSendEvent_LDKSendTxAckRbf_Body;
7351 typedef struct LDKMessageSendEvent_LDKSendTxAbort_Body {
7353 * The node_id of the node which should receive this message
7355 struct LDKPublicKey node_id;
7357 * The message which should be sent.
7359 struct LDKTxAbort msg;
7360 } LDKMessageSendEvent_LDKSendTxAbort_Body;
7362 typedef struct LDKMessageSendEvent_LDKSendChannelReady_Body {
7364 * The node_id of the node which should receive these message(s)
7366 struct LDKPublicKey node_id;
7368 * The channel_ready message which should be sent.
7370 struct LDKChannelReady msg;
7371 } LDKMessageSendEvent_LDKSendChannelReady_Body;
7373 typedef struct LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body {
7375 * The node_id of the node which should receive these message(s)
7377 struct LDKPublicKey node_id;
7379 * The announcement_signatures message which should be sent.
7381 struct LDKAnnouncementSignatures msg;
7382 } LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body;
7384 typedef struct LDKMessageSendEvent_LDKUpdateHTLCs_Body {
7386 * The node_id of the node which should receive these message(s)
7388 struct LDKPublicKey node_id;
7390 * The update messages which should be sent. ALL messages in the struct should be sent!
7392 struct LDKCommitmentUpdate updates;
7393 } LDKMessageSendEvent_LDKUpdateHTLCs_Body;
7395 typedef struct LDKMessageSendEvent_LDKSendRevokeAndACK_Body {
7397 * The node_id of the node which should receive this message
7399 struct LDKPublicKey node_id;
7401 * The message which should be sent.
7403 struct LDKRevokeAndACK msg;
7404 } LDKMessageSendEvent_LDKSendRevokeAndACK_Body;
7406 typedef struct LDKMessageSendEvent_LDKSendClosingSigned_Body {
7408 * The node_id of the node which should receive this message
7410 struct LDKPublicKey node_id;
7412 * The message which should be sent.
7414 struct LDKClosingSigned msg;
7415 } LDKMessageSendEvent_LDKSendClosingSigned_Body;
7417 typedef struct LDKMessageSendEvent_LDKSendShutdown_Body {
7419 * The node_id of the node which should receive this message
7421 struct LDKPublicKey node_id;
7423 * The message which should be sent.
7425 struct LDKShutdown msg;
7426 } LDKMessageSendEvent_LDKSendShutdown_Body;
7428 typedef struct LDKMessageSendEvent_LDKSendChannelReestablish_Body {
7430 * The node_id of the node which should receive this message
7432 struct LDKPublicKey node_id;
7434 * The message which should be sent.
7436 struct LDKChannelReestablish msg;
7437 } LDKMessageSendEvent_LDKSendChannelReestablish_Body;
7439 typedef struct LDKMessageSendEvent_LDKSendChannelAnnouncement_Body {
7441 * The node_id of the node which should receive this message
7443 struct LDKPublicKey node_id;
7445 * The channel_announcement which should be sent.
7447 struct LDKChannelAnnouncement msg;
7449 * The followup channel_update which should be sent.
7451 struct LDKChannelUpdate update_msg;
7452 } LDKMessageSendEvent_LDKSendChannelAnnouncement_Body;
7454 typedef struct LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body {
7456 * The channel_announcement which should be sent.
7458 struct LDKChannelAnnouncement msg;
7460 * The followup channel_update which should be sent.
7462 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
7464 struct LDKChannelUpdate update_msg;
7465 } LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body;
7467 typedef struct LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body {
7469 * The channel_update which should be sent.
7471 struct LDKChannelUpdate msg;
7472 } LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body;
7474 typedef struct LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body {
7476 * The node_announcement which should be sent.
7478 struct LDKNodeAnnouncement msg;
7479 } LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body;
7481 typedef struct LDKMessageSendEvent_LDKSendChannelUpdate_Body {
7483 * The node_id of the node which should receive this message
7485 struct LDKPublicKey node_id;
7487 * The channel_update which should be sent.
7489 struct LDKChannelUpdate msg;
7490 } LDKMessageSendEvent_LDKSendChannelUpdate_Body;
7492 typedef struct LDKMessageSendEvent_LDKHandleError_Body {
7494 * The node_id of the node which should receive this message
7496 struct LDKPublicKey node_id;
7498 * The action which should be taken.
7500 struct LDKErrorAction action;
7501 } LDKMessageSendEvent_LDKHandleError_Body;
7503 typedef struct LDKMessageSendEvent_LDKSendChannelRangeQuery_Body {
7505 * The node_id of this message recipient
7507 struct LDKPublicKey node_id;
7509 * The query_channel_range which should be sent.
7511 struct LDKQueryChannelRange msg;
7512 } LDKMessageSendEvent_LDKSendChannelRangeQuery_Body;
7514 typedef struct LDKMessageSendEvent_LDKSendShortIdsQuery_Body {
7516 * The node_id of this message recipient
7518 struct LDKPublicKey node_id;
7520 * The query_short_channel_ids which should be sent.
7522 struct LDKQueryShortChannelIds msg;
7523 } LDKMessageSendEvent_LDKSendShortIdsQuery_Body;
7525 typedef struct LDKMessageSendEvent_LDKSendReplyChannelRange_Body {
7527 * The node_id of this message recipient
7529 struct LDKPublicKey node_id;
7531 * The reply_channel_range which should be sent.
7533 struct LDKReplyChannelRange msg;
7534 } LDKMessageSendEvent_LDKSendReplyChannelRange_Body;
7536 typedef struct LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body {
7538 * The node_id of this message recipient
7540 struct LDKPublicKey node_id;
7542 * The gossip_timestamp_filter which should be sent.
7544 struct LDKGossipTimestampFilter msg;
7545 } LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body;
7547 typedef struct MUST_USE_STRUCT LDKMessageSendEvent {
7548 LDKMessageSendEvent_Tag tag;
7550 LDKMessageSendEvent_LDKSendAcceptChannel_Body send_accept_channel;
7551 LDKMessageSendEvent_LDKSendAcceptChannelV2_Body send_accept_channel_v2;
7552 LDKMessageSendEvent_LDKSendOpenChannel_Body send_open_channel;
7553 LDKMessageSendEvent_LDKSendOpenChannelV2_Body send_open_channel_v2;
7554 LDKMessageSendEvent_LDKSendFundingCreated_Body send_funding_created;
7555 LDKMessageSendEvent_LDKSendFundingSigned_Body send_funding_signed;
7556 LDKMessageSendEvent_LDKSendStfu_Body send_stfu;
7557 LDKMessageSendEvent_LDKSendSplice_Body send_splice;
7558 LDKMessageSendEvent_LDKSendSpliceAck_Body send_splice_ack;
7559 LDKMessageSendEvent_LDKSendSpliceLocked_Body send_splice_locked;
7560 LDKMessageSendEvent_LDKSendTxAddInput_Body send_tx_add_input;
7561 LDKMessageSendEvent_LDKSendTxAddOutput_Body send_tx_add_output;
7562 LDKMessageSendEvent_LDKSendTxRemoveInput_Body send_tx_remove_input;
7563 LDKMessageSendEvent_LDKSendTxRemoveOutput_Body send_tx_remove_output;
7564 LDKMessageSendEvent_LDKSendTxComplete_Body send_tx_complete;
7565 LDKMessageSendEvent_LDKSendTxSignatures_Body send_tx_signatures;
7566 LDKMessageSendEvent_LDKSendTxInitRbf_Body send_tx_init_rbf;
7567 LDKMessageSendEvent_LDKSendTxAckRbf_Body send_tx_ack_rbf;
7568 LDKMessageSendEvent_LDKSendTxAbort_Body send_tx_abort;
7569 LDKMessageSendEvent_LDKSendChannelReady_Body send_channel_ready;
7570 LDKMessageSendEvent_LDKSendAnnouncementSignatures_Body send_announcement_signatures;
7571 LDKMessageSendEvent_LDKUpdateHTLCs_Body update_htl_cs;
7572 LDKMessageSendEvent_LDKSendRevokeAndACK_Body send_revoke_and_ack;
7573 LDKMessageSendEvent_LDKSendClosingSigned_Body send_closing_signed;
7574 LDKMessageSendEvent_LDKSendShutdown_Body send_shutdown;
7575 LDKMessageSendEvent_LDKSendChannelReestablish_Body send_channel_reestablish;
7576 LDKMessageSendEvent_LDKSendChannelAnnouncement_Body send_channel_announcement;
7577 LDKMessageSendEvent_LDKBroadcastChannelAnnouncement_Body broadcast_channel_announcement;
7578 LDKMessageSendEvent_LDKBroadcastChannelUpdate_Body broadcast_channel_update;
7579 LDKMessageSendEvent_LDKBroadcastNodeAnnouncement_Body broadcast_node_announcement;
7580 LDKMessageSendEvent_LDKSendChannelUpdate_Body send_channel_update;
7581 LDKMessageSendEvent_LDKHandleError_Body handle_error;
7582 LDKMessageSendEvent_LDKSendChannelRangeQuery_Body send_channel_range_query;
7583 LDKMessageSendEvent_LDKSendShortIdsQuery_Body send_short_ids_query;
7584 LDKMessageSendEvent_LDKSendReplyChannelRange_Body send_reply_channel_range;
7585 LDKMessageSendEvent_LDKSendGossipTimestampFilter_Body send_gossip_timestamp_filter;
7587 } LDKMessageSendEvent;
7590 * A dynamically-allocated array of crate::lightning::events::MessageSendEvents of arbitrary size.
7591 * This corresponds to std::vector in C++
7593 typedef struct LDKCVec_MessageSendEventZ {
7595 * The elements in the array.
7596 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7598 struct LDKMessageSendEvent *data;
7600 * The number of elements pointed to by `data`.
7603 } LDKCVec_MessageSendEventZ;
7608 * Details about one direction of a channel as received within a [`ChannelUpdate`].
7610 typedef struct MUST_USE_STRUCT LDKChannelUpdateInfo {
7612 * A pointer to the opaque Rust object.
7613 * Nearly everywhere, inner must be non-null, however in places where
7614 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7616 LDKnativeChannelUpdateInfo *inner;
7618 * Indicates that this is the only struct which contains the same pointer.
7619 * Rust functions which take ownership of an object provided via an argument require
7620 * this to be true and invalidate the object pointed to by inner.
7623 } LDKChannelUpdateInfo;
7626 * The contents of CResult_ChannelUpdateInfoDecodeErrorZ
7628 typedef union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr {
7630 * A pointer to the contents in the success state.
7631 * Reading from this pointer when `result_ok` is not set is undefined.
7633 struct LDKChannelUpdateInfo *result;
7635 * A pointer to the contents in the error state.
7636 * Reading from this pointer when `result_ok` is set is undefined.
7638 struct LDKDecodeError *err;
7639 } LDKCResult_ChannelUpdateInfoDecodeErrorZPtr;
7642 * A CResult_ChannelUpdateInfoDecodeErrorZ represents the result of a fallible operation,
7643 * containing a crate::lightning::routing::gossip::ChannelUpdateInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7644 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7646 typedef struct LDKCResult_ChannelUpdateInfoDecodeErrorZ {
7648 * The contents of this CResult_ChannelUpdateInfoDecodeErrorZ, accessible via either
7649 * `err` or `result` depending on the state of `result_ok`.
7651 union LDKCResult_ChannelUpdateInfoDecodeErrorZPtr contents;
7653 * Whether this CResult_ChannelUpdateInfoDecodeErrorZ represents a success state.
7656 } LDKCResult_ChannelUpdateInfoDecodeErrorZ;
7661 * Details about a channel (both directions).
7662 * Received within a channel announcement.
7664 typedef struct MUST_USE_STRUCT LDKChannelInfo {
7666 * A pointer to the opaque Rust object.
7667 * Nearly everywhere, inner must be non-null, however in places where
7668 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7670 LDKnativeChannelInfo *inner;
7672 * Indicates that this is the only struct which contains the same pointer.
7673 * Rust functions which take ownership of an object provided via an argument require
7674 * this to be true and invalidate the object pointed to by inner.
7680 * The contents of CResult_ChannelInfoDecodeErrorZ
7682 typedef union LDKCResult_ChannelInfoDecodeErrorZPtr {
7684 * A pointer to the contents in the success state.
7685 * Reading from this pointer when `result_ok` is not set is undefined.
7687 struct LDKChannelInfo *result;
7689 * A pointer to the contents in the error state.
7690 * Reading from this pointer when `result_ok` is set is undefined.
7692 struct LDKDecodeError *err;
7693 } LDKCResult_ChannelInfoDecodeErrorZPtr;
7696 * A CResult_ChannelInfoDecodeErrorZ represents the result of a fallible operation,
7697 * containing a crate::lightning::routing::gossip::ChannelInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7698 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7700 typedef struct LDKCResult_ChannelInfoDecodeErrorZ {
7702 * The contents of this CResult_ChannelInfoDecodeErrorZ, accessible via either
7703 * `err` or `result` depending on the state of `result_ok`.
7705 union LDKCResult_ChannelInfoDecodeErrorZPtr contents;
7707 * Whether this CResult_ChannelInfoDecodeErrorZ represents a success state.
7710 } LDKCResult_ChannelInfoDecodeErrorZ;
7715 * Fees for routing via a given channel or a node
7717 typedef struct MUST_USE_STRUCT LDKRoutingFees {
7719 * A pointer to the opaque Rust object.
7720 * Nearly everywhere, inner must be non-null, however in places where
7721 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7723 LDKnativeRoutingFees *inner;
7725 * Indicates that this is the only struct which contains the same pointer.
7726 * Rust functions which take ownership of an object provided via an argument require
7727 * this to be true and invalidate the object pointed to by inner.
7733 * The contents of CResult_RoutingFeesDecodeErrorZ
7735 typedef union LDKCResult_RoutingFeesDecodeErrorZPtr {
7737 * A pointer to the contents in the success state.
7738 * Reading from this pointer when `result_ok` is not set is undefined.
7740 struct LDKRoutingFees *result;
7742 * A pointer to the contents in the error state.
7743 * Reading from this pointer when `result_ok` is set is undefined.
7745 struct LDKDecodeError *err;
7746 } LDKCResult_RoutingFeesDecodeErrorZPtr;
7749 * A CResult_RoutingFeesDecodeErrorZ represents the result of a fallible operation,
7750 * containing a crate::lightning::routing::gossip::RoutingFees on success and a crate::lightning::ln::msgs::DecodeError on failure.
7751 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7753 typedef struct LDKCResult_RoutingFeesDecodeErrorZ {
7755 * The contents of this CResult_RoutingFeesDecodeErrorZ, accessible via either
7756 * `err` or `result` depending on the state of `result_ok`.
7758 union LDKCResult_RoutingFeesDecodeErrorZPtr contents;
7760 * Whether this CResult_RoutingFeesDecodeErrorZ represents a success state.
7763 } LDKCResult_RoutingFeesDecodeErrorZ;
7766 * A 4-byte byte array.
7768 typedef struct LDKFourBytes {
7776 * A 12-byte byte array.
7778 typedef struct LDKTwelveBytes {
7788 * Represents a hostname for serialization purposes.
7789 * Only the character set and length will be validated.
7790 * The character set consists of ASCII alphanumeric characters, hyphens, and periods.
7791 * Its length is guaranteed to be representable by a single byte.
7792 * This serialization is used by [`BOLT 7`] hostnames.
7794 * [`BOLT 7`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
7796 typedef struct MUST_USE_STRUCT LDKHostname {
7798 * A pointer to the opaque Rust object.
7799 * Nearly everywhere, inner must be non-null, however in places where
7800 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7802 LDKnativeHostname *inner;
7804 * Indicates that this is the only struct which contains the same pointer.
7805 * Rust functions which take ownership of an object provided via an argument require
7806 * this to be true and invalidate the object pointed to by inner.
7812 * An address which can be used to connect to a remote peer.
7814 typedef enum LDKSocketAddress_Tag {
7816 * An IPv4 address and port on which the peer is listening.
7818 LDKSocketAddress_TcpIpV4,
7820 * An IPv6 address and port on which the peer is listening.
7822 LDKSocketAddress_TcpIpV6,
7824 * An old-style Tor onion address/port on which the peer is listening.
7826 * This field is deprecated and the Tor network generally no longer supports V2 Onion
7827 * addresses. Thus, the details are not parsed here.
7829 LDKSocketAddress_OnionV2,
7831 * A new-style Tor onion address/port on which the peer is listening.
7833 * To create the human-readable \"hostname\", concatenate the ED25519 pubkey, checksum, and version,
7834 * wrap as base32 and append \".onion\".
7836 LDKSocketAddress_OnionV3,
7838 * A hostname/port on which the peer is listening.
7840 LDKSocketAddress_Hostname,
7842 * Must be last for serialization purposes
7844 LDKSocketAddress_Sentinel,
7845 } LDKSocketAddress_Tag;
7847 typedef struct LDKSocketAddress_LDKTcpIpV4_Body {
7849 * The 4-byte IPv4 address
7851 struct LDKFourBytes addr;
7853 * The port on which the node is listening
7856 } LDKSocketAddress_LDKTcpIpV4_Body;
7858 typedef struct LDKSocketAddress_LDKTcpIpV6_Body {
7860 * The 16-byte IPv6 address
7862 struct LDKSixteenBytes addr;
7864 * The port on which the node is listening
7867 } LDKSocketAddress_LDKTcpIpV6_Body;
7869 typedef struct LDKSocketAddress_LDKOnionV3_Body {
7871 * The ed25519 long-term public key of the peer
7873 struct LDKThirtyTwoBytes ed25519_pubkey;
7875 * The checksum of the pubkey and version, as included in the onion address
7879 * The version byte, as defined by the Tor Onion v3 spec.
7883 * The port on which the node is listening
7886 } LDKSocketAddress_LDKOnionV3_Body;
7888 typedef struct LDKSocketAddress_LDKHostname_Body {
7890 * The hostname on which the node is listening.
7892 struct LDKHostname hostname;
7894 * The port on which the node is listening.
7897 } LDKSocketAddress_LDKHostname_Body;
7899 typedef struct MUST_USE_STRUCT LDKSocketAddress {
7900 LDKSocketAddress_Tag tag;
7902 LDKSocketAddress_LDKTcpIpV4_Body tcp_ip_v4;
7903 LDKSocketAddress_LDKTcpIpV6_Body tcp_ip_v6;
7905 struct LDKTwelveBytes onion_v2;
7907 LDKSocketAddress_LDKOnionV3_Body onion_v3;
7908 LDKSocketAddress_LDKHostname_Body hostname;
7913 * A dynamically-allocated array of crate::lightning::ln::msgs::SocketAddresss of arbitrary size.
7914 * This corresponds to std::vector in C++
7916 typedef struct LDKCVec_SocketAddressZ {
7918 * The elements in the array.
7919 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
7921 struct LDKSocketAddress *data;
7923 * The number of elements pointed to by `data`.
7926 } LDKCVec_SocketAddressZ;
7931 * Information received in the latest node_announcement from this node.
7933 typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
7935 * A pointer to the opaque Rust object.
7936 * Nearly everywhere, inner must be non-null, however in places where
7937 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7939 LDKnativeNodeAnnouncementInfo *inner;
7941 * Indicates that this is the only struct which contains the same pointer.
7942 * Rust functions which take ownership of an object provided via an argument require
7943 * this to be true and invalidate the object pointed to by inner.
7946 } LDKNodeAnnouncementInfo;
7949 * The contents of CResult_NodeAnnouncementInfoDecodeErrorZ
7951 typedef union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr {
7953 * A pointer to the contents in the success state.
7954 * Reading from this pointer when `result_ok` is not set is undefined.
7956 struct LDKNodeAnnouncementInfo *result;
7958 * A pointer to the contents in the error state.
7959 * Reading from this pointer when `result_ok` is set is undefined.
7961 struct LDKDecodeError *err;
7962 } LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr;
7965 * A CResult_NodeAnnouncementInfoDecodeErrorZ represents the result of a fallible operation,
7966 * containing a crate::lightning::routing::gossip::NodeAnnouncementInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
7967 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
7969 typedef struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ {
7971 * The contents of this CResult_NodeAnnouncementInfoDecodeErrorZ, accessible via either
7972 * `err` or `result` depending on the state of `result_ok`.
7974 union LDKCResult_NodeAnnouncementInfoDecodeErrorZPtr contents;
7976 * Whether this CResult_NodeAnnouncementInfoDecodeErrorZ represents a success state.
7979 } LDKCResult_NodeAnnouncementInfoDecodeErrorZ;
7984 * A user-defined name for a node, which may be used when displaying the node in a graph.
7986 * Since node aliases are provided by third parties, they are a potential avenue for injection
7987 * attacks. Care must be taken when processing.
7989 typedef struct MUST_USE_STRUCT LDKNodeAlias {
7991 * A pointer to the opaque Rust object.
7992 * Nearly everywhere, inner must be non-null, however in places where
7993 * the Rust equivalent takes an Option, it may be set to null to indicate None.
7995 LDKnativeNodeAlias *inner;
7997 * Indicates that this is the only struct which contains the same pointer.
7998 * Rust functions which take ownership of an object provided via an argument require
7999 * this to be true and invalidate the object pointed to by inner.
8005 * The contents of CResult_NodeAliasDecodeErrorZ
8007 typedef union LDKCResult_NodeAliasDecodeErrorZPtr {
8009 * A pointer to the contents in the success state.
8010 * Reading from this pointer when `result_ok` is not set is undefined.
8012 struct LDKNodeAlias *result;
8014 * A pointer to the contents in the error state.
8015 * Reading from this pointer when `result_ok` is set is undefined.
8017 struct LDKDecodeError *err;
8018 } LDKCResult_NodeAliasDecodeErrorZPtr;
8021 * A CResult_NodeAliasDecodeErrorZ represents the result of a fallible operation,
8022 * containing a crate::lightning::routing::gossip::NodeAlias on success and a crate::lightning::ln::msgs::DecodeError on failure.
8023 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8025 typedef struct LDKCResult_NodeAliasDecodeErrorZ {
8027 * The contents of this CResult_NodeAliasDecodeErrorZ, accessible via either
8028 * `err` or `result` depending on the state of `result_ok`.
8030 union LDKCResult_NodeAliasDecodeErrorZPtr contents;
8032 * Whether this CResult_NodeAliasDecodeErrorZ represents a success state.
8035 } LDKCResult_NodeAliasDecodeErrorZ;
8040 * Details about a node in the network, known from the network announcement.
8042 typedef struct MUST_USE_STRUCT LDKNodeInfo {
8044 * A pointer to the opaque Rust object.
8045 * Nearly everywhere, inner must be non-null, however in places where
8046 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8048 LDKnativeNodeInfo *inner;
8050 * Indicates that this is the only struct which contains the same pointer.
8051 * Rust functions which take ownership of an object provided via an argument require
8052 * this to be true and invalidate the object pointed to by inner.
8058 * The contents of CResult_NodeInfoDecodeErrorZ
8060 typedef union LDKCResult_NodeInfoDecodeErrorZPtr {
8062 * A pointer to the contents in the success state.
8063 * Reading from this pointer when `result_ok` is not set is undefined.
8065 struct LDKNodeInfo *result;
8067 * A pointer to the contents in the error state.
8068 * Reading from this pointer when `result_ok` is set is undefined.
8070 struct LDKDecodeError *err;
8071 } LDKCResult_NodeInfoDecodeErrorZPtr;
8074 * A CResult_NodeInfoDecodeErrorZ represents the result of a fallible operation,
8075 * containing a crate::lightning::routing::gossip::NodeInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
8076 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8078 typedef struct LDKCResult_NodeInfoDecodeErrorZ {
8080 * The contents of this CResult_NodeInfoDecodeErrorZ, accessible via either
8081 * `err` or `result` depending on the state of `result_ok`.
8083 union LDKCResult_NodeInfoDecodeErrorZPtr contents;
8085 * Whether this CResult_NodeInfoDecodeErrorZ represents a success state.
8088 } LDKCResult_NodeInfoDecodeErrorZ;
8091 * The contents of CResult_NetworkGraphDecodeErrorZ
8093 typedef union LDKCResult_NetworkGraphDecodeErrorZPtr {
8095 * A pointer to the contents in the success state.
8096 * Reading from this pointer when `result_ok` is not set is undefined.
8098 struct LDKNetworkGraph *result;
8100 * A pointer to the contents in the error state.
8101 * Reading from this pointer when `result_ok` is set is undefined.
8103 struct LDKDecodeError *err;
8104 } LDKCResult_NetworkGraphDecodeErrorZPtr;
8107 * A CResult_NetworkGraphDecodeErrorZ represents the result of a fallible operation,
8108 * containing a crate::lightning::routing::gossip::NetworkGraph on success and a crate::lightning::ln::msgs::DecodeError on failure.
8109 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8111 typedef struct LDKCResult_NetworkGraphDecodeErrorZ {
8113 * The contents of this CResult_NetworkGraphDecodeErrorZ, accessible via either
8114 * `err` or `result` depending on the state of `result_ok`.
8116 union LDKCResult_NetworkGraphDecodeErrorZPtr contents;
8118 * Whether this CResult_NetworkGraphDecodeErrorZ represents a success state.
8121 } LDKCResult_NetworkGraphDecodeErrorZ;
8124 * An enum which can either contain a crate::c_types::derived::CVec_SocketAddressZ or not
8126 typedef enum LDKCOption_CVec_SocketAddressZZ_Tag {
8128 * When we're in this state, this COption_CVec_SocketAddressZZ contains a crate::c_types::derived::CVec_SocketAddressZ
8130 LDKCOption_CVec_SocketAddressZZ_Some,
8132 * When we're in this state, this COption_CVec_SocketAddressZZ contains nothing
8134 LDKCOption_CVec_SocketAddressZZ_None,
8136 * Must be last for serialization purposes
8138 LDKCOption_CVec_SocketAddressZZ_Sentinel,
8139 } LDKCOption_CVec_SocketAddressZZ_Tag;
8141 typedef struct LDKCOption_CVec_SocketAddressZZ {
8142 LDKCOption_CVec_SocketAddressZZ_Tag tag;
8145 struct LDKCVec_SocketAddressZ some;
8148 } LDKCOption_CVec_SocketAddressZZ;
8153 * Information about an incoming HTLC, including the [`PendingHTLCRouting`] describing where it
8156 typedef struct MUST_USE_STRUCT LDKPendingHTLCInfo {
8158 * A pointer to the opaque Rust object.
8159 * Nearly everywhere, inner must be non-null, however in places where
8160 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8162 LDKnativePendingHTLCInfo *inner;
8164 * Indicates that this is the only struct which contains the same pointer.
8165 * Rust functions which take ownership of an object provided via an argument require
8166 * this to be true and invalidate the object pointed to by inner.
8169 } LDKPendingHTLCInfo;
8174 * Invalid inbound onion payment.
8176 typedef struct MUST_USE_STRUCT LDKInboundHTLCErr {
8178 * A pointer to the opaque Rust object.
8179 * Nearly everywhere, inner must be non-null, however in places where
8180 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8182 LDKnativeInboundHTLCErr *inner;
8184 * Indicates that this is the only struct which contains the same pointer.
8185 * Rust functions which take ownership of an object provided via an argument require
8186 * this to be true and invalidate the object pointed to by inner.
8189 } LDKInboundHTLCErr;
8192 * The contents of CResult_PendingHTLCInfoInboundHTLCErrZ
8194 typedef union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr {
8196 * A pointer to the contents in the success state.
8197 * Reading from this pointer when `result_ok` is not set is undefined.
8199 struct LDKPendingHTLCInfo *result;
8201 * A pointer to the contents in the error state.
8202 * Reading from this pointer when `result_ok` is set is undefined.
8204 struct LDKInboundHTLCErr *err;
8205 } LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr;
8208 * A CResult_PendingHTLCInfoInboundHTLCErrZ represents the result of a fallible operation,
8209 * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::onion_payment::InboundHTLCErr on failure.
8210 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8212 typedef struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ {
8214 * The contents of this CResult_PendingHTLCInfoInboundHTLCErrZ, accessible via either
8215 * `err` or `result` depending on the state of `result_ok`.
8217 union LDKCResult_PendingHTLCInfoInboundHTLCErrZPtr contents;
8219 * Whether this CResult_PendingHTLCInfoInboundHTLCErrZ represents a success state.
8222 } LDKCResult_PendingHTLCInfoInboundHTLCErrZ;
8225 * A dynamically-allocated array of crate::lightning::ln::chan_utils::HTLCOutputInCommitments of arbitrary size.
8226 * This corresponds to std::vector in C++
8228 typedef struct LDKCVec_HTLCOutputInCommitmentZ {
8230 * The elements in the array.
8231 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8233 struct LDKHTLCOutputInCommitment *data;
8235 * The number of elements pointed to by `data`.
8238 } LDKCVec_HTLCOutputInCommitmentZ;
8241 * A dynamically-allocated array of crate::lightning::sign::HTLCDescriptors of arbitrary size.
8242 * This corresponds to std::vector in C++
8244 typedef struct LDKCVec_HTLCDescriptorZ {
8246 * The elements in the array.
8247 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8249 struct LDKHTLCDescriptor *data;
8251 * The number of elements pointed to by `data`.
8254 } LDKCVec_HTLCDescriptorZ;
8259 * An unspent transaction output that is available to spend resulting from a successful
8260 * [`CoinSelection`] attempt.
8262 typedef struct MUST_USE_STRUCT LDKUtxo {
8264 * A pointer to the opaque Rust object.
8265 * Nearly everywhere, inner must be non-null, however in places where
8266 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8268 LDKnativeUtxo *inner;
8270 * Indicates that this is the only struct which contains the same pointer.
8271 * Rust functions which take ownership of an object provided via an argument require
8272 * this to be true and invalidate the object pointed to by inner.
8278 * A dynamically-allocated array of crate::lightning::events::bump_transaction::Utxos of arbitrary size.
8279 * This corresponds to std::vector in C++
8281 typedef struct LDKCVec_UtxoZ {
8283 * The elements in the array.
8284 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8286 struct LDKUtxo *data;
8288 * The number of elements pointed to by `data`.
8294 * An enum which can either contain a crate::c_types::TxOut or not
8296 typedef enum LDKCOption_TxOutZ_Tag {
8298 * When we're in this state, this COption_TxOutZ contains a crate::c_types::TxOut
8300 LDKCOption_TxOutZ_Some,
8302 * When we're in this state, this COption_TxOutZ contains nothing
8304 LDKCOption_TxOutZ_None,
8306 * Must be last for serialization purposes
8308 LDKCOption_TxOutZ_Sentinel,
8309 } LDKCOption_TxOutZ_Tag;
8311 typedef struct LDKCOption_TxOutZ {
8312 LDKCOption_TxOutZ_Tag tag;
8315 struct LDKTxOut some;
8318 } LDKCOption_TxOutZ;
8323 * An input that must be included in a transaction when performing coin selection through
8324 * [`CoinSelectionSource::select_confirmed_utxos`]. It is guaranteed to be a SegWit input, so it
8325 * must have an empty [`TxIn::script_sig`] when spent.
8327 typedef struct MUST_USE_STRUCT LDKInput {
8329 * A pointer to the opaque Rust object.
8330 * Nearly everywhere, inner must be non-null, however in places where
8331 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8333 LDKnativeInput *inner;
8335 * Indicates that this is the only struct which contains the same pointer.
8336 * Rust functions which take ownership of an object provided via an argument require
8337 * this to be true and invalidate the object pointed to by inner.
8343 * A dynamically-allocated array of crate::lightning::events::bump_transaction::Inputs of arbitrary size.
8344 * This corresponds to std::vector in C++
8346 typedef struct LDKCVec_InputZ {
8348 * The elements in the array.
8349 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8351 struct LDKInput *data;
8353 * The number of elements pointed to by `data`.
8361 * The result of a successful coin selection attempt for a transaction requiring additional UTXOs
8362 * to cover its fees.
8364 typedef struct MUST_USE_STRUCT LDKCoinSelection {
8366 * A pointer to the opaque Rust object.
8367 * Nearly everywhere, inner must be non-null, however in places where
8368 * the Rust equivalent takes an Option, it may be set to null to indicate None.
8370 LDKnativeCoinSelection *inner;
8372 * Indicates that this is the only struct which contains the same pointer.
8373 * Rust functions which take ownership of an object provided via an argument require
8374 * this to be true and invalidate the object pointed to by inner.
8380 * The contents of CResult_CoinSelectionNoneZ
8382 typedef union LDKCResult_CoinSelectionNoneZPtr {
8384 * A pointer to the contents in the success state.
8385 * Reading from this pointer when `result_ok` is not set is undefined.
8387 struct LDKCoinSelection *result;
8389 * Note that this value is always NULL, as there are no contents in the Err variant
8392 } LDKCResult_CoinSelectionNoneZPtr;
8395 * A CResult_CoinSelectionNoneZ represents the result of a fallible operation,
8396 * containing a crate::lightning::events::bump_transaction::CoinSelection on success and a () on failure.
8397 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8399 typedef struct LDKCResult_CoinSelectionNoneZ {
8401 * The contents of this CResult_CoinSelectionNoneZ, accessible via either
8402 * `err` or `result` depending on the state of `result_ok`.
8404 union LDKCResult_CoinSelectionNoneZPtr contents;
8406 * Whether this CResult_CoinSelectionNoneZ represents a success state.
8409 } LDKCResult_CoinSelectionNoneZ;
8412 * The contents of CResult_CVec_UtxoZNoneZ
8414 typedef union LDKCResult_CVec_UtxoZNoneZPtr {
8416 * A pointer to the contents in the success state.
8417 * Reading from this pointer when `result_ok` is not set is undefined.
8419 struct LDKCVec_UtxoZ *result;
8421 * Note that this value is always NULL, as there are no contents in the Err variant
8424 } LDKCResult_CVec_UtxoZNoneZPtr;
8427 * A CResult_CVec_UtxoZNoneZ represents the result of a fallible operation,
8428 * containing a crate::c_types::derived::CVec_UtxoZ on success and a () on failure.
8429 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8431 typedef struct LDKCResult_CVec_UtxoZNoneZ {
8433 * The contents of this CResult_CVec_UtxoZNoneZ, accessible via either
8434 * `err` or `result` depending on the state of `result_ok`.
8436 union LDKCResult_CVec_UtxoZNoneZPtr contents;
8438 * Whether this CResult_CVec_UtxoZNoneZ represents a success state.
8441 } LDKCResult_CVec_UtxoZNoneZ;
8444 * A tuple of 2 elements. See the individual fields for the types contained.
8446 typedef struct LDKC2Tuple_u64u16Z {
8448 * The element at position 0
8452 * The element at position 1
8455 } LDKC2Tuple_u64u16Z;
8458 * An enum which can either contain a crate::c_types::derived::C2Tuple_u64u16Z or not
8460 typedef enum LDKCOption_C2Tuple_u64u16ZZ_Tag {
8462 * When we're in this state, this COption_C2Tuple_u64u16ZZ contains a crate::c_types::derived::C2Tuple_u64u16Z
8464 LDKCOption_C2Tuple_u64u16ZZ_Some,
8466 * When we're in this state, this COption_C2Tuple_u64u16ZZ contains nothing
8468 LDKCOption_C2Tuple_u64u16ZZ_None,
8470 * Must be last for serialization purposes
8472 LDKCOption_C2Tuple_u64u16ZZ_Sentinel,
8473 } LDKCOption_C2Tuple_u64u16ZZ_Tag;
8475 typedef struct LDKCOption_C2Tuple_u64u16ZZ {
8476 LDKCOption_C2Tuple_u64u16ZZ_Tag tag;
8479 struct LDKC2Tuple_u64u16Z some;
8482 } LDKCOption_C2Tuple_u64u16ZZ;
8485 * An enum which can either contain a crate::lightning::ln::channelmanager::ChannelShutdownState or not
8487 typedef enum LDKCOption_ChannelShutdownStateZ_Tag {
8489 * When we're in this state, this COption_ChannelShutdownStateZ contains a crate::lightning::ln::channelmanager::ChannelShutdownState
8491 LDKCOption_ChannelShutdownStateZ_Some,
8493 * When we're in this state, this COption_ChannelShutdownStateZ contains nothing
8495 LDKCOption_ChannelShutdownStateZ_None,
8497 * Must be last for serialization purposes
8499 LDKCOption_ChannelShutdownStateZ_Sentinel,
8500 } LDKCOption_ChannelShutdownStateZ_Tag;
8502 typedef struct LDKCOption_ChannelShutdownStateZ {
8503 LDKCOption_ChannelShutdownStateZ_Tag tag;
8506 enum LDKChannelShutdownState some;
8509 } LDKCOption_ChannelShutdownStateZ;
8512 * The contents of CResult_ThirtyTwoBytesAPIErrorZ
8514 typedef union LDKCResult_ThirtyTwoBytesAPIErrorZPtr {
8516 * A pointer to the contents in the success state.
8517 * Reading from this pointer when `result_ok` is not set is undefined.
8519 struct LDKThirtyTwoBytes *result;
8521 * A pointer to the contents in the error state.
8522 * Reading from this pointer when `result_ok` is set is undefined.
8524 struct LDKAPIError *err;
8525 } LDKCResult_ThirtyTwoBytesAPIErrorZPtr;
8528 * A CResult_ThirtyTwoBytesAPIErrorZ represents the result of a fallible operation,
8529 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::util::errors::APIError on failure.
8530 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8532 typedef struct LDKCResult_ThirtyTwoBytesAPIErrorZ {
8534 * The contents of this CResult_ThirtyTwoBytesAPIErrorZ, accessible via either
8535 * `err` or `result` depending on the state of `result_ok`.
8537 union LDKCResult_ThirtyTwoBytesAPIErrorZPtr contents;
8539 * Whether this CResult_ThirtyTwoBytesAPIErrorZ represents a success state.
8542 } LDKCResult_ThirtyTwoBytesAPIErrorZ;
8545 * Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
8546 * These include payments that have yet to find a successful path, or have unresolved HTLCs.
8548 typedef enum LDKRecentPaymentDetails_Tag {
8550 * When an invoice was requested and thus a payment has not yet been sent.
8552 LDKRecentPaymentDetails_AwaitingInvoice,
8554 * When a payment is still being sent and awaiting successful delivery.
8556 LDKRecentPaymentDetails_Pending,
8558 * When a pending payment is fulfilled, we continue tracking it until all pending HTLCs have
8559 * been resolved. Upon receiving [`Event::PaymentSent`], we delay for a few minutes before the
8560 * payment is removed from tracking.
8562 LDKRecentPaymentDetails_Fulfilled,
8564 * After a payment's retries are exhausted per the provided [`Retry`], or it is explicitly
8565 * abandoned via [`ChannelManager::abandon_payment`], it is marked as abandoned until all
8566 * pending HTLCs for this payment resolve and an [`Event::PaymentFailed`] is generated.
8568 LDKRecentPaymentDetails_Abandoned,
8570 * Must be last for serialization purposes
8572 LDKRecentPaymentDetails_Sentinel,
8573 } LDKRecentPaymentDetails_Tag;
8575 typedef struct LDKRecentPaymentDetails_LDKAwaitingInvoice_Body {
8577 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8578 * a payment and ensure idempotency in LDK.
8580 struct LDKThirtyTwoBytes payment_id;
8581 } LDKRecentPaymentDetails_LDKAwaitingInvoice_Body;
8583 typedef struct LDKRecentPaymentDetails_LDKPending_Body {
8585 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8586 * a payment and ensure idempotency in LDK.
8588 struct LDKThirtyTwoBytes payment_id;
8590 * Hash of the payment that is currently being sent but has yet to be fulfilled or
8593 struct LDKThirtyTwoBytes payment_hash;
8595 * Total amount (in msat, excluding fees) across all paths for this payment,
8596 * not just the amount currently inflight.
8598 uint64_t total_msat;
8599 } LDKRecentPaymentDetails_LDKPending_Body;
8601 typedef struct LDKRecentPaymentDetails_LDKFulfilled_Body {
8603 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8604 * a payment and ensure idempotency in LDK.
8606 struct LDKThirtyTwoBytes payment_id;
8608 * Hash of the payment that was claimed. `None` for serializations of [`ChannelManager`]
8609 * made before LDK version 0.0.104.
8611 struct LDKCOption_ThirtyTwoBytesZ payment_hash;
8612 } LDKRecentPaymentDetails_LDKFulfilled_Body;
8614 typedef struct LDKRecentPaymentDetails_LDKAbandoned_Body {
8616 * A user-provided identifier in [`ChannelManager::send_payment`] used to uniquely identify
8617 * a payment and ensure idempotency in LDK.
8619 struct LDKThirtyTwoBytes payment_id;
8621 * Hash of the payment that we have given up trying to send.
8623 struct LDKThirtyTwoBytes payment_hash;
8624 } LDKRecentPaymentDetails_LDKAbandoned_Body;
8626 typedef struct MUST_USE_STRUCT LDKRecentPaymentDetails {
8627 LDKRecentPaymentDetails_Tag tag;
8629 LDKRecentPaymentDetails_LDKAwaitingInvoice_Body awaiting_invoice;
8630 LDKRecentPaymentDetails_LDKPending_Body pending;
8631 LDKRecentPaymentDetails_LDKFulfilled_Body fulfilled;
8632 LDKRecentPaymentDetails_LDKAbandoned_Body abandoned;
8634 } LDKRecentPaymentDetails;
8637 * A dynamically-allocated array of crate::lightning::ln::channelmanager::RecentPaymentDetailss of arbitrary size.
8638 * This corresponds to std::vector in C++
8640 typedef struct LDKCVec_RecentPaymentDetailsZ {
8642 * The elements in the array.
8643 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8645 struct LDKRecentPaymentDetails *data;
8647 * The number of elements pointed to by `data`.
8650 } LDKCVec_RecentPaymentDetailsZ;
8653 * If a payment fails to send with [`ChannelManager::send_payment_with_route`], it can be in one
8654 * of several states. This enum is returned as the Err() type describing which state the payment
8655 * is in, see the description of individual enum states for more.
8657 * [`ChannelManager::send_payment_with_route`]: crate::ln::channelmanager::ChannelManager::send_payment_with_route
8659 typedef enum LDKPaymentSendFailure_Tag {
8661 * A parameter which was passed to send_payment was invalid, preventing us from attempting to
8662 * send the payment at all.
8664 * You can freely resend the payment in full (with the parameter error fixed).
8666 * Because the payment failed outright, no payment tracking is done and no
8667 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8669 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8670 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8672 LDKPaymentSendFailure_ParameterError,
8674 * A parameter in a single path which was passed to send_payment was invalid, preventing us
8675 * from attempting to send the payment at all.
8677 * You can freely resend the payment in full (with the parameter error fixed).
8679 * Because the payment failed outright, no payment tracking is done and no
8680 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8682 * The results here are ordered the same as the paths in the route object which was passed to
8685 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8686 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8688 LDKPaymentSendFailure_PathParameterError,
8690 * All paths which were attempted failed to send, with no channel state change taking place.
8691 * You can freely resend the payment in full (though you probably want to do so over different
8692 * paths than the ones selected).
8694 * Because the payment failed outright, no payment tracking is done and no
8695 * [`Event::PaymentPathFailed`] or [`Event::PaymentFailed`] events will be generated.
8697 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
8698 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8700 LDKPaymentSendFailure_AllFailedResendSafe,
8702 * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not
8703 * yet completed (i.e. generated an [`Event::PaymentSent`] or [`Event::PaymentFailed`]).
8705 * [`PaymentId`]: crate::ln::channelmanager::PaymentId
8706 * [`Event::PaymentSent`]: crate::events::Event::PaymentSent
8707 * [`Event::PaymentFailed`]: crate::events::Event::PaymentFailed
8709 LDKPaymentSendFailure_DuplicatePayment,
8711 * Some paths that were attempted failed to send, though some paths may have succeeded. At least
8712 * some paths have irrevocably committed to the HTLC.
8714 * The results here are ordered the same as the paths in the route object that was passed to
8717 * Any entries that contain `Err(APIError::MonitorUpdateInprogress)` will send once a
8718 * [`MonitorEvent::Completed`] is provided for the next-hop channel with the latest update_id.
8720 * [`MonitorEvent::Completed`]: crate::chain::channelmonitor::MonitorEvent::Completed
8722 LDKPaymentSendFailure_PartialFailure,
8724 * Must be last for serialization purposes
8726 LDKPaymentSendFailure_Sentinel,
8727 } LDKPaymentSendFailure_Tag;
8729 typedef struct LDKPaymentSendFailure_LDKPartialFailure_Body {
8731 * The errors themselves, in the same order as the paths from the route.
8733 struct LDKCVec_CResult_NoneAPIErrorZZ results;
8735 * If some paths failed without irrevocably committing to the new HTLC(s), this will
8736 * contain a [`RouteParameters`] object for the failing paths.
8738 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
8740 struct LDKRouteParameters failed_paths_retry;
8742 * The payment id for the payment, which is now at least partially pending.
8744 struct LDKThirtyTwoBytes payment_id;
8745 } LDKPaymentSendFailure_LDKPartialFailure_Body;
8747 typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
8748 LDKPaymentSendFailure_Tag tag;
8751 struct LDKAPIError parameter_error;
8754 struct LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error;
8757 struct LDKCVec_APIErrorZ all_failed_resend_safe;
8759 LDKPaymentSendFailure_LDKPartialFailure_Body partial_failure;
8761 } LDKPaymentSendFailure;
8764 * The contents of CResult_NonePaymentSendFailureZ
8766 typedef union LDKCResult_NonePaymentSendFailureZPtr {
8768 * Note that this value is always NULL, as there are no contents in the OK variant
8772 * A pointer to the contents in the error state.
8773 * Reading from this pointer when `result_ok` is set is undefined.
8775 struct LDKPaymentSendFailure *err;
8776 } LDKCResult_NonePaymentSendFailureZPtr;
8779 * A CResult_NonePaymentSendFailureZ represents the result of a fallible operation,
8780 * containing a () on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8781 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8783 typedef struct LDKCResult_NonePaymentSendFailureZ {
8785 * The contents of this CResult_NonePaymentSendFailureZ, accessible via either
8786 * `err` or `result` depending on the state of `result_ok`.
8788 union LDKCResult_NonePaymentSendFailureZPtr contents;
8790 * Whether this CResult_NonePaymentSendFailureZ represents a success state.
8793 } LDKCResult_NonePaymentSendFailureZ;
8796 * The contents of CResult_NoneRetryableSendFailureZ
8798 typedef union LDKCResult_NoneRetryableSendFailureZPtr {
8800 * Note that this value is always NULL, as there are no contents in the OK variant
8804 * A pointer to the contents in the error state.
8805 * Reading from this pointer when `result_ok` is set is undefined.
8807 enum LDKRetryableSendFailure *err;
8808 } LDKCResult_NoneRetryableSendFailureZPtr;
8811 * A CResult_NoneRetryableSendFailureZ represents the result of a fallible operation,
8812 * containing a () on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8813 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8815 typedef struct LDKCResult_NoneRetryableSendFailureZ {
8817 * The contents of this CResult_NoneRetryableSendFailureZ, accessible via either
8818 * `err` or `result` depending on the state of `result_ok`.
8820 union LDKCResult_NoneRetryableSendFailureZPtr contents;
8822 * Whether this CResult_NoneRetryableSendFailureZ represents a success state.
8825 } LDKCResult_NoneRetryableSendFailureZ;
8828 * The contents of CResult_ThirtyTwoBytesPaymentSendFailureZ
8830 typedef union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr {
8832 * A pointer to the contents in the success state.
8833 * Reading from this pointer when `result_ok` is not set is undefined.
8835 struct LDKThirtyTwoBytes *result;
8837 * A pointer to the contents in the error state.
8838 * Reading from this pointer when `result_ok` is set is undefined.
8840 struct LDKPaymentSendFailure *err;
8841 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr;
8844 * A CResult_ThirtyTwoBytesPaymentSendFailureZ represents the result of a fallible operation,
8845 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8846 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8848 typedef struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ {
8850 * The contents of this CResult_ThirtyTwoBytesPaymentSendFailureZ, accessible via either
8851 * `err` or `result` depending on the state of `result_ok`.
8853 union LDKCResult_ThirtyTwoBytesPaymentSendFailureZPtr contents;
8855 * Whether this CResult_ThirtyTwoBytesPaymentSendFailureZ represents a success state.
8858 } LDKCResult_ThirtyTwoBytesPaymentSendFailureZ;
8861 * The contents of CResult_ThirtyTwoBytesRetryableSendFailureZ
8863 typedef union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr {
8865 * A pointer to the contents in the success state.
8866 * Reading from this pointer when `result_ok` is not set is undefined.
8868 struct LDKThirtyTwoBytes *result;
8870 * A pointer to the contents in the error state.
8871 * Reading from this pointer when `result_ok` is set is undefined.
8873 enum LDKRetryableSendFailure *err;
8874 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr;
8877 * A CResult_ThirtyTwoBytesRetryableSendFailureZ represents the result of a fallible operation,
8878 * containing a crate::c_types::ThirtyTwoBytes on success and a crate::lightning::ln::outbound_payment::RetryableSendFailure on failure.
8879 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8881 typedef struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ {
8883 * The contents of this CResult_ThirtyTwoBytesRetryableSendFailureZ, accessible via either
8884 * `err` or `result` depending on the state of `result_ok`.
8886 union LDKCResult_ThirtyTwoBytesRetryableSendFailureZPtr contents;
8888 * Whether this CResult_ThirtyTwoBytesRetryableSendFailureZ represents a success state.
8891 } LDKCResult_ThirtyTwoBytesRetryableSendFailureZ;
8894 * A tuple of 2 elements. See the individual fields for the types contained.
8896 typedef struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ {
8898 * The element at position 0
8900 struct LDKThirtyTwoBytes a;
8902 * The element at position 1
8904 struct LDKThirtyTwoBytes b;
8905 } LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ;
8908 * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ
8910 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr {
8912 * A pointer to the contents in the success state.
8913 * Reading from this pointer when `result_ok` is not set is undefined.
8915 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
8917 * A pointer to the contents in the error state.
8918 * Reading from this pointer when `result_ok` is set is undefined.
8920 struct LDKPaymentSendFailure *err;
8921 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr;
8924 * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents the result of a fallible operation,
8925 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a crate::lightning::ln::outbound_payment::PaymentSendFailure on failure.
8926 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
8928 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ {
8930 * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ, accessible via either
8931 * `err` or `result` depending on the state of `result_ok`.
8933 union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZPtr contents;
8935 * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ represents a success state.
8938 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ;
8941 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZs of arbitrary size.
8942 * This corresponds to std::vector in C++
8944 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ {
8946 * The elements in the array.
8947 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
8949 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *data;
8951 * The number of elements pointed to by `data`.
8954 } LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ;
8957 * Indicates that we failed to send a payment probe. Further errors may be surfaced later via
8958 * [`Event::ProbeFailed`].
8960 * [`Event::ProbeFailed`]: crate::events::Event::ProbeFailed
8962 typedef enum LDKProbeSendFailure_Tag {
8964 * We were unable to find a route to the destination.
8966 LDKProbeSendFailure_RouteNotFound,
8968 * We failed to send the payment probes.
8970 LDKProbeSendFailure_SendingFailed,
8972 * Must be last for serialization purposes
8974 LDKProbeSendFailure_Sentinel,
8975 } LDKProbeSendFailure_Tag;
8977 typedef struct MUST_USE_STRUCT LDKProbeSendFailure {
8978 LDKProbeSendFailure_Tag tag;
8981 struct LDKPaymentSendFailure sending_failed;
8984 } LDKProbeSendFailure;
8987 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ
8989 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr {
8991 * A pointer to the contents in the success state.
8992 * Reading from this pointer when `result_ok` is not set is undefined.
8994 struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ *result;
8996 * A pointer to the contents in the error state.
8997 * Reading from this pointer when `result_ok` is set is undefined.
8999 struct LDKProbeSendFailure *err;
9000 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr;
9003 * A CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents the result of a fallible operation,
9004 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ on success and a crate::lightning::ln::outbound_payment::ProbeSendFailure on failure.
9005 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9007 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ {
9009 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ, accessible via either
9010 * `err` or `result` depending on the state of `result_ok`.
9012 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZPtr contents;
9014 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ represents a success state.
9017 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ;
9020 * A tuple of 2 elements. See the individual fields for the types contained.
9022 typedef struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ {
9024 * The element at position 0
9026 struct LDKThirtyTwoBytes a;
9028 * The element at position 1
9030 struct LDKPublicKey b;
9031 } LDKC2Tuple_ThirtyTwoBytesPublicKeyZ;
9034 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesPublicKeyZs of arbitrary size.
9035 * This corresponds to std::vector in C++
9037 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ {
9039 * The elements in the array.
9040 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9042 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *data;
9044 * The number of elements pointed to by `data`.
9047 } LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ;
9050 * An enum which can either contain a crate::c_types::Str or not
9052 typedef enum LDKCOption_StrZ_Tag {
9054 * When we're in this state, this COption_StrZ contains a crate::c_types::Str
9056 LDKCOption_StrZ_Some,
9058 * When we're in this state, this COption_StrZ contains nothing
9060 LDKCOption_StrZ_None,
9062 * Must be last for serialization purposes
9064 LDKCOption_StrZ_Sentinel,
9065 } LDKCOption_StrZ_Tag;
9067 typedef struct LDKCOption_StrZ {
9068 LDKCOption_StrZ_Tag tag;
9077 * The contents of CResult_NoneBolt12SemanticErrorZ
9079 typedef union LDKCResult_NoneBolt12SemanticErrorZPtr {
9081 * Note that this value is always NULL, as there are no contents in the OK variant
9085 * A pointer to the contents in the error state.
9086 * Reading from this pointer when `result_ok` is set is undefined.
9088 enum LDKBolt12SemanticError *err;
9089 } LDKCResult_NoneBolt12SemanticErrorZPtr;
9092 * A CResult_NoneBolt12SemanticErrorZ represents the result of a fallible operation,
9093 * containing a () on success and a crate::lightning::offers::parse::Bolt12SemanticError on failure.
9094 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9096 typedef struct LDKCResult_NoneBolt12SemanticErrorZ {
9098 * The contents of this CResult_NoneBolt12SemanticErrorZ, accessible via either
9099 * `err` or `result` depending on the state of `result_ok`.
9101 union LDKCResult_NoneBolt12SemanticErrorZPtr contents;
9103 * Whether this CResult_NoneBolt12SemanticErrorZ represents a success state.
9106 } LDKCResult_NoneBolt12SemanticErrorZ;
9109 * The contents of CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ
9111 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr {
9113 * A pointer to the contents in the success state.
9114 * Reading from this pointer when `result_ok` is not set is undefined.
9116 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *result;
9118 * Note that this value is always NULL, as there are no contents in the Err variant
9121 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr;
9124 * A CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents the result of a fallible operation,
9125 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ on success and a () on failure.
9126 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9128 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ {
9130 * The contents of this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ, accessible via either
9131 * `err` or `result` depending on the state of `result_ok`.
9133 union LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZPtr contents;
9135 * Whether this CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ represents a success state.
9138 } LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ;
9143 * An `InvoiceRequest` is a request for a [`Bolt12Invoice`] formulated from an [`Offer`].
9145 * An offer may provide choices such as quantity, amount, chain, features, etc. An invoice request
9146 * specifies these such that its recipient can send an invoice for payment.
9148 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
9149 * [`Offer`]: crate::offers::offer::Offer
9151 typedef struct MUST_USE_STRUCT LDKInvoiceRequest {
9153 * A pointer to the opaque Rust object.
9154 * Nearly everywhere, inner must be non-null, however in places where
9155 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9157 LDKnativeInvoiceRequest *inner;
9159 * Indicates that this is the only struct which contains the same pointer.
9160 * Rust functions which take ownership of an object provided via an argument require
9161 * this to be true and invalidate the object pointed to by inner.
9164 } LDKInvoiceRequest;
9169 * A `Bolt12Invoice` is a payment request, typically corresponding to an [`Offer`] or a [`Refund`].
9171 * An invoice may be sent in response to an [`InvoiceRequest`] in the case of an offer or sent
9172 * directly after scanning a refund. It includes all the information needed to pay a recipient.
9174 * [`Offer`]: crate::offers::offer::Offer
9175 * [`Refund`]: crate::offers::refund::Refund
9176 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
9178 typedef struct MUST_USE_STRUCT LDKBolt12Invoice {
9180 * A pointer to the opaque Rust object.
9181 * Nearly everywhere, inner must be non-null, however in places where
9182 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9184 LDKnativeBolt12Invoice *inner;
9186 * Indicates that this is the only struct which contains the same pointer.
9187 * Rust functions which take ownership of an object provided via an argument require
9188 * this to be true and invalidate the object pointed to by inner.
9196 * An error in response to an [`InvoiceRequest`] or an [`Bolt12Invoice`].
9198 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
9199 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
9201 typedef struct MUST_USE_STRUCT LDKInvoiceError {
9203 * A pointer to the opaque Rust object.
9204 * Nearly everywhere, inner must be non-null, however in places where
9205 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9207 LDKnativeInvoiceError *inner;
9209 * Indicates that this is the only struct which contains the same pointer.
9210 * Rust functions which take ownership of an object provided via an argument require
9211 * this to be true and invalidate the object pointed to by inner.
9217 * Possible BOLT 12 Offers messages sent and received via an [`OnionMessage`].
9219 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
9221 typedef enum LDKOffersMessage_Tag {
9223 * A request for a [`Bolt12Invoice`] for a particular [`Offer`].
9225 * [`Offer`]: crate::offers::offer::Offer
9227 LDKOffersMessage_InvoiceRequest,
9229 * A [`Bolt12Invoice`] sent in response to an [`InvoiceRequest`] or a [`Refund`].
9231 * [`Refund`]: crate::offers::refund::Refund
9233 LDKOffersMessage_Invoice,
9235 * An error from handling an [`OffersMessage`].
9237 LDKOffersMessage_InvoiceError,
9239 * Must be last for serialization purposes
9241 LDKOffersMessage_Sentinel,
9242 } LDKOffersMessage_Tag;
9244 typedef struct MUST_USE_STRUCT LDKOffersMessage {
9245 LDKOffersMessage_Tag tag;
9248 struct LDKInvoiceRequest invoice_request;
9251 struct LDKBolt12Invoice invoice;
9254 struct LDKInvoiceError invoice_error;
9260 * An enum which can either contain a crate::lightning::onion_message::offers::OffersMessage or not
9262 typedef enum LDKCOption_OffersMessageZ_Tag {
9264 * When we're in this state, this COption_OffersMessageZ contains a crate::lightning::onion_message::offers::OffersMessage
9266 LDKCOption_OffersMessageZ_Some,
9268 * When we're in this state, this COption_OffersMessageZ contains nothing
9270 LDKCOption_OffersMessageZ_None,
9272 * Must be last for serialization purposes
9274 LDKCOption_OffersMessageZ_Sentinel,
9275 } LDKCOption_OffersMessageZ_Tag;
9277 typedef struct LDKCOption_OffersMessageZ {
9278 LDKCOption_OffersMessageZ_Tag tag;
9281 struct LDKOffersMessage some;
9284 } LDKCOption_OffersMessageZ;
9287 * The destination of an onion message.
9289 typedef enum LDKDestination_Tag {
9291 * We're sending this onion message to a node.
9293 LDKDestination_Node,
9295 * We're sending this onion message to a blinded path.
9297 LDKDestination_BlindedPath,
9299 * Must be last for serialization purposes
9301 LDKDestination_Sentinel,
9302 } LDKDestination_Tag;
9304 typedef struct MUST_USE_STRUCT LDKDestination {
9305 LDKDestination_Tag tag;
9308 struct LDKPublicKey node;
9311 struct LDKBlindedPath blinded_path;
9317 * A tuple of 3 elements. See the individual fields for the types contained.
9319 typedef struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ {
9321 * The element at position 0
9323 struct LDKOffersMessage a;
9325 * The element at position 1
9327 struct LDKDestination b;
9329 * The element at position 2
9331 struct LDKBlindedPath c;
9332 } LDKC3Tuple_OffersMessageDestinationBlindedPathZ;
9335 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OffersMessageDestinationBlindedPathZs of arbitrary size.
9336 * This corresponds to std::vector in C++
9338 typedef struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ {
9340 * The elements in the array.
9341 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9343 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *data;
9345 * The number of elements pointed to by `data`.
9348 } LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ;
9353 * Information needed for constructing an invoice route hint for this channel.
9355 typedef struct MUST_USE_STRUCT LDKCounterpartyForwardingInfo {
9357 * A pointer to the opaque Rust object.
9358 * Nearly everywhere, inner must be non-null, however in places where
9359 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9361 LDKnativeCounterpartyForwardingInfo *inner;
9363 * Indicates that this is the only struct which contains the same pointer.
9364 * Rust functions which take ownership of an object provided via an argument require
9365 * this to be true and invalidate the object pointed to by inner.
9368 } LDKCounterpartyForwardingInfo;
9371 * The contents of CResult_CounterpartyForwardingInfoDecodeErrorZ
9373 typedef union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr {
9375 * A pointer to the contents in the success state.
9376 * Reading from this pointer when `result_ok` is not set is undefined.
9378 struct LDKCounterpartyForwardingInfo *result;
9380 * A pointer to the contents in the error state.
9381 * Reading from this pointer when `result_ok` is set is undefined.
9383 struct LDKDecodeError *err;
9384 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr;
9387 * A CResult_CounterpartyForwardingInfoDecodeErrorZ represents the result of a fallible operation,
9388 * containing a crate::lightning::ln::channelmanager::CounterpartyForwardingInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
9389 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9391 typedef struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ {
9393 * The contents of this CResult_CounterpartyForwardingInfoDecodeErrorZ, accessible via either
9394 * `err` or `result` depending on the state of `result_ok`.
9396 union LDKCResult_CounterpartyForwardingInfoDecodeErrorZPtr contents;
9398 * Whether this CResult_CounterpartyForwardingInfoDecodeErrorZ represents a success state.
9401 } LDKCResult_CounterpartyForwardingInfoDecodeErrorZ;
9406 * Channel parameters which apply to our counterparty. These are split out from [`ChannelDetails`]
9407 * to better separate parameters.
9409 typedef struct MUST_USE_STRUCT LDKChannelCounterparty {
9411 * A pointer to the opaque Rust object.
9412 * Nearly everywhere, inner must be non-null, however in places where
9413 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9415 LDKnativeChannelCounterparty *inner;
9417 * Indicates that this is the only struct which contains the same pointer.
9418 * Rust functions which take ownership of an object provided via an argument require
9419 * this to be true and invalidate the object pointed to by inner.
9422 } LDKChannelCounterparty;
9425 * The contents of CResult_ChannelCounterpartyDecodeErrorZ
9427 typedef union LDKCResult_ChannelCounterpartyDecodeErrorZPtr {
9429 * A pointer to the contents in the success state.
9430 * Reading from this pointer when `result_ok` is not set is undefined.
9432 struct LDKChannelCounterparty *result;
9434 * A pointer to the contents in the error state.
9435 * Reading from this pointer when `result_ok` is set is undefined.
9437 struct LDKDecodeError *err;
9438 } LDKCResult_ChannelCounterpartyDecodeErrorZPtr;
9441 * A CResult_ChannelCounterpartyDecodeErrorZ represents the result of a fallible operation,
9442 * containing a crate::lightning::ln::channelmanager::ChannelCounterparty on success and a crate::lightning::ln::msgs::DecodeError on failure.
9443 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9445 typedef struct LDKCResult_ChannelCounterpartyDecodeErrorZ {
9447 * The contents of this CResult_ChannelCounterpartyDecodeErrorZ, accessible via either
9448 * `err` or `result` depending on the state of `result_ok`.
9450 union LDKCResult_ChannelCounterpartyDecodeErrorZPtr contents;
9452 * Whether this CResult_ChannelCounterpartyDecodeErrorZ represents a success state.
9455 } LDKCResult_ChannelCounterpartyDecodeErrorZ;
9458 * The contents of CResult_ChannelDetailsDecodeErrorZ
9460 typedef union LDKCResult_ChannelDetailsDecodeErrorZPtr {
9462 * A pointer to the contents in the success state.
9463 * Reading from this pointer when `result_ok` is not set is undefined.
9465 struct LDKChannelDetails *result;
9467 * A pointer to the contents in the error state.
9468 * Reading from this pointer when `result_ok` is set is undefined.
9470 struct LDKDecodeError *err;
9471 } LDKCResult_ChannelDetailsDecodeErrorZPtr;
9474 * A CResult_ChannelDetailsDecodeErrorZ represents the result of a fallible operation,
9475 * containing a crate::lightning::ln::channelmanager::ChannelDetails on success and a crate::lightning::ln::msgs::DecodeError on failure.
9476 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9478 typedef struct LDKCResult_ChannelDetailsDecodeErrorZ {
9480 * The contents of this CResult_ChannelDetailsDecodeErrorZ, accessible via either
9481 * `err` or `result` depending on the state of `result_ok`.
9483 union LDKCResult_ChannelDetailsDecodeErrorZPtr contents;
9485 * Whether this CResult_ChannelDetailsDecodeErrorZ represents a success state.
9488 } LDKCResult_ChannelDetailsDecodeErrorZ;
9493 * Route hints used in constructing invoices for [phantom node payents].
9495 * [phantom node payments]: crate::sign::PhantomKeysManager
9497 typedef struct MUST_USE_STRUCT LDKPhantomRouteHints {
9499 * A pointer to the opaque Rust object.
9500 * Nearly everywhere, inner must be non-null, however in places where
9501 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9503 LDKnativePhantomRouteHints *inner;
9505 * Indicates that this is the only struct which contains the same pointer.
9506 * Rust functions which take ownership of an object provided via an argument require
9507 * this to be true and invalidate the object pointed to by inner.
9510 } LDKPhantomRouteHints;
9513 * The contents of CResult_PhantomRouteHintsDecodeErrorZ
9515 typedef union LDKCResult_PhantomRouteHintsDecodeErrorZPtr {
9517 * A pointer to the contents in the success state.
9518 * Reading from this pointer when `result_ok` is not set is undefined.
9520 struct LDKPhantomRouteHints *result;
9522 * A pointer to the contents in the error state.
9523 * Reading from this pointer when `result_ok` is set is undefined.
9525 struct LDKDecodeError *err;
9526 } LDKCResult_PhantomRouteHintsDecodeErrorZPtr;
9529 * A CResult_PhantomRouteHintsDecodeErrorZ represents the result of a fallible operation,
9530 * containing a crate::lightning::ln::channelmanager::PhantomRouteHints on success and a crate::lightning::ln::msgs::DecodeError on failure.
9531 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9533 typedef struct LDKCResult_PhantomRouteHintsDecodeErrorZ {
9535 * The contents of this CResult_PhantomRouteHintsDecodeErrorZ, accessible via either
9536 * `err` or `result` depending on the state of `result_ok`.
9538 union LDKCResult_PhantomRouteHintsDecodeErrorZPtr contents;
9540 * Whether this CResult_PhantomRouteHintsDecodeErrorZ represents a success state.
9543 } LDKCResult_PhantomRouteHintsDecodeErrorZ;
9548 * Information used to forward or fail this HTLC that is being forwarded within a blinded path.
9550 typedef struct MUST_USE_STRUCT LDKBlindedForward {
9552 * A pointer to the opaque Rust object.
9553 * Nearly everywhere, inner must be non-null, however in places where
9554 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9556 LDKnativeBlindedForward *inner;
9558 * Indicates that this is the only struct which contains the same pointer.
9559 * Rust functions which take ownership of an object provided via an argument require
9560 * this to be true and invalidate the object pointed to by inner.
9563 } LDKBlindedForward;
9566 * The contents of CResult_BlindedForwardDecodeErrorZ
9568 typedef union LDKCResult_BlindedForwardDecodeErrorZPtr {
9570 * A pointer to the contents in the success state.
9571 * Reading from this pointer when `result_ok` is not set is undefined.
9573 struct LDKBlindedForward *result;
9575 * A pointer to the contents in the error state.
9576 * Reading from this pointer when `result_ok` is set is undefined.
9578 struct LDKDecodeError *err;
9579 } LDKCResult_BlindedForwardDecodeErrorZPtr;
9582 * A CResult_BlindedForwardDecodeErrorZ represents the result of a fallible operation,
9583 * containing a crate::lightning::ln::channelmanager::BlindedForward on success and a crate::lightning::ln::msgs::DecodeError on failure.
9584 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9586 typedef struct LDKCResult_BlindedForwardDecodeErrorZ {
9588 * The contents of this CResult_BlindedForwardDecodeErrorZ, accessible via either
9589 * `err` or `result` depending on the state of `result_ok`.
9591 union LDKCResult_BlindedForwardDecodeErrorZPtr contents;
9593 * Whether this CResult_BlindedForwardDecodeErrorZ represents a success state.
9596 } LDKCResult_BlindedForwardDecodeErrorZ;
9601 * BOLT 4 onion packet including hop data for the next peer.
9603 typedef struct MUST_USE_STRUCT LDKOnionPacket {
9605 * A pointer to the opaque Rust object.
9606 * Nearly everywhere, inner must be non-null, however in places where
9607 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9609 LDKnativeOnionPacket *inner;
9611 * Indicates that this is the only struct which contains the same pointer.
9612 * Rust functions which take ownership of an object provided via an argument require
9613 * this to be true and invalidate the object pointed to by inner.
9621 * Information communicated in the onion to the recipient for multi-part tracking and proof that
9622 * the payment is associated with an invoice.
9624 typedef struct MUST_USE_STRUCT LDKFinalOnionHopData {
9626 * A pointer to the opaque Rust object.
9627 * Nearly everywhere, inner must be non-null, however in places where
9628 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9630 LDKnativeFinalOnionHopData *inner;
9632 * Indicates that this is the only struct which contains the same pointer.
9633 * Rust functions which take ownership of an object provided via an argument require
9634 * this to be true and invalidate the object pointed to by inner.
9637 } LDKFinalOnionHopData;
9640 * Information about where a received HTLC('s onion) has indicated the HTLC should go.
9642 typedef enum LDKPendingHTLCRouting_Tag {
9644 * An HTLC which should be forwarded on to another node.
9646 LDKPendingHTLCRouting_Forward,
9648 * The onion indicates that this is a payment for an invoice (supposedly) generated by us.
9650 * Note that at this point, we have not checked that the invoice being paid was actually
9651 * generated by us, but rather it's claiming to pay an invoice of ours.
9653 LDKPendingHTLCRouting_Receive,
9655 * The onion indicates that this is for payment to us but which contains the preimage for
9656 * claiming included, and is unrelated to any invoice we'd previously generated (aka a
9657 * \"keysend\" or \"spontaneous\" payment).
9659 LDKPendingHTLCRouting_ReceiveKeysend,
9661 * Must be last for serialization purposes
9663 LDKPendingHTLCRouting_Sentinel,
9664 } LDKPendingHTLCRouting_Tag;
9666 typedef struct LDKPendingHTLCRouting_LDKForward_Body {
9668 * The onion which should be included in the forwarded HTLC, telling the next hop what to
9671 struct LDKOnionPacket onion_packet;
9673 * The short channel ID of the channel which we were instructed to forward this HTLC to.
9675 * This could be a real on-chain SCID, an SCID alias, or some other SCID which has meaning
9676 * to the receiving node, such as one returned from
9677 * [`ChannelManager::get_intercept_scid`] or [`ChannelManager::get_phantom_scid`].
9679 uint64_t short_channel_id;
9681 * Set if this HTLC is being forwarded within a blinded path.
9683 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
9685 struct LDKBlindedForward blinded;
9686 } LDKPendingHTLCRouting_LDKForward_Body;
9688 typedef struct LDKPendingHTLCRouting_LDKReceive_Body {
9690 * Information about the amount the sender intended to pay and (potential) proof that this
9691 * is a payment for an invoice we generated. This proof of payment is is also used for
9692 * linking MPP parts of a larger payment.
9694 struct LDKFinalOnionHopData payment_data;
9696 * Additional data which we (allegedly) instructed the sender to include in the onion.
9698 * For HTLCs received by LDK, this will ultimately be exposed in
9699 * [`Event::PaymentClaimable::onion_fields`] as
9700 * [`RecipientOnionFields::payment_metadata`].
9702 struct LDKCOption_CVec_u8ZZ payment_metadata;
9704 * CLTV expiry of the received HTLC.
9706 * Used to track when we should expire pending HTLCs that go unclaimed.
9708 uint32_t incoming_cltv_expiry;
9710 * If the onion had forwarding instructions to one of our phantom node SCIDs, this will
9711 * provide the onion shared secret used to decrypt the next level of forwarding
9714 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
9716 struct LDKThirtyTwoBytes phantom_shared_secret;
9718 * Custom TLVs which were set by the sender.
9720 * For HTLCs received by LDK, this will ultimately be exposed in
9721 * [`Event::PaymentClaimable::onion_fields`] as
9722 * [`RecipientOnionFields::custom_tlvs`].
9724 struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
9726 * Set if this HTLC is the final hop in a multi-hop blinded path.
9728 bool requires_blinded_error;
9729 } LDKPendingHTLCRouting_LDKReceive_Body;
9731 typedef struct LDKPendingHTLCRouting_LDKReceiveKeysend_Body {
9733 * Information about the amount the sender intended to pay and possibly a token to
9734 * associate MPP parts of a larger payment.
9736 * This will only be filled in if receiving MPP keysend payments is enabled, and it being
9737 * present will cause deserialization to fail on versions of LDK prior to 0.0.116.
9739 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
9741 struct LDKFinalOnionHopData payment_data;
9743 * Preimage for this onion payment. This preimage is provided by the sender and will be
9744 * used to settle the spontaneous payment.
9746 struct LDKThirtyTwoBytes payment_preimage;
9748 * Additional data which we (allegedly) instructed the sender to include in the onion.
9750 * For HTLCs received by LDK, this will ultimately bubble back up as
9751 * [`RecipientOnionFields::payment_metadata`].
9753 struct LDKCOption_CVec_u8ZZ payment_metadata;
9755 * CLTV expiry of the received HTLC.
9757 * Used to track when we should expire pending HTLCs that go unclaimed.
9759 uint32_t incoming_cltv_expiry;
9761 * Custom TLVs which were set by the sender.
9763 * For HTLCs received by LDK, these will ultimately bubble back up as
9764 * [`RecipientOnionFields::custom_tlvs`].
9766 struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs;
9767 } LDKPendingHTLCRouting_LDKReceiveKeysend_Body;
9769 typedef struct MUST_USE_STRUCT LDKPendingHTLCRouting {
9770 LDKPendingHTLCRouting_Tag tag;
9772 LDKPendingHTLCRouting_LDKForward_Body forward;
9773 LDKPendingHTLCRouting_LDKReceive_Body receive;
9774 LDKPendingHTLCRouting_LDKReceiveKeysend_Body receive_keysend;
9776 } LDKPendingHTLCRouting;
9779 * The contents of CResult_PendingHTLCRoutingDecodeErrorZ
9781 typedef union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr {
9783 * A pointer to the contents in the success state.
9784 * Reading from this pointer when `result_ok` is not set is undefined.
9786 struct LDKPendingHTLCRouting *result;
9788 * A pointer to the contents in the error state.
9789 * Reading from this pointer when `result_ok` is set is undefined.
9791 struct LDKDecodeError *err;
9792 } LDKCResult_PendingHTLCRoutingDecodeErrorZPtr;
9795 * A CResult_PendingHTLCRoutingDecodeErrorZ represents the result of a fallible operation,
9796 * containing a crate::lightning::ln::channelmanager::PendingHTLCRouting on success and a crate::lightning::ln::msgs::DecodeError on failure.
9797 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9799 typedef struct LDKCResult_PendingHTLCRoutingDecodeErrorZ {
9801 * The contents of this CResult_PendingHTLCRoutingDecodeErrorZ, accessible via either
9802 * `err` or `result` depending on the state of `result_ok`.
9804 union LDKCResult_PendingHTLCRoutingDecodeErrorZPtr contents;
9806 * Whether this CResult_PendingHTLCRoutingDecodeErrorZ represents a success state.
9809 } LDKCResult_PendingHTLCRoutingDecodeErrorZ;
9812 * The contents of CResult_PendingHTLCInfoDecodeErrorZ
9814 typedef union LDKCResult_PendingHTLCInfoDecodeErrorZPtr {
9816 * A pointer to the contents in the success state.
9817 * Reading from this pointer when `result_ok` is not set is undefined.
9819 struct LDKPendingHTLCInfo *result;
9821 * A pointer to the contents in the error state.
9822 * Reading from this pointer when `result_ok` is set is undefined.
9824 struct LDKDecodeError *err;
9825 } LDKCResult_PendingHTLCInfoDecodeErrorZPtr;
9828 * A CResult_PendingHTLCInfoDecodeErrorZ represents the result of a fallible operation,
9829 * containing a crate::lightning::ln::channelmanager::PendingHTLCInfo on success and a crate::lightning::ln::msgs::DecodeError on failure.
9830 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9832 typedef struct LDKCResult_PendingHTLCInfoDecodeErrorZ {
9834 * The contents of this CResult_PendingHTLCInfoDecodeErrorZ, accessible via either
9835 * `err` or `result` depending on the state of `result_ok`.
9837 union LDKCResult_PendingHTLCInfoDecodeErrorZPtr contents;
9839 * Whether this CResult_PendingHTLCInfoDecodeErrorZ represents a success state.
9842 } LDKCResult_PendingHTLCInfoDecodeErrorZ;
9845 * The contents of CResult_BlindedFailureDecodeErrorZ
9847 typedef union LDKCResult_BlindedFailureDecodeErrorZPtr {
9849 * A pointer to the contents in the success state.
9850 * Reading from this pointer when `result_ok` is not set is undefined.
9852 enum LDKBlindedFailure *result;
9854 * A pointer to the contents in the error state.
9855 * Reading from this pointer when `result_ok` is set is undefined.
9857 struct LDKDecodeError *err;
9858 } LDKCResult_BlindedFailureDecodeErrorZPtr;
9861 * A CResult_BlindedFailureDecodeErrorZ represents the result of a fallible operation,
9862 * containing a crate::lightning::ln::channelmanager::BlindedFailure on success and a crate::lightning::ln::msgs::DecodeError on failure.
9863 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9865 typedef struct LDKCResult_BlindedFailureDecodeErrorZ {
9867 * The contents of this CResult_BlindedFailureDecodeErrorZ, accessible via either
9868 * `err` or `result` depending on the state of `result_ok`.
9870 union LDKCResult_BlindedFailureDecodeErrorZPtr contents;
9872 * Whether this CResult_BlindedFailureDecodeErrorZ represents a success state.
9875 } LDKCResult_BlindedFailureDecodeErrorZ;
9878 * The contents of CResult_ChannelShutdownStateDecodeErrorZ
9880 typedef union LDKCResult_ChannelShutdownStateDecodeErrorZPtr {
9882 * A pointer to the contents in the success state.
9883 * Reading from this pointer when `result_ok` is not set is undefined.
9885 enum LDKChannelShutdownState *result;
9887 * A pointer to the contents in the error state.
9888 * Reading from this pointer when `result_ok` is set is undefined.
9890 struct LDKDecodeError *err;
9891 } LDKCResult_ChannelShutdownStateDecodeErrorZPtr;
9894 * A CResult_ChannelShutdownStateDecodeErrorZ represents the result of a fallible operation,
9895 * containing a crate::lightning::ln::channelmanager::ChannelShutdownState on success and a crate::lightning::ln::msgs::DecodeError on failure.
9896 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
9898 typedef struct LDKCResult_ChannelShutdownStateDecodeErrorZ {
9900 * The contents of this CResult_ChannelShutdownStateDecodeErrorZ, accessible via either
9901 * `err` or `result` depending on the state of `result_ok`.
9903 union LDKCResult_ChannelShutdownStateDecodeErrorZPtr contents;
9905 * Whether this CResult_ChannelShutdownStateDecodeErrorZ represents a success state.
9908 } LDKCResult_ChannelShutdownStateDecodeErrorZ;
9913 * A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
9914 * on-chain transactions to ensure no loss of funds occurs.
9916 * You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
9917 * information and are actively monitoring the chain.
9919 * Note that the deserializer is only implemented for (BlockHash, ChannelMonitor), which
9920 * tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
9921 * the \"reorg path\" (ie disconnecting blocks until you find a common ancestor from both the
9922 * returned block hash and the the current chain and then reconnecting blocks to get to the
9923 * best chain) upon deserializing the object!
9925 typedef struct MUST_USE_STRUCT LDKChannelMonitor {
9927 * A pointer to the opaque Rust object.
9928 * Nearly everywhere, inner must be non-null, however in places where
9929 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9931 LDKnativeChannelMonitor *inner;
9933 * Indicates that this is the only struct which contains the same pointer.
9934 * Rust functions which take ownership of an object provided via an argument require
9935 * this to be true and invalidate the object pointed to by inner.
9938 } LDKChannelMonitor;
9941 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::ChannelMonitors of arbitrary size.
9942 * This corresponds to std::vector in C++
9944 typedef struct LDKCVec_ChannelMonitorZ {
9946 * The elements in the array.
9947 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
9949 struct LDKChannelMonitor *data;
9951 * The number of elements pointed to by `data`.
9954 } LDKCVec_ChannelMonitorZ;
9959 * An update generated by the underlying channel itself which contains some new information the
9960 * [`ChannelMonitor`] should be made aware of.
9962 * Because this represents only a small number of updates to the underlying state, it is generally
9963 * much smaller than a full [`ChannelMonitor`]. However, for large single commitment transaction
9964 * updates (e.g. ones during which there are hundreds of HTLCs pending on the commitment
9965 * transaction), a single update may reach upwards of 1 MiB in serialized size.
9967 typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
9969 * A pointer to the opaque Rust object.
9970 * Nearly everywhere, inner must be non-null, however in places where
9971 * the Rust equivalent takes an Option, it may be set to null to indicate None.
9973 LDKnativeChannelMonitorUpdate *inner;
9975 * Indicates that this is the only struct which contains the same pointer.
9976 * Rust functions which take ownership of an object provided via an argument require
9977 * this to be true and invalidate the object pointed to by inner.
9980 } LDKChannelMonitorUpdate;
9983 * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
9984 * blocks are connected and disconnected.
9986 * Each channel is associated with a [`ChannelMonitor`]. Implementations of this trait are
9987 * responsible for maintaining a set of monitors such that they can be updated as channel state
9988 * changes. On each update, *all copies* of a [`ChannelMonitor`] must be updated and the update
9989 * persisted to disk to ensure that the latest [`ChannelMonitor`] state can be reloaded if the
9990 * application crashes.
9992 * See method documentation and [`ChannelMonitorUpdateStatus`] for specific requirements.
9994 typedef struct LDKWatch {
9996 * An opaque pointer which is passed to your function implementations as an argument.
9997 * This has no meaning in the LDK, and can be NULL or any other value.
10001 * Watches a channel identified by `funding_txo` using `monitor`.
10003 * Implementations are responsible for watching the chain for the funding transaction along
10004 * with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
10005 * calling [`block_connected`] and [`block_disconnected`] on the monitor.
10007 * A return of `Err(())` indicates that the channel should immediately be force-closed without
10008 * broadcasting the funding transaction.
10010 * If the given `funding_txo` has previously been registered via `watch_channel`, `Err(())`
10011 * must be returned.
10013 * [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
10014 * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
10015 * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
10017 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ (*watch_channel)(const void *this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor);
10019 * Updates a channel identified by `funding_txo` by applying `update` to its monitor.
10021 * Implementations must call [`ChannelMonitor::update_monitor`] with the given update. This
10022 * may fail (returning an `Err(())`), in which case this should return
10023 * [`ChannelMonitorUpdateStatus::InProgress`] (and the update should never complete). This
10024 * generally implies the channel has been closed (either by the funding outpoint being spent
10025 * on-chain or the [`ChannelMonitor`] having decided to do so and broadcasted a transaction),
10026 * and the [`ChannelManager`] state will be updated once it sees the funding spend on-chain.
10028 * In general, persistence failures should be retried after returning
10029 * [`ChannelMonitorUpdateStatus::InProgress`] and eventually complete. If a failure truly
10030 * cannot be retried, the node should shut down immediately after returning
10031 * [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
10033 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
10035 enum LDKChannelMonitorUpdateStatus (*update_channel)(const void *this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
10037 * Returns any monitor events since the last call. Subsequent calls must only return new
10040 * Note that after any block- or transaction-connection calls to a [`ChannelMonitor`], no
10041 * further events may be returned here until the [`ChannelMonitor`] has been fully persisted
10044 * For details on asynchronous [`ChannelMonitor`] updating and returning
10045 * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
10047 struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ (*release_pending_monitor_events)(const void *this_arg);
10049 * Frees any resources associated with this object given its this_arg pointer.
10050 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10052 void (*free)(void *this_arg);
10056 * A dynamically-allocated array of crate::c_types::Transactions of arbitrary size.
10057 * This corresponds to std::vector in C++
10059 typedef struct LDKCVec_TransactionZ {
10061 * The elements in the array.
10062 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
10064 struct LDKTransaction *data;
10066 * The number of elements pointed to by `data`.
10069 } LDKCVec_TransactionZ;
10072 * An interface to send a transaction to the Bitcoin network.
10074 typedef struct LDKBroadcasterInterface {
10076 * An opaque pointer which is passed to your function implementations as an argument.
10077 * This has no meaning in the LDK, and can be NULL or any other value.
10081 * Sends a list of transactions out to (hopefully) be mined.
10082 * This only needs to handle the actual broadcasting of transactions, LDK will automatically
10083 * rebroadcast transactions that haven't made it into a block.
10085 * In some cases LDK may attempt to broadcast a transaction which double-spends another
10086 * and this isn't a bug and can be safely ignored.
10088 * If more than one transaction is given, these transactions should be considered to be a
10089 * package and broadcast together. Some of the transactions may or may not depend on each other,
10090 * be sure to manage both cases correctly.
10092 * Bitcoin transaction packages are defined in BIP 331 and here:
10093 * <https://github.com/bitcoin/bitcoin/blob/master/doc/policy/packages.md>
10095 void (*broadcast_transactions)(const void *this_arg, struct LDKCVec_TransactionZ txs);
10097 * Frees any resources associated with this object given its this_arg pointer.
10098 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10100 void (*free)(void *this_arg);
10101 } LDKBroadcasterInterface;
10104 * A trait that describes a source of entropy.
10106 typedef struct LDKEntropySource {
10108 * An opaque pointer which is passed to your function implementations as an argument.
10109 * This has no meaning in the LDK, and can be NULL or any other value.
10113 * Gets a unique, cryptographically-secure, random 32-byte value. This method must return a
10114 * different value each time it is called.
10116 struct LDKThirtyTwoBytes (*get_secure_random_bytes)(const void *this_arg);
10118 * Frees any resources associated with this object given its this_arg pointer.
10119 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10121 void (*free)(void *this_arg);
10122 } LDKEntropySource;
10127 * A semantically valid [`InvoiceRequest`] that hasn't been signed.
10131 * This is serialized as a TLV stream, which includes TLV records from the originating message. As
10132 * such, it may include unknown, odd TLV records.
10134 typedef struct MUST_USE_STRUCT LDKUnsignedInvoiceRequest {
10136 * A pointer to the opaque Rust object.
10137 * Nearly everywhere, inner must be non-null, however in places where
10138 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10140 LDKnativeUnsignedInvoiceRequest *inner;
10142 * Indicates that this is the only struct which contains the same pointer.
10143 * Rust functions which take ownership of an object provided via an argument require
10144 * this to be true and invalidate the object pointed to by inner.
10147 } LDKUnsignedInvoiceRequest;
10152 * A semantically valid [`Bolt12Invoice`] that hasn't been signed.
10156 * This is serialized as a TLV stream, which includes TLV records from the originating message. As
10157 * such, it may include unknown, odd TLV records.
10159 typedef struct MUST_USE_STRUCT LDKUnsignedBolt12Invoice {
10161 * A pointer to the opaque Rust object.
10162 * Nearly everywhere, inner must be non-null, however in places where
10163 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10165 LDKnativeUnsignedBolt12Invoice *inner;
10167 * Indicates that this is the only struct which contains the same pointer.
10168 * Rust functions which take ownership of an object provided via an argument require
10169 * this to be true and invalidate the object pointed to by inner.
10172 } LDKUnsignedBolt12Invoice;
10177 * The unsigned part of a [`channel_update`] message.
10179 * [`channel_update`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
10181 typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
10183 * A pointer to the opaque Rust object.
10184 * Nearly everywhere, inner must be non-null, however in places where
10185 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10187 LDKnativeUnsignedChannelUpdate *inner;
10189 * Indicates that this is the only struct which contains the same pointer.
10190 * Rust functions which take ownership of an object provided via an argument require
10191 * this to be true and invalidate the object pointed to by inner.
10194 } LDKUnsignedChannelUpdate;
10199 * The unsigned part of a [`node_announcement`] message.
10201 * [`node_announcement`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-node_announcement-message
10203 typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
10205 * A pointer to the opaque Rust object.
10206 * Nearly everywhere, inner must be non-null, however in places where
10207 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10209 LDKnativeUnsignedNodeAnnouncement *inner;
10211 * Indicates that this is the only struct which contains the same pointer.
10212 * Rust functions which take ownership of an object provided via an argument require
10213 * this to be true and invalidate the object pointed to by inner.
10216 } LDKUnsignedNodeAnnouncement;
10219 * Represents the set of gossip messages that require a signature from a node's identity key.
10221 typedef enum LDKUnsignedGossipMessage_Tag {
10223 * An unsigned channel announcement.
10225 LDKUnsignedGossipMessage_ChannelAnnouncement,
10227 * An unsigned channel update.
10229 LDKUnsignedGossipMessage_ChannelUpdate,
10231 * An unsigned node announcement.
10233 LDKUnsignedGossipMessage_NodeAnnouncement,
10235 * Must be last for serialization purposes
10237 LDKUnsignedGossipMessage_Sentinel,
10238 } LDKUnsignedGossipMessage_Tag;
10240 typedef struct MUST_USE_STRUCT LDKUnsignedGossipMessage {
10241 LDKUnsignedGossipMessage_Tag tag;
10244 struct LDKUnsignedChannelAnnouncement channel_announcement;
10247 struct LDKUnsignedChannelUpdate channel_update;
10250 struct LDKUnsignedNodeAnnouncement node_announcement;
10253 } LDKUnsignedGossipMessage;
10256 * A trait that can handle cryptographic operations at the scope level of a node.
10258 typedef struct LDKNodeSigner {
10260 * An opaque pointer which is passed to your function implementations as an argument.
10261 * This has no meaning in the LDK, and can be NULL or any other value.
10265 * Get secret key material as bytes for use in encrypting and decrypting inbound payment data.
10267 * If the implementor of this trait supports [phantom node payments], then every node that is
10268 * intended to be included in the phantom invoice route hints must return the same value from
10271 * This method must return the same value each time it is called.
10273 * [phantom node payments]: PhantomKeysManager
10275 struct LDKThirtyTwoBytes (*get_inbound_payment_key_material)(const void *this_arg);
10277 * Get node id based on the provided [`Recipient`].
10279 * This method must return the same value each time it is called with a given [`Recipient`]
10282 * Errors if the [`Recipient`] variant is not supported by the implementation.
10284 struct LDKCResult_PublicKeyNoneZ (*get_node_id)(const void *this_arg, enum LDKRecipient recipient);
10286 * Gets the ECDH shared secret of our node secret and `other_key`, multiplying by `tweak` if
10287 * one is provided. Note that this tweak can be applied to `other_key` instead of our node
10288 * secret, though this is less efficient.
10290 * Note that if this fails while attempting to forward an HTLC, LDK will panic. The error
10291 * should be resolved to allow LDK to resume forwarding HTLCs.
10293 * Errors if the [`Recipient`] variant is not supported by the implementation.
10295 struct LDKCResult_ThirtyTwoBytesNoneZ (*ecdh)(const void *this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_BigEndianScalarZ tweak);
10299 * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of
10300 * this trait to parse the invoice and make sure they're signing what they expect, rather than
10301 * blindly signing the hash.
10303 * The `hrp_bytes` are ASCII bytes, while the `invoice_data` is base32.
10305 * The secret key used to sign the invoice is dependent on the [`Recipient`].
10307 * Errors if the [`Recipient`] variant is not supported by the implementation.
10309 struct LDKCResult_RecoverableSignatureNoneZ (*sign_invoice)(const void *this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient recipient);
10311 * Signs the [`TaggedHash`] of a BOLT 12 invoice request.
10313 * May be called by a function passed to [`UnsignedInvoiceRequest::sign`] where
10314 * `invoice_request` is the callee.
10316 * Implementors may check that the `invoice_request` is expected rather than blindly signing
10317 * the tagged hash. An `Ok` result should sign `invoice_request.tagged_hash().as_digest()` with
10318 * the node's signing key or an ephemeral key to preserve privacy, whichever is associated with
10319 * [`UnsignedInvoiceRequest::payer_id`].
10321 * [`TaggedHash`]: crate::offers::merkle::TaggedHash
10323 struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice_request)(const void *this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR invoice_request);
10325 * Signs the [`TaggedHash`] of a BOLT 12 invoice.
10327 * May be called by a function passed to [`UnsignedBolt12Invoice::sign`] where `invoice` is the
10330 * Implementors may check that the `invoice` is expected rather than blindly signing the tagged
10331 * hash. An `Ok` result should sign `invoice.tagged_hash().as_digest()` with the node's signing
10332 * key or an ephemeral key to preserve privacy, whichever is associated with
10333 * [`UnsignedBolt12Invoice::signing_pubkey`].
10335 * [`TaggedHash`]: crate::offers::merkle::TaggedHash
10337 struct LDKCResult_SchnorrSignatureNoneZ (*sign_bolt12_invoice)(const void *this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR invoice);
10339 * Sign a gossip message.
10341 * Note that if this fails, LDK may panic and the message will not be broadcast to the network
10342 * or a possible channel counterparty. If LDK panics, the error should be resolved to allow the
10343 * message to be broadcast, as otherwise it may prevent one from receiving funds over the
10344 * corresponding channel.
10346 struct LDKCResult_ECDSASignatureNoneZ (*sign_gossip_message)(const void *this_arg, struct LDKUnsignedGossipMessage msg);
10348 * Frees any resources associated with this object given its this_arg pointer.
10349 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10351 void (*free)(void *this_arg);
10355 * A trait that can return signer instances for individual channels.
10357 typedef struct LDKSignerProvider {
10359 * An opaque pointer which is passed to your function implementations as an argument.
10360 * This has no meaning in the LDK, and can be NULL or any other value.
10364 * Generates a unique `channel_keys_id` that can be used to obtain a [`Self::EcdsaSigner`] through
10365 * [`SignerProvider::derive_channel_signer`]. The `user_channel_id` is provided to allow
10366 * implementations of [`SignerProvider`] to maintain a mapping between itself and the generated
10367 * `channel_keys_id`.
10369 * This method must return a different value each time it is called.
10371 struct LDKThirtyTwoBytes (*generate_channel_keys_id)(const void *this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id);
10373 * Derives the private key material backing a `Signer`.
10375 * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through
10376 * [`SignerProvider::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be
10377 * re-derived from its `channel_keys_id`, which can be obtained through its trait method
10378 * [`ChannelSigner::channel_keys_id`].
10380 struct LDKWriteableEcdsaChannelSigner (*derive_channel_signer)(const void *this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id);
10382 * Reads a [`Signer`] for this [`SignerProvider`] from the given input stream.
10383 * This is only called during deserialization of other objects which contain
10384 * [`WriteableEcdsaChannelSigner`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s).
10385 * The bytes are exactly those which `<Self::Signer as Writeable>::write()` writes, and
10386 * contain no versioning scheme. You may wish to include your own version prefix and ensure
10387 * you've read all of the provided bytes to ensure no corruption occurred.
10389 * This method is slowly being phased out -- it will only be called when reading objects
10390 * written by LDK versions prior to 0.0.113.
10392 * [`Signer`]: Self::EcdsaSigner
10393 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
10394 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
10396 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ (*read_chan_signer)(const void *this_arg, struct LDKu8slice reader);
10398 * Get a script pubkey which we send funds to when claiming on-chain contestable outputs.
10400 * If this function returns an error, this will result in a channel failing to open.
10402 * This method should return a different value each time it is called, to avoid linking
10403 * on-chain funds across channels as controlled to the same user. `channel_keys_id` may be
10404 * used to derive a unique value for each channel.
10406 struct LDKCResult_CVec_u8ZNoneZ (*get_destination_script)(const void *this_arg, struct LDKThirtyTwoBytes channel_keys_id);
10408 * Get a script pubkey which we will send funds to when closing a channel.
10410 * If this function returns an error, this will result in a channel failing to open or close.
10411 * In the event of a failure when the counterparty is initiating a close, this can result in a
10412 * channel force close.
10414 * This method should return a different value each time it is called, to avoid linking
10415 * on-chain funds across channels as controlled to the same user.
10417 struct LDKCResult_ShutdownScriptNoneZ (*get_shutdown_scriptpubkey)(const void *this_arg);
10419 * Frees any resources associated with this object given its this_arg pointer.
10420 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10422 void (*free)(void *this_arg);
10423 } LDKSignerProvider;
10426 * A trait which should be implemented to provide feerate information on a number of time
10429 * If access to a local mempool is not feasible, feerate estimates should be fetched from a set of
10430 * third-parties hosting them. Note that this enables them to affect the propagation of your
10431 * pre-signed transactions at any time and therefore endangers the safety of channels funds. It
10432 * should be considered carefully as a deployment.
10434 * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're
10435 * called from inside the library in response to chain events, P2P events, or timer events).
10437 typedef struct LDKFeeEstimator {
10439 * An opaque pointer which is passed to your function implementations as an argument.
10440 * This has no meaning in the LDK, and can be NULL or any other value.
10444 * Gets estimated satoshis of fee required per 1000 Weight-Units.
10446 * LDK will wrap this method and ensure that the value returned is no smaller than 253
10447 * (ie 1 satoshi-per-byte rounded up to ensure later round-downs don't put us below 1 satoshi-per-byte).
10449 * The following unit conversions can be used to convert to sats/KW:
10450 * * satoshis-per-byte * 250
10451 * * satoshis-per-kbyte / 4
10453 uint32_t (*get_est_sat_per_1000_weight)(const void *this_arg, enum LDKConfirmationTarget confirmation_target);
10455 * Frees any resources associated with this object given its this_arg pointer.
10456 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10458 void (*free)(void *this_arg);
10464 * Data to construct a [`BlindedHop`] for receiving a payment. This payload is custom to LDK and
10465 * may not be valid if received by another lightning implementation.
10467 typedef struct MUST_USE_STRUCT LDKReceiveTlvs {
10469 * A pointer to the opaque Rust object.
10470 * Nearly everywhere, inner must be non-null, however in places where
10471 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10473 LDKnativeReceiveTlvs *inner;
10475 * Indicates that this is the only struct which contains the same pointer.
10476 * Rust functions which take ownership of an object provided via an argument require
10477 * this to be true and invalidate the object pointed to by inner.
10483 * A trait defining behavior for routing an [`OnionMessage`].
10485 typedef struct LDKMessageRouter {
10487 * An opaque pointer which is passed to your function implementations as an argument.
10488 * This has no meaning in the LDK, and can be NULL or any other value.
10492 * Returns a route for sending an [`OnionMessage`] to the given [`Destination`].
10494 struct LDKCResult_OnionMessagePathNoneZ (*find_path)(const void *this_arg, struct LDKPublicKey sender, struct LDKCVec_PublicKeyZ peers, struct LDKDestination destination);
10496 * Creates [`BlindedPath`]s to the `recipient` node. The nodes in `peers` are assumed to be
10497 * direct peers with the `recipient`.
10499 struct LDKCResult_CVec_BlindedPathZNoneZ (*create_blinded_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_PublicKeyZ peers);
10501 * Frees any resources associated with this object given its this_arg pointer.
10502 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10504 void (*free)(void *this_arg);
10505 } LDKMessageRouter;
10508 * A trait defining behavior for routing a payment.
10510 typedef struct LDKRouter {
10512 * An opaque pointer which is passed to your function implementations as an argument.
10513 * This has no meaning in the LDK, and can be NULL or any other value.
10517 * Finds a [`Route`] for a payment between the given `payer` and a payee.
10519 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
10520 * and [`RouteParameters::final_value_msat`], respectively.
10522 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
10524 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);
10526 * Finds a [`Route`] for a payment between the given `payer` and a payee.
10528 * The `payee` and the payment's value are given in [`RouteParameters::payment_params`]
10529 * and [`RouteParameters::final_value_msat`], respectively.
10531 * Includes a [`PaymentHash`] and a [`PaymentId`] to be able to correlate the request with a specific
10534 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
10536 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);
10538 * Creates [`BlindedPath`]s for payment to the `recipient` node. The channels in `first_hops`
10539 * are assumed to be with the `recipient`'s peers. The payment secret and any constraints are
10542 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ (*create_blinded_payment_paths)(const void *this_arg, struct LDKPublicKey recipient, struct LDKCVec_ChannelDetailsZ first_hops, struct LDKReceiveTlvs tlvs, uint64_t amount_msats);
10544 * Implementation of MessageRouter for this object.
10546 struct LDKMessageRouter MessageRouter;
10548 * Frees any resources associated with this object given its this_arg pointer.
10549 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
10551 void (*free)(void *this_arg);
10557 * Manager which keeps track of a number of channels and sends messages to the appropriate
10558 * channel, also tracking HTLC preimages and forwarding onion packets appropriately.
10560 * Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through
10561 * to individual Channels.
10563 * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for
10564 * all peers during write/read (though does not modify this instance, only the instance being
10565 * serialized). This will result in any channels which have not yet exchanged [`funding_created`] (i.e.,
10566 * called [`funding_transaction_generated`] for outbound channels) being closed.
10568 * Note that you can be a bit lazier about writing out `ChannelManager` than you can be with
10569 * [`ChannelMonitor`]. With [`ChannelMonitor`] you MUST durably write each
10570 * [`ChannelMonitorUpdate`] before returning from
10571 * [`chain::Watch::watch_channel`]/[`update_channel`] or before completing async writes. With
10572 * `ChannelManager`s, writing updates happens out-of-band (and will prevent any other
10573 * `ChannelManager` operations from occurring during the serialization process). If the
10574 * deserialized version is out-of-date compared to the [`ChannelMonitor`] passed by reference to
10575 * [`read`], those channels will be force-closed based on the `ChannelMonitor` state and no funds
10576 * will be lost (modulo on-chain transaction fees).
10578 * Note that the deserializer is only implemented for `(`[`BlockHash`]`, `[`ChannelManager`]`)`, which
10579 * tells you the last block hash which was connected. You should get the best block tip before using the manager.
10580 * See [`chain::Listen`] and [`chain::Confirm`] for more details.
10582 * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating
10583 * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid
10584 * spam due to quick disconnection/reconnection, updates are not sent until the channel has been
10585 * offline for a full minute. In order to track this, you must call
10586 * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect.
10588 * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and
10589 * inbound channels without confirmed funding transactions. This may result in nodes which we do
10590 * not have a channel with being unable to connect to us or open new channels with us if we have
10591 * many peers with unfunded channels.
10593 * Because it is an indication of trust, inbound channels which we've accepted as 0conf are
10594 * exempted from the count of unfunded channels. Similarly, outbound channels and connections are
10595 * never limited. Please ensure you limit the count of such channels yourself.
10597 * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`]
10598 * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but
10599 * essentially you should default to using a [`SimpleRefChannelManager`], and use a
10600 * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when
10601 * you're using lightning-net-tokio.
10603 * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected
10604 * [`funding_created`]: msgs::FundingCreated
10605 * [`funding_transaction_generated`]: Self::funding_transaction_generated
10606 * [`BlockHash`]: bitcoin::hash_types::BlockHash
10607 * [`update_channel`]: chain::Watch::update_channel
10608 * [`ChannelUpdate`]: msgs::ChannelUpdate
10609 * [`timer_tick_occurred`]: Self::timer_tick_occurred
10610 * [`read`]: ReadableArgs::read
10612 typedef struct MUST_USE_STRUCT LDKChannelManager {
10614 * A pointer to the opaque Rust object.
10615 * Nearly everywhere, inner must be non-null, however in places where
10616 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10618 LDKnativeChannelManager *inner;
10620 * Indicates that this is the only struct which contains the same pointer.
10621 * Rust functions which take ownership of an object provided via an argument require
10622 * this to be true and invalidate the object pointed to by inner.
10625 } LDKChannelManager;
10628 * A tuple of 2 elements. See the individual fields for the types contained.
10630 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ {
10632 * The element at position 0
10634 struct LDKThirtyTwoBytes a;
10636 * The element at position 1
10638 struct LDKChannelManager b;
10639 } LDKC2Tuple_ThirtyTwoBytesChannelManagerZ;
10642 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ
10644 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr {
10646 * A pointer to the contents in the success state.
10647 * Reading from this pointer when `result_ok` is not set is undefined.
10649 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ *result;
10651 * A pointer to the contents in the error state.
10652 * Reading from this pointer when `result_ok` is set is undefined.
10654 struct LDKDecodeError *err;
10655 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr;
10658 * A CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents the result of a fallible operation,
10659 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelManagerZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10660 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10662 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ {
10664 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ, accessible via either
10665 * `err` or `result` depending on the state of `result_ok`.
10667 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZPtr contents;
10669 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ represents a success state.
10672 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ;
10675 * Options for how to set the max dust HTLC exposure allowed on a channel. See
10676 * [`ChannelConfig::max_dust_htlc_exposure`] for details.
10678 typedef enum LDKMaxDustHTLCExposure_Tag {
10680 * This sets a fixed limit on the total dust exposure in millisatoshis. Setting this too low
10681 * may prevent the sending or receipt of low-value HTLCs on high-traffic nodes, however this
10682 * limit is very important to prevent stealing of large amounts of dust HTLCs by miners
10683 * through [fee griefing
10684 * attacks](https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-May/002714.html).
10686 * Note that if the feerate increases significantly, without a manual increase
10687 * to this maximum the channel may be unable to send/receive HTLCs between the maximum dust
10688 * exposure and the new minimum value for HTLCs to be economically viable to claim.
10690 LDKMaxDustHTLCExposure_FixedLimitMsat,
10692 * This sets a multiplier on the estimated high priority feerate (sats/KW, as obtained from
10693 * [`FeeEstimator`]) to determine the maximum allowed dust exposure. If this variant is used
10694 * then the maximum dust exposure in millisatoshis is calculated as:
10695 * `high_priority_feerate_per_kw * value`. For example, with our default value
10696 * `FeeRateMultiplier(5000)`:
10698 * - For the minimum fee rate of 1 sat/vByte (250 sat/KW, although the minimum
10699 * defaults to 253 sats/KW for rounding, see [`FeeEstimator`]), the max dust exposure would
10700 * be 253 * 5000 = 1,265,000 msats.
10701 * - For a fee rate of 30 sat/vByte (7500 sat/KW), the max dust exposure would be
10702 * 7500 * 5000 = 37,500,000 msats.
10704 * This allows the maximum dust exposure to automatically scale with fee rate changes.
10706 * Note, if you're using a third-party fee estimator, this may leave you more exposed to a
10707 * fee griefing attack, where your fee estimator may purposely overestimate the fee rate,
10708 * causing you to accept more dust HTLCs than you would otherwise.
10710 * This variant is primarily meant to serve pre-anchor channels, as HTLC fees being included
10711 * on HTLC outputs means your channel may be subject to more dust exposure in the event of
10712 * increases in fee rate.
10714 * # Backwards Compatibility
10715 * This variant only became available in LDK 0.0.116, so if you downgrade to a prior version
10716 * by default this will be set to a [`Self::FixedLimitMsat`] of 5,000,000 msat.
10718 * [`FeeEstimator`]: crate::chain::chaininterface::FeeEstimator
10720 LDKMaxDustHTLCExposure_FeeRateMultiplier,
10722 * Must be last for serialization purposes
10724 LDKMaxDustHTLCExposure_Sentinel,
10725 } LDKMaxDustHTLCExposure_Tag;
10727 typedef struct MUST_USE_STRUCT LDKMaxDustHTLCExposure {
10728 LDKMaxDustHTLCExposure_Tag tag;
10731 uint64_t fixed_limit_msat;
10734 uint64_t fee_rate_multiplier;
10737 } LDKMaxDustHTLCExposure;
10740 * The contents of CResult_MaxDustHTLCExposureDecodeErrorZ
10742 typedef union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr {
10744 * A pointer to the contents in the success state.
10745 * Reading from this pointer when `result_ok` is not set is undefined.
10747 struct LDKMaxDustHTLCExposure *result;
10749 * A pointer to the contents in the error state.
10750 * Reading from this pointer when `result_ok` is set is undefined.
10752 struct LDKDecodeError *err;
10753 } LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr;
10756 * A CResult_MaxDustHTLCExposureDecodeErrorZ represents the result of a fallible operation,
10757 * containing a crate::lightning::util::config::MaxDustHTLCExposure on success and a crate::lightning::ln::msgs::DecodeError on failure.
10758 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10760 typedef struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ {
10762 * The contents of this CResult_MaxDustHTLCExposureDecodeErrorZ, accessible via either
10763 * `err` or `result` depending on the state of `result_ok`.
10765 union LDKCResult_MaxDustHTLCExposureDecodeErrorZPtr contents;
10767 * Whether this CResult_MaxDustHTLCExposureDecodeErrorZ represents a success state.
10770 } LDKCResult_MaxDustHTLCExposureDecodeErrorZ;
10775 * Options which apply on a per-channel basis and may change at runtime or based on negotiation
10776 * with our counterparty.
10778 typedef struct MUST_USE_STRUCT LDKChannelConfig {
10780 * A pointer to the opaque Rust object.
10781 * Nearly everywhere, inner must be non-null, however in places where
10782 * the Rust equivalent takes an Option, it may be set to null to indicate None.
10784 LDKnativeChannelConfig *inner;
10786 * Indicates that this is the only struct which contains the same pointer.
10787 * Rust functions which take ownership of an object provided via an argument require
10788 * this to be true and invalidate the object pointed to by inner.
10791 } LDKChannelConfig;
10794 * The contents of CResult_ChannelConfigDecodeErrorZ
10796 typedef union LDKCResult_ChannelConfigDecodeErrorZPtr {
10798 * A pointer to the contents in the success state.
10799 * Reading from this pointer when `result_ok` is not set is undefined.
10801 struct LDKChannelConfig *result;
10803 * A pointer to the contents in the error state.
10804 * Reading from this pointer when `result_ok` is set is undefined.
10806 struct LDKDecodeError *err;
10807 } LDKCResult_ChannelConfigDecodeErrorZPtr;
10810 * A CResult_ChannelConfigDecodeErrorZ represents the result of a fallible operation,
10811 * containing a crate::lightning::util::config::ChannelConfig on success and a crate::lightning::ln::msgs::DecodeError on failure.
10812 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10814 typedef struct LDKCResult_ChannelConfigDecodeErrorZ {
10816 * The contents of this CResult_ChannelConfigDecodeErrorZ, accessible via either
10817 * `err` or `result` depending on the state of `result_ok`.
10819 union LDKCResult_ChannelConfigDecodeErrorZPtr contents;
10821 * Whether this CResult_ChannelConfigDecodeErrorZ represents a success state.
10824 } LDKCResult_ChannelConfigDecodeErrorZ;
10827 * An enum which can either contain a crate::lightning::util::config::MaxDustHTLCExposure or not
10829 typedef enum LDKCOption_MaxDustHTLCExposureZ_Tag {
10831 * When we're in this state, this COption_MaxDustHTLCExposureZ contains a crate::lightning::util::config::MaxDustHTLCExposure
10833 LDKCOption_MaxDustHTLCExposureZ_Some,
10835 * When we're in this state, this COption_MaxDustHTLCExposureZ contains nothing
10837 LDKCOption_MaxDustHTLCExposureZ_None,
10839 * Must be last for serialization purposes
10841 LDKCOption_MaxDustHTLCExposureZ_Sentinel,
10842 } LDKCOption_MaxDustHTLCExposureZ_Tag;
10844 typedef struct LDKCOption_MaxDustHTLCExposureZ {
10845 LDKCOption_MaxDustHTLCExposureZ_Tag tag;
10848 struct LDKMaxDustHTLCExposure some;
10851 } LDKCOption_MaxDustHTLCExposureZ;
10854 * An enum which can either contain a crate::lightning::util::errors::APIError or not
10856 typedef enum LDKCOption_APIErrorZ_Tag {
10858 * When we're in this state, this COption_APIErrorZ contains a crate::lightning::util::errors::APIError
10860 LDKCOption_APIErrorZ_Some,
10862 * When we're in this state, this COption_APIErrorZ contains nothing
10864 LDKCOption_APIErrorZ_None,
10866 * Must be last for serialization purposes
10868 LDKCOption_APIErrorZ_Sentinel,
10869 } LDKCOption_APIErrorZ_Tag;
10871 typedef struct LDKCOption_APIErrorZ {
10872 LDKCOption_APIErrorZ_Tag tag;
10875 struct LDKAPIError some;
10878 } LDKCOption_APIErrorZ;
10881 * The contents of CResult_COption_APIErrorZDecodeErrorZ
10883 typedef union LDKCResult_COption_APIErrorZDecodeErrorZPtr {
10885 * A pointer to the contents in the success state.
10886 * Reading from this pointer when `result_ok` is not set is undefined.
10888 struct LDKCOption_APIErrorZ *result;
10890 * A pointer to the contents in the error state.
10891 * Reading from this pointer when `result_ok` is set is undefined.
10893 struct LDKDecodeError *err;
10894 } LDKCResult_COption_APIErrorZDecodeErrorZPtr;
10897 * A CResult_COption_APIErrorZDecodeErrorZ represents the result of a fallible operation,
10898 * containing a crate::c_types::derived::COption_APIErrorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10899 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10901 typedef struct LDKCResult_COption_APIErrorZDecodeErrorZ {
10903 * The contents of this CResult_COption_APIErrorZDecodeErrorZ, accessible via either
10904 * `err` or `result` depending on the state of `result_ok`.
10906 union LDKCResult_COption_APIErrorZDecodeErrorZPtr contents;
10908 * Whether this CResult_COption_APIErrorZDecodeErrorZ represents a success state.
10911 } LDKCResult_COption_APIErrorZDecodeErrorZ;
10914 * The contents of CResult_ChannelMonitorUpdateDecodeErrorZ
10916 typedef union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr {
10918 * A pointer to the contents in the success state.
10919 * Reading from this pointer when `result_ok` is not set is undefined.
10921 struct LDKChannelMonitorUpdate *result;
10923 * A pointer to the contents in the error state.
10924 * Reading from this pointer when `result_ok` is set is undefined.
10926 struct LDKDecodeError *err;
10927 } LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr;
10930 * A CResult_ChannelMonitorUpdateDecodeErrorZ represents the result of a fallible operation,
10931 * containing a crate::lightning::chain::channelmonitor::ChannelMonitorUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
10932 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10934 typedef struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ {
10936 * The contents of this CResult_ChannelMonitorUpdateDecodeErrorZ, accessible via either
10937 * `err` or `result` depending on the state of `result_ok`.
10939 union LDKCResult_ChannelMonitorUpdateDecodeErrorZPtr contents;
10941 * Whether this CResult_ChannelMonitorUpdateDecodeErrorZ represents a success state.
10944 } LDKCResult_ChannelMonitorUpdateDecodeErrorZ;
10947 * An enum which can either contain a crate::lightning::chain::channelmonitor::MonitorEvent or not
10949 typedef enum LDKCOption_MonitorEventZ_Tag {
10951 * When we're in this state, this COption_MonitorEventZ contains a crate::lightning::chain::channelmonitor::MonitorEvent
10953 LDKCOption_MonitorEventZ_Some,
10955 * When we're in this state, this COption_MonitorEventZ contains nothing
10957 LDKCOption_MonitorEventZ_None,
10959 * Must be last for serialization purposes
10961 LDKCOption_MonitorEventZ_Sentinel,
10962 } LDKCOption_MonitorEventZ_Tag;
10964 typedef struct LDKCOption_MonitorEventZ {
10965 LDKCOption_MonitorEventZ_Tag tag;
10968 struct LDKMonitorEvent some;
10971 } LDKCOption_MonitorEventZ;
10974 * The contents of CResult_COption_MonitorEventZDecodeErrorZ
10976 typedef union LDKCResult_COption_MonitorEventZDecodeErrorZPtr {
10978 * A pointer to the contents in the success state.
10979 * Reading from this pointer when `result_ok` is not set is undefined.
10981 struct LDKCOption_MonitorEventZ *result;
10983 * A pointer to the contents in the error state.
10984 * Reading from this pointer when `result_ok` is set is undefined.
10986 struct LDKDecodeError *err;
10987 } LDKCResult_COption_MonitorEventZDecodeErrorZPtr;
10990 * A CResult_COption_MonitorEventZDecodeErrorZ represents the result of a fallible operation,
10991 * containing a crate::c_types::derived::COption_MonitorEventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
10992 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
10994 typedef struct LDKCResult_COption_MonitorEventZDecodeErrorZ {
10996 * The contents of this CResult_COption_MonitorEventZDecodeErrorZ, accessible via either
10997 * `err` or `result` depending on the state of `result_ok`.
10999 union LDKCResult_COption_MonitorEventZDecodeErrorZPtr contents;
11001 * Whether this CResult_COption_MonitorEventZDecodeErrorZ represents a success state.
11004 } LDKCResult_COption_MonitorEventZDecodeErrorZ;
11007 * The contents of CResult_HTLCUpdateDecodeErrorZ
11009 typedef union LDKCResult_HTLCUpdateDecodeErrorZPtr {
11011 * A pointer to the contents in the success state.
11012 * Reading from this pointer when `result_ok` is not set is undefined.
11014 struct LDKHTLCUpdate *result;
11016 * A pointer to the contents in the error state.
11017 * Reading from this pointer when `result_ok` is set is undefined.
11019 struct LDKDecodeError *err;
11020 } LDKCResult_HTLCUpdateDecodeErrorZPtr;
11023 * A CResult_HTLCUpdateDecodeErrorZ represents the result of a fallible operation,
11024 * containing a crate::lightning::chain::channelmonitor::HTLCUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
11025 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11027 typedef struct LDKCResult_HTLCUpdateDecodeErrorZ {
11029 * The contents of this CResult_HTLCUpdateDecodeErrorZ, accessible via either
11030 * `err` or `result` depending on the state of `result_ok`.
11032 union LDKCResult_HTLCUpdateDecodeErrorZPtr contents;
11034 * Whether this CResult_HTLCUpdateDecodeErrorZ represents a success state.
11037 } LDKCResult_HTLCUpdateDecodeErrorZ;
11040 * A tuple of 2 elements. See the individual fields for the types contained.
11042 typedef struct LDKC2Tuple_OutPointCVec_u8ZZ {
11044 * The element at position 0
11046 struct LDKOutPoint a;
11048 * The element at position 1
11050 struct LDKCVec_u8Z b;
11051 } LDKC2Tuple_OutPointCVec_u8ZZ;
11054 * A tuple of 2 elements. See the individual fields for the types contained.
11056 typedef struct LDKC2Tuple_u32CVec_u8ZZ {
11058 * The element at position 0
11062 * The element at position 1
11064 struct LDKCVec_u8Z b;
11065 } LDKC2Tuple_u32CVec_u8ZZ;
11068 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32CVec_u8ZZs of arbitrary size.
11069 * This corresponds to std::vector in C++
11071 typedef struct LDKCVec_C2Tuple_u32CVec_u8ZZZ {
11073 * The elements in the array.
11074 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11076 struct LDKC2Tuple_u32CVec_u8ZZ *data;
11078 * The number of elements pointed to by `data`.
11081 } LDKCVec_C2Tuple_u32CVec_u8ZZZ;
11084 * A tuple of 2 elements. See the individual fields for the types contained.
11086 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ {
11088 * The element at position 0
11090 struct LDKThirtyTwoBytes a;
11092 * The element at position 1
11094 struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b;
11095 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ;
11098 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZs of arbitrary size.
11099 * This corresponds to std::vector in C++
11101 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ {
11103 * The elements in the array.
11104 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11106 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *data;
11108 * The number of elements pointed to by `data`.
11111 } LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ;
11114 * A dynamically-allocated array of crate::lightning::ln::chan_utils::CommitmentTransactions of arbitrary size.
11115 * This corresponds to std::vector in C++
11117 typedef struct LDKCVec_CommitmentTransactionZ {
11119 * The elements in the array.
11120 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11122 struct LDKCommitmentTransaction *data;
11124 * The number of elements pointed to by `data`.
11127 } LDKCVec_CommitmentTransactionZ;
11130 * A tuple of 2 elements. See the individual fields for the types contained.
11132 typedef struct LDKC2Tuple_u32TxOutZ {
11134 * The element at position 0
11138 * The element at position 1
11141 } LDKC2Tuple_u32TxOutZ;
11144 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_u32TxOutZs of arbitrary size.
11145 * This corresponds to std::vector in C++
11147 typedef struct LDKCVec_C2Tuple_u32TxOutZZ {
11149 * The elements in the array.
11150 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11152 struct LDKC2Tuple_u32TxOutZ *data;
11154 * The number of elements pointed to by `data`.
11157 } LDKCVec_C2Tuple_u32TxOutZZ;
11160 * A tuple of 2 elements. See the individual fields for the types contained.
11162 typedef struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ {
11164 * The element at position 0
11166 struct LDKThirtyTwoBytes a;
11168 * The element at position 1
11170 struct LDKCVec_C2Tuple_u32TxOutZZ b;
11171 } LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ;
11174 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZs of arbitrary size.
11175 * This corresponds to std::vector in C++
11177 typedef struct LDKCVec_TransactionOutputsZ {
11179 * The elements in the array.
11180 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11182 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *data;
11184 * The number of elements pointed to by `data`.
11187 } LDKCVec_TransactionOutputsZ;
11190 * Details about the balance(s) available for spending once the channel appears on chain.
11192 * See [`ChannelMonitor::get_claimable_balances`] for more details on when these will or will not
11195 typedef enum LDKBalance_Tag {
11197 * The channel is not yet closed (or the commitment or closing transaction has not yet
11198 * appeared in a block). The given balance is claimable (less on-chain fees) if the channel is
11199 * force-closed now.
11201 LDKBalance_ClaimableOnChannelClose,
11203 * The channel has been closed, and the given balance is ours but awaiting confirmations until
11204 * we consider it spendable.
11206 LDKBalance_ClaimableAwaitingConfirmations,
11208 * The channel has been closed, and the given balance should be ours but awaiting spending
11209 * transaction confirmation. If the spending transaction does not confirm in time, it is
11210 * possible our counterparty can take the funds by broadcasting an HTLC timeout on-chain.
11212 * Once the spending transaction confirms, before it has reached enough confirmations to be
11213 * considered safe from chain reorganizations, the balance will instead be provided via
11214 * [`Balance::ClaimableAwaitingConfirmations`].
11216 LDKBalance_ContentiousClaimable,
11218 * HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
11219 * fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
11220 * likely to be claimed by our counterparty before we do.
11222 LDKBalance_MaybeTimeoutClaimableHTLC,
11224 * HTLCs which we received from our counterparty which are claimable with a preimage which we
11225 * do not currently have. This will only be claimable if we receive the preimage from the node
11226 * to which we forwarded this HTLC before the timeout.
11228 LDKBalance_MaybePreimageClaimableHTLC,
11230 * The channel has been closed, and our counterparty broadcasted a revoked commitment
11233 * Thus, we're able to claim all outputs in the commitment transaction, one of which has the
11234 * following amount.
11236 LDKBalance_CounterpartyRevokedOutputClaimable,
11238 * Must be last for serialization purposes
11240 LDKBalance_Sentinel,
11243 typedef struct LDKBalance_LDKClaimableOnChannelClose_Body {
11245 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
11246 * required to do so.
11248 uint64_t amount_satoshis;
11249 } LDKBalance_LDKClaimableOnChannelClose_Body;
11251 typedef struct LDKBalance_LDKClaimableAwaitingConfirmations_Body {
11253 * The amount available to claim, in satoshis, possibly excluding the on-chain fees which
11254 * were spent in broadcasting the transaction.
11256 uint64_t amount_satoshis;
11258 * The height at which an [`Event::SpendableOutputs`] event will be generated for this
11261 uint32_t confirmation_height;
11262 } LDKBalance_LDKClaimableAwaitingConfirmations_Body;
11264 typedef struct LDKBalance_LDKContentiousClaimable_Body {
11266 * The amount available to claim, in satoshis, excluding the on-chain fees which will be
11267 * required to do so.
11269 uint64_t amount_satoshis;
11271 * The height at which the counterparty may be able to claim the balance if we have not
11274 uint32_t timeout_height;
11276 * The payment hash that locks this HTLC.
11278 struct LDKThirtyTwoBytes payment_hash;
11280 * The preimage that can be used to claim this HTLC.
11282 struct LDKThirtyTwoBytes payment_preimage;
11283 } LDKBalance_LDKContentiousClaimable_Body;
11285 typedef struct LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body {
11287 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
11288 * which will be required to do so.
11290 uint64_t amount_satoshis;
11292 * The height at which we will be able to claim the balance if our counterparty has not
11295 uint32_t claimable_height;
11297 * The payment hash whose preimage our counterparty needs to claim this HTLC.
11299 struct LDKThirtyTwoBytes payment_hash;
11300 } LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body;
11302 typedef struct LDKBalance_LDKMaybePreimageClaimableHTLC_Body {
11304 * The amount potentially available to claim, in satoshis, excluding the on-chain fees
11305 * which will be required to do so.
11307 uint64_t amount_satoshis;
11309 * The height at which our counterparty will be able to claim the balance if we have not
11310 * yet received the preimage and claimed it ourselves.
11312 uint32_t expiry_height;
11314 * The payment hash whose preimage we need to claim this HTLC.
11316 struct LDKThirtyTwoBytes payment_hash;
11317 } LDKBalance_LDKMaybePreimageClaimableHTLC_Body;
11319 typedef struct LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body {
11321 * The amount, in satoshis, of the output which we can claim.
11323 * Note that for outputs from HTLC balances this may be excluding some on-chain fees that
11324 * were already spent.
11326 uint64_t amount_satoshis;
11327 } LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body;
11329 typedef struct MUST_USE_STRUCT LDKBalance {
11330 LDKBalance_Tag tag;
11332 LDKBalance_LDKClaimableOnChannelClose_Body claimable_on_channel_close;
11333 LDKBalance_LDKClaimableAwaitingConfirmations_Body claimable_awaiting_confirmations;
11334 LDKBalance_LDKContentiousClaimable_Body contentious_claimable;
11335 LDKBalance_LDKMaybeTimeoutClaimableHTLC_Body maybe_timeout_claimable_htlc;
11336 LDKBalance_LDKMaybePreimageClaimableHTLC_Body maybe_preimage_claimable_htlc;
11337 LDKBalance_LDKCounterpartyRevokedOutputClaimable_Body counterparty_revoked_output_claimable;
11342 * A dynamically-allocated array of crate::lightning::chain::channelmonitor::Balances of arbitrary size.
11343 * This corresponds to std::vector in C++
11345 typedef struct LDKCVec_BalanceZ {
11347 * The elements in the array.
11348 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11350 struct LDKBalance *data;
11352 * The number of elements pointed to by `data`.
11355 } LDKCVec_BalanceZ;
11358 * A tuple of 2 elements. See the individual fields for the types contained.
11360 typedef struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ {
11362 * The element at position 0
11364 struct LDKThirtyTwoBytes a;
11366 * The element at position 1
11368 struct LDKChannelMonitor b;
11369 } LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ;
11372 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ
11374 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr {
11376 * A pointer to the contents in the success state.
11377 * Reading from this pointer when `result_ok` is not set is undefined.
11379 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
11381 * A pointer to the contents in the error state.
11382 * Reading from this pointer when `result_ok` is set is undefined.
11384 struct LDKDecodeError *err;
11385 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr;
11388 * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents the result of a fallible operation,
11389 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
11390 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11392 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ {
11394 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ, accessible via either
11395 * `err` or `result` depending on the state of `result_ok`.
11397 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZPtr contents;
11399 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ represents a success state.
11402 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ;
11405 * Defines a type identifier for sending messages over the wire.
11407 * Messages implementing this trait specify a type and must be [`Writeable`].
11409 typedef struct LDKType {
11411 * An opaque pointer which is passed to your function implementations as an argument.
11412 * This has no meaning in the LDK, and can be NULL or any other value.
11416 * Returns the type identifying the message payload.
11418 uint16_t (*type_id)(const void *this_arg);
11420 * Return a human-readable "debug" string describing this object
11422 struct LDKStr (*debug_str)(const void *this_arg);
11424 * Serialize the object into a byte array
11426 struct LDKCVec_u8Z (*write)(const void *this_arg);
11428 * Called, if set, after this Type has been cloned into a duplicate object.
11429 * The new Type is provided, and should be mutated as needed to perform a
11430 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
11432 void (*cloned)(struct LDKType *NONNULL_PTR new_Type);
11434 * Frees any resources associated with this object given its this_arg pointer.
11435 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11437 void (*free)(void *this_arg);
11441 * A tuple of 2 elements. See the individual fields for the types contained.
11443 typedef struct LDKC2Tuple_PublicKeyTypeZ {
11445 * The element at position 0
11447 struct LDKPublicKey a;
11449 * The element at position 1
11452 } LDKC2Tuple_PublicKeyTypeZ;
11455 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyTypeZs of arbitrary size.
11456 * This corresponds to std::vector in C++
11458 typedef struct LDKCVec_C2Tuple_PublicKeyTypeZZ {
11460 * The elements in the array.
11461 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11463 struct LDKC2Tuple_PublicKeyTypeZ *data;
11465 * The number of elements pointed to by `data`.
11468 } LDKCVec_C2Tuple_PublicKeyTypeZZ;
11471 * A tuple of 2 elements. See the individual fields for the types contained.
11473 typedef struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ {
11475 * The element at position 0
11477 struct LDKPublicKey a;
11479 * The element at position 1
11481 struct LDKCVec_SocketAddressZ b;
11482 } LDKC2Tuple_PublicKeyCVec_SocketAddressZZ;
11485 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCVec_SocketAddressZZs of arbitrary size.
11486 * This corresponds to std::vector in C++
11488 typedef struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ {
11490 * The elements in the array.
11491 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11493 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *data;
11495 * The number of elements pointed to by `data`.
11498 } LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ;
11501 * The contents of an onion message.
11503 typedef struct LDKOnionMessageContents {
11505 * An opaque pointer which is passed to your function implementations as an argument.
11506 * This has no meaning in the LDK, and can be NULL or any other value.
11510 * Returns the TLV type identifying the message contents. MUST be >= 64.
11512 uint64_t (*tlv_type)(const void *this_arg);
11514 * Serialize the object into a byte array
11516 struct LDKCVec_u8Z (*write)(const void *this_arg);
11518 * Return a human-readable "debug" string describing this object
11520 struct LDKStr (*debug_str)(const void *this_arg);
11522 * Called, if set, after this OnionMessageContents has been cloned into a duplicate object.
11523 * The new OnionMessageContents is provided, and should be mutated as needed to perform a
11524 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
11526 void (*cloned)(struct LDKOnionMessageContents *NONNULL_PTR new_OnionMessageContents);
11528 * Frees any resources associated with this object given its this_arg pointer.
11529 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
11531 void (*free)(void *this_arg);
11532 } LDKOnionMessageContents;
11535 * An enum which can either contain a crate::lightning::onion_message::packet::OnionMessageContents or not
11537 typedef enum LDKCOption_OnionMessageContentsZ_Tag {
11539 * When we're in this state, this COption_OnionMessageContentsZ contains a crate::lightning::onion_message::packet::OnionMessageContents
11541 LDKCOption_OnionMessageContentsZ_Some,
11543 * When we're in this state, this COption_OnionMessageContentsZ contains nothing
11545 LDKCOption_OnionMessageContentsZ_None,
11547 * Must be last for serialization purposes
11549 LDKCOption_OnionMessageContentsZ_Sentinel,
11550 } LDKCOption_OnionMessageContentsZ_Tag;
11552 typedef struct LDKCOption_OnionMessageContentsZ {
11553 LDKCOption_OnionMessageContentsZ_Tag tag;
11556 struct LDKOnionMessageContents some;
11559 } LDKCOption_OnionMessageContentsZ;
11562 * The contents of CResult_COption_OnionMessageContentsZDecodeErrorZ
11564 typedef union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr {
11566 * A pointer to the contents in the success state.
11567 * Reading from this pointer when `result_ok` is not set is undefined.
11569 struct LDKCOption_OnionMessageContentsZ *result;
11571 * A pointer to the contents in the error state.
11572 * Reading from this pointer when `result_ok` is set is undefined.
11574 struct LDKDecodeError *err;
11575 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr;
11578 * A CResult_COption_OnionMessageContentsZDecodeErrorZ represents the result of a fallible operation,
11579 * containing a crate::c_types::derived::COption_OnionMessageContentsZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
11580 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11582 typedef struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ {
11584 * The contents of this CResult_COption_OnionMessageContentsZDecodeErrorZ, accessible via either
11585 * `err` or `result` depending on the state of `result_ok`.
11587 union LDKCResult_COption_OnionMessageContentsZDecodeErrorZPtr contents;
11589 * Whether this CResult_COption_OnionMessageContentsZDecodeErrorZ represents a success state.
11592 } LDKCResult_COption_OnionMessageContentsZDecodeErrorZ;
11595 * A tuple of 3 elements. See the individual fields for the types contained.
11597 typedef struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ {
11599 * The element at position 0
11601 struct LDKOnionMessageContents a;
11603 * The element at position 1
11605 struct LDKDestination b;
11607 * The element at position 2
11609 struct LDKBlindedPath c;
11610 } LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ;
11613 * A dynamically-allocated array of crate::c_types::derived::C3Tuple_OnionMessageContentsDestinationBlindedPathZs of arbitrary size.
11614 * This corresponds to std::vector in C++
11616 typedef struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ {
11618 * The elements in the array.
11619 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11621 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *data;
11623 * The number of elements pointed to by `data`.
11626 } LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ;
11629 * An enum which can either contain a crate::lightning::ln::wire::Type or not
11631 typedef enum LDKCOption_TypeZ_Tag {
11633 * When we're in this state, this COption_TypeZ contains a crate::lightning::ln::wire::Type
11635 LDKCOption_TypeZ_Some,
11637 * When we're in this state, this COption_TypeZ contains nothing
11639 LDKCOption_TypeZ_None,
11641 * Must be last for serialization purposes
11643 LDKCOption_TypeZ_Sentinel,
11644 } LDKCOption_TypeZ_Tag;
11646 typedef struct LDKCOption_TypeZ {
11647 LDKCOption_TypeZ_Tag tag;
11650 struct LDKType some;
11653 } LDKCOption_TypeZ;
11656 * The contents of CResult_COption_TypeZDecodeErrorZ
11658 typedef union LDKCResult_COption_TypeZDecodeErrorZPtr {
11660 * A pointer to the contents in the success state.
11661 * Reading from this pointer when `result_ok` is not set is undefined.
11663 struct LDKCOption_TypeZ *result;
11665 * A pointer to the contents in the error state.
11666 * Reading from this pointer when `result_ok` is set is undefined.
11668 struct LDKDecodeError *err;
11669 } LDKCResult_COption_TypeZDecodeErrorZPtr;
11672 * A CResult_COption_TypeZDecodeErrorZ represents the result of a fallible operation,
11673 * containing a crate::c_types::derived::COption_TypeZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
11674 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11676 typedef struct LDKCResult_COption_TypeZDecodeErrorZ {
11678 * The contents of this CResult_COption_TypeZDecodeErrorZ, accessible via either
11679 * `err` or `result` depending on the state of `result_ok`.
11681 union LDKCResult_COption_TypeZDecodeErrorZPtr contents;
11683 * Whether this CResult_COption_TypeZDecodeErrorZ represents a success state.
11686 } LDKCResult_COption_TypeZDecodeErrorZ;
11689 * An enum which can either contain a crate::lightning::ln::msgs::SocketAddress or not
11691 typedef enum LDKCOption_SocketAddressZ_Tag {
11693 * When we're in this state, this COption_SocketAddressZ contains a crate::lightning::ln::msgs::SocketAddress
11695 LDKCOption_SocketAddressZ_Some,
11697 * When we're in this state, this COption_SocketAddressZ contains nothing
11699 LDKCOption_SocketAddressZ_None,
11701 * Must be last for serialization purposes
11703 LDKCOption_SocketAddressZ_Sentinel,
11704 } LDKCOption_SocketAddressZ_Tag;
11706 typedef struct LDKCOption_SocketAddressZ {
11707 LDKCOption_SocketAddressZ_Tag tag;
11710 struct LDKSocketAddress some;
11713 } LDKCOption_SocketAddressZ;
11716 * A tuple of 2 elements. See the individual fields for the types contained.
11718 typedef struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ {
11720 * The element at position 0
11722 struct LDKPublicKey a;
11724 * The element at position 1
11726 struct LDKCOption_SocketAddressZ b;
11727 } LDKC2Tuple_PublicKeyCOption_SocketAddressZZ;
11730 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_PublicKeyCOption_SocketAddressZZs of arbitrary size.
11731 * This corresponds to std::vector in C++
11733 typedef struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ {
11735 * The elements in the array.
11736 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11738 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *data;
11740 * The number of elements pointed to by `data`.
11743 } LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ;
11748 * Error for PeerManager errors. If you get one of these, you must disconnect the socket and
11749 * generate no further read_event/write_buffer_space_avail/socket_disconnected calls for the
11752 typedef struct MUST_USE_STRUCT LDKPeerHandleError {
11754 * A pointer to the opaque Rust object.
11755 * Nearly everywhere, inner must be non-null, however in places where
11756 * the Rust equivalent takes an Option, it may be set to null to indicate None.
11758 LDKnativePeerHandleError *inner;
11760 * Indicates that this is the only struct which contains the same pointer.
11761 * Rust functions which take ownership of an object provided via an argument require
11762 * this to be true and invalidate the object pointed to by inner.
11765 } LDKPeerHandleError;
11768 * The contents of CResult_CVec_u8ZPeerHandleErrorZ
11770 typedef union LDKCResult_CVec_u8ZPeerHandleErrorZPtr {
11772 * A pointer to the contents in the success state.
11773 * Reading from this pointer when `result_ok` is not set is undefined.
11775 struct LDKCVec_u8Z *result;
11777 * A pointer to the contents in the error state.
11778 * Reading from this pointer when `result_ok` is set is undefined.
11780 struct LDKPeerHandleError *err;
11781 } LDKCResult_CVec_u8ZPeerHandleErrorZPtr;
11784 * A CResult_CVec_u8ZPeerHandleErrorZ represents the result of a fallible operation,
11785 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
11786 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11788 typedef struct LDKCResult_CVec_u8ZPeerHandleErrorZ {
11790 * The contents of this CResult_CVec_u8ZPeerHandleErrorZ, accessible via either
11791 * `err` or `result` depending on the state of `result_ok`.
11793 union LDKCResult_CVec_u8ZPeerHandleErrorZPtr contents;
11795 * Whether this CResult_CVec_u8ZPeerHandleErrorZ represents a success state.
11798 } LDKCResult_CVec_u8ZPeerHandleErrorZ;
11801 * The contents of CResult_NonePeerHandleErrorZ
11803 typedef union LDKCResult_NonePeerHandleErrorZPtr {
11805 * Note that this value is always NULL, as there are no contents in the OK variant
11809 * A pointer to the contents in the error state.
11810 * Reading from this pointer when `result_ok` is set is undefined.
11812 struct LDKPeerHandleError *err;
11813 } LDKCResult_NonePeerHandleErrorZPtr;
11816 * A CResult_NonePeerHandleErrorZ represents the result of a fallible operation,
11817 * containing a () on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
11818 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11820 typedef struct LDKCResult_NonePeerHandleErrorZ {
11822 * The contents of this CResult_NonePeerHandleErrorZ, accessible via either
11823 * `err` or `result` depending on the state of `result_ok`.
11825 union LDKCResult_NonePeerHandleErrorZPtr contents;
11827 * Whether this CResult_NonePeerHandleErrorZ represents a success state.
11830 } LDKCResult_NonePeerHandleErrorZ;
11833 * The contents of CResult_boolPeerHandleErrorZ
11835 typedef union LDKCResult_boolPeerHandleErrorZPtr {
11837 * A pointer to the contents in the success state.
11838 * Reading from this pointer when `result_ok` is not set is undefined.
11842 * A pointer to the contents in the error state.
11843 * Reading from this pointer when `result_ok` is set is undefined.
11845 struct LDKPeerHandleError *err;
11846 } LDKCResult_boolPeerHandleErrorZPtr;
11849 * A CResult_boolPeerHandleErrorZ represents the result of a fallible operation,
11850 * containing a bool on success and a crate::lightning::ln::peer_handler::PeerHandleError on failure.
11851 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11853 typedef struct LDKCResult_boolPeerHandleErrorZ {
11855 * The contents of this CResult_boolPeerHandleErrorZ, accessible via either
11856 * `err` or `result` depending on the state of `result_ok`.
11858 union LDKCResult_boolPeerHandleErrorZPtr contents;
11860 * Whether this CResult_boolPeerHandleErrorZ represents a success state.
11863 } LDKCResult_boolPeerHandleErrorZ;
11866 * All-encompassing standard error type that processing can return
11868 typedef enum LDKGraphSyncError_Tag {
11870 * Error trying to read the update data, typically due to an erroneous data length indication
11871 * that is greater than the actual amount of data provided
11873 LDKGraphSyncError_DecodeError,
11875 * Error applying the patch to the network graph, usually the result of updates that are too
11876 * old or missing prerequisite data to the application of updates out of order
11878 LDKGraphSyncError_LightningError,
11880 * Must be last for serialization purposes
11882 LDKGraphSyncError_Sentinel,
11883 } LDKGraphSyncError_Tag;
11885 typedef struct MUST_USE_STRUCT LDKGraphSyncError {
11886 LDKGraphSyncError_Tag tag;
11889 struct LDKDecodeError decode_error;
11892 struct LDKLightningError lightning_error;
11895 } LDKGraphSyncError;
11898 * The contents of CResult_u32GraphSyncErrorZ
11900 typedef union LDKCResult_u32GraphSyncErrorZPtr {
11902 * A pointer to the contents in the success state.
11903 * Reading from this pointer when `result_ok` is not set is undefined.
11907 * A pointer to the contents in the error state.
11908 * Reading from this pointer when `result_ok` is set is undefined.
11910 struct LDKGraphSyncError *err;
11911 } LDKCResult_u32GraphSyncErrorZPtr;
11914 * A CResult_u32GraphSyncErrorZ represents the result of a fallible operation,
11915 * containing a u32 on success and a crate::lightning_rapid_gossip_sync::GraphSyncError on failure.
11916 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11918 typedef struct LDKCResult_u32GraphSyncErrorZ {
11920 * The contents of this CResult_u32GraphSyncErrorZ, accessible via either
11921 * `err` or `result` depending on the state of `result_ok`.
11923 union LDKCResult_u32GraphSyncErrorZPtr contents;
11925 * Whether this CResult_u32GraphSyncErrorZ represents a success state.
11928 } LDKCResult_u32GraphSyncErrorZ;
11931 * The contents of CResult_CVec_u8ZIOErrorZ
11933 typedef union LDKCResult_CVec_u8ZIOErrorZPtr {
11935 * A pointer to the contents in the success state.
11936 * Reading from this pointer when `result_ok` is not set is undefined.
11938 struct LDKCVec_u8Z *result;
11940 * A pointer to the contents in the error state.
11941 * Reading from this pointer when `result_ok` is set is undefined.
11943 enum LDKIOError *err;
11944 } LDKCResult_CVec_u8ZIOErrorZPtr;
11947 * A CResult_CVec_u8ZIOErrorZ represents the result of a fallible operation,
11948 * containing a crate::c_types::derived::CVec_u8Z on success and a crate::c_types::IOError on failure.
11949 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
11951 typedef struct LDKCResult_CVec_u8ZIOErrorZ {
11953 * The contents of this CResult_CVec_u8ZIOErrorZ, accessible via either
11954 * `err` or `result` depending on the state of `result_ok`.
11956 union LDKCResult_CVec_u8ZIOErrorZPtr contents;
11958 * Whether this CResult_CVec_u8ZIOErrorZ represents a success state.
11961 } LDKCResult_CVec_u8ZIOErrorZ;
11964 * A dynamically-allocated array of crate::c_types::Strs of arbitrary size.
11965 * This corresponds to std::vector in C++
11967 typedef struct LDKCVec_StrZ {
11969 * The elements in the array.
11970 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
11972 struct LDKStr *data;
11974 * The number of elements pointed to by `data`.
11980 * The contents of CResult_CVec_StrZIOErrorZ
11982 typedef union LDKCResult_CVec_StrZIOErrorZPtr {
11984 * A pointer to the contents in the success state.
11985 * Reading from this pointer when `result_ok` is not set is undefined.
11987 struct LDKCVec_StrZ *result;
11989 * A pointer to the contents in the error state.
11990 * Reading from this pointer when `result_ok` is set is undefined.
11992 enum LDKIOError *err;
11993 } LDKCResult_CVec_StrZIOErrorZPtr;
11996 * A CResult_CVec_StrZIOErrorZ represents the result of a fallible operation,
11997 * containing a crate::c_types::derived::CVec_StrZ on success and a crate::c_types::IOError on failure.
11998 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12000 typedef struct LDKCResult_CVec_StrZIOErrorZ {
12002 * The contents of this CResult_CVec_StrZIOErrorZ, accessible via either
12003 * `err` or `result` depending on the state of `result_ok`.
12005 union LDKCResult_CVec_StrZIOErrorZPtr contents;
12007 * Whether this CResult_CVec_StrZIOErrorZ represents a success state.
12010 } LDKCResult_CVec_StrZIOErrorZ;
12013 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZs of arbitrary size.
12014 * This corresponds to std::vector in C++
12016 typedef struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ {
12018 * The elements in the array.
12019 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12021 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *data;
12023 * The number of elements pointed to by `data`.
12026 } LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ;
12029 * The contents of CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ
12031 typedef union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr {
12033 * A pointer to the contents in the success state.
12034 * Reading from this pointer when `result_ok` is not set is undefined.
12036 struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ *result;
12038 * A pointer to the contents in the error state.
12039 * Reading from this pointer when `result_ok` is set is undefined.
12041 enum LDKIOError *err;
12042 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr;
12045 * A CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents the result of a fallible operation,
12046 * containing a crate::c_types::derived::CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ on success and a crate::c_types::IOError on failure.
12047 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12049 typedef struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ {
12051 * The contents of this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ, accessible via either
12052 * `err` or `result` depending on the state of `result_ok`.
12054 union LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZPtr contents;
12056 * Whether this CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ represents a success state.
12059 } LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ;
12062 * The contents of CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ
12064 typedef union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr {
12066 * A pointer to the contents in the success state.
12067 * Reading from this pointer when `result_ok` is not set is undefined.
12069 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *result;
12071 * A pointer to the contents in the error state.
12072 * Reading from this pointer when `result_ok` is set is undefined.
12074 enum LDKIOError *err;
12075 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr;
12078 * A CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents the result of a fallible operation,
12079 * containing a crate::c_types::derived::C2Tuple_ThirtyTwoBytesChannelMonitorZ on success and a crate::c_types::IOError on failure.
12080 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12082 typedef struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ {
12084 * The contents of this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ, accessible via either
12085 * `err` or `result` depending on the state of `result_ok`.
12087 union LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZPtr contents;
12089 * Whether this CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ represents a success state.
12092 } LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ;
12095 * Represents a valid secp256k1 secret key serialized as a 32 byte array.
12097 typedef struct LDKSecretKey {
12099 * The bytes of the secret key
12105 * An enum which can either contain a crate::c_types::SecretKey or not
12107 typedef enum LDKCOption_SecretKeyZ_Tag {
12109 * When we're in this state, this COption_SecretKeyZ contains a crate::c_types::SecretKey
12111 LDKCOption_SecretKeyZ_Some,
12113 * When we're in this state, this COption_SecretKeyZ contains nothing
12115 LDKCOption_SecretKeyZ_None,
12117 * Must be last for serialization purposes
12119 LDKCOption_SecretKeyZ_Sentinel,
12120 } LDKCOption_SecretKeyZ_Tag;
12122 typedef struct LDKCOption_SecretKeyZ {
12123 LDKCOption_SecretKeyZ_Tag tag;
12126 struct LDKSecretKey some;
12129 } LDKCOption_SecretKeyZ;
12134 * An [`InvoiceRequest`] that has been verified by [`InvoiceRequest::verify`] and exposes different
12135 * ways to respond depending on whether the signing keys were derived.
12137 typedef struct MUST_USE_STRUCT LDKVerifiedInvoiceRequest {
12139 * A pointer to the opaque Rust object.
12140 * Nearly everywhere, inner must be non-null, however in places where
12141 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12143 LDKnativeVerifiedInvoiceRequest *inner;
12145 * Indicates that this is the only struct which contains the same pointer.
12146 * Rust functions which take ownership of an object provided via an argument require
12147 * this to be true and invalidate the object pointed to by inner.
12150 } LDKVerifiedInvoiceRequest;
12153 * The contents of CResult_VerifiedInvoiceRequestNoneZ
12155 typedef union LDKCResult_VerifiedInvoiceRequestNoneZPtr {
12157 * A pointer to the contents in the success state.
12158 * Reading from this pointer when `result_ok` is not set is undefined.
12160 struct LDKVerifiedInvoiceRequest *result;
12162 * Note that this value is always NULL, as there are no contents in the Err variant
12165 } LDKCResult_VerifiedInvoiceRequestNoneZPtr;
12168 * A CResult_VerifiedInvoiceRequestNoneZ represents the result of a fallible operation,
12169 * containing a crate::lightning::offers::invoice_request::VerifiedInvoiceRequest on success and a () on failure.
12170 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12172 typedef struct LDKCResult_VerifiedInvoiceRequestNoneZ {
12174 * The contents of this CResult_VerifiedInvoiceRequestNoneZ, accessible via either
12175 * `err` or `result` depending on the state of `result_ok`.
12177 union LDKCResult_VerifiedInvoiceRequestNoneZPtr contents;
12179 * Whether this CResult_VerifiedInvoiceRequestNoneZ represents a success state.
12182 } LDKCResult_VerifiedInvoiceRequestNoneZ;
12185 * A dynamically-allocated array of crate::c_types::Witnesss of arbitrary size.
12186 * This corresponds to std::vector in C++
12188 typedef struct LDKCVec_WitnessZ {
12190 * The elements in the array.
12191 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12193 struct LDKWitness *data;
12195 * The number of elements pointed to by `data`.
12198 } LDKCVec_WitnessZ;
12201 * An enum which can either contain a i64 or not
12203 typedef enum LDKCOption_i64Z_Tag {
12205 * When we're in this state, this COption_i64Z contains a i64
12207 LDKCOption_i64Z_Some,
12209 * When we're in this state, this COption_i64Z contains nothing
12211 LDKCOption_i64Z_None,
12213 * Must be last for serialization purposes
12215 LDKCOption_i64Z_Sentinel,
12216 } LDKCOption_i64Z_Tag;
12218 typedef struct LDKCOption_i64Z {
12219 LDKCOption_i64Z_Tag tag;
12228 * The contents of CResult_SocketAddressDecodeErrorZ
12230 typedef union LDKCResult_SocketAddressDecodeErrorZPtr {
12232 * A pointer to the contents in the success state.
12233 * Reading from this pointer when `result_ok` is not set is undefined.
12235 struct LDKSocketAddress *result;
12237 * A pointer to the contents in the error state.
12238 * Reading from this pointer when `result_ok` is set is undefined.
12240 struct LDKDecodeError *err;
12241 } LDKCResult_SocketAddressDecodeErrorZPtr;
12244 * A CResult_SocketAddressDecodeErrorZ represents the result of a fallible operation,
12245 * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::DecodeError on failure.
12246 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12248 typedef struct LDKCResult_SocketAddressDecodeErrorZ {
12250 * The contents of this CResult_SocketAddressDecodeErrorZ, accessible via either
12251 * `err` or `result` depending on the state of `result_ok`.
12253 union LDKCResult_SocketAddressDecodeErrorZPtr contents;
12255 * Whether this CResult_SocketAddressDecodeErrorZ represents a success state.
12258 } LDKCResult_SocketAddressDecodeErrorZ;
12261 * The contents of CResult_SocketAddressSocketAddressParseErrorZ
12263 typedef union LDKCResult_SocketAddressSocketAddressParseErrorZPtr {
12265 * A pointer to the contents in the success state.
12266 * Reading from this pointer when `result_ok` is not set is undefined.
12268 struct LDKSocketAddress *result;
12270 * A pointer to the contents in the error state.
12271 * Reading from this pointer when `result_ok` is set is undefined.
12273 enum LDKSocketAddressParseError *err;
12274 } LDKCResult_SocketAddressSocketAddressParseErrorZPtr;
12277 * A CResult_SocketAddressSocketAddressParseErrorZ represents the result of a fallible operation,
12278 * containing a crate::lightning::ln::msgs::SocketAddress on success and a crate::lightning::ln::msgs::SocketAddressParseError on failure.
12279 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12281 typedef struct LDKCResult_SocketAddressSocketAddressParseErrorZ {
12283 * The contents of this CResult_SocketAddressSocketAddressParseErrorZ, accessible via either
12284 * `err` or `result` depending on the state of `result_ok`.
12286 union LDKCResult_SocketAddressSocketAddressParseErrorZPtr contents;
12288 * Whether this CResult_SocketAddressSocketAddressParseErrorZ represents a success state.
12291 } LDKCResult_SocketAddressSocketAddressParseErrorZ;
12296 * An [`update_add_htlc`] message to be sent to or received from a peer.
12298 * [`update_add_htlc`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#adding-an-htlc-update_add_htlc
12300 typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
12302 * A pointer to the opaque Rust object.
12303 * Nearly everywhere, inner must be non-null, however in places where
12304 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12306 LDKnativeUpdateAddHTLC *inner;
12308 * Indicates that this is the only struct which contains the same pointer.
12309 * Rust functions which take ownership of an object provided via an argument require
12310 * this to be true and invalidate the object pointed to by inner.
12313 } LDKUpdateAddHTLC;
12316 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateAddHTLCs of arbitrary size.
12317 * This corresponds to std::vector in C++
12319 typedef struct LDKCVec_UpdateAddHTLCZ {
12321 * The elements in the array.
12322 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12324 struct LDKUpdateAddHTLC *data;
12326 * The number of elements pointed to by `data`.
12329 } LDKCVec_UpdateAddHTLCZ;
12334 * An [`update_fulfill_htlc`] message to be sent to or received from a peer.
12336 * [`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
12338 typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
12340 * A pointer to the opaque Rust object.
12341 * Nearly everywhere, inner must be non-null, however in places where
12342 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12344 LDKnativeUpdateFulfillHTLC *inner;
12346 * Indicates that this is the only struct which contains the same pointer.
12347 * Rust functions which take ownership of an object provided via an argument require
12348 * this to be true and invalidate the object pointed to by inner.
12351 } LDKUpdateFulfillHTLC;
12354 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFulfillHTLCs of arbitrary size.
12355 * This corresponds to std::vector in C++
12357 typedef struct LDKCVec_UpdateFulfillHTLCZ {
12359 * The elements in the array.
12360 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12362 struct LDKUpdateFulfillHTLC *data;
12364 * The number of elements pointed to by `data`.
12367 } LDKCVec_UpdateFulfillHTLCZ;
12372 * An [`update_fail_htlc`] message to be sent to or received from a peer.
12374 * [`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
12376 typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
12378 * A pointer to the opaque Rust object.
12379 * Nearly everywhere, inner must be non-null, however in places where
12380 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12382 LDKnativeUpdateFailHTLC *inner;
12384 * Indicates that this is the only struct which contains the same pointer.
12385 * Rust functions which take ownership of an object provided via an argument require
12386 * this to be true and invalidate the object pointed to by inner.
12389 } LDKUpdateFailHTLC;
12392 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailHTLCs of arbitrary size.
12393 * This corresponds to std::vector in C++
12395 typedef struct LDKCVec_UpdateFailHTLCZ {
12397 * The elements in the array.
12398 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12400 struct LDKUpdateFailHTLC *data;
12402 * The number of elements pointed to by `data`.
12405 } LDKCVec_UpdateFailHTLCZ;
12410 * An [`update_fail_malformed_htlc`] message to be sent to or received from a peer.
12412 * [`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
12414 typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
12416 * A pointer to the opaque Rust object.
12417 * Nearly everywhere, inner must be non-null, however in places where
12418 * the Rust equivalent takes an Option, it may be set to null to indicate None.
12420 LDKnativeUpdateFailMalformedHTLC *inner;
12422 * Indicates that this is the only struct which contains the same pointer.
12423 * Rust functions which take ownership of an object provided via an argument require
12424 * this to be true and invalidate the object pointed to by inner.
12427 } LDKUpdateFailMalformedHTLC;
12430 * A dynamically-allocated array of crate::lightning::ln::msgs::UpdateFailMalformedHTLCs of arbitrary size.
12431 * This corresponds to std::vector in C++
12433 typedef struct LDKCVec_UpdateFailMalformedHTLCZ {
12435 * The elements in the array.
12436 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
12438 struct LDKUpdateFailMalformedHTLC *data;
12440 * The number of elements pointed to by `data`.
12443 } LDKCVec_UpdateFailMalformedHTLCZ;
12446 * The contents of CResult_AcceptChannelDecodeErrorZ
12448 typedef union LDKCResult_AcceptChannelDecodeErrorZPtr {
12450 * A pointer to the contents in the success state.
12451 * Reading from this pointer when `result_ok` is not set is undefined.
12453 struct LDKAcceptChannel *result;
12455 * A pointer to the contents in the error state.
12456 * Reading from this pointer when `result_ok` is set is undefined.
12458 struct LDKDecodeError *err;
12459 } LDKCResult_AcceptChannelDecodeErrorZPtr;
12462 * A CResult_AcceptChannelDecodeErrorZ represents the result of a fallible operation,
12463 * containing a crate::lightning::ln::msgs::AcceptChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
12464 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12466 typedef struct LDKCResult_AcceptChannelDecodeErrorZ {
12468 * The contents of this CResult_AcceptChannelDecodeErrorZ, accessible via either
12469 * `err` or `result` depending on the state of `result_ok`.
12471 union LDKCResult_AcceptChannelDecodeErrorZPtr contents;
12473 * Whether this CResult_AcceptChannelDecodeErrorZ represents a success state.
12476 } LDKCResult_AcceptChannelDecodeErrorZ;
12479 * The contents of CResult_AcceptChannelV2DecodeErrorZ
12481 typedef union LDKCResult_AcceptChannelV2DecodeErrorZPtr {
12483 * A pointer to the contents in the success state.
12484 * Reading from this pointer when `result_ok` is not set is undefined.
12486 struct LDKAcceptChannelV2 *result;
12488 * A pointer to the contents in the error state.
12489 * Reading from this pointer when `result_ok` is set is undefined.
12491 struct LDKDecodeError *err;
12492 } LDKCResult_AcceptChannelV2DecodeErrorZPtr;
12495 * A CResult_AcceptChannelV2DecodeErrorZ represents the result of a fallible operation,
12496 * containing a crate::lightning::ln::msgs::AcceptChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
12497 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12499 typedef struct LDKCResult_AcceptChannelV2DecodeErrorZ {
12501 * The contents of this CResult_AcceptChannelV2DecodeErrorZ, accessible via either
12502 * `err` or `result` depending on the state of `result_ok`.
12504 union LDKCResult_AcceptChannelV2DecodeErrorZPtr contents;
12506 * Whether this CResult_AcceptChannelV2DecodeErrorZ represents a success state.
12509 } LDKCResult_AcceptChannelV2DecodeErrorZ;
12512 * The contents of CResult_StfuDecodeErrorZ
12514 typedef union LDKCResult_StfuDecodeErrorZPtr {
12516 * A pointer to the contents in the success state.
12517 * Reading from this pointer when `result_ok` is not set is undefined.
12519 struct LDKStfu *result;
12521 * A pointer to the contents in the error state.
12522 * Reading from this pointer when `result_ok` is set is undefined.
12524 struct LDKDecodeError *err;
12525 } LDKCResult_StfuDecodeErrorZPtr;
12528 * A CResult_StfuDecodeErrorZ represents the result of a fallible operation,
12529 * containing a crate::lightning::ln::msgs::Stfu on success and a crate::lightning::ln::msgs::DecodeError on failure.
12530 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12532 typedef struct LDKCResult_StfuDecodeErrorZ {
12534 * The contents of this CResult_StfuDecodeErrorZ, accessible via either
12535 * `err` or `result` depending on the state of `result_ok`.
12537 union LDKCResult_StfuDecodeErrorZPtr contents;
12539 * Whether this CResult_StfuDecodeErrorZ represents a success state.
12542 } LDKCResult_StfuDecodeErrorZ;
12545 * The contents of CResult_SpliceDecodeErrorZ
12547 typedef union LDKCResult_SpliceDecodeErrorZPtr {
12549 * A pointer to the contents in the success state.
12550 * Reading from this pointer when `result_ok` is not set is undefined.
12552 struct LDKSplice *result;
12554 * A pointer to the contents in the error state.
12555 * Reading from this pointer when `result_ok` is set is undefined.
12557 struct LDKDecodeError *err;
12558 } LDKCResult_SpliceDecodeErrorZPtr;
12561 * A CResult_SpliceDecodeErrorZ represents the result of a fallible operation,
12562 * containing a crate::lightning::ln::msgs::Splice on success and a crate::lightning::ln::msgs::DecodeError on failure.
12563 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12565 typedef struct LDKCResult_SpliceDecodeErrorZ {
12567 * The contents of this CResult_SpliceDecodeErrorZ, accessible via either
12568 * `err` or `result` depending on the state of `result_ok`.
12570 union LDKCResult_SpliceDecodeErrorZPtr contents;
12572 * Whether this CResult_SpliceDecodeErrorZ represents a success state.
12575 } LDKCResult_SpliceDecodeErrorZ;
12578 * The contents of CResult_SpliceAckDecodeErrorZ
12580 typedef union LDKCResult_SpliceAckDecodeErrorZPtr {
12582 * A pointer to the contents in the success state.
12583 * Reading from this pointer when `result_ok` is not set is undefined.
12585 struct LDKSpliceAck *result;
12587 * A pointer to the contents in the error state.
12588 * Reading from this pointer when `result_ok` is set is undefined.
12590 struct LDKDecodeError *err;
12591 } LDKCResult_SpliceAckDecodeErrorZPtr;
12594 * A CResult_SpliceAckDecodeErrorZ represents the result of a fallible operation,
12595 * containing a crate::lightning::ln::msgs::SpliceAck on success and a crate::lightning::ln::msgs::DecodeError on failure.
12596 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12598 typedef struct LDKCResult_SpliceAckDecodeErrorZ {
12600 * The contents of this CResult_SpliceAckDecodeErrorZ, accessible via either
12601 * `err` or `result` depending on the state of `result_ok`.
12603 union LDKCResult_SpliceAckDecodeErrorZPtr contents;
12605 * Whether this CResult_SpliceAckDecodeErrorZ represents a success state.
12608 } LDKCResult_SpliceAckDecodeErrorZ;
12611 * The contents of CResult_SpliceLockedDecodeErrorZ
12613 typedef union LDKCResult_SpliceLockedDecodeErrorZPtr {
12615 * A pointer to the contents in the success state.
12616 * Reading from this pointer when `result_ok` is not set is undefined.
12618 struct LDKSpliceLocked *result;
12620 * A pointer to the contents in the error state.
12621 * Reading from this pointer when `result_ok` is set is undefined.
12623 struct LDKDecodeError *err;
12624 } LDKCResult_SpliceLockedDecodeErrorZPtr;
12627 * A CResult_SpliceLockedDecodeErrorZ represents the result of a fallible operation,
12628 * containing a crate::lightning::ln::msgs::SpliceLocked on success and a crate::lightning::ln::msgs::DecodeError on failure.
12629 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12631 typedef struct LDKCResult_SpliceLockedDecodeErrorZ {
12633 * The contents of this CResult_SpliceLockedDecodeErrorZ, accessible via either
12634 * `err` or `result` depending on the state of `result_ok`.
12636 union LDKCResult_SpliceLockedDecodeErrorZPtr contents;
12638 * Whether this CResult_SpliceLockedDecodeErrorZ represents a success state.
12641 } LDKCResult_SpliceLockedDecodeErrorZ;
12644 * The contents of CResult_TxAddInputDecodeErrorZ
12646 typedef union LDKCResult_TxAddInputDecodeErrorZPtr {
12648 * A pointer to the contents in the success state.
12649 * Reading from this pointer when `result_ok` is not set is undefined.
12651 struct LDKTxAddInput *result;
12653 * A pointer to the contents in the error state.
12654 * Reading from this pointer when `result_ok` is set is undefined.
12656 struct LDKDecodeError *err;
12657 } LDKCResult_TxAddInputDecodeErrorZPtr;
12660 * A CResult_TxAddInputDecodeErrorZ represents the result of a fallible operation,
12661 * containing a crate::lightning::ln::msgs::TxAddInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
12662 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12664 typedef struct LDKCResult_TxAddInputDecodeErrorZ {
12666 * The contents of this CResult_TxAddInputDecodeErrorZ, accessible via either
12667 * `err` or `result` depending on the state of `result_ok`.
12669 union LDKCResult_TxAddInputDecodeErrorZPtr contents;
12671 * Whether this CResult_TxAddInputDecodeErrorZ represents a success state.
12674 } LDKCResult_TxAddInputDecodeErrorZ;
12677 * The contents of CResult_TxAddOutputDecodeErrorZ
12679 typedef union LDKCResult_TxAddOutputDecodeErrorZPtr {
12681 * A pointer to the contents in the success state.
12682 * Reading from this pointer when `result_ok` is not set is undefined.
12684 struct LDKTxAddOutput *result;
12686 * A pointer to the contents in the error state.
12687 * Reading from this pointer when `result_ok` is set is undefined.
12689 struct LDKDecodeError *err;
12690 } LDKCResult_TxAddOutputDecodeErrorZPtr;
12693 * A CResult_TxAddOutputDecodeErrorZ represents the result of a fallible operation,
12694 * containing a crate::lightning::ln::msgs::TxAddOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
12695 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12697 typedef struct LDKCResult_TxAddOutputDecodeErrorZ {
12699 * The contents of this CResult_TxAddOutputDecodeErrorZ, accessible via either
12700 * `err` or `result` depending on the state of `result_ok`.
12702 union LDKCResult_TxAddOutputDecodeErrorZPtr contents;
12704 * Whether this CResult_TxAddOutputDecodeErrorZ represents a success state.
12707 } LDKCResult_TxAddOutputDecodeErrorZ;
12710 * The contents of CResult_TxRemoveInputDecodeErrorZ
12712 typedef union LDKCResult_TxRemoveInputDecodeErrorZPtr {
12714 * A pointer to the contents in the success state.
12715 * Reading from this pointer when `result_ok` is not set is undefined.
12717 struct LDKTxRemoveInput *result;
12719 * A pointer to the contents in the error state.
12720 * Reading from this pointer when `result_ok` is set is undefined.
12722 struct LDKDecodeError *err;
12723 } LDKCResult_TxRemoveInputDecodeErrorZPtr;
12726 * A CResult_TxRemoveInputDecodeErrorZ represents the result of a fallible operation,
12727 * containing a crate::lightning::ln::msgs::TxRemoveInput on success and a crate::lightning::ln::msgs::DecodeError on failure.
12728 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12730 typedef struct LDKCResult_TxRemoveInputDecodeErrorZ {
12732 * The contents of this CResult_TxRemoveInputDecodeErrorZ, accessible via either
12733 * `err` or `result` depending on the state of `result_ok`.
12735 union LDKCResult_TxRemoveInputDecodeErrorZPtr contents;
12737 * Whether this CResult_TxRemoveInputDecodeErrorZ represents a success state.
12740 } LDKCResult_TxRemoveInputDecodeErrorZ;
12743 * The contents of CResult_TxRemoveOutputDecodeErrorZ
12745 typedef union LDKCResult_TxRemoveOutputDecodeErrorZPtr {
12747 * A pointer to the contents in the success state.
12748 * Reading from this pointer when `result_ok` is not set is undefined.
12750 struct LDKTxRemoveOutput *result;
12752 * A pointer to the contents in the error state.
12753 * Reading from this pointer when `result_ok` is set is undefined.
12755 struct LDKDecodeError *err;
12756 } LDKCResult_TxRemoveOutputDecodeErrorZPtr;
12759 * A CResult_TxRemoveOutputDecodeErrorZ represents the result of a fallible operation,
12760 * containing a crate::lightning::ln::msgs::TxRemoveOutput on success and a crate::lightning::ln::msgs::DecodeError on failure.
12761 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12763 typedef struct LDKCResult_TxRemoveOutputDecodeErrorZ {
12765 * The contents of this CResult_TxRemoveOutputDecodeErrorZ, accessible via either
12766 * `err` or `result` depending on the state of `result_ok`.
12768 union LDKCResult_TxRemoveOutputDecodeErrorZPtr contents;
12770 * Whether this CResult_TxRemoveOutputDecodeErrorZ represents a success state.
12773 } LDKCResult_TxRemoveOutputDecodeErrorZ;
12776 * The contents of CResult_TxCompleteDecodeErrorZ
12778 typedef union LDKCResult_TxCompleteDecodeErrorZPtr {
12780 * A pointer to the contents in the success state.
12781 * Reading from this pointer when `result_ok` is not set is undefined.
12783 struct LDKTxComplete *result;
12785 * A pointer to the contents in the error state.
12786 * Reading from this pointer when `result_ok` is set is undefined.
12788 struct LDKDecodeError *err;
12789 } LDKCResult_TxCompleteDecodeErrorZPtr;
12792 * A CResult_TxCompleteDecodeErrorZ represents the result of a fallible operation,
12793 * containing a crate::lightning::ln::msgs::TxComplete on success and a crate::lightning::ln::msgs::DecodeError on failure.
12794 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12796 typedef struct LDKCResult_TxCompleteDecodeErrorZ {
12798 * The contents of this CResult_TxCompleteDecodeErrorZ, accessible via either
12799 * `err` or `result` depending on the state of `result_ok`.
12801 union LDKCResult_TxCompleteDecodeErrorZPtr contents;
12803 * Whether this CResult_TxCompleteDecodeErrorZ represents a success state.
12806 } LDKCResult_TxCompleteDecodeErrorZ;
12809 * The contents of CResult_TxSignaturesDecodeErrorZ
12811 typedef union LDKCResult_TxSignaturesDecodeErrorZPtr {
12813 * A pointer to the contents in the success state.
12814 * Reading from this pointer when `result_ok` is not set is undefined.
12816 struct LDKTxSignatures *result;
12818 * A pointer to the contents in the error state.
12819 * Reading from this pointer when `result_ok` is set is undefined.
12821 struct LDKDecodeError *err;
12822 } LDKCResult_TxSignaturesDecodeErrorZPtr;
12825 * A CResult_TxSignaturesDecodeErrorZ represents the result of a fallible operation,
12826 * containing a crate::lightning::ln::msgs::TxSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
12827 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12829 typedef struct LDKCResult_TxSignaturesDecodeErrorZ {
12831 * The contents of this CResult_TxSignaturesDecodeErrorZ, accessible via either
12832 * `err` or `result` depending on the state of `result_ok`.
12834 union LDKCResult_TxSignaturesDecodeErrorZPtr contents;
12836 * Whether this CResult_TxSignaturesDecodeErrorZ represents a success state.
12839 } LDKCResult_TxSignaturesDecodeErrorZ;
12842 * The contents of CResult_TxInitRbfDecodeErrorZ
12844 typedef union LDKCResult_TxInitRbfDecodeErrorZPtr {
12846 * A pointer to the contents in the success state.
12847 * Reading from this pointer when `result_ok` is not set is undefined.
12849 struct LDKTxInitRbf *result;
12851 * A pointer to the contents in the error state.
12852 * Reading from this pointer when `result_ok` is set is undefined.
12854 struct LDKDecodeError *err;
12855 } LDKCResult_TxInitRbfDecodeErrorZPtr;
12858 * A CResult_TxInitRbfDecodeErrorZ represents the result of a fallible operation,
12859 * containing a crate::lightning::ln::msgs::TxInitRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
12860 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12862 typedef struct LDKCResult_TxInitRbfDecodeErrorZ {
12864 * The contents of this CResult_TxInitRbfDecodeErrorZ, accessible via either
12865 * `err` or `result` depending on the state of `result_ok`.
12867 union LDKCResult_TxInitRbfDecodeErrorZPtr contents;
12869 * Whether this CResult_TxInitRbfDecodeErrorZ represents a success state.
12872 } LDKCResult_TxInitRbfDecodeErrorZ;
12875 * The contents of CResult_TxAckRbfDecodeErrorZ
12877 typedef union LDKCResult_TxAckRbfDecodeErrorZPtr {
12879 * A pointer to the contents in the success state.
12880 * Reading from this pointer when `result_ok` is not set is undefined.
12882 struct LDKTxAckRbf *result;
12884 * A pointer to the contents in the error state.
12885 * Reading from this pointer when `result_ok` is set is undefined.
12887 struct LDKDecodeError *err;
12888 } LDKCResult_TxAckRbfDecodeErrorZPtr;
12891 * A CResult_TxAckRbfDecodeErrorZ represents the result of a fallible operation,
12892 * containing a crate::lightning::ln::msgs::TxAckRbf on success and a crate::lightning::ln::msgs::DecodeError on failure.
12893 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12895 typedef struct LDKCResult_TxAckRbfDecodeErrorZ {
12897 * The contents of this CResult_TxAckRbfDecodeErrorZ, accessible via either
12898 * `err` or `result` depending on the state of `result_ok`.
12900 union LDKCResult_TxAckRbfDecodeErrorZPtr contents;
12902 * Whether this CResult_TxAckRbfDecodeErrorZ represents a success state.
12905 } LDKCResult_TxAckRbfDecodeErrorZ;
12908 * The contents of CResult_TxAbortDecodeErrorZ
12910 typedef union LDKCResult_TxAbortDecodeErrorZPtr {
12912 * A pointer to the contents in the success state.
12913 * Reading from this pointer when `result_ok` is not set is undefined.
12915 struct LDKTxAbort *result;
12917 * A pointer to the contents in the error state.
12918 * Reading from this pointer when `result_ok` is set is undefined.
12920 struct LDKDecodeError *err;
12921 } LDKCResult_TxAbortDecodeErrorZPtr;
12924 * A CResult_TxAbortDecodeErrorZ represents the result of a fallible operation,
12925 * containing a crate::lightning::ln::msgs::TxAbort on success and a crate::lightning::ln::msgs::DecodeError on failure.
12926 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12928 typedef struct LDKCResult_TxAbortDecodeErrorZ {
12930 * The contents of this CResult_TxAbortDecodeErrorZ, accessible via either
12931 * `err` or `result` depending on the state of `result_ok`.
12933 union LDKCResult_TxAbortDecodeErrorZPtr contents;
12935 * Whether this CResult_TxAbortDecodeErrorZ represents a success state.
12938 } LDKCResult_TxAbortDecodeErrorZ;
12941 * The contents of CResult_AnnouncementSignaturesDecodeErrorZ
12943 typedef union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr {
12945 * A pointer to the contents in the success state.
12946 * Reading from this pointer when `result_ok` is not set is undefined.
12948 struct LDKAnnouncementSignatures *result;
12950 * A pointer to the contents in the error state.
12951 * Reading from this pointer when `result_ok` is set is undefined.
12953 struct LDKDecodeError *err;
12954 } LDKCResult_AnnouncementSignaturesDecodeErrorZPtr;
12957 * A CResult_AnnouncementSignaturesDecodeErrorZ represents the result of a fallible operation,
12958 * containing a crate::lightning::ln::msgs::AnnouncementSignatures on success and a crate::lightning::ln::msgs::DecodeError on failure.
12959 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12961 typedef struct LDKCResult_AnnouncementSignaturesDecodeErrorZ {
12963 * The contents of this CResult_AnnouncementSignaturesDecodeErrorZ, accessible via either
12964 * `err` or `result` depending on the state of `result_ok`.
12966 union LDKCResult_AnnouncementSignaturesDecodeErrorZPtr contents;
12968 * Whether this CResult_AnnouncementSignaturesDecodeErrorZ represents a success state.
12971 } LDKCResult_AnnouncementSignaturesDecodeErrorZ;
12974 * The contents of CResult_ChannelReestablishDecodeErrorZ
12976 typedef union LDKCResult_ChannelReestablishDecodeErrorZPtr {
12978 * A pointer to the contents in the success state.
12979 * Reading from this pointer when `result_ok` is not set is undefined.
12981 struct LDKChannelReestablish *result;
12983 * A pointer to the contents in the error state.
12984 * Reading from this pointer when `result_ok` is set is undefined.
12986 struct LDKDecodeError *err;
12987 } LDKCResult_ChannelReestablishDecodeErrorZPtr;
12990 * A CResult_ChannelReestablishDecodeErrorZ represents the result of a fallible operation,
12991 * containing a crate::lightning::ln::msgs::ChannelReestablish on success and a crate::lightning::ln::msgs::DecodeError on failure.
12992 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
12994 typedef struct LDKCResult_ChannelReestablishDecodeErrorZ {
12996 * The contents of this CResult_ChannelReestablishDecodeErrorZ, accessible via either
12997 * `err` or `result` depending on the state of `result_ok`.
12999 union LDKCResult_ChannelReestablishDecodeErrorZPtr contents;
13001 * Whether this CResult_ChannelReestablishDecodeErrorZ represents a success state.
13004 } LDKCResult_ChannelReestablishDecodeErrorZ;
13007 * The contents of CResult_ClosingSignedDecodeErrorZ
13009 typedef union LDKCResult_ClosingSignedDecodeErrorZPtr {
13011 * A pointer to the contents in the success state.
13012 * Reading from this pointer when `result_ok` is not set is undefined.
13014 struct LDKClosingSigned *result;
13016 * A pointer to the contents in the error state.
13017 * Reading from this pointer when `result_ok` is set is undefined.
13019 struct LDKDecodeError *err;
13020 } LDKCResult_ClosingSignedDecodeErrorZPtr;
13023 * A CResult_ClosingSignedDecodeErrorZ represents the result of a fallible operation,
13024 * containing a crate::lightning::ln::msgs::ClosingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
13025 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13027 typedef struct LDKCResult_ClosingSignedDecodeErrorZ {
13029 * The contents of this CResult_ClosingSignedDecodeErrorZ, accessible via either
13030 * `err` or `result` depending on the state of `result_ok`.
13032 union LDKCResult_ClosingSignedDecodeErrorZPtr contents;
13034 * Whether this CResult_ClosingSignedDecodeErrorZ represents a success state.
13037 } LDKCResult_ClosingSignedDecodeErrorZ;
13042 * The minimum and maximum fees which the sender is willing to place on the closing transaction.
13044 * This is provided in [`ClosingSigned`] by both sides to indicate the fee range they are willing
13047 typedef struct MUST_USE_STRUCT LDKClosingSignedFeeRange {
13049 * A pointer to the opaque Rust object.
13050 * Nearly everywhere, inner must be non-null, however in places where
13051 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13053 LDKnativeClosingSignedFeeRange *inner;
13055 * Indicates that this is the only struct which contains the same pointer.
13056 * Rust functions which take ownership of an object provided via an argument require
13057 * this to be true and invalidate the object pointed to by inner.
13060 } LDKClosingSignedFeeRange;
13063 * The contents of CResult_ClosingSignedFeeRangeDecodeErrorZ
13065 typedef union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr {
13067 * A pointer to the contents in the success state.
13068 * Reading from this pointer when `result_ok` is not set is undefined.
13070 struct LDKClosingSignedFeeRange *result;
13072 * A pointer to the contents in the error state.
13073 * Reading from this pointer when `result_ok` is set is undefined.
13075 struct LDKDecodeError *err;
13076 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr;
13079 * A CResult_ClosingSignedFeeRangeDecodeErrorZ represents the result of a fallible operation,
13080 * containing a crate::lightning::ln::msgs::ClosingSignedFeeRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
13081 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13083 typedef struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ {
13085 * The contents of this CResult_ClosingSignedFeeRangeDecodeErrorZ, accessible via either
13086 * `err` or `result` depending on the state of `result_ok`.
13088 union LDKCResult_ClosingSignedFeeRangeDecodeErrorZPtr contents;
13090 * Whether this CResult_ClosingSignedFeeRangeDecodeErrorZ represents a success state.
13093 } LDKCResult_ClosingSignedFeeRangeDecodeErrorZ;
13098 * A [`commitment_signed`] message to be sent to or received from a peer.
13100 * [`commitment_signed`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#committing-updates-so-far-commitment_signed
13102 typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
13104 * A pointer to the opaque Rust object.
13105 * Nearly everywhere, inner must be non-null, however in places where
13106 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13108 LDKnativeCommitmentSigned *inner;
13110 * Indicates that this is the only struct which contains the same pointer.
13111 * Rust functions which take ownership of an object provided via an argument require
13112 * this to be true and invalidate the object pointed to by inner.
13115 } LDKCommitmentSigned;
13118 * The contents of CResult_CommitmentSignedDecodeErrorZ
13120 typedef union LDKCResult_CommitmentSignedDecodeErrorZPtr {
13122 * A pointer to the contents in the success state.
13123 * Reading from this pointer when `result_ok` is not set is undefined.
13125 struct LDKCommitmentSigned *result;
13127 * A pointer to the contents in the error state.
13128 * Reading from this pointer when `result_ok` is set is undefined.
13130 struct LDKDecodeError *err;
13131 } LDKCResult_CommitmentSignedDecodeErrorZPtr;
13134 * A CResult_CommitmentSignedDecodeErrorZ represents the result of a fallible operation,
13135 * containing a crate::lightning::ln::msgs::CommitmentSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
13136 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13138 typedef struct LDKCResult_CommitmentSignedDecodeErrorZ {
13140 * The contents of this CResult_CommitmentSignedDecodeErrorZ, accessible via either
13141 * `err` or `result` depending on the state of `result_ok`.
13143 union LDKCResult_CommitmentSignedDecodeErrorZPtr contents;
13145 * Whether this CResult_CommitmentSignedDecodeErrorZ represents a success state.
13148 } LDKCResult_CommitmentSignedDecodeErrorZ;
13151 * The contents of CResult_FundingCreatedDecodeErrorZ
13153 typedef union LDKCResult_FundingCreatedDecodeErrorZPtr {
13155 * A pointer to the contents in the success state.
13156 * Reading from this pointer when `result_ok` is not set is undefined.
13158 struct LDKFundingCreated *result;
13160 * A pointer to the contents in the error state.
13161 * Reading from this pointer when `result_ok` is set is undefined.
13163 struct LDKDecodeError *err;
13164 } LDKCResult_FundingCreatedDecodeErrorZPtr;
13167 * A CResult_FundingCreatedDecodeErrorZ represents the result of a fallible operation,
13168 * containing a crate::lightning::ln::msgs::FundingCreated on success and a crate::lightning::ln::msgs::DecodeError on failure.
13169 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13171 typedef struct LDKCResult_FundingCreatedDecodeErrorZ {
13173 * The contents of this CResult_FundingCreatedDecodeErrorZ, accessible via either
13174 * `err` or `result` depending on the state of `result_ok`.
13176 union LDKCResult_FundingCreatedDecodeErrorZPtr contents;
13178 * Whether this CResult_FundingCreatedDecodeErrorZ represents a success state.
13181 } LDKCResult_FundingCreatedDecodeErrorZ;
13184 * The contents of CResult_FundingSignedDecodeErrorZ
13186 typedef union LDKCResult_FundingSignedDecodeErrorZPtr {
13188 * A pointer to the contents in the success state.
13189 * Reading from this pointer when `result_ok` is not set is undefined.
13191 struct LDKFundingSigned *result;
13193 * A pointer to the contents in the error state.
13194 * Reading from this pointer when `result_ok` is set is undefined.
13196 struct LDKDecodeError *err;
13197 } LDKCResult_FundingSignedDecodeErrorZPtr;
13200 * A CResult_FundingSignedDecodeErrorZ represents the result of a fallible operation,
13201 * containing a crate::lightning::ln::msgs::FundingSigned on success and a crate::lightning::ln::msgs::DecodeError on failure.
13202 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13204 typedef struct LDKCResult_FundingSignedDecodeErrorZ {
13206 * The contents of this CResult_FundingSignedDecodeErrorZ, accessible via either
13207 * `err` or `result` depending on the state of `result_ok`.
13209 union LDKCResult_FundingSignedDecodeErrorZPtr contents;
13211 * Whether this CResult_FundingSignedDecodeErrorZ represents a success state.
13214 } LDKCResult_FundingSignedDecodeErrorZ;
13217 * The contents of CResult_ChannelReadyDecodeErrorZ
13219 typedef union LDKCResult_ChannelReadyDecodeErrorZPtr {
13221 * A pointer to the contents in the success state.
13222 * Reading from this pointer when `result_ok` is not set is undefined.
13224 struct LDKChannelReady *result;
13226 * A pointer to the contents in the error state.
13227 * Reading from this pointer when `result_ok` is set is undefined.
13229 struct LDKDecodeError *err;
13230 } LDKCResult_ChannelReadyDecodeErrorZPtr;
13233 * A CResult_ChannelReadyDecodeErrorZ represents the result of a fallible operation,
13234 * containing a crate::lightning::ln::msgs::ChannelReady on success and a crate::lightning::ln::msgs::DecodeError on failure.
13235 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13237 typedef struct LDKCResult_ChannelReadyDecodeErrorZ {
13239 * The contents of this CResult_ChannelReadyDecodeErrorZ, accessible via either
13240 * `err` or `result` depending on the state of `result_ok`.
13242 union LDKCResult_ChannelReadyDecodeErrorZPtr contents;
13244 * Whether this CResult_ChannelReadyDecodeErrorZ represents a success state.
13247 } LDKCResult_ChannelReadyDecodeErrorZ;
13252 * An [`init`] message to be sent to or received from a peer.
13254 * [`init`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-init-message
13256 typedef struct MUST_USE_STRUCT LDKInit {
13258 * A pointer to the opaque Rust object.
13259 * Nearly everywhere, inner must be non-null, however in places where
13260 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13262 LDKnativeInit *inner;
13264 * Indicates that this is the only struct which contains the same pointer.
13265 * Rust functions which take ownership of an object provided via an argument require
13266 * this to be true and invalidate the object pointed to by inner.
13272 * The contents of CResult_InitDecodeErrorZ
13274 typedef union LDKCResult_InitDecodeErrorZPtr {
13276 * A pointer to the contents in the success state.
13277 * Reading from this pointer when `result_ok` is not set is undefined.
13279 struct LDKInit *result;
13281 * A pointer to the contents in the error state.
13282 * Reading from this pointer when `result_ok` is set is undefined.
13284 struct LDKDecodeError *err;
13285 } LDKCResult_InitDecodeErrorZPtr;
13288 * A CResult_InitDecodeErrorZ represents the result of a fallible operation,
13289 * containing a crate::lightning::ln::msgs::Init on success and a crate::lightning::ln::msgs::DecodeError on failure.
13290 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13292 typedef struct LDKCResult_InitDecodeErrorZ {
13294 * The contents of this CResult_InitDecodeErrorZ, accessible via either
13295 * `err` or `result` depending on the state of `result_ok`.
13297 union LDKCResult_InitDecodeErrorZPtr contents;
13299 * Whether this CResult_InitDecodeErrorZ represents a success state.
13302 } LDKCResult_InitDecodeErrorZ;
13305 * The contents of CResult_OpenChannelDecodeErrorZ
13307 typedef union LDKCResult_OpenChannelDecodeErrorZPtr {
13309 * A pointer to the contents in the success state.
13310 * Reading from this pointer when `result_ok` is not set is undefined.
13312 struct LDKOpenChannel *result;
13314 * A pointer to the contents in the error state.
13315 * Reading from this pointer when `result_ok` is set is undefined.
13317 struct LDKDecodeError *err;
13318 } LDKCResult_OpenChannelDecodeErrorZPtr;
13321 * A CResult_OpenChannelDecodeErrorZ represents the result of a fallible operation,
13322 * containing a crate::lightning::ln::msgs::OpenChannel on success and a crate::lightning::ln::msgs::DecodeError on failure.
13323 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13325 typedef struct LDKCResult_OpenChannelDecodeErrorZ {
13327 * The contents of this CResult_OpenChannelDecodeErrorZ, accessible via either
13328 * `err` or `result` depending on the state of `result_ok`.
13330 union LDKCResult_OpenChannelDecodeErrorZPtr contents;
13332 * Whether this CResult_OpenChannelDecodeErrorZ represents a success state.
13335 } LDKCResult_OpenChannelDecodeErrorZ;
13338 * The contents of CResult_OpenChannelV2DecodeErrorZ
13340 typedef union LDKCResult_OpenChannelV2DecodeErrorZPtr {
13342 * A pointer to the contents in the success state.
13343 * Reading from this pointer when `result_ok` is not set is undefined.
13345 struct LDKOpenChannelV2 *result;
13347 * A pointer to the contents in the error state.
13348 * Reading from this pointer when `result_ok` is set is undefined.
13350 struct LDKDecodeError *err;
13351 } LDKCResult_OpenChannelV2DecodeErrorZPtr;
13354 * A CResult_OpenChannelV2DecodeErrorZ represents the result of a fallible operation,
13355 * containing a crate::lightning::ln::msgs::OpenChannelV2 on success and a crate::lightning::ln::msgs::DecodeError on failure.
13356 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13358 typedef struct LDKCResult_OpenChannelV2DecodeErrorZ {
13360 * The contents of this CResult_OpenChannelV2DecodeErrorZ, accessible via either
13361 * `err` or `result` depending on the state of `result_ok`.
13363 union LDKCResult_OpenChannelV2DecodeErrorZPtr contents;
13365 * Whether this CResult_OpenChannelV2DecodeErrorZ represents a success state.
13368 } LDKCResult_OpenChannelV2DecodeErrorZ;
13371 * The contents of CResult_RevokeAndACKDecodeErrorZ
13373 typedef union LDKCResult_RevokeAndACKDecodeErrorZPtr {
13375 * A pointer to the contents in the success state.
13376 * Reading from this pointer when `result_ok` is not set is undefined.
13378 struct LDKRevokeAndACK *result;
13380 * A pointer to the contents in the error state.
13381 * Reading from this pointer when `result_ok` is set is undefined.
13383 struct LDKDecodeError *err;
13384 } LDKCResult_RevokeAndACKDecodeErrorZPtr;
13387 * A CResult_RevokeAndACKDecodeErrorZ represents the result of a fallible operation,
13388 * containing a crate::lightning::ln::msgs::RevokeAndACK on success and a crate::lightning::ln::msgs::DecodeError on failure.
13389 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13391 typedef struct LDKCResult_RevokeAndACKDecodeErrorZ {
13393 * The contents of this CResult_RevokeAndACKDecodeErrorZ, accessible via either
13394 * `err` or `result` depending on the state of `result_ok`.
13396 union LDKCResult_RevokeAndACKDecodeErrorZPtr contents;
13398 * Whether this CResult_RevokeAndACKDecodeErrorZ represents a success state.
13401 } LDKCResult_RevokeAndACKDecodeErrorZ;
13404 * The contents of CResult_ShutdownDecodeErrorZ
13406 typedef union LDKCResult_ShutdownDecodeErrorZPtr {
13408 * A pointer to the contents in the success state.
13409 * Reading from this pointer when `result_ok` is not set is undefined.
13411 struct LDKShutdown *result;
13413 * A pointer to the contents in the error state.
13414 * Reading from this pointer when `result_ok` is set is undefined.
13416 struct LDKDecodeError *err;
13417 } LDKCResult_ShutdownDecodeErrorZPtr;
13420 * A CResult_ShutdownDecodeErrorZ represents the result of a fallible operation,
13421 * containing a crate::lightning::ln::msgs::Shutdown on success and a crate::lightning::ln::msgs::DecodeError on failure.
13422 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13424 typedef struct LDKCResult_ShutdownDecodeErrorZ {
13426 * The contents of this CResult_ShutdownDecodeErrorZ, accessible via either
13427 * `err` or `result` depending on the state of `result_ok`.
13429 union LDKCResult_ShutdownDecodeErrorZPtr contents;
13431 * Whether this CResult_ShutdownDecodeErrorZ represents a success state.
13434 } LDKCResult_ShutdownDecodeErrorZ;
13437 * The contents of CResult_UpdateFailHTLCDecodeErrorZ
13439 typedef union LDKCResult_UpdateFailHTLCDecodeErrorZPtr {
13441 * A pointer to the contents in the success state.
13442 * Reading from this pointer when `result_ok` is not set is undefined.
13444 struct LDKUpdateFailHTLC *result;
13446 * A pointer to the contents in the error state.
13447 * Reading from this pointer when `result_ok` is set is undefined.
13449 struct LDKDecodeError *err;
13450 } LDKCResult_UpdateFailHTLCDecodeErrorZPtr;
13453 * A CResult_UpdateFailHTLCDecodeErrorZ represents the result of a fallible operation,
13454 * containing a crate::lightning::ln::msgs::UpdateFailHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
13455 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13457 typedef struct LDKCResult_UpdateFailHTLCDecodeErrorZ {
13459 * The contents of this CResult_UpdateFailHTLCDecodeErrorZ, accessible via either
13460 * `err` or `result` depending on the state of `result_ok`.
13462 union LDKCResult_UpdateFailHTLCDecodeErrorZPtr contents;
13464 * Whether this CResult_UpdateFailHTLCDecodeErrorZ represents a success state.
13467 } LDKCResult_UpdateFailHTLCDecodeErrorZ;
13470 * The contents of CResult_UpdateFailMalformedHTLCDecodeErrorZ
13472 typedef union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr {
13474 * A pointer to the contents in the success state.
13475 * Reading from this pointer when `result_ok` is not set is undefined.
13477 struct LDKUpdateFailMalformedHTLC *result;
13479 * A pointer to the contents in the error state.
13480 * Reading from this pointer when `result_ok` is set is undefined.
13482 struct LDKDecodeError *err;
13483 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr;
13486 * A CResult_UpdateFailMalformedHTLCDecodeErrorZ represents the result of a fallible operation,
13487 * containing a crate::lightning::ln::msgs::UpdateFailMalformedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
13488 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13490 typedef struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ {
13492 * The contents of this CResult_UpdateFailMalformedHTLCDecodeErrorZ, accessible via either
13493 * `err` or `result` depending on the state of `result_ok`.
13495 union LDKCResult_UpdateFailMalformedHTLCDecodeErrorZPtr contents;
13497 * Whether this CResult_UpdateFailMalformedHTLCDecodeErrorZ represents a success state.
13500 } LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ;
13505 * An [`update_fee`] message to be sent to or received from a peer
13507 * [`update_fee`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#updating-fees-update_fee
13509 typedef struct MUST_USE_STRUCT LDKUpdateFee {
13511 * A pointer to the opaque Rust object.
13512 * Nearly everywhere, inner must be non-null, however in places where
13513 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13515 LDKnativeUpdateFee *inner;
13517 * Indicates that this is the only struct which contains the same pointer.
13518 * Rust functions which take ownership of an object provided via an argument require
13519 * this to be true and invalidate the object pointed to by inner.
13525 * The contents of CResult_UpdateFeeDecodeErrorZ
13527 typedef union LDKCResult_UpdateFeeDecodeErrorZPtr {
13529 * A pointer to the contents in the success state.
13530 * Reading from this pointer when `result_ok` is not set is undefined.
13532 struct LDKUpdateFee *result;
13534 * A pointer to the contents in the error state.
13535 * Reading from this pointer when `result_ok` is set is undefined.
13537 struct LDKDecodeError *err;
13538 } LDKCResult_UpdateFeeDecodeErrorZPtr;
13541 * A CResult_UpdateFeeDecodeErrorZ represents the result of a fallible operation,
13542 * containing a crate::lightning::ln::msgs::UpdateFee on success and a crate::lightning::ln::msgs::DecodeError on failure.
13543 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13545 typedef struct LDKCResult_UpdateFeeDecodeErrorZ {
13547 * The contents of this CResult_UpdateFeeDecodeErrorZ, accessible via either
13548 * `err` or `result` depending on the state of `result_ok`.
13550 union LDKCResult_UpdateFeeDecodeErrorZPtr contents;
13552 * Whether this CResult_UpdateFeeDecodeErrorZ represents a success state.
13555 } LDKCResult_UpdateFeeDecodeErrorZ;
13558 * The contents of CResult_UpdateFulfillHTLCDecodeErrorZ
13560 typedef union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr {
13562 * A pointer to the contents in the success state.
13563 * Reading from this pointer when `result_ok` is not set is undefined.
13565 struct LDKUpdateFulfillHTLC *result;
13567 * A pointer to the contents in the error state.
13568 * Reading from this pointer when `result_ok` is set is undefined.
13570 struct LDKDecodeError *err;
13571 } LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr;
13574 * A CResult_UpdateFulfillHTLCDecodeErrorZ represents the result of a fallible operation,
13575 * containing a crate::lightning::ln::msgs::UpdateFulfillHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
13576 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13578 typedef struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ {
13580 * The contents of this CResult_UpdateFulfillHTLCDecodeErrorZ, accessible via either
13581 * `err` or `result` depending on the state of `result_ok`.
13583 union LDKCResult_UpdateFulfillHTLCDecodeErrorZPtr contents;
13585 * Whether this CResult_UpdateFulfillHTLCDecodeErrorZ represents a success state.
13588 } LDKCResult_UpdateFulfillHTLCDecodeErrorZ;
13591 * The contents of CResult_OnionPacketDecodeErrorZ
13593 typedef union LDKCResult_OnionPacketDecodeErrorZPtr {
13595 * A pointer to the contents in the success state.
13596 * Reading from this pointer when `result_ok` is not set is undefined.
13598 struct LDKOnionPacket *result;
13600 * A pointer to the contents in the error state.
13601 * Reading from this pointer when `result_ok` is set is undefined.
13603 struct LDKDecodeError *err;
13604 } LDKCResult_OnionPacketDecodeErrorZPtr;
13607 * A CResult_OnionPacketDecodeErrorZ represents the result of a fallible operation,
13608 * containing a crate::lightning::ln::msgs::OnionPacket on success and a crate::lightning::ln::msgs::DecodeError on failure.
13609 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13611 typedef struct LDKCResult_OnionPacketDecodeErrorZ {
13613 * The contents of this CResult_OnionPacketDecodeErrorZ, accessible via either
13614 * `err` or `result` depending on the state of `result_ok`.
13616 union LDKCResult_OnionPacketDecodeErrorZPtr contents;
13618 * Whether this CResult_OnionPacketDecodeErrorZ represents a success state.
13621 } LDKCResult_OnionPacketDecodeErrorZ;
13624 * The contents of CResult_UpdateAddHTLCDecodeErrorZ
13626 typedef union LDKCResult_UpdateAddHTLCDecodeErrorZPtr {
13628 * A pointer to the contents in the success state.
13629 * Reading from this pointer when `result_ok` is not set is undefined.
13631 struct LDKUpdateAddHTLC *result;
13633 * A pointer to the contents in the error state.
13634 * Reading from this pointer when `result_ok` is set is undefined.
13636 struct LDKDecodeError *err;
13637 } LDKCResult_UpdateAddHTLCDecodeErrorZPtr;
13640 * A CResult_UpdateAddHTLCDecodeErrorZ represents the result of a fallible operation,
13641 * containing a crate::lightning::ln::msgs::UpdateAddHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
13642 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13644 typedef struct LDKCResult_UpdateAddHTLCDecodeErrorZ {
13646 * The contents of this CResult_UpdateAddHTLCDecodeErrorZ, accessible via either
13647 * `err` or `result` depending on the state of `result_ok`.
13649 union LDKCResult_UpdateAddHTLCDecodeErrorZPtr contents;
13651 * Whether this CResult_UpdateAddHTLCDecodeErrorZ represents a success state.
13654 } LDKCResult_UpdateAddHTLCDecodeErrorZ;
13659 * An onion message to be sent to or received from a peer.
13662 typedef struct MUST_USE_STRUCT LDKOnionMessage {
13664 * A pointer to the opaque Rust object.
13665 * Nearly everywhere, inner must be non-null, however in places where
13666 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13668 LDKnativeOnionMessage *inner;
13670 * Indicates that this is the only struct which contains the same pointer.
13671 * Rust functions which take ownership of an object provided via an argument require
13672 * this to be true and invalidate the object pointed to by inner.
13678 * The contents of CResult_OnionMessageDecodeErrorZ
13680 typedef union LDKCResult_OnionMessageDecodeErrorZPtr {
13682 * A pointer to the contents in the success state.
13683 * Reading from this pointer when `result_ok` is not set is undefined.
13685 struct LDKOnionMessage *result;
13687 * A pointer to the contents in the error state.
13688 * Reading from this pointer when `result_ok` is set is undefined.
13690 struct LDKDecodeError *err;
13691 } LDKCResult_OnionMessageDecodeErrorZPtr;
13694 * A CResult_OnionMessageDecodeErrorZ represents the result of a fallible operation,
13695 * containing a crate::lightning::ln::msgs::OnionMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
13696 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13698 typedef struct LDKCResult_OnionMessageDecodeErrorZ {
13700 * The contents of this CResult_OnionMessageDecodeErrorZ, accessible via either
13701 * `err` or `result` depending on the state of `result_ok`.
13703 union LDKCResult_OnionMessageDecodeErrorZPtr contents;
13705 * Whether this CResult_OnionMessageDecodeErrorZ represents a success state.
13708 } LDKCResult_OnionMessageDecodeErrorZ;
13711 * The contents of CResult_FinalOnionHopDataDecodeErrorZ
13713 typedef union LDKCResult_FinalOnionHopDataDecodeErrorZPtr {
13715 * A pointer to the contents in the success state.
13716 * Reading from this pointer when `result_ok` is not set is undefined.
13718 struct LDKFinalOnionHopData *result;
13720 * A pointer to the contents in the error state.
13721 * Reading from this pointer when `result_ok` is set is undefined.
13723 struct LDKDecodeError *err;
13724 } LDKCResult_FinalOnionHopDataDecodeErrorZPtr;
13727 * A CResult_FinalOnionHopDataDecodeErrorZ represents the result of a fallible operation,
13728 * containing a crate::lightning::ln::msgs::FinalOnionHopData on success and a crate::lightning::ln::msgs::DecodeError on failure.
13729 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13731 typedef struct LDKCResult_FinalOnionHopDataDecodeErrorZ {
13733 * The contents of this CResult_FinalOnionHopDataDecodeErrorZ, accessible via either
13734 * `err` or `result` depending on the state of `result_ok`.
13736 union LDKCResult_FinalOnionHopDataDecodeErrorZPtr contents;
13738 * Whether this CResult_FinalOnionHopDataDecodeErrorZ represents a success state.
13741 } LDKCResult_FinalOnionHopDataDecodeErrorZ;
13746 * A [`ping`] message to be sent to or received from a peer.
13748 * [`ping`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
13750 typedef struct MUST_USE_STRUCT LDKPing {
13752 * A pointer to the opaque Rust object.
13753 * Nearly everywhere, inner must be non-null, however in places where
13754 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13756 LDKnativePing *inner;
13758 * Indicates that this is the only struct which contains the same pointer.
13759 * Rust functions which take ownership of an object provided via an argument require
13760 * this to be true and invalidate the object pointed to by inner.
13766 * The contents of CResult_PingDecodeErrorZ
13768 typedef union LDKCResult_PingDecodeErrorZPtr {
13770 * A pointer to the contents in the success state.
13771 * Reading from this pointer when `result_ok` is not set is undefined.
13773 struct LDKPing *result;
13775 * A pointer to the contents in the error state.
13776 * Reading from this pointer when `result_ok` is set is undefined.
13778 struct LDKDecodeError *err;
13779 } LDKCResult_PingDecodeErrorZPtr;
13782 * A CResult_PingDecodeErrorZ represents the result of a fallible operation,
13783 * containing a crate::lightning::ln::msgs::Ping on success and a crate::lightning::ln::msgs::DecodeError on failure.
13784 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13786 typedef struct LDKCResult_PingDecodeErrorZ {
13788 * The contents of this CResult_PingDecodeErrorZ, accessible via either
13789 * `err` or `result` depending on the state of `result_ok`.
13791 union LDKCResult_PingDecodeErrorZPtr contents;
13793 * Whether this CResult_PingDecodeErrorZ represents a success state.
13796 } LDKCResult_PingDecodeErrorZ;
13801 * A [`pong`] message to be sent to or received from a peer.
13803 * [`pong`]: https://github.com/lightning/bolts/blob/master/01-messaging.md#the-ping-and-pong-messages
13805 typedef struct MUST_USE_STRUCT LDKPong {
13807 * A pointer to the opaque Rust object.
13808 * Nearly everywhere, inner must be non-null, however in places where
13809 * the Rust equivalent takes an Option, it may be set to null to indicate None.
13811 LDKnativePong *inner;
13813 * Indicates that this is the only struct which contains the same pointer.
13814 * Rust functions which take ownership of an object provided via an argument require
13815 * this to be true and invalidate the object pointed to by inner.
13821 * The contents of CResult_PongDecodeErrorZ
13823 typedef union LDKCResult_PongDecodeErrorZPtr {
13825 * A pointer to the contents in the success state.
13826 * Reading from this pointer when `result_ok` is not set is undefined.
13828 struct LDKPong *result;
13830 * A pointer to the contents in the error state.
13831 * Reading from this pointer when `result_ok` is set is undefined.
13833 struct LDKDecodeError *err;
13834 } LDKCResult_PongDecodeErrorZPtr;
13837 * A CResult_PongDecodeErrorZ represents the result of a fallible operation,
13838 * containing a crate::lightning::ln::msgs::Pong on success and a crate::lightning::ln::msgs::DecodeError on failure.
13839 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13841 typedef struct LDKCResult_PongDecodeErrorZ {
13843 * The contents of this CResult_PongDecodeErrorZ, accessible via either
13844 * `err` or `result` depending on the state of `result_ok`.
13846 union LDKCResult_PongDecodeErrorZPtr contents;
13848 * Whether this CResult_PongDecodeErrorZ represents a success state.
13851 } LDKCResult_PongDecodeErrorZ;
13854 * The contents of CResult_UnsignedChannelAnnouncementDecodeErrorZ
13856 typedef union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr {
13858 * A pointer to the contents in the success state.
13859 * Reading from this pointer when `result_ok` is not set is undefined.
13861 struct LDKUnsignedChannelAnnouncement *result;
13863 * A pointer to the contents in the error state.
13864 * Reading from this pointer when `result_ok` is set is undefined.
13866 struct LDKDecodeError *err;
13867 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr;
13870 * A CResult_UnsignedChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
13871 * containing a crate::lightning::ln::msgs::UnsignedChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
13872 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13874 typedef struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ {
13876 * The contents of this CResult_UnsignedChannelAnnouncementDecodeErrorZ, accessible via either
13877 * `err` or `result` depending on the state of `result_ok`.
13879 union LDKCResult_UnsignedChannelAnnouncementDecodeErrorZPtr contents;
13881 * Whether this CResult_UnsignedChannelAnnouncementDecodeErrorZ represents a success state.
13884 } LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ;
13887 * The contents of CResult_ChannelAnnouncementDecodeErrorZ
13889 typedef union LDKCResult_ChannelAnnouncementDecodeErrorZPtr {
13891 * A pointer to the contents in the success state.
13892 * Reading from this pointer when `result_ok` is not set is undefined.
13894 struct LDKChannelAnnouncement *result;
13896 * A pointer to the contents in the error state.
13897 * Reading from this pointer when `result_ok` is set is undefined.
13899 struct LDKDecodeError *err;
13900 } LDKCResult_ChannelAnnouncementDecodeErrorZPtr;
13903 * A CResult_ChannelAnnouncementDecodeErrorZ represents the result of a fallible operation,
13904 * containing a crate::lightning::ln::msgs::ChannelAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
13905 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13907 typedef struct LDKCResult_ChannelAnnouncementDecodeErrorZ {
13909 * The contents of this CResult_ChannelAnnouncementDecodeErrorZ, accessible via either
13910 * `err` or `result` depending on the state of `result_ok`.
13912 union LDKCResult_ChannelAnnouncementDecodeErrorZPtr contents;
13914 * Whether this CResult_ChannelAnnouncementDecodeErrorZ represents a success state.
13917 } LDKCResult_ChannelAnnouncementDecodeErrorZ;
13920 * The contents of CResult_UnsignedChannelUpdateDecodeErrorZ
13922 typedef union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr {
13924 * A pointer to the contents in the success state.
13925 * Reading from this pointer when `result_ok` is not set is undefined.
13927 struct LDKUnsignedChannelUpdate *result;
13929 * A pointer to the contents in the error state.
13930 * Reading from this pointer when `result_ok` is set is undefined.
13932 struct LDKDecodeError *err;
13933 } LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr;
13936 * A CResult_UnsignedChannelUpdateDecodeErrorZ represents the result of a fallible operation,
13937 * containing a crate::lightning::ln::msgs::UnsignedChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
13938 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13940 typedef struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ {
13942 * The contents of this CResult_UnsignedChannelUpdateDecodeErrorZ, accessible via either
13943 * `err` or `result` depending on the state of `result_ok`.
13945 union LDKCResult_UnsignedChannelUpdateDecodeErrorZPtr contents;
13947 * Whether this CResult_UnsignedChannelUpdateDecodeErrorZ represents a success state.
13950 } LDKCResult_UnsignedChannelUpdateDecodeErrorZ;
13953 * The contents of CResult_ChannelUpdateDecodeErrorZ
13955 typedef union LDKCResult_ChannelUpdateDecodeErrorZPtr {
13957 * A pointer to the contents in the success state.
13958 * Reading from this pointer when `result_ok` is not set is undefined.
13960 struct LDKChannelUpdate *result;
13962 * A pointer to the contents in the error state.
13963 * Reading from this pointer when `result_ok` is set is undefined.
13965 struct LDKDecodeError *err;
13966 } LDKCResult_ChannelUpdateDecodeErrorZPtr;
13969 * A CResult_ChannelUpdateDecodeErrorZ represents the result of a fallible operation,
13970 * containing a crate::lightning::ln::msgs::ChannelUpdate on success and a crate::lightning::ln::msgs::DecodeError on failure.
13971 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
13973 typedef struct LDKCResult_ChannelUpdateDecodeErrorZ {
13975 * The contents of this CResult_ChannelUpdateDecodeErrorZ, accessible via either
13976 * `err` or `result` depending on the state of `result_ok`.
13978 union LDKCResult_ChannelUpdateDecodeErrorZPtr contents;
13980 * Whether this CResult_ChannelUpdateDecodeErrorZ represents a success state.
13983 } LDKCResult_ChannelUpdateDecodeErrorZ;
13986 * The contents of CResult_ErrorMessageDecodeErrorZ
13988 typedef union LDKCResult_ErrorMessageDecodeErrorZPtr {
13990 * A pointer to the contents in the success state.
13991 * Reading from this pointer when `result_ok` is not set is undefined.
13993 struct LDKErrorMessage *result;
13995 * A pointer to the contents in the error state.
13996 * Reading from this pointer when `result_ok` is set is undefined.
13998 struct LDKDecodeError *err;
13999 } LDKCResult_ErrorMessageDecodeErrorZPtr;
14002 * A CResult_ErrorMessageDecodeErrorZ represents the result of a fallible operation,
14003 * containing a crate::lightning::ln::msgs::ErrorMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
14004 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14006 typedef struct LDKCResult_ErrorMessageDecodeErrorZ {
14008 * The contents of this CResult_ErrorMessageDecodeErrorZ, accessible via either
14009 * `err` or `result` depending on the state of `result_ok`.
14011 union LDKCResult_ErrorMessageDecodeErrorZPtr contents;
14013 * Whether this CResult_ErrorMessageDecodeErrorZ represents a success state.
14016 } LDKCResult_ErrorMessageDecodeErrorZ;
14019 * The contents of CResult_WarningMessageDecodeErrorZ
14021 typedef union LDKCResult_WarningMessageDecodeErrorZPtr {
14023 * A pointer to the contents in the success state.
14024 * Reading from this pointer when `result_ok` is not set is undefined.
14026 struct LDKWarningMessage *result;
14028 * A pointer to the contents in the error state.
14029 * Reading from this pointer when `result_ok` is set is undefined.
14031 struct LDKDecodeError *err;
14032 } LDKCResult_WarningMessageDecodeErrorZPtr;
14035 * A CResult_WarningMessageDecodeErrorZ represents the result of a fallible operation,
14036 * containing a crate::lightning::ln::msgs::WarningMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
14037 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14039 typedef struct LDKCResult_WarningMessageDecodeErrorZ {
14041 * The contents of this CResult_WarningMessageDecodeErrorZ, accessible via either
14042 * `err` or `result` depending on the state of `result_ok`.
14044 union LDKCResult_WarningMessageDecodeErrorZPtr contents;
14046 * Whether this CResult_WarningMessageDecodeErrorZ represents a success state.
14049 } LDKCResult_WarningMessageDecodeErrorZ;
14052 * The contents of CResult_UnsignedNodeAnnouncementDecodeErrorZ
14054 typedef union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr {
14056 * A pointer to the contents in the success state.
14057 * Reading from this pointer when `result_ok` is not set is undefined.
14059 struct LDKUnsignedNodeAnnouncement *result;
14061 * A pointer to the contents in the error state.
14062 * Reading from this pointer when `result_ok` is set is undefined.
14064 struct LDKDecodeError *err;
14065 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr;
14068 * A CResult_UnsignedNodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
14069 * containing a crate::lightning::ln::msgs::UnsignedNodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
14070 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14072 typedef struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ {
14074 * The contents of this CResult_UnsignedNodeAnnouncementDecodeErrorZ, accessible via either
14075 * `err` or `result` depending on the state of `result_ok`.
14077 union LDKCResult_UnsignedNodeAnnouncementDecodeErrorZPtr contents;
14079 * Whether this CResult_UnsignedNodeAnnouncementDecodeErrorZ represents a success state.
14082 } LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ;
14085 * The contents of CResult_NodeAnnouncementDecodeErrorZ
14087 typedef union LDKCResult_NodeAnnouncementDecodeErrorZPtr {
14089 * A pointer to the contents in the success state.
14090 * Reading from this pointer when `result_ok` is not set is undefined.
14092 struct LDKNodeAnnouncement *result;
14094 * A pointer to the contents in the error state.
14095 * Reading from this pointer when `result_ok` is set is undefined.
14097 struct LDKDecodeError *err;
14098 } LDKCResult_NodeAnnouncementDecodeErrorZPtr;
14101 * A CResult_NodeAnnouncementDecodeErrorZ represents the result of a fallible operation,
14102 * containing a crate::lightning::ln::msgs::NodeAnnouncement on success and a crate::lightning::ln::msgs::DecodeError on failure.
14103 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14105 typedef struct LDKCResult_NodeAnnouncementDecodeErrorZ {
14107 * The contents of this CResult_NodeAnnouncementDecodeErrorZ, accessible via either
14108 * `err` or `result` depending on the state of `result_ok`.
14110 union LDKCResult_NodeAnnouncementDecodeErrorZPtr contents;
14112 * Whether this CResult_NodeAnnouncementDecodeErrorZ represents a success state.
14115 } LDKCResult_NodeAnnouncementDecodeErrorZ;
14118 * The contents of CResult_QueryShortChannelIdsDecodeErrorZ
14120 typedef union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr {
14122 * A pointer to the contents in the success state.
14123 * Reading from this pointer when `result_ok` is not set is undefined.
14125 struct LDKQueryShortChannelIds *result;
14127 * A pointer to the contents in the error state.
14128 * Reading from this pointer when `result_ok` is set is undefined.
14130 struct LDKDecodeError *err;
14131 } LDKCResult_QueryShortChannelIdsDecodeErrorZPtr;
14134 * A CResult_QueryShortChannelIdsDecodeErrorZ represents the result of a fallible operation,
14135 * containing a crate::lightning::ln::msgs::QueryShortChannelIds on success and a crate::lightning::ln::msgs::DecodeError on failure.
14136 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14138 typedef struct LDKCResult_QueryShortChannelIdsDecodeErrorZ {
14140 * The contents of this CResult_QueryShortChannelIdsDecodeErrorZ, accessible via either
14141 * `err` or `result` depending on the state of `result_ok`.
14143 union LDKCResult_QueryShortChannelIdsDecodeErrorZPtr contents;
14145 * Whether this CResult_QueryShortChannelIdsDecodeErrorZ represents a success state.
14148 } LDKCResult_QueryShortChannelIdsDecodeErrorZ;
14153 * A [`reply_short_channel_ids_end`] message is sent as a reply to a
14154 * message. The query recipient makes a best
14155 * effort to respond based on their local network view which may not be
14156 * a perfect view of the network.
14158 * [`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
14160 typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
14162 * A pointer to the opaque Rust object.
14163 * Nearly everywhere, inner must be non-null, however in places where
14164 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14166 LDKnativeReplyShortChannelIdsEnd *inner;
14168 * Indicates that this is the only struct which contains the same pointer.
14169 * Rust functions which take ownership of an object provided via an argument require
14170 * this to be true and invalidate the object pointed to by inner.
14173 } LDKReplyShortChannelIdsEnd;
14176 * The contents of CResult_ReplyShortChannelIdsEndDecodeErrorZ
14178 typedef union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr {
14180 * A pointer to the contents in the success state.
14181 * Reading from this pointer when `result_ok` is not set is undefined.
14183 struct LDKReplyShortChannelIdsEnd *result;
14185 * A pointer to the contents in the error state.
14186 * Reading from this pointer when `result_ok` is set is undefined.
14188 struct LDKDecodeError *err;
14189 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr;
14192 * A CResult_ReplyShortChannelIdsEndDecodeErrorZ represents the result of a fallible operation,
14193 * containing a crate::lightning::ln::msgs::ReplyShortChannelIdsEnd on success and a crate::lightning::ln::msgs::DecodeError on failure.
14194 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14196 typedef struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ {
14198 * The contents of this CResult_ReplyShortChannelIdsEndDecodeErrorZ, accessible via either
14199 * `err` or `result` depending on the state of `result_ok`.
14201 union LDKCResult_ReplyShortChannelIdsEndDecodeErrorZPtr contents;
14203 * Whether this CResult_ReplyShortChannelIdsEndDecodeErrorZ represents a success state.
14206 } LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ;
14209 * The contents of CResult_QueryChannelRangeDecodeErrorZ
14211 typedef union LDKCResult_QueryChannelRangeDecodeErrorZPtr {
14213 * A pointer to the contents in the success state.
14214 * Reading from this pointer when `result_ok` is not set is undefined.
14216 struct LDKQueryChannelRange *result;
14218 * A pointer to the contents in the error state.
14219 * Reading from this pointer when `result_ok` is set is undefined.
14221 struct LDKDecodeError *err;
14222 } LDKCResult_QueryChannelRangeDecodeErrorZPtr;
14225 * A CResult_QueryChannelRangeDecodeErrorZ represents the result of a fallible operation,
14226 * containing a crate::lightning::ln::msgs::QueryChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
14227 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14229 typedef struct LDKCResult_QueryChannelRangeDecodeErrorZ {
14231 * The contents of this CResult_QueryChannelRangeDecodeErrorZ, accessible via either
14232 * `err` or `result` depending on the state of `result_ok`.
14234 union LDKCResult_QueryChannelRangeDecodeErrorZPtr contents;
14236 * Whether this CResult_QueryChannelRangeDecodeErrorZ represents a success state.
14239 } LDKCResult_QueryChannelRangeDecodeErrorZ;
14242 * The contents of CResult_ReplyChannelRangeDecodeErrorZ
14244 typedef union LDKCResult_ReplyChannelRangeDecodeErrorZPtr {
14246 * A pointer to the contents in the success state.
14247 * Reading from this pointer when `result_ok` is not set is undefined.
14249 struct LDKReplyChannelRange *result;
14251 * A pointer to the contents in the error state.
14252 * Reading from this pointer when `result_ok` is set is undefined.
14254 struct LDKDecodeError *err;
14255 } LDKCResult_ReplyChannelRangeDecodeErrorZPtr;
14258 * A CResult_ReplyChannelRangeDecodeErrorZ represents the result of a fallible operation,
14259 * containing a crate::lightning::ln::msgs::ReplyChannelRange on success and a crate::lightning::ln::msgs::DecodeError on failure.
14260 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14262 typedef struct LDKCResult_ReplyChannelRangeDecodeErrorZ {
14264 * The contents of this CResult_ReplyChannelRangeDecodeErrorZ, accessible via either
14265 * `err` or `result` depending on the state of `result_ok`.
14267 union LDKCResult_ReplyChannelRangeDecodeErrorZPtr contents;
14269 * Whether this CResult_ReplyChannelRangeDecodeErrorZ represents a success state.
14272 } LDKCResult_ReplyChannelRangeDecodeErrorZ;
14275 * The contents of CResult_GossipTimestampFilterDecodeErrorZ
14277 typedef union LDKCResult_GossipTimestampFilterDecodeErrorZPtr {
14279 * A pointer to the contents in the success state.
14280 * Reading from this pointer when `result_ok` is not set is undefined.
14282 struct LDKGossipTimestampFilter *result;
14284 * A pointer to the contents in the error state.
14285 * Reading from this pointer when `result_ok` is set is undefined.
14287 struct LDKDecodeError *err;
14288 } LDKCResult_GossipTimestampFilterDecodeErrorZPtr;
14291 * A CResult_GossipTimestampFilterDecodeErrorZ represents the result of a fallible operation,
14292 * containing a crate::lightning::ln::msgs::GossipTimestampFilter on success and a crate::lightning::ln::msgs::DecodeError on failure.
14293 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14295 typedef struct LDKCResult_GossipTimestampFilterDecodeErrorZ {
14297 * The contents of this CResult_GossipTimestampFilterDecodeErrorZ, accessible via either
14298 * `err` or `result` depending on the state of `result_ok`.
14300 union LDKCResult_GossipTimestampFilterDecodeErrorZPtr contents;
14302 * Whether this CResult_GossipTimestampFilterDecodeErrorZ represents a success state.
14305 } LDKCResult_GossipTimestampFilterDecodeErrorZ;
14308 * A dynamically-allocated array of crate::lightning::ln::channelmanager::PhantomRouteHintss of arbitrary size.
14309 * This corresponds to std::vector in C++
14311 typedef struct LDKCVec_PhantomRouteHintsZ {
14313 * The elements in the array.
14314 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14316 struct LDKPhantomRouteHints *data;
14318 * The number of elements pointed to by `data`.
14321 } LDKCVec_PhantomRouteHintsZ;
14326 * Represents a syntactically and semantically correct lightning BOLT11 invoice.
14328 * There are three ways to construct a `Bolt11Invoice`:
14329 * 1. using [`InvoiceBuilder`]
14330 * 2. using [`Bolt11Invoice::from_signed`]
14331 * 3. using `str::parse::<Bolt11Invoice>(&str)` (see [`Bolt11Invoice::from_str`])
14333 * [`Bolt11Invoice::from_str`]: crate::Bolt11Invoice#impl-FromStr
14335 typedef struct MUST_USE_STRUCT LDKBolt11Invoice {
14337 * A pointer to the opaque Rust object.
14338 * Nearly everywhere, inner must be non-null, however in places where
14339 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14341 LDKnativeBolt11Invoice *inner;
14343 * Indicates that this is the only struct which contains the same pointer.
14344 * Rust functions which take ownership of an object provided via an argument require
14345 * this to be true and invalidate the object pointed to by inner.
14348 } LDKBolt11Invoice;
14351 * When signing using a fallible method either an user-supplied `SignError` or a [`CreationError`]
14354 typedef enum LDKSignOrCreationError_Tag {
14356 * An error occurred during signing
14358 LDKSignOrCreationError_SignError,
14360 * An error occurred while building the transaction
14362 LDKSignOrCreationError_CreationError,
14364 * Must be last for serialization purposes
14366 LDKSignOrCreationError_Sentinel,
14367 } LDKSignOrCreationError_Tag;
14369 typedef struct MUST_USE_STRUCT LDKSignOrCreationError {
14370 LDKSignOrCreationError_Tag tag;
14373 enum LDKCreationError creation_error;
14376 } LDKSignOrCreationError;
14379 * The contents of CResult_Bolt11InvoiceSignOrCreationErrorZ
14381 typedef union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr {
14383 * A pointer to the contents in the success state.
14384 * Reading from this pointer when `result_ok` is not set is undefined.
14386 struct LDKBolt11Invoice *result;
14388 * A pointer to the contents in the error state.
14389 * Reading from this pointer when `result_ok` is set is undefined.
14391 struct LDKSignOrCreationError *err;
14392 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr;
14395 * A CResult_Bolt11InvoiceSignOrCreationErrorZ represents the result of a fallible operation,
14396 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::SignOrCreationError on failure.
14397 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14399 typedef struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ {
14401 * The contents of this CResult_Bolt11InvoiceSignOrCreationErrorZ, accessible via either
14402 * `err` or `result` depending on the state of `result_ok`.
14404 union LDKCResult_Bolt11InvoiceSignOrCreationErrorZPtr contents;
14406 * Whether this CResult_Bolt11InvoiceSignOrCreationErrorZ represents a success state.
14409 } LDKCResult_Bolt11InvoiceSignOrCreationErrorZ;
14414 * A simple future which can complete once, and calls some callback(s) when it does so.
14416 * Clones can be made and all futures cloned from the same source will complete at the same time.
14418 typedef struct MUST_USE_STRUCT LDKFuture {
14420 * A pointer to the opaque Rust object.
14421 * Nearly everywhere, inner must be non-null, however in places where
14422 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14424 LDKnativeFuture *inner;
14426 * Indicates that this is the only struct which contains the same pointer.
14427 * Rust functions which take ownership of an object provided via an argument require
14428 * this to be true and invalidate the object pointed to by inner.
14434 * A dynamically-allocated array of crate::lightning::util::wakers::Futures of arbitrary size.
14435 * This corresponds to std::vector in C++
14437 typedef struct LDKCVec_FutureZ {
14439 * The elements in the array.
14440 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
14442 struct LDKFuture *data;
14444 * The number of elements pointed to by `data`.
14450 * The contents of CResult_OffersMessageDecodeErrorZ
14452 typedef union LDKCResult_OffersMessageDecodeErrorZPtr {
14454 * A pointer to the contents in the success state.
14455 * Reading from this pointer when `result_ok` is not set is undefined.
14457 struct LDKOffersMessage *result;
14459 * A pointer to the contents in the error state.
14460 * Reading from this pointer when `result_ok` is set is undefined.
14462 struct LDKDecodeError *err;
14463 } LDKCResult_OffersMessageDecodeErrorZPtr;
14466 * A CResult_OffersMessageDecodeErrorZ represents the result of a fallible operation,
14467 * containing a crate::lightning::onion_message::offers::OffersMessage on success and a crate::lightning::ln::msgs::DecodeError on failure.
14468 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14470 typedef struct LDKCResult_OffersMessageDecodeErrorZ {
14472 * The contents of this CResult_OffersMessageDecodeErrorZ, accessible via either
14473 * `err` or `result` depending on the state of `result_ok`.
14475 union LDKCResult_OffersMessageDecodeErrorZPtr contents;
14477 * Whether this CResult_OffersMessageDecodeErrorZ represents a success state.
14480 } LDKCResult_OffersMessageDecodeErrorZ;
14483 * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not
14485 typedef enum LDKCOption_HTLCClaimZ_Tag {
14487 * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim
14489 LDKCOption_HTLCClaimZ_Some,
14491 * When we're in this state, this COption_HTLCClaimZ contains nothing
14493 LDKCOption_HTLCClaimZ_None,
14495 * Must be last for serialization purposes
14497 LDKCOption_HTLCClaimZ_Sentinel,
14498 } LDKCOption_HTLCClaimZ_Tag;
14500 typedef struct LDKCOption_HTLCClaimZ {
14501 LDKCOption_HTLCClaimZ_Tag tag;
14504 enum LDKHTLCClaim some;
14507 } LDKCOption_HTLCClaimZ;
14512 * Implements the per-commitment secret storage scheme from
14513 * [BOLT 3](https://github.com/lightning/bolts/blob/dcbf8583976df087c79c3ce0b535311212e6812d/03-transactions.md#efficient-per-commitment-secret-storage).
14515 * Allows us to keep track of all of the revocation secrets of our counterparty in just 50*32 bytes
14518 typedef struct MUST_USE_STRUCT LDKCounterpartyCommitmentSecrets {
14520 * A pointer to the opaque Rust object.
14521 * Nearly everywhere, inner must be non-null, however in places where
14522 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14524 LDKnativeCounterpartyCommitmentSecrets *inner;
14526 * Indicates that this is the only struct which contains the same pointer.
14527 * Rust functions which take ownership of an object provided via an argument require
14528 * this to be true and invalidate the object pointed to by inner.
14531 } LDKCounterpartyCommitmentSecrets;
14534 * The contents of CResult_CounterpartyCommitmentSecretsDecodeErrorZ
14536 typedef union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr {
14538 * A pointer to the contents in the success state.
14539 * Reading from this pointer when `result_ok` is not set is undefined.
14541 struct LDKCounterpartyCommitmentSecrets *result;
14543 * A pointer to the contents in the error state.
14544 * Reading from this pointer when `result_ok` is set is undefined.
14546 struct LDKDecodeError *err;
14547 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr;
14550 * A CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents the result of a fallible operation,
14551 * containing a crate::lightning::ln::chan_utils::CounterpartyCommitmentSecrets on success and a crate::lightning::ln::msgs::DecodeError on failure.
14552 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14554 typedef struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ {
14556 * The contents of this CResult_CounterpartyCommitmentSecretsDecodeErrorZ, accessible via either
14557 * `err` or `result` depending on the state of `result_ok`.
14559 union LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZPtr contents;
14561 * Whether this CResult_CounterpartyCommitmentSecretsDecodeErrorZ represents a success state.
14564 } LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ;
14569 * The set of public keys which are used in the creation of one commitment transaction.
14570 * These are derived from the channel base keys and per-commitment data.
14572 * A broadcaster key is provided from potential broadcaster of the computed transaction.
14573 * A countersignatory key is coming from a protocol participant unable to broadcast the
14576 * These keys are assumed to be good, either because the code derived them from
14577 * channel basepoints via the new function, or they were obtained via
14578 * CommitmentTransaction.trust().keys() because we trusted the source of the
14579 * pre-calculated keys.
14581 typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
14583 * A pointer to the opaque Rust object.
14584 * Nearly everywhere, inner must be non-null, however in places where
14585 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14587 LDKnativeTxCreationKeys *inner;
14589 * Indicates that this is the only struct which contains the same pointer.
14590 * Rust functions which take ownership of an object provided via an argument require
14591 * this to be true and invalidate the object pointed to by inner.
14594 } LDKTxCreationKeys;
14597 * The contents of CResult_TxCreationKeysDecodeErrorZ
14599 typedef union LDKCResult_TxCreationKeysDecodeErrorZPtr {
14601 * A pointer to the contents in the success state.
14602 * Reading from this pointer when `result_ok` is not set is undefined.
14604 struct LDKTxCreationKeys *result;
14606 * A pointer to the contents in the error state.
14607 * Reading from this pointer when `result_ok` is set is undefined.
14609 struct LDKDecodeError *err;
14610 } LDKCResult_TxCreationKeysDecodeErrorZPtr;
14613 * A CResult_TxCreationKeysDecodeErrorZ represents the result of a fallible operation,
14614 * containing a crate::lightning::ln::chan_utils::TxCreationKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
14615 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14617 typedef struct LDKCResult_TxCreationKeysDecodeErrorZ {
14619 * The contents of this CResult_TxCreationKeysDecodeErrorZ, accessible via either
14620 * `err` or `result` depending on the state of `result_ok`.
14622 union LDKCResult_TxCreationKeysDecodeErrorZPtr contents;
14624 * Whether this CResult_TxCreationKeysDecodeErrorZ represents a success state.
14627 } LDKCResult_TxCreationKeysDecodeErrorZ;
14630 * The contents of CResult_ChannelPublicKeysDecodeErrorZ
14632 typedef union LDKCResult_ChannelPublicKeysDecodeErrorZPtr {
14634 * A pointer to the contents in the success state.
14635 * Reading from this pointer when `result_ok` is not set is undefined.
14637 struct LDKChannelPublicKeys *result;
14639 * A pointer to the contents in the error state.
14640 * Reading from this pointer when `result_ok` is set is undefined.
14642 struct LDKDecodeError *err;
14643 } LDKCResult_ChannelPublicKeysDecodeErrorZPtr;
14646 * A CResult_ChannelPublicKeysDecodeErrorZ represents the result of a fallible operation,
14647 * containing a crate::lightning::ln::chan_utils::ChannelPublicKeys on success and a crate::lightning::ln::msgs::DecodeError on failure.
14648 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14650 typedef struct LDKCResult_ChannelPublicKeysDecodeErrorZ {
14652 * The contents of this CResult_ChannelPublicKeysDecodeErrorZ, accessible via either
14653 * `err` or `result` depending on the state of `result_ok`.
14655 union LDKCResult_ChannelPublicKeysDecodeErrorZPtr contents;
14657 * Whether this CResult_ChannelPublicKeysDecodeErrorZ represents a success state.
14660 } LDKCResult_ChannelPublicKeysDecodeErrorZ;
14663 * The contents of CResult_HTLCOutputInCommitmentDecodeErrorZ
14665 typedef union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr {
14667 * A pointer to the contents in the success state.
14668 * Reading from this pointer when `result_ok` is not set is undefined.
14670 struct LDKHTLCOutputInCommitment *result;
14672 * A pointer to the contents in the error state.
14673 * Reading from this pointer when `result_ok` is set is undefined.
14675 struct LDKDecodeError *err;
14676 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr;
14679 * A CResult_HTLCOutputInCommitmentDecodeErrorZ represents the result of a fallible operation,
14680 * containing a crate::lightning::ln::chan_utils::HTLCOutputInCommitment on success and a crate::lightning::ln::msgs::DecodeError on failure.
14681 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14683 typedef struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ {
14685 * The contents of this CResult_HTLCOutputInCommitmentDecodeErrorZ, accessible via either
14686 * `err` or `result` depending on the state of `result_ok`.
14688 union LDKCResult_HTLCOutputInCommitmentDecodeErrorZPtr contents;
14690 * Whether this CResult_HTLCOutputInCommitmentDecodeErrorZ represents a success state.
14693 } LDKCResult_HTLCOutputInCommitmentDecodeErrorZ;
14698 * Late-bound per-channel counterparty data used to build transactions.
14700 typedef struct MUST_USE_STRUCT LDKCounterpartyChannelTransactionParameters {
14702 * A pointer to the opaque Rust object.
14703 * Nearly everywhere, inner must be non-null, however in places where
14704 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14706 LDKnativeCounterpartyChannelTransactionParameters *inner;
14708 * Indicates that this is the only struct which contains the same pointer.
14709 * Rust functions which take ownership of an object provided via an argument require
14710 * this to be true and invalidate the object pointed to by inner.
14713 } LDKCounterpartyChannelTransactionParameters;
14716 * The contents of CResult_CounterpartyChannelTransactionParametersDecodeErrorZ
14718 typedef union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr {
14720 * A pointer to the contents in the success state.
14721 * Reading from this pointer when `result_ok` is not set is undefined.
14723 struct LDKCounterpartyChannelTransactionParameters *result;
14725 * A pointer to the contents in the error state.
14726 * Reading from this pointer when `result_ok` is set is undefined.
14728 struct LDKDecodeError *err;
14729 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr;
14732 * A CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
14733 * containing a crate::lightning::ln::chan_utils::CounterpartyChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
14734 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14736 typedef struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ {
14738 * The contents of this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ, accessible via either
14739 * `err` or `result` depending on the state of `result_ok`.
14741 union LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZPtr contents;
14743 * Whether this CResult_CounterpartyChannelTransactionParametersDecodeErrorZ represents a success state.
14746 } LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ;
14749 * The contents of CResult_ChannelTransactionParametersDecodeErrorZ
14751 typedef union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr {
14753 * A pointer to the contents in the success state.
14754 * Reading from this pointer when `result_ok` is not set is undefined.
14756 struct LDKChannelTransactionParameters *result;
14758 * A pointer to the contents in the error state.
14759 * Reading from this pointer when `result_ok` is set is undefined.
14761 struct LDKDecodeError *err;
14762 } LDKCResult_ChannelTransactionParametersDecodeErrorZPtr;
14765 * A CResult_ChannelTransactionParametersDecodeErrorZ represents the result of a fallible operation,
14766 * containing a crate::lightning::ln::chan_utils::ChannelTransactionParameters on success and a crate::lightning::ln::msgs::DecodeError on failure.
14767 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14769 typedef struct LDKCResult_ChannelTransactionParametersDecodeErrorZ {
14771 * The contents of this CResult_ChannelTransactionParametersDecodeErrorZ, accessible via either
14772 * `err` or `result` depending on the state of `result_ok`.
14774 union LDKCResult_ChannelTransactionParametersDecodeErrorZPtr contents;
14776 * Whether this CResult_ChannelTransactionParametersDecodeErrorZ represents a success state.
14779 } LDKCResult_ChannelTransactionParametersDecodeErrorZ;
14782 * The contents of CResult_HolderCommitmentTransactionDecodeErrorZ
14784 typedef union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr {
14786 * A pointer to the contents in the success state.
14787 * Reading from this pointer when `result_ok` is not set is undefined.
14789 struct LDKHolderCommitmentTransaction *result;
14791 * A pointer to the contents in the error state.
14792 * Reading from this pointer when `result_ok` is set is undefined.
14794 struct LDKDecodeError *err;
14795 } LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr;
14798 * A CResult_HolderCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
14799 * containing a crate::lightning::ln::chan_utils::HolderCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
14800 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14802 typedef struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ {
14804 * The contents of this CResult_HolderCommitmentTransactionDecodeErrorZ, accessible via either
14805 * `err` or `result` depending on the state of `result_ok`.
14807 union LDKCResult_HolderCommitmentTransactionDecodeErrorZPtr contents;
14809 * Whether this CResult_HolderCommitmentTransactionDecodeErrorZ represents a success state.
14812 } LDKCResult_HolderCommitmentTransactionDecodeErrorZ;
14817 * A pre-built Bitcoin commitment transaction and its txid.
14819 typedef struct MUST_USE_STRUCT LDKBuiltCommitmentTransaction {
14821 * A pointer to the opaque Rust object.
14822 * Nearly everywhere, inner must be non-null, however in places where
14823 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14825 LDKnativeBuiltCommitmentTransaction *inner;
14827 * Indicates that this is the only struct which contains the same pointer.
14828 * Rust functions which take ownership of an object provided via an argument require
14829 * this to be true and invalidate the object pointed to by inner.
14832 } LDKBuiltCommitmentTransaction;
14835 * The contents of CResult_BuiltCommitmentTransactionDecodeErrorZ
14837 typedef union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr {
14839 * A pointer to the contents in the success state.
14840 * Reading from this pointer when `result_ok` is not set is undefined.
14842 struct LDKBuiltCommitmentTransaction *result;
14844 * A pointer to the contents in the error state.
14845 * Reading from this pointer when `result_ok` is set is undefined.
14847 struct LDKDecodeError *err;
14848 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr;
14851 * A CResult_BuiltCommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
14852 * containing a crate::lightning::ln::chan_utils::BuiltCommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
14853 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14855 typedef struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ {
14857 * The contents of this CResult_BuiltCommitmentTransactionDecodeErrorZ, accessible via either
14858 * `err` or `result` depending on the state of `result_ok`.
14860 union LDKCResult_BuiltCommitmentTransactionDecodeErrorZPtr contents;
14862 * Whether this CResult_BuiltCommitmentTransactionDecodeErrorZ represents a success state.
14865 } LDKCResult_BuiltCommitmentTransactionDecodeErrorZ;
14870 * A wrapper on ClosingTransaction indicating that the built bitcoin
14871 * transaction is trusted.
14873 * See trust() and verify() functions on CommitmentTransaction.
14875 * This structure implements Deref.
14877 typedef struct MUST_USE_STRUCT LDKTrustedClosingTransaction {
14879 * A pointer to the opaque Rust object.
14880 * Nearly everywhere, inner must be non-null, however in places where
14881 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14883 LDKnativeTrustedClosingTransaction *inner;
14885 * Indicates that this is the only struct which contains the same pointer.
14886 * Rust functions which take ownership of an object provided via an argument require
14887 * this to be true and invalidate the object pointed to by inner.
14890 } LDKTrustedClosingTransaction;
14893 * The contents of CResult_TrustedClosingTransactionNoneZ
14895 typedef union LDKCResult_TrustedClosingTransactionNoneZPtr {
14897 * A pointer to the contents in the success state.
14898 * Reading from this pointer when `result_ok` is not set is undefined.
14900 struct LDKTrustedClosingTransaction *result;
14902 * Note that this value is always NULL, as there are no contents in the Err variant
14905 } LDKCResult_TrustedClosingTransactionNoneZPtr;
14908 * A CResult_TrustedClosingTransactionNoneZ represents the result of a fallible operation,
14909 * containing a crate::lightning::ln::chan_utils::TrustedClosingTransaction on success and a () on failure.
14910 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14912 typedef struct LDKCResult_TrustedClosingTransactionNoneZ {
14914 * The contents of this CResult_TrustedClosingTransactionNoneZ, accessible via either
14915 * `err` or `result` depending on the state of `result_ok`.
14917 union LDKCResult_TrustedClosingTransactionNoneZPtr contents;
14919 * Whether this CResult_TrustedClosingTransactionNoneZ represents a success state.
14922 } LDKCResult_TrustedClosingTransactionNoneZ;
14925 * The contents of CResult_CommitmentTransactionDecodeErrorZ
14927 typedef union LDKCResult_CommitmentTransactionDecodeErrorZPtr {
14929 * A pointer to the contents in the success state.
14930 * Reading from this pointer when `result_ok` is not set is undefined.
14932 struct LDKCommitmentTransaction *result;
14934 * A pointer to the contents in the error state.
14935 * Reading from this pointer when `result_ok` is set is undefined.
14937 struct LDKDecodeError *err;
14938 } LDKCResult_CommitmentTransactionDecodeErrorZPtr;
14941 * A CResult_CommitmentTransactionDecodeErrorZ represents the result of a fallible operation,
14942 * containing a crate::lightning::ln::chan_utils::CommitmentTransaction on success and a crate::lightning::ln::msgs::DecodeError on failure.
14943 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
14945 typedef struct LDKCResult_CommitmentTransactionDecodeErrorZ {
14947 * The contents of this CResult_CommitmentTransactionDecodeErrorZ, accessible via either
14948 * `err` or `result` depending on the state of `result_ok`.
14950 union LDKCResult_CommitmentTransactionDecodeErrorZPtr contents;
14952 * Whether this CResult_CommitmentTransactionDecodeErrorZ represents a success state.
14955 } LDKCResult_CommitmentTransactionDecodeErrorZ;
14960 * A wrapper on CommitmentTransaction indicating that the derived fields (the built bitcoin
14961 * transaction and the transaction creation keys) are trusted.
14963 * See trust() and verify() functions on CommitmentTransaction.
14965 * This structure implements Deref.
14967 typedef struct MUST_USE_STRUCT LDKTrustedCommitmentTransaction {
14969 * A pointer to the opaque Rust object.
14970 * Nearly everywhere, inner must be non-null, however in places where
14971 * the Rust equivalent takes an Option, it may be set to null to indicate None.
14973 LDKnativeTrustedCommitmentTransaction *inner;
14975 * Indicates that this is the only struct which contains the same pointer.
14976 * Rust functions which take ownership of an object provided via an argument require
14977 * this to be true and invalidate the object pointed to by inner.
14980 } LDKTrustedCommitmentTransaction;
14983 * The contents of CResult_TrustedCommitmentTransactionNoneZ
14985 typedef union LDKCResult_TrustedCommitmentTransactionNoneZPtr {
14987 * A pointer to the contents in the success state.
14988 * Reading from this pointer when `result_ok` is not set is undefined.
14990 struct LDKTrustedCommitmentTransaction *result;
14992 * Note that this value is always NULL, as there are no contents in the Err variant
14995 } LDKCResult_TrustedCommitmentTransactionNoneZPtr;
14998 * A CResult_TrustedCommitmentTransactionNoneZ represents the result of a fallible operation,
14999 * containing a crate::lightning::ln::chan_utils::TrustedCommitmentTransaction on success and a () on failure.
15000 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15002 typedef struct LDKCResult_TrustedCommitmentTransactionNoneZ {
15004 * The contents of this CResult_TrustedCommitmentTransactionNoneZ, accessible via either
15005 * `err` or `result` depending on the state of `result_ok`.
15007 union LDKCResult_TrustedCommitmentTransactionNoneZPtr contents;
15009 * Whether this CResult_TrustedCommitmentTransactionNoneZ represents a success state.
15012 } LDKCResult_TrustedCommitmentTransactionNoneZ;
15015 * The contents of CResult_CVec_ECDSASignatureZNoneZ
15017 typedef union LDKCResult_CVec_ECDSASignatureZNoneZPtr {
15019 * A pointer to the contents in the success state.
15020 * Reading from this pointer when `result_ok` is not set is undefined.
15022 struct LDKCVec_ECDSASignatureZ *result;
15024 * Note that this value is always NULL, as there are no contents in the Err variant
15027 } LDKCResult_CVec_ECDSASignatureZNoneZPtr;
15030 * A CResult_CVec_ECDSASignatureZNoneZ represents the result of a fallible operation,
15031 * containing a crate::c_types::derived::CVec_ECDSASignatureZ on success and a () on failure.
15032 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15034 typedef struct LDKCResult_CVec_ECDSASignatureZNoneZ {
15036 * The contents of this CResult_CVec_ECDSASignatureZNoneZ, accessible via either
15037 * `err` or `result` depending on the state of `result_ok`.
15039 union LDKCResult_CVec_ECDSASignatureZNoneZPtr contents;
15041 * Whether this CResult_CVec_ECDSASignatureZNoneZ represents a success state.
15044 } LDKCResult_CVec_ECDSASignatureZNoneZ;
15047 * An enum which can either contain a usize or not
15049 typedef enum LDKCOption_usizeZ_Tag {
15051 * When we're in this state, this COption_usizeZ contains a usize
15053 LDKCOption_usizeZ_Some,
15055 * When we're in this state, this COption_usizeZ contains nothing
15057 LDKCOption_usizeZ_None,
15059 * Must be last for serialization purposes
15061 LDKCOption_usizeZ_Sentinel,
15062 } LDKCOption_usizeZ_Tag;
15064 typedef struct LDKCOption_usizeZ {
15065 LDKCOption_usizeZ_Tag tag;
15071 } LDKCOption_usizeZ;
15074 * The contents of CResult_ShutdownScriptDecodeErrorZ
15076 typedef union LDKCResult_ShutdownScriptDecodeErrorZPtr {
15078 * A pointer to the contents in the success state.
15079 * Reading from this pointer when `result_ok` is not set is undefined.
15081 struct LDKShutdownScript *result;
15083 * A pointer to the contents in the error state.
15084 * Reading from this pointer when `result_ok` is set is undefined.
15086 struct LDKDecodeError *err;
15087 } LDKCResult_ShutdownScriptDecodeErrorZPtr;
15090 * A CResult_ShutdownScriptDecodeErrorZ represents the result of a fallible operation,
15091 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::msgs::DecodeError on failure.
15092 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15094 typedef struct LDKCResult_ShutdownScriptDecodeErrorZ {
15096 * The contents of this CResult_ShutdownScriptDecodeErrorZ, accessible via either
15097 * `err` or `result` depending on the state of `result_ok`.
15099 union LDKCResult_ShutdownScriptDecodeErrorZPtr contents;
15101 * Whether this CResult_ShutdownScriptDecodeErrorZ represents a success state.
15104 } LDKCResult_ShutdownScriptDecodeErrorZ;
15109 * An error occurring when converting from [`ScriptBuf`] to [`ShutdownScript`].
15111 typedef struct MUST_USE_STRUCT LDKInvalidShutdownScript {
15113 * A pointer to the opaque Rust object.
15114 * Nearly everywhere, inner must be non-null, however in places where
15115 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15117 LDKnativeInvalidShutdownScript *inner;
15119 * Indicates that this is the only struct which contains the same pointer.
15120 * Rust functions which take ownership of an object provided via an argument require
15121 * this to be true and invalidate the object pointed to by inner.
15124 } LDKInvalidShutdownScript;
15127 * The contents of CResult_ShutdownScriptInvalidShutdownScriptZ
15129 typedef union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr {
15131 * A pointer to the contents in the success state.
15132 * Reading from this pointer when `result_ok` is not set is undefined.
15134 struct LDKShutdownScript *result;
15136 * A pointer to the contents in the error state.
15137 * Reading from this pointer when `result_ok` is set is undefined.
15139 struct LDKInvalidShutdownScript *err;
15140 } LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr;
15143 * A CResult_ShutdownScriptInvalidShutdownScriptZ represents the result of a fallible operation,
15144 * containing a crate::lightning::ln::script::ShutdownScript on success and a crate::lightning::ln::script::InvalidShutdownScript on failure.
15145 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15147 typedef struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ {
15149 * The contents of this CResult_ShutdownScriptInvalidShutdownScriptZ, accessible via either
15150 * `err` or `result` depending on the state of `result_ok`.
15152 union LDKCResult_ShutdownScriptInvalidShutdownScriptZPtr contents;
15154 * Whether this CResult_ShutdownScriptInvalidShutdownScriptZ represents a success state.
15157 } LDKCResult_ShutdownScriptInvalidShutdownScriptZ;
15160 * Some information provided on receipt of payment depends on whether the payment received is a
15161 * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
15163 typedef enum LDKPaymentPurpose_Tag {
15165 * Information for receiving a payment that we generated an invoice for.
15167 LDKPaymentPurpose_InvoicePayment,
15169 * Because this is a spontaneous payment, the payer generated their own preimage rather than us
15170 * (the payee) providing a preimage.
15172 LDKPaymentPurpose_SpontaneousPayment,
15174 * Must be last for serialization purposes
15176 LDKPaymentPurpose_Sentinel,
15177 } LDKPaymentPurpose_Tag;
15179 typedef struct LDKPaymentPurpose_LDKInvoicePayment_Body {
15181 * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
15182 * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
15183 * [`ChannelManager::claim_funds`].
15185 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
15186 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
15188 struct LDKCOption_ThirtyTwoBytesZ payment_preimage;
15190 * The \"payment secret\". This authenticates the sender to the recipient, preventing a
15191 * number of deanonymization attacks during the routing process.
15192 * It is provided here for your reference, however its accuracy is enforced directly by
15193 * [`ChannelManager`] using the values you previously provided to
15194 * [`ChannelManager::create_inbound_payment`] or
15195 * [`ChannelManager::create_inbound_payment_for_hash`].
15197 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
15198 * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
15199 * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
15201 struct LDKThirtyTwoBytes payment_secret;
15202 } LDKPaymentPurpose_LDKInvoicePayment_Body;
15204 typedef struct MUST_USE_STRUCT LDKPaymentPurpose {
15205 LDKPaymentPurpose_Tag tag;
15207 LDKPaymentPurpose_LDKInvoicePayment_Body invoice_payment;
15209 struct LDKThirtyTwoBytes spontaneous_payment;
15212 } LDKPaymentPurpose;
15215 * The contents of CResult_PaymentPurposeDecodeErrorZ
15217 typedef union LDKCResult_PaymentPurposeDecodeErrorZPtr {
15219 * A pointer to the contents in the success state.
15220 * Reading from this pointer when `result_ok` is not set is undefined.
15222 struct LDKPaymentPurpose *result;
15224 * A pointer to the contents in the error state.
15225 * Reading from this pointer when `result_ok` is set is undefined.
15227 struct LDKDecodeError *err;
15228 } LDKCResult_PaymentPurposeDecodeErrorZPtr;
15231 * A CResult_PaymentPurposeDecodeErrorZ represents the result of a fallible operation,
15232 * containing a crate::lightning::events::PaymentPurpose on success and a crate::lightning::ln::msgs::DecodeError on failure.
15233 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15235 typedef struct LDKCResult_PaymentPurposeDecodeErrorZ {
15237 * The contents of this CResult_PaymentPurposeDecodeErrorZ, accessible via either
15238 * `err` or `result` depending on the state of `result_ok`.
15240 union LDKCResult_PaymentPurposeDecodeErrorZPtr contents;
15242 * Whether this CResult_PaymentPurposeDecodeErrorZ represents a success state.
15245 } LDKCResult_PaymentPurposeDecodeErrorZ;
15250 * Information about an HTLC that is part of a payment that can be claimed.
15252 typedef struct MUST_USE_STRUCT LDKClaimedHTLC {
15254 * A pointer to the opaque Rust object.
15255 * Nearly everywhere, inner must be non-null, however in places where
15256 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15258 LDKnativeClaimedHTLC *inner;
15260 * Indicates that this is the only struct which contains the same pointer.
15261 * Rust functions which take ownership of an object provided via an argument require
15262 * this to be true and invalidate the object pointed to by inner.
15268 * The contents of CResult_ClaimedHTLCDecodeErrorZ
15270 typedef union LDKCResult_ClaimedHTLCDecodeErrorZPtr {
15272 * A pointer to the contents in the success state.
15273 * Reading from this pointer when `result_ok` is not set is undefined.
15275 struct LDKClaimedHTLC *result;
15277 * A pointer to the contents in the error state.
15278 * Reading from this pointer when `result_ok` is set is undefined.
15280 struct LDKDecodeError *err;
15281 } LDKCResult_ClaimedHTLCDecodeErrorZPtr;
15284 * A CResult_ClaimedHTLCDecodeErrorZ represents the result of a fallible operation,
15285 * containing a crate::lightning::events::ClaimedHTLC on success and a crate::lightning::ln::msgs::DecodeError on failure.
15286 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15288 typedef struct LDKCResult_ClaimedHTLCDecodeErrorZ {
15290 * The contents of this CResult_ClaimedHTLCDecodeErrorZ, accessible via either
15291 * `err` or `result` depending on the state of `result_ok`.
15293 union LDKCResult_ClaimedHTLCDecodeErrorZPtr contents;
15295 * Whether this CResult_ClaimedHTLCDecodeErrorZ represents a success state.
15298 } LDKCResult_ClaimedHTLCDecodeErrorZ;
15301 * When the payment path failure took place and extra details about it. [`PathFailure::OnPath`] may
15302 * contain a [`NetworkUpdate`] that needs to be applied to the [`NetworkGraph`].
15304 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
15305 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
15307 typedef enum LDKPathFailure_Tag {
15309 * We failed to initially send the payment and no HTLC was committed to. Contains the relevant
15312 LDKPathFailure_InitialSend,
15314 * A hop on the path failed to forward our payment.
15316 LDKPathFailure_OnPath,
15318 * Must be last for serialization purposes
15320 LDKPathFailure_Sentinel,
15321 } LDKPathFailure_Tag;
15323 typedef struct LDKPathFailure_LDKInitialSend_Body {
15325 * The error surfaced from initial send.
15327 struct LDKAPIError err;
15328 } LDKPathFailure_LDKInitialSend_Body;
15330 typedef struct LDKPathFailure_LDKOnPath_Body {
15332 * If present, this [`NetworkUpdate`] should be applied to the [`NetworkGraph`] so that routing
15333 * decisions can take into account the update.
15335 * [`NetworkUpdate`]: crate::routing::gossip::NetworkUpdate
15336 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
15338 struct LDKCOption_NetworkUpdateZ network_update;
15339 } LDKPathFailure_LDKOnPath_Body;
15341 typedef struct MUST_USE_STRUCT LDKPathFailure {
15342 LDKPathFailure_Tag tag;
15344 LDKPathFailure_LDKInitialSend_Body initial_send;
15345 LDKPathFailure_LDKOnPath_Body on_path;
15350 * An enum which can either contain a crate::lightning::events::PathFailure or not
15352 typedef enum LDKCOption_PathFailureZ_Tag {
15354 * When we're in this state, this COption_PathFailureZ contains a crate::lightning::events::PathFailure
15356 LDKCOption_PathFailureZ_Some,
15358 * When we're in this state, this COption_PathFailureZ contains nothing
15360 LDKCOption_PathFailureZ_None,
15362 * Must be last for serialization purposes
15364 LDKCOption_PathFailureZ_Sentinel,
15365 } LDKCOption_PathFailureZ_Tag;
15367 typedef struct LDKCOption_PathFailureZ {
15368 LDKCOption_PathFailureZ_Tag tag;
15371 struct LDKPathFailure some;
15374 } LDKCOption_PathFailureZ;
15377 * The contents of CResult_COption_PathFailureZDecodeErrorZ
15379 typedef union LDKCResult_COption_PathFailureZDecodeErrorZPtr {
15381 * A pointer to the contents in the success state.
15382 * Reading from this pointer when `result_ok` is not set is undefined.
15384 struct LDKCOption_PathFailureZ *result;
15386 * A pointer to the contents in the error state.
15387 * Reading from this pointer when `result_ok` is set is undefined.
15389 struct LDKDecodeError *err;
15390 } LDKCResult_COption_PathFailureZDecodeErrorZPtr;
15393 * A CResult_COption_PathFailureZDecodeErrorZ represents the result of a fallible operation,
15394 * containing a crate::c_types::derived::COption_PathFailureZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
15395 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15397 typedef struct LDKCResult_COption_PathFailureZDecodeErrorZ {
15399 * The contents of this CResult_COption_PathFailureZDecodeErrorZ, accessible via either
15400 * `err` or `result` depending on the state of `result_ok`.
15402 union LDKCResult_COption_PathFailureZDecodeErrorZPtr contents;
15404 * Whether this CResult_COption_PathFailureZDecodeErrorZ represents a success state.
15407 } LDKCResult_COption_PathFailureZDecodeErrorZ;
15412 * Struct to `Display` fields in a safe way using `PrintableString`
15414 typedef struct MUST_USE_STRUCT LDKUntrustedString {
15416 * A pointer to the opaque Rust object.
15417 * Nearly everywhere, inner must be non-null, however in places where
15418 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15420 LDKnativeUntrustedString *inner;
15422 * Indicates that this is the only struct which contains the same pointer.
15423 * Rust functions which take ownership of an object provided via an argument require
15424 * this to be true and invalidate the object pointed to by inner.
15427 } LDKUntrustedString;
15430 * The reason the channel was closed. See individual variants for more details.
15432 typedef enum LDKClosureReason_Tag {
15434 * Closure generated from receiving a peer error message.
15436 * Our counterparty may have broadcasted their latest commitment state, and we have
15439 LDKClosureReason_CounterpartyForceClosed,
15441 * Closure generated from [`ChannelManager::force_close_channel`], called by the user.
15443 * [`ChannelManager::force_close_channel`]: crate::ln::channelmanager::ChannelManager::force_close_channel.
15445 LDKClosureReason_HolderForceClosed,
15447 * The channel was closed after negotiating a cooperative close and we've now broadcasted
15448 * the cooperative close transaction. Note the shutdown may have been initiated by us.
15450 LDKClosureReason_CooperativeClosure,
15452 * A commitment transaction was confirmed on chain, closing the channel. Most likely this
15453 * commitment transaction came from our counterparty, but it may also have come from
15454 * a copy of our own `ChannelMonitor`.
15456 LDKClosureReason_CommitmentTxConfirmed,
15458 * The funding transaction failed to confirm in a timely manner on an inbound channel.
15460 LDKClosureReason_FundingTimedOut,
15462 * Closure generated from processing an event, likely a HTLC forward/relay/reception.
15464 LDKClosureReason_ProcessingError,
15466 * The peer disconnected prior to funding completing. In this case the spec mandates that we
15467 * forget the channel entirely - we can attempt again if the peer reconnects.
15469 * This includes cases where we restarted prior to funding completion, including prior to the
15470 * initial [`ChannelMonitor`] persistence completing.
15472 * In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
15473 * peer because of mutual incompatibility between us and our channel counterparty.
15475 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
15477 LDKClosureReason_DisconnectedPeer,
15479 * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
15480 * the [`ChannelManager`] deserialized.
15482 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
15483 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
15485 LDKClosureReason_OutdatedChannelManager,
15487 * The counterparty requested a cooperative close of a channel that had not been funded yet.
15488 * The channel has been immediately closed.
15490 LDKClosureReason_CounterpartyCoopClosedUnfundedChannel,
15492 * Another channel in the same funding batch closed before the funding transaction
15493 * was ready to be broadcast.
15495 LDKClosureReason_FundingBatchClosure,
15497 * Must be last for serialization purposes
15499 LDKClosureReason_Sentinel,
15500 } LDKClosureReason_Tag;
15502 typedef struct LDKClosureReason_LDKCounterpartyForceClosed_Body {
15504 * The error which the peer sent us.
15506 * Be careful about printing the peer_msg, a well-crafted message could exploit
15507 * a security vulnerability in the terminal emulator or the logging subsystem.
15508 * To be safe, use `Display` on `UntrustedString`
15510 * [`UntrustedString`]: crate::util::string::UntrustedString
15512 struct LDKUntrustedString peer_msg;
15513 } LDKClosureReason_LDKCounterpartyForceClosed_Body;
15515 typedef struct LDKClosureReason_LDKProcessingError_Body {
15517 * A developer-readable error message which we generated.
15520 } LDKClosureReason_LDKProcessingError_Body;
15522 typedef struct MUST_USE_STRUCT LDKClosureReason {
15523 LDKClosureReason_Tag tag;
15525 LDKClosureReason_LDKCounterpartyForceClosed_Body counterparty_force_closed;
15526 LDKClosureReason_LDKProcessingError_Body processing_error;
15528 } LDKClosureReason;
15531 * An enum which can either contain a crate::lightning::events::ClosureReason or not
15533 typedef enum LDKCOption_ClosureReasonZ_Tag {
15535 * When we're in this state, this COption_ClosureReasonZ contains a crate::lightning::events::ClosureReason
15537 LDKCOption_ClosureReasonZ_Some,
15539 * When we're in this state, this COption_ClosureReasonZ contains nothing
15541 LDKCOption_ClosureReasonZ_None,
15543 * Must be last for serialization purposes
15545 LDKCOption_ClosureReasonZ_Sentinel,
15546 } LDKCOption_ClosureReasonZ_Tag;
15548 typedef struct LDKCOption_ClosureReasonZ {
15549 LDKCOption_ClosureReasonZ_Tag tag;
15552 struct LDKClosureReason some;
15555 } LDKCOption_ClosureReasonZ;
15558 * The contents of CResult_COption_ClosureReasonZDecodeErrorZ
15560 typedef union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr {
15562 * A pointer to the contents in the success state.
15563 * Reading from this pointer when `result_ok` is not set is undefined.
15565 struct LDKCOption_ClosureReasonZ *result;
15567 * A pointer to the contents in the error state.
15568 * Reading from this pointer when `result_ok` is set is undefined.
15570 struct LDKDecodeError *err;
15571 } LDKCResult_COption_ClosureReasonZDecodeErrorZPtr;
15574 * A CResult_COption_ClosureReasonZDecodeErrorZ represents the result of a fallible operation,
15575 * containing a crate::c_types::derived::COption_ClosureReasonZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
15576 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
15578 typedef struct LDKCResult_COption_ClosureReasonZDecodeErrorZ {
15580 * The contents of this CResult_COption_ClosureReasonZDecodeErrorZ, accessible via either
15581 * `err` or `result` depending on the state of `result_ok`.
15583 union LDKCResult_COption_ClosureReasonZDecodeErrorZPtr contents;
15585 * Whether this CResult_COption_ClosureReasonZDecodeErrorZ represents a success state.
15588 } LDKCResult_COption_ClosureReasonZDecodeErrorZ;
15591 * Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
15593 typedef enum LDKHTLCDestination_Tag {
15595 * We tried forwarding to a channel but failed to do so. An example of such an instance is when
15596 * there is insufficient capacity in our outbound channel.
15598 LDKHTLCDestination_NextHopChannel,
15600 * Scenario where we are unsure of the next node to forward the HTLC to.
15602 LDKHTLCDestination_UnknownNextHop,
15604 * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate
15607 LDKHTLCDestination_InvalidForward,
15609 * Failure scenario where an HTLC may have been forwarded to be intended for us,
15610 * but is invalid for some reason, so we reject it.
15612 * Some of the reasons may include:
15614 * * Excess HTLCs for a payment that we have already fully received, over-paying for the
15616 * * The counterparty node modified the HTLC in transit,
15617 * * A probing attack where an intermediary node is trying to detect if we are the ultimate
15618 * recipient for a payment.
15620 LDKHTLCDestination_FailedPayment,
15622 * Must be last for serialization purposes
15624 LDKHTLCDestination_Sentinel,
15625 } LDKHTLCDestination_Tag;
15627 typedef struct LDKHTLCDestination_LDKNextHopChannel_Body {
15629 * The `node_id` of the next node. For backwards compatibility, this field is
15630 * marked as optional, versions prior to 0.0.110 may not always be able to provide
15631 * counterparty node information.
15633 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
15635 struct LDKPublicKey node_id;
15637 * The outgoing `channel_id` between us and the next node.
15639 struct LDKThirtyTwoBytes channel_id;
15640 } LDKHTLCDestination_LDKNextHopChannel_Body;
15642 typedef struct LDKHTLCDestination_LDKUnknownNextHop_Body {
15644 * Short channel id we are requesting to forward an HTLC to.
15646 uint64_t requested_forward_scid;
15647 } LDKHTLCDestination_LDKUnknownNextHop_Body;
15649 typedef struct LDKHTLCDestination_LDKInvalidForward_Body {
15651 * Short channel id we are requesting to forward an HTLC to.
15653 uint64_t requested_forward_scid;
15654 } LDKHTLCDestination_LDKInvalidForward_Body;
15656 typedef struct LDKHTLCDestination_LDKFailedPayment_Body {
15658 * The payment hash of the payment we attempted to process.
15660 struct LDKThirtyTwoBytes payment_hash;
15661 } LDKHTLCDestination_LDKFailedPayment_Body;
15663 typedef struct MUST_USE_STRUCT LDKHTLCDestination {
15664 LDKHTLCDestination_Tag tag;
15666 LDKHTLCDestination_LDKNextHopChannel_Body next_hop_channel;
15667 LDKHTLCDestination_LDKUnknownNextHop_Body unknown_next_hop;
15668 LDKHTLCDestination_LDKInvalidForward_Body invalid_forward;
15669 LDKHTLCDestination_LDKFailedPayment_Body failed_payment;
15671 } LDKHTLCDestination;
15674 * An enum which can either contain a crate::lightning::events::HTLCDestination or not
15676 typedef enum LDKCOption_HTLCDestinationZ_Tag {
15678 * When we're in this state, this COption_HTLCDestinationZ contains a crate::lightning::events::HTLCDestination
15680 LDKCOption_HTLCDestinationZ_Some,
15682 * When we're in this state, this COption_HTLCDestinationZ contains nothing
15684 LDKCOption_HTLCDestinationZ_None,
15686 * Must be last for serialization purposes
15688 LDKCOption_HTLCDestinationZ_Sentinel,
15689 } LDKCOption_HTLCDestinationZ_Tag;
15691 typedef struct LDKCOption_HTLCDestinationZ {
15692 LDKCOption_HTLCDestinationZ_Tag tag;
15695 struct LDKHTLCDestination some;
15698 } LDKCOption_HTLCDestinationZ;
15701 * The contents of CResult_COption_HTLCDestinationZDecodeErrorZ
15703 typedef union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr {
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 LDKCOption_HTLCDestinationZ *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_COption_HTLCDestinationZDecodeErrorZPtr;
15717 * A CResult_COption_HTLCDestinationZDecodeErrorZ represents the result of a fallible operation,
15718 * containing a crate::c_types::derived::COption_HTLCDestinationZ 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_COption_HTLCDestinationZDecodeErrorZ {
15723 * The contents of this CResult_COption_HTLCDestinationZDecodeErrorZ, accessible via either
15724 * `err` or `result` depending on the state of `result_ok`.
15726 union LDKCResult_COption_HTLCDestinationZDecodeErrorZPtr contents;
15728 * Whether this CResult_COption_HTLCDestinationZDecodeErrorZ represents a success state.
15731 } LDKCResult_COption_HTLCDestinationZDecodeErrorZ;
15734 * The contents of CResult_PaymentFailureReasonDecodeErrorZ
15736 typedef union LDKCResult_PaymentFailureReasonDecodeErrorZPtr {
15738 * A pointer to the contents in the success state.
15739 * Reading from this pointer when `result_ok` is not set is undefined.
15741 enum LDKPaymentFailureReason *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_PaymentFailureReasonDecodeErrorZPtr;
15750 * A CResult_PaymentFailureReasonDecodeErrorZ represents the result of a fallible operation,
15751 * containing a crate::lightning::events::PaymentFailureReason 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_PaymentFailureReasonDecodeErrorZ {
15756 * The contents of this CResult_PaymentFailureReasonDecodeErrorZ, accessible via either
15757 * `err` or `result` depending on the state of `result_ok`.
15759 union LDKCResult_PaymentFailureReasonDecodeErrorZPtr contents;
15761 * Whether this CResult_PaymentFailureReasonDecodeErrorZ represents a success state.
15764 } LDKCResult_PaymentFailureReasonDecodeErrorZ;
15767 * An enum which can either contain a crate::c_types::U128 or not
15769 typedef enum LDKCOption_U128Z_Tag {
15771 * When we're in this state, this COption_U128Z contains a crate::c_types::U128
15773 LDKCOption_U128Z_Some,
15775 * When we're in this state, this COption_U128Z contains nothing
15777 LDKCOption_U128Z_None,
15779 * Must be last for serialization purposes
15781 LDKCOption_U128Z_Sentinel,
15782 } LDKCOption_U128Z_Tag;
15784 typedef struct LDKCOption_U128Z {
15785 LDKCOption_U128Z_Tag tag;
15788 struct LDKU128 some;
15791 } LDKCOption_U128Z;
15794 * A dynamically-allocated array of crate::lightning::events::ClaimedHTLCs of arbitrary size.
15795 * This corresponds to std::vector in C++
15797 typedef struct LDKCVec_ClaimedHTLCZ {
15799 * The elements in the array.
15800 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
15802 struct LDKClaimedHTLC *data;
15804 * The number of elements pointed to by `data`.
15807 } LDKCVec_ClaimedHTLCZ;
15810 * An enum which can either contain a crate::lightning::events::PaymentFailureReason or not
15812 typedef enum LDKCOption_PaymentFailureReasonZ_Tag {
15814 * When we're in this state, this COption_PaymentFailureReasonZ contains a crate::lightning::events::PaymentFailureReason
15816 LDKCOption_PaymentFailureReasonZ_Some,
15818 * When we're in this state, this COption_PaymentFailureReasonZ contains nothing
15820 LDKCOption_PaymentFailureReasonZ_None,
15822 * Must be last for serialization purposes
15824 LDKCOption_PaymentFailureReasonZ_Sentinel,
15825 } LDKCOption_PaymentFailureReasonZ_Tag;
15827 typedef struct LDKCOption_PaymentFailureReasonZ {
15828 LDKCOption_PaymentFailureReasonZ_Tag tag;
15831 enum LDKPaymentFailureReason some;
15834 } LDKCOption_PaymentFailureReasonZ;
15839 * A descriptor used to sign for a commitment transaction's anchor output.
15841 typedef struct MUST_USE_STRUCT LDKAnchorDescriptor {
15843 * A pointer to the opaque Rust object.
15844 * Nearly everywhere, inner must be non-null, however in places where
15845 * the Rust equivalent takes an Option, it may be set to null to indicate None.
15847 LDKnativeAnchorDescriptor *inner;
15849 * Indicates that this is the only struct which contains the same pointer.
15850 * Rust functions which take ownership of an object provided via an argument require
15851 * this to be true and invalidate the object pointed to by inner.
15854 } LDKAnchorDescriptor;
15857 * Represents the different types of transactions, originating from LDK, to be bumped.
15859 typedef enum LDKBumpTransactionEvent_Tag {
15861 * Indicates that a channel featuring anchor outputs is to be closed by broadcasting the local
15862 * commitment transaction. Since commitment transactions have a static feerate pre-agreed upon,
15863 * they may need additional fees to be attached through a child transaction using the popular
15864 * [Child-Pays-For-Parent](https://bitcoinops.org/en/topics/cpfp) fee bumping technique. This
15865 * child transaction must include the anchor input described within `anchor_descriptor` along
15866 * with additional inputs to meet the target feerate. Failure to meet the target feerate
15867 * decreases the confirmation odds of the transaction package (which includes the commitment
15868 * and child anchor transactions), possibly resulting in a loss of funds. Once the transaction
15869 * is constructed, it must be fully signed for and broadcast by the consumer of the event
15870 * along with the `commitment_tx` enclosed. Note that the `commitment_tx` must always be
15871 * broadcast first, as the child anchor transaction depends on it.
15873 * The consumer should be able to sign for any of the additional inputs included within the
15874 * child anchor transaction. To sign its anchor input, an [`EcdsaChannelSigner`] should be
15875 * re-derived through [`AnchorDescriptor::derive_channel_signer`]. The anchor input signature
15876 * can be computed with [`EcdsaChannelSigner::sign_holder_anchor_input`], which can then be
15877 * provided to [`build_anchor_input_witness`] along with the `funding_pubkey` to obtain the
15878 * full witness required to spend.
15880 * It is possible to receive more than one instance of this event if a valid child anchor
15881 * transaction is never broadcast or is but not with a sufficient fee to be mined. Care should
15882 * be taken by the consumer of the event to ensure any future iterations of the child anchor
15883 * transaction adhere to the [Replace-By-Fee
15884 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
15885 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
15886 * these events is not user-controlled, users may ignore/drop the event if they are no longer
15887 * able to commit external confirmed funds to the child anchor transaction.
15889 * The set of `pending_htlcs` on the commitment transaction to be broadcast can be inspected to
15890 * determine whether a significant portion of the channel's funds are allocated to HTLCs,
15891 * enabling users to make their own decisions regarding the importance of the commitment
15892 * transaction's confirmation. Note that this is not required, but simply exists as an option
15893 * for users to override LDK's behavior. On commitments with no HTLCs (indicated by those with
15894 * an empty `pending_htlcs`), confirmation of the commitment transaction can be considered to
15897 * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
15898 * [`EcdsaChannelSigner::sign_holder_anchor_input`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_anchor_input
15899 * [`build_anchor_input_witness`]: crate::ln::chan_utils::build_anchor_input_witness
15901 LDKBumpTransactionEvent_ChannelClose,
15903 * Indicates that a channel featuring anchor outputs has unilaterally closed on-chain by a
15904 * holder commitment transaction and its HTLC(s) need to be resolved on-chain. With the
15905 * zero-HTLC-transaction-fee variant of anchor outputs, the pre-signed HTLC
15906 * transactions have a zero fee, thus requiring additional inputs and/or outputs to be attached
15907 * for a timely confirmation within the chain. These additional inputs and/or outputs must be
15908 * appended to the resulting HTLC transaction to meet the target feerate. Failure to meet the
15909 * target feerate decreases the confirmation odds of the transaction, possibly resulting in a
15910 * loss of funds. Once the transaction meets the target feerate, it must be signed for and
15911 * broadcast by the consumer of the event.
15913 * The consumer should be able to sign for any of the non-HTLC inputs added to the resulting
15914 * HTLC transaction. To sign HTLC inputs, an [`EcdsaChannelSigner`] should be re-derived
15915 * through [`HTLCDescriptor::derive_channel_signer`]. Each HTLC input's signature can be
15916 * computed with [`EcdsaChannelSigner::sign_holder_htlc_transaction`], which can then be
15917 * provided to [`HTLCDescriptor::tx_input_witness`] to obtain the fully signed witness required
15920 * It is possible to receive more than one instance of this event if a valid HTLC transaction
15921 * is never broadcast or is but not with a sufficient fee to be mined. Care should be taken by
15922 * the consumer of the event to ensure any future iterations of the HTLC transaction adhere to
15923 * the [Replace-By-Fee
15924 * rules](https://github.com/bitcoin/bitcoin/blob/master/doc/policy/mempool-replacements.md)
15925 * for fee bumps to be accepted into the mempool, and eventually the chain. As the frequency of
15926 * these events is not user-controlled, users may ignore/drop the event if either they are no
15927 * longer able to commit external confirmed funds to the HTLC transaction or the fee committed
15928 * to the HTLC transaction is greater in value than the HTLCs being claimed.
15930 * [`EcdsaChannelSigner`]: crate::sign::ecdsa::EcdsaChannelSigner
15931 * [`EcdsaChannelSigner::sign_holder_htlc_transaction`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_holder_htlc_transaction
15933 LDKBumpTransactionEvent_HTLCResolution,
15935 * Must be last for serialization purposes
15937 LDKBumpTransactionEvent_Sentinel,
15938 } LDKBumpTransactionEvent_Tag;
15940 typedef struct LDKBumpTransactionEvent_LDKChannelClose_Body {
15942 * The unique identifier for the claim of the anchor output in the commitment transaction.
15944 * The identifier must map to the set of external UTXOs assigned to the claim, such that
15945 * they can be reused when a new claim with the same identifier needs to be made, resulting
15946 * in a fee-bumping attempt.
15948 struct LDKThirtyTwoBytes claim_id;
15950 * The target feerate that the transaction package, which consists of the commitment
15951 * transaction and the to-be-crafted child anchor transaction, must meet.
15953 uint32_t package_target_feerate_sat_per_1000_weight;
15955 * The channel's commitment transaction to bump the fee of. This transaction should be
15956 * broadcast along with the anchor transaction constructed as a result of consuming this
15959 struct LDKTransaction commitment_tx;
15961 * The absolute fee in satoshis of the commitment transaction. This can be used along the
15962 * with weight of the commitment transaction to determine its feerate.
15964 uint64_t commitment_tx_fee_satoshis;
15966 * The descriptor to sign the anchor input of the anchor transaction constructed as a
15967 * result of consuming this event.
15969 struct LDKAnchorDescriptor anchor_descriptor;
15971 * The set of pending HTLCs on the commitment transaction that need to be resolved once the
15972 * commitment transaction confirms.
15974 struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs;
15975 } LDKBumpTransactionEvent_LDKChannelClose_Body;
15977 typedef struct LDKBumpTransactionEvent_LDKHTLCResolution_Body {
15979 * The unique identifier for the claim of the HTLCs in the confirmed commitment
15982 * The identifier must map to the set of external UTXOs assigned to the claim, such that
15983 * they can be reused when a new claim with the same identifier needs to be made, resulting
15984 * in a fee-bumping attempt.
15986 struct LDKThirtyTwoBytes claim_id;
15988 * The target feerate that the resulting HTLC transaction must meet.
15990 uint32_t target_feerate_sat_per_1000_weight;
15992 * The set of pending HTLCs on the confirmed commitment that need to be claimed, preferably
15993 * by the same transaction.
15995 struct LDKCVec_HTLCDescriptorZ htlc_descriptors;
15997 * The locktime required for the resulting HTLC transaction.
15999 uint32_t tx_lock_time;
16000 } LDKBumpTransactionEvent_LDKHTLCResolution_Body;
16002 typedef struct MUST_USE_STRUCT LDKBumpTransactionEvent {
16003 LDKBumpTransactionEvent_Tag tag;
16005 LDKBumpTransactionEvent_LDKChannelClose_Body channel_close;
16006 LDKBumpTransactionEvent_LDKHTLCResolution_Body htlc_resolution;
16008 } LDKBumpTransactionEvent;
16011 * An Event which you should probably take some action in response to.
16013 * Note that while Writeable and Readable are implemented for Event, you probably shouldn't use
16014 * them directly as they don't round-trip exactly (for example FundingGenerationReady is never
16015 * written as it makes no sense to respond to it after reconnecting to peers).
16017 typedef enum LDKEvent_Tag {
16019 * Used to indicate that the client should generate a funding transaction with the given
16020 * parameters and then call [`ChannelManager::funding_transaction_generated`].
16021 * Generated in [`ChannelManager`] message handling.
16022 * Note that *all inputs* in the funding transaction must spend SegWit outputs or your
16023 * counterparty can steal your funds!
16025 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
16026 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
16028 LDKEvent_FundingGenerationReady,
16030 * Indicates that we've been offered a payment and it needs to be claimed via calling
16031 * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
16033 * Note that if the preimage is not known, you should call
16034 * [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
16035 * to free up resources for this HTLC and avoid network congestion.
16037 * If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
16038 * numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
16039 * [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
16040 * [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
16041 * If you don't intend to check for custom TLVs, you can simply use
16042 * [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
16044 * If you fail to call [`ChannelManager::claim_funds`],
16045 * [`ChannelManager::claim_funds_with_known_custom_tlvs`],
16046 * [`ChannelManager::fail_htlc_backwards`], or
16047 * [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
16048 * be automatically failed.
16051 * LDK will not stop an inbound payment from being paid multiple times, so multiple
16052 * `PaymentClaimable` events may be generated for the same payment. In such a case it is
16053 * polite (and required in the lightning specification) to fail the payment the second time
16054 * and give the sender their money back rather than accepting double payment.
16057 * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier.
16059 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
16060 * [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
16061 * [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
16062 * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
16063 * [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
16065 LDKEvent_PaymentClaimable,
16067 * Indicates a payment has been claimed and we've received money!
16069 * This most likely occurs when [`ChannelManager::claim_funds`] has been called in response
16070 * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a
16071 * [`ChannelManager::claim_funds`] call you may see this event without a corresponding
16072 * [`Event::PaymentClaimable`] event.
16075 * LDK will not stop an inbound payment from being paid multiple times, so multiple
16076 * `PaymentClaimable` events may be generated for the same payment. If you then call
16077 * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get
16078 * multiple `PaymentClaimed` events.
16080 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
16082 LDKEvent_PaymentClaimed,
16084 * Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
16086 * Typically, this happens when a [`MessageRouter`] is unable to find a complete path to a
16087 * [`Destination`]. Once a connection is established, any messages buffered by an
16088 * [`OnionMessageHandler`] may be sent.
16090 * This event will not be generated for onion message forwards; only for sends including
16091 * replies. Handlers should connect to the node otherwise any buffered messages may be lost.
16093 * [`OnionMessage`]: msgs::OnionMessage
16094 * [`MessageRouter`]: crate::onion_message::messenger::MessageRouter
16095 * [`Destination`]: crate::onion_message::messenger::Destination
16096 * [`OnionMessageHandler`]: crate::ln::msgs::OnionMessageHandler
16098 LDKEvent_ConnectionNeeded,
16100 * Indicates a request for an invoice failed to yield a response in a reasonable amount of time
16101 * or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
16102 * [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
16104 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
16105 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
16106 * [`Offer`]: crate::offers::offer::Offer
16107 * [`Refund`]: crate::offers::refund::Refund
16109 LDKEvent_InvoiceRequestFailed,
16111 * Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
16112 * and we got back the payment preimage for it).
16114 * Note for MPP payments: in rare cases, this event may be preceded by a `PaymentPathFailed`
16115 * event. In this situation, you SHOULD treat this payment as having succeeded.
16117 LDKEvent_PaymentSent,
16119 * Indicates an outbound payment failed. Individual [`Event::PaymentPathFailed`] events
16120 * provide failure information for each path attempt in the payment, including retries.
16122 * This event is provided once there are no further pending HTLCs for the payment and the
16123 * payment is no longer retryable, due either to the [`Retry`] provided or
16124 * [`ChannelManager::abandon_payment`] having been called for the corresponding payment.
16126 * In exceedingly rare cases, it is possible that an [`Event::PaymentFailed`] is generated for
16127 * a payment after an [`Event::PaymentSent`] event for this same payment has already been
16128 * received and processed. In this case, the [`Event::PaymentFailed`] event MUST be ignored,
16129 * and the payment MUST be treated as having succeeded.
16131 * [`Retry`]: crate::ln::channelmanager::Retry
16132 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
16134 LDKEvent_PaymentFailed,
16136 * Indicates that a path for an outbound payment was successful.
16138 * Always generated after [`Event::PaymentSent`] and thus useful for scoring channels. See
16139 * [`Event::PaymentSent`] for obtaining the payment preimage.
16141 LDKEvent_PaymentPathSuccessful,
16143 * Indicates an outbound HTLC we sent failed, likely due to an intermediary node being unable to
16146 * Note that this does *not* indicate that all paths for an MPP payment have failed, see
16147 * [`Event::PaymentFailed`].
16149 * See [`ChannelManager::abandon_payment`] for giving up on this payment before its retries have
16152 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
16154 LDKEvent_PaymentPathFailed,
16156 * Indicates that a probe payment we sent returned successful, i.e., only failed at the destination.
16158 LDKEvent_ProbeSuccessful,
16160 * Indicates that a probe payment we sent failed at an intermediary node on the path.
16162 LDKEvent_ProbeFailed,
16164 * Used to indicate that [`ChannelManager::process_pending_htlc_forwards`] should be called at
16165 * a time in the future.
16167 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
16169 LDKEvent_PendingHTLCsForwardable,
16171 * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if
16172 * you've encoded an intercept scid in the receiver's invoice route hints using
16173 * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`].
16175 * [`ChannelManager::forward_intercepted_htlc`] or
16176 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See
16177 * their docs for more information.
16179 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
16180 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
16181 * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
16182 * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc
16184 LDKEvent_HTLCIntercepted,
16186 * Used to indicate that an output which you should know how to spend was confirmed on chain
16187 * and is now spendable.
16188 * Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
16189 * counterparty spending them due to some kind of timeout. Thus, you need to store them
16190 * somewhere and spend them when you create on-chain transactions.
16192 LDKEvent_SpendableOutputs,
16194 * This event is generated when a payment has been successfully forwarded through us and a
16195 * forwarding fee earned.
16197 LDKEvent_PaymentForwarded,
16199 * Used to indicate that a channel with the given `channel_id` is being opened and pending
16200 * confirmation on-chain.
16202 * This event is emitted when the funding transaction has been signed and is broadcast to the
16203 * network. For 0conf channels it will be immediately followed by the corresponding
16204 * [`Event::ChannelReady`] event.
16206 LDKEvent_ChannelPending,
16208 * Used to indicate that a channel with the given `channel_id` is ready to
16209 * be used. This event is emitted either when the funding transaction has been confirmed
16210 * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel
16213 LDKEvent_ChannelReady,
16215 * Used to indicate that a previously opened channel with the given `channel_id` is in the
16216 * process of closure.
16218 * Note that this event is only triggered for accepted channels: if the
16219 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true and the channel is
16220 * rejected, no `ChannelClosed` event will be sent.
16222 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16223 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
16225 LDKEvent_ChannelClosed,
16227 * Used to indicate to the user that they can abandon the funding transaction and recycle the
16228 * inputs for another purpose.
16230 * This event is not guaranteed to be generated for channels that are closed due to a restart.
16232 LDKEvent_DiscardFunding,
16234 * Indicates a request to open a new channel by a peer.
16236 * To accept the request, call [`ChannelManager::accept_inbound_channel`]. To reject the request,
16237 * call [`ChannelManager::force_close_without_broadcasting_txn`]. Note that a ['ChannelClosed`]
16238 * event will _not_ be triggered if the channel is rejected.
16240 * The event is only triggered when a new open channel request is received and the
16241 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true.
16243 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16244 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
16245 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
16247 LDKEvent_OpenChannelRequest,
16249 * Indicates that the HTLC was accepted, but could not be processed when or after attempting to
16252 * Some scenarios where this event may be sent include:
16253 * * Insufficient capacity in the outbound channel
16254 * * While waiting to forward the HTLC, the channel it is meant to be forwarded through closes
16255 * * When an unknown SCID is requested for forwarding a payment.
16256 * * Expected MPP amount has already been reached
16257 * * The HTLC has timed out
16259 * This event, however, does not get generated if an HTLC fails to meet the forwarding
16260 * requirements (i.e. insufficient fees paid, or a CLTV that is too soon).
16262 LDKEvent_HTLCHandlingFailed,
16264 * Indicates that a transaction originating from LDK needs to have its fee bumped. This event
16265 * requires confirmed external funds to be readily available to spend.
16267 * LDK does not currently generate this event unless the
16268 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`] config flag is set to true.
16269 * It is limited to the scope of channels with anchor outputs.
16271 * [`ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx`]: crate::util::config::ChannelHandshakeConfig::negotiate_anchors_zero_fee_htlc_tx
16273 LDKEvent_BumpTransaction,
16275 * Must be last for serialization purposes
16280 typedef struct LDKEvent_LDKFundingGenerationReady_Body {
16282 * The random channel_id we picked which you'll need to pass into
16283 * [`ChannelManager::funding_transaction_generated`].
16285 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
16287 struct LDKThirtyTwoBytes temporary_channel_id;
16289 * The counterparty's node_id, which you'll need to pass back into
16290 * [`ChannelManager::funding_transaction_generated`].
16292 * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated
16294 struct LDKPublicKey counterparty_node_id;
16296 * The value, in satoshis, that the output should have.
16298 uint64_t channel_value_satoshis;
16300 * The script which should be used in the transaction output.
16302 struct LDKCVec_u8Z output_script;
16304 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
16305 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
16306 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
16307 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
16308 * serialized with LDK versions prior to 0.0.113.
16310 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
16311 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16312 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
16314 struct LDKU128 user_channel_id;
16315 } LDKEvent_LDKFundingGenerationReady_Body;
16317 typedef struct LDKEvent_LDKPaymentClaimable_Body {
16319 * The node that will receive the payment after it has been claimed.
16320 * This is useful to identify payments received via [phantom nodes].
16321 * This field will always be filled in when the event was generated by LDK versions
16322 * 0.0.113 and above.
16324 * [phantom nodes]: crate::sign::PhantomKeysManager
16326 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
16328 struct LDKPublicKey receiver_node_id;
16330 * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will
16331 * not stop you from registering duplicate payment hashes for inbound payments.
16333 struct LDKThirtyTwoBytes payment_hash;
16335 * The fields in the onion which were received with each HTLC. Only fields which were
16336 * identical in each HTLC involved in the payment will be included here.
16338 * Payments received on LDK versions prior to 0.0.115 will have this field unset.
16340 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
16342 struct LDKRecipientOnionFields onion_fields;
16344 * The value, in thousandths of a satoshi, that this payment is claimable for. May be greater
16345 * than the invoice amount.
16347 * May be less than the invoice amount if [`ChannelConfig::accept_underpaying_htlcs`] is set
16348 * and the previous hop took an extra fee.
16351 * If [`ChannelConfig::accept_underpaying_htlcs`] is set and you claim without verifying this
16352 * field, you may lose money!
16354 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
16356 uint64_t amount_msat;
16358 * The value, in thousands of a satoshi, that was skimmed off of this payment as an extra fee
16359 * taken by our channel counterparty.
16361 * Will always be 0 unless [`ChannelConfig::accept_underpaying_htlcs`] is set.
16363 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
16365 uint64_t counterparty_skimmed_fee_msat;
16367 * Information for claiming this received payment, based on whether the purpose of the
16368 * payment is to pay an invoice or to send a spontaneous payment.
16370 struct LDKPaymentPurpose purpose;
16372 * The `channel_id` indicating over which channel we received the payment.
16374 struct LDKCOption_ThirtyTwoBytesZ via_channel_id;
16376 * The `user_channel_id` indicating over which channel we received the payment.
16378 struct LDKCOption_U128Z via_user_channel_id;
16380 * The block height at which this payment will be failed back and will no longer be
16381 * eligible for claiming.
16383 * Prior to this height, a call to [`ChannelManager::claim_funds`] is guaranteed to
16384 * succeed, however you should wait for [`Event::PaymentClaimed`] to be sure.
16386 * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
16388 struct LDKCOption_u32Z claim_deadline;
16389 } LDKEvent_LDKPaymentClaimable_Body;
16391 typedef struct LDKEvent_LDKPaymentClaimed_Body {
16393 * The node that received the payment.
16394 * This is useful to identify payments which were received via [phantom nodes].
16395 * This field will always be filled in when the event was generated by LDK versions
16396 * 0.0.113 and above.
16398 * [phantom nodes]: crate::sign::PhantomKeysManager
16400 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
16402 struct LDKPublicKey receiver_node_id;
16404 * The payment hash of the claimed payment. Note that LDK will not stop you from
16405 * registering duplicate payment hashes for inbound payments.
16407 struct LDKThirtyTwoBytes payment_hash;
16409 * The value, in thousandths of a satoshi, that this payment is for. May be greater than the
16412 uint64_t amount_msat;
16414 * The purpose of the claimed payment, i.e. whether the payment was for an invoice or a
16415 * spontaneous payment.
16417 struct LDKPaymentPurpose purpose;
16419 * The HTLCs that comprise the claimed payment. This will be empty for events serialized prior
16420 * to LDK version 0.0.117.
16422 struct LDKCVec_ClaimedHTLCZ htlcs;
16424 * The sender-intended sum total of all the MPP parts. This will be `None` for events
16425 * serialized prior to LDK version 0.0.117.
16427 struct LDKCOption_u64Z sender_intended_total_msat;
16428 } LDKEvent_LDKPaymentClaimed_Body;
16430 typedef struct LDKEvent_LDKConnectionNeeded_Body {
16432 * The node id for the node needing a connection.
16434 struct LDKPublicKey node_id;
16436 * Sockets for connecting to the node.
16438 struct LDKCVec_SocketAddressZ addresses;
16439 } LDKEvent_LDKConnectionNeeded_Body;
16441 typedef struct LDKEvent_LDKInvoiceRequestFailed_Body {
16443 * The `payment_id` to have been associated with payment for the requested invoice.
16445 struct LDKThirtyTwoBytes payment_id;
16446 } LDKEvent_LDKInvoiceRequestFailed_Body;
16448 typedef struct LDKEvent_LDKPaymentSent_Body {
16450 * The `payment_id` passed to [`ChannelManager::send_payment`].
16452 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16454 struct LDKCOption_ThirtyTwoBytesZ payment_id;
16456 * The preimage to the hash given to ChannelManager::send_payment.
16457 * Note that this serves as a payment receipt, if you wish to have such a thing, you must
16458 * store it somehow!
16460 struct LDKThirtyTwoBytes payment_preimage;
16462 * The hash that was given to [`ChannelManager::send_payment`].
16464 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16466 struct LDKThirtyTwoBytes payment_hash;
16468 * The total fee which was spent at intermediate hops in this payment, across all paths.
16470 * Note that, like [`Route::get_total_fees`] this does *not* include any potential
16471 * overpayment to the recipient node.
16473 * If the recipient or an intermediate node misbehaves and gives us free money, this may
16474 * overstate the amount paid, though this is unlikely.
16476 * [`Route::get_total_fees`]: crate::routing::router::Route::get_total_fees
16478 struct LDKCOption_u64Z fee_paid_msat;
16479 } LDKEvent_LDKPaymentSent_Body;
16481 typedef struct LDKEvent_LDKPaymentFailed_Body {
16483 * The `payment_id` passed to [`ChannelManager::send_payment`].
16485 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16487 struct LDKThirtyTwoBytes payment_id;
16489 * The hash that was given to [`ChannelManager::send_payment`].
16491 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16493 struct LDKThirtyTwoBytes payment_hash;
16495 * The reason the payment failed. This is only `None` for events generated or serialized
16496 * by versions prior to 0.0.115.
16498 struct LDKCOption_PaymentFailureReasonZ reason;
16499 } LDKEvent_LDKPaymentFailed_Body;
16501 typedef struct LDKEvent_LDKPaymentPathSuccessful_Body {
16503 * The `payment_id` passed to [`ChannelManager::send_payment`].
16505 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16507 struct LDKThirtyTwoBytes payment_id;
16509 * The hash that was given to [`ChannelManager::send_payment`].
16511 * This will be `Some` for all payments which completed on LDK 0.0.104 or later.
16513 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16515 struct LDKCOption_ThirtyTwoBytesZ payment_hash;
16517 * The payment path that was successful.
16519 * May contain a closed channel if the HTLC sent along the path was fulfilled on chain.
16521 struct LDKPath path;
16522 } LDKEvent_LDKPaymentPathSuccessful_Body;
16524 typedef struct LDKEvent_LDKPaymentPathFailed_Body {
16526 * The `payment_id` passed to [`ChannelManager::send_payment`].
16528 * This will be `Some` for all payment paths which failed on LDK 0.0.103 or later.
16530 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16531 * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
16533 struct LDKCOption_ThirtyTwoBytesZ payment_id;
16535 * The hash that was given to [`ChannelManager::send_payment`].
16537 * [`ChannelManager::send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
16539 struct LDKThirtyTwoBytes payment_hash;
16541 * Indicates the payment was rejected for some reason by the recipient. This implies that
16542 * the payment has failed, not just the route in question. If this is not set, the payment may
16543 * be retried via a different route.
16545 bool payment_failed_permanently;
16547 * Extra error details based on the failure type. May contain an update that needs to be
16548 * applied to the [`NetworkGraph`].
16550 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
16552 struct LDKPathFailure failure;
16554 * The payment path that failed.
16556 struct LDKPath path;
16558 * The channel responsible for the failed payment path.
16560 * Note that for route hints or for the first hop in a path this may be an SCID alias and
16561 * may not refer to a channel in the public network graph. These aliases may also collide
16562 * with channels in the public network graph.
16564 * If this is `Some`, then the corresponding channel should be avoided when the payment is
16565 * retried. May be `None` for older [`Event`] serializations.
16567 struct LDKCOption_u64Z short_channel_id;
16568 } LDKEvent_LDKPaymentPathFailed_Body;
16570 typedef struct LDKEvent_LDKProbeSuccessful_Body {
16572 * The id returned by [`ChannelManager::send_probe`].
16574 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
16576 struct LDKThirtyTwoBytes payment_id;
16578 * The hash generated by [`ChannelManager::send_probe`].
16580 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
16582 struct LDKThirtyTwoBytes payment_hash;
16584 * The payment path that was successful.
16586 struct LDKPath path;
16587 } LDKEvent_LDKProbeSuccessful_Body;
16589 typedef struct LDKEvent_LDKProbeFailed_Body {
16591 * The id returned by [`ChannelManager::send_probe`].
16593 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
16595 struct LDKThirtyTwoBytes payment_id;
16597 * The hash generated by [`ChannelManager::send_probe`].
16599 * [`ChannelManager::send_probe`]: crate::ln::channelmanager::ChannelManager::send_probe
16601 struct LDKThirtyTwoBytes payment_hash;
16603 * The payment path that failed.
16605 struct LDKPath path;
16607 * The channel responsible for the failed probe.
16609 * Note that for route hints or for the first hop in a path this may be an SCID alias and
16610 * may not refer to a channel in the public network graph. These aliases may also collide
16611 * with channels in the public network graph.
16613 struct LDKCOption_u64Z short_channel_id;
16614 } LDKEvent_LDKProbeFailed_Body;
16616 typedef struct LDKEvent_LDKPendingHTLCsForwardable_Body {
16618 * The minimum amount of time that should be waited prior to calling
16619 * process_pending_htlc_forwards. To increase the effort required to correlate payments,
16620 * you should wait a random amount of time in roughly the range (now + time_forwardable,
16621 * now + 5*time_forwardable).
16623 uint64_t time_forwardable;
16624 } LDKEvent_LDKPendingHTLCsForwardable_Body;
16626 typedef struct LDKEvent_LDKHTLCIntercepted_Body {
16628 * An id to help LDK identify which HTLC is being forwarded or failed.
16630 struct LDKThirtyTwoBytes intercept_id;
16632 * The fake scid that was programmed as the next hop's scid, generated using
16633 * [`ChannelManager::get_intercept_scid`].
16635 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
16637 uint64_t requested_next_hop_scid;
16639 * The payment hash used for this HTLC.
16641 struct LDKThirtyTwoBytes payment_hash;
16643 * How many msats were received on the inbound edge of this HTLC.
16645 uint64_t inbound_amount_msat;
16647 * How many msats the payer intended to route to the next node. Depending on the reason you are
16648 * intercepting this payment, you might take a fee by forwarding less than this amount.
16649 * Forwarding less than this amount may break compatibility with LDK versions prior to 0.0.116.
16651 * Note that LDK will NOT check that expected fees were factored into this value. You MUST
16652 * check that whatever fee you want has been included here or subtract it as required. Further,
16653 * LDK will not stop you from forwarding more than you received.
16655 uint64_t expected_outbound_amount_msat;
16656 } LDKEvent_LDKHTLCIntercepted_Body;
16658 typedef struct LDKEvent_LDKSpendableOutputs_Body {
16660 * The outputs which you should store as spendable by you.
16662 struct LDKCVec_SpendableOutputDescriptorZ outputs;
16664 * The `channel_id` indicating which channel the spendable outputs belong to.
16666 * This will always be `Some` for events generated by LDK versions 0.0.117 and above.
16668 struct LDKCOption_ThirtyTwoBytesZ channel_id;
16669 } LDKEvent_LDKSpendableOutputs_Body;
16671 typedef struct LDKEvent_LDKPaymentForwarded_Body {
16673 * The incoming channel between the previous node and us. This is only `None` for events
16674 * generated or serialized by versions prior to 0.0.107.
16676 struct LDKCOption_ThirtyTwoBytesZ prev_channel_id;
16678 * The outgoing channel between the next node and us. This is only `None` for events
16679 * generated or serialized by versions prior to 0.0.107.
16681 struct LDKCOption_ThirtyTwoBytesZ next_channel_id;
16683 * The fee, in milli-satoshis, which was earned as a result of the payment.
16685 * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC
16686 * was pending, the amount the next hop claimed will have been rounded down to the nearest
16687 * whole satoshi. Thus, the fee calculated here may be higher than expected as we still
16688 * claimed the full value in millisatoshis from the source. In this case,
16689 * `claim_from_onchain_tx` will be set.
16691 * If the channel which sent us the payment has been force-closed, we will claim the funds
16692 * via an on-chain transaction. In that case we do not yet know the on-chain transaction
16693 * fees which we will spend and will instead set this to `None`. It is possible duplicate
16694 * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is
16697 struct LDKCOption_u64Z fee_earned_msat;
16699 * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain
16702 bool claim_from_onchain_tx;
16704 * The final amount forwarded, in milli-satoshis, after the fee is deducted.
16706 * The caveat described above the `fee_earned_msat` field applies here as well.
16708 struct LDKCOption_u64Z outbound_amount_forwarded_msat;
16709 } LDKEvent_LDKPaymentForwarded_Body;
16711 typedef struct LDKEvent_LDKChannelPending_Body {
16713 * The `channel_id` of the channel that is pending confirmation.
16715 struct LDKThirtyTwoBytes channel_id;
16717 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
16718 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
16719 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
16720 * `user_channel_id` will be randomized for an inbound channel.
16722 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
16723 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16724 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
16726 struct LDKU128 user_channel_id;
16728 * The `temporary_channel_id` this channel used to be known by during channel establishment.
16730 * Will be `None` for channels created prior to LDK version 0.0.115.
16732 struct LDKCOption_ThirtyTwoBytesZ former_temporary_channel_id;
16734 * The `node_id` of the channel counterparty.
16736 struct LDKPublicKey counterparty_node_id;
16738 * The outpoint of the channel's funding transaction.
16740 struct LDKOutPoint funding_txo;
16741 } LDKEvent_LDKChannelPending_Body;
16743 typedef struct LDKEvent_LDKChannelReady_Body {
16745 * The `channel_id` of the channel that is ready.
16747 struct LDKThirtyTwoBytes channel_id;
16749 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
16750 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
16751 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
16752 * `user_channel_id` will be randomized for an inbound channel.
16754 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
16755 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16756 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
16758 struct LDKU128 user_channel_id;
16760 * The `node_id` of the channel counterparty.
16762 struct LDKPublicKey counterparty_node_id;
16764 * The features that this channel will operate with.
16766 struct LDKChannelTypeFeatures channel_type;
16767 } LDKEvent_LDKChannelReady_Body;
16769 typedef struct LDKEvent_LDKChannelClosed_Body {
16771 * The `channel_id` of the channel which has been closed. Note that on-chain transactions
16772 * resolving the channel are likely still awaiting confirmation.
16774 struct LDKThirtyTwoBytes channel_id;
16776 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
16777 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
16778 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
16779 * `user_channel_id` will be randomized for inbound channels.
16780 * This may be zero for inbound channels serialized prior to 0.0.113 and will always be
16781 * zero for objects serialized with LDK versions prior to 0.0.102.
16783 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
16784 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16785 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
16787 struct LDKU128 user_channel_id;
16789 * The reason the channel was closed.
16791 struct LDKClosureReason reason;
16793 * Counterparty in the closed channel.
16795 * This field will be `None` for objects serialized prior to LDK 0.0.117.
16797 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
16799 struct LDKPublicKey counterparty_node_id;
16801 * Channel capacity of the closing channel (sats).
16803 * This field will be `None` for objects serialized prior to LDK 0.0.117.
16805 struct LDKCOption_u64Z channel_capacity_sats;
16807 * The original channel funding TXO; this helps checking for the existence and confirmation
16808 * status of the closing tx.
16809 * Note that for instances serialized in v0.0.119 or prior this will be missing (None).
16811 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
16813 struct LDKOutPoint channel_funding_txo;
16814 } LDKEvent_LDKChannelClosed_Body;
16816 typedef struct LDKEvent_LDKDiscardFunding_Body {
16818 * The channel_id of the channel which has been closed.
16820 struct LDKThirtyTwoBytes channel_id;
16822 * The full transaction received from the user
16824 struct LDKTransaction transaction;
16825 } LDKEvent_LDKDiscardFunding_Body;
16827 typedef struct LDKEvent_LDKOpenChannelRequest_Body {
16829 * The temporary channel ID of the channel requested to be opened.
16831 * When responding to the request, the `temporary_channel_id` should be passed
16832 * back to the ChannelManager through [`ChannelManager::accept_inbound_channel`] to accept,
16833 * or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject.
16835 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16836 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
16838 struct LDKThirtyTwoBytes temporary_channel_id;
16840 * The node_id of the counterparty requesting to open the channel.
16842 * When responding to the request, the `counterparty_node_id` should be passed
16843 * back to the `ChannelManager` through [`ChannelManager::accept_inbound_channel`] to
16844 * accept the request, or through [`ChannelManager::force_close_without_broadcasting_txn`] to reject the
16847 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
16848 * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn
16850 struct LDKPublicKey counterparty_node_id;
16852 * The channel value of the requested channel.
16854 uint64_t funding_satoshis;
16856 * Our starting balance in the channel if the request is accepted, in milli-satoshi.
16858 uint64_t push_msat;
16860 * The features that this channel will operate with. If you reject the channel, a
16861 * well-behaved counterparty may automatically re-attempt the channel with a new set of
16864 * Note that if [`ChannelTypeFeatures::supports_scid_privacy`] returns true on this type,
16865 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
16868 * Furthermore, note that if [`ChannelTypeFeatures::supports_zero_conf`] returns true on this type,
16869 * the resulting [`ChannelManager`] will not be readable by versions of LDK prior to
16870 * 0.0.107. Channels setting this type also need to get manually accepted via
16871 * [`crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`],
16872 * or will be rejected otherwise.
16874 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
16876 struct LDKChannelTypeFeatures channel_type;
16877 } LDKEvent_LDKOpenChannelRequest_Body;
16879 typedef struct LDKEvent_LDKHTLCHandlingFailed_Body {
16881 * The channel over which the HTLC was received.
16883 struct LDKThirtyTwoBytes prev_channel_id;
16885 * Destination of the HTLC that failed to be processed.
16887 struct LDKHTLCDestination failed_next_destination;
16888 } LDKEvent_LDKHTLCHandlingFailed_Body;
16890 typedef struct MUST_USE_STRUCT LDKEvent {
16893 LDKEvent_LDKFundingGenerationReady_Body funding_generation_ready;
16894 LDKEvent_LDKPaymentClaimable_Body payment_claimable;
16895 LDKEvent_LDKPaymentClaimed_Body payment_claimed;
16896 LDKEvent_LDKConnectionNeeded_Body connection_needed;
16897 LDKEvent_LDKInvoiceRequestFailed_Body invoice_request_failed;
16898 LDKEvent_LDKPaymentSent_Body payment_sent;
16899 LDKEvent_LDKPaymentFailed_Body payment_failed;
16900 LDKEvent_LDKPaymentPathSuccessful_Body payment_path_successful;
16901 LDKEvent_LDKPaymentPathFailed_Body payment_path_failed;
16902 LDKEvent_LDKProbeSuccessful_Body probe_successful;
16903 LDKEvent_LDKProbeFailed_Body probe_failed;
16904 LDKEvent_LDKPendingHTLCsForwardable_Body pending_htl_cs_forwardable;
16905 LDKEvent_LDKHTLCIntercepted_Body htlc_intercepted;
16906 LDKEvent_LDKSpendableOutputs_Body spendable_outputs;
16907 LDKEvent_LDKPaymentForwarded_Body payment_forwarded;
16908 LDKEvent_LDKChannelPending_Body channel_pending;
16909 LDKEvent_LDKChannelReady_Body channel_ready;
16910 LDKEvent_LDKChannelClosed_Body channel_closed;
16911 LDKEvent_LDKDiscardFunding_Body discard_funding;
16912 LDKEvent_LDKOpenChannelRequest_Body open_channel_request;
16913 LDKEvent_LDKHTLCHandlingFailed_Body htlc_handling_failed;
16915 struct LDKBumpTransactionEvent bump_transaction;
16921 * An enum which can either contain a crate::lightning::events::Event or not
16923 typedef enum LDKCOption_EventZ_Tag {
16925 * When we're in this state, this COption_EventZ contains a crate::lightning::events::Event
16927 LDKCOption_EventZ_Some,
16929 * When we're in this state, this COption_EventZ contains nothing
16931 LDKCOption_EventZ_None,
16933 * Must be last for serialization purposes
16935 LDKCOption_EventZ_Sentinel,
16936 } LDKCOption_EventZ_Tag;
16938 typedef struct LDKCOption_EventZ {
16939 LDKCOption_EventZ_Tag tag;
16942 struct LDKEvent some;
16945 } LDKCOption_EventZ;
16948 * The contents of CResult_COption_EventZDecodeErrorZ
16950 typedef union LDKCResult_COption_EventZDecodeErrorZPtr {
16952 * A pointer to the contents in the success state.
16953 * Reading from this pointer when `result_ok` is not set is undefined.
16955 struct LDKCOption_EventZ *result;
16957 * A pointer to the contents in the error state.
16958 * Reading from this pointer when `result_ok` is set is undefined.
16960 struct LDKDecodeError *err;
16961 } LDKCResult_COption_EventZDecodeErrorZPtr;
16964 * A CResult_COption_EventZDecodeErrorZ represents the result of a fallible operation,
16965 * containing a crate::c_types::derived::COption_EventZ on success and a crate::lightning::ln::msgs::DecodeError on failure.
16966 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
16968 typedef struct LDKCResult_COption_EventZDecodeErrorZ {
16970 * The contents of this CResult_COption_EventZDecodeErrorZ, accessible via either
16971 * `err` or `result` depending on the state of `result_ok`.
16973 union LDKCResult_COption_EventZDecodeErrorZPtr contents;
16975 * Whether this CResult_COption_EventZDecodeErrorZ represents a success state.
16978 } LDKCResult_COption_EventZDecodeErrorZ;
16981 * Sub-errors which don't have specific information in them use this type.
16983 typedef struct LDKError {
16985 * Zero-Sized_types aren't consistent across Rust/C/C++, so we add some size here
16991 * Errors that indicate what is wrong with the invoice. They have some granularity for debug
16992 * reasons, but should generally result in an \"invalid BOLT11 invoice\" message for the user.
16994 typedef enum LDKBolt11ParseError_Tag {
16995 LDKBolt11ParseError_Bech32Error,
16996 LDKBolt11ParseError_ParseAmountError,
16997 LDKBolt11ParseError_MalformedSignature,
16998 LDKBolt11ParseError_BadPrefix,
16999 LDKBolt11ParseError_UnknownCurrency,
17000 LDKBolt11ParseError_UnknownSiPrefix,
17001 LDKBolt11ParseError_MalformedHRP,
17002 LDKBolt11ParseError_TooShortDataPart,
17003 LDKBolt11ParseError_UnexpectedEndOfTaggedFields,
17004 LDKBolt11ParseError_DescriptionDecodeError,
17005 LDKBolt11ParseError_PaddingError,
17006 LDKBolt11ParseError_IntegerOverflowError,
17007 LDKBolt11ParseError_InvalidSegWitProgramLength,
17008 LDKBolt11ParseError_InvalidPubKeyHashLength,
17009 LDKBolt11ParseError_InvalidScriptHashLength,
17010 LDKBolt11ParseError_InvalidRecoveryId,
17011 LDKBolt11ParseError_InvalidSliceLength,
17013 * Not an error, but used internally to signal that a part of the invoice should be ignored
17014 * according to BOLT11
17016 LDKBolt11ParseError_Skip,
17018 * Must be last for serialization purposes
17020 LDKBolt11ParseError_Sentinel,
17021 } LDKBolt11ParseError_Tag;
17023 typedef struct MUST_USE_STRUCT LDKBolt11ParseError {
17024 LDKBolt11ParseError_Tag tag;
17027 struct LDKBech32Error bech32_error;
17030 struct LDKError parse_amount_error;
17033 enum LDKSecp256k1Error malformed_signature;
17036 struct LDKError description_decode_error;
17039 struct LDKStr invalid_slice_length;
17042 } LDKBolt11ParseError;
17045 * The contents of CResult_SiPrefixBolt11ParseErrorZ
17047 typedef union LDKCResult_SiPrefixBolt11ParseErrorZPtr {
17049 * A pointer to the contents in the success state.
17050 * Reading from this pointer when `result_ok` is not set is undefined.
17052 enum LDKSiPrefix *result;
17054 * A pointer to the contents in the error state.
17055 * Reading from this pointer when `result_ok` is set is undefined.
17057 struct LDKBolt11ParseError *err;
17058 } LDKCResult_SiPrefixBolt11ParseErrorZPtr;
17061 * A CResult_SiPrefixBolt11ParseErrorZ represents the result of a fallible operation,
17062 * containing a crate::lightning_invoice::SiPrefix on success and a crate::lightning_invoice::Bolt11ParseError on failure.
17063 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17065 typedef struct LDKCResult_SiPrefixBolt11ParseErrorZ {
17067 * The contents of this CResult_SiPrefixBolt11ParseErrorZ, accessible via either
17068 * `err` or `result` depending on the state of `result_ok`.
17070 union LDKCResult_SiPrefixBolt11ParseErrorZPtr contents;
17072 * Whether this CResult_SiPrefixBolt11ParseErrorZ represents a success state.
17075 } LDKCResult_SiPrefixBolt11ParseErrorZ;
17078 * Indicates that something went wrong while parsing or validating the invoice. Parsing errors
17079 * should be mostly seen as opaque and are only there for debugging reasons. Semantic errors
17080 * like wrong signatures, missing fields etc. could mean that someone tampered with the invoice.
17082 typedef enum LDKParseOrSemanticError_Tag {
17084 * The invoice couldn't be decoded
17086 LDKParseOrSemanticError_ParseError,
17088 * The invoice could be decoded but violates the BOLT11 standard
17090 LDKParseOrSemanticError_SemanticError,
17092 * Must be last for serialization purposes
17094 LDKParseOrSemanticError_Sentinel,
17095 } LDKParseOrSemanticError_Tag;
17097 typedef struct MUST_USE_STRUCT LDKParseOrSemanticError {
17098 LDKParseOrSemanticError_Tag tag;
17101 struct LDKBolt11ParseError parse_error;
17104 enum LDKBolt11SemanticError semantic_error;
17107 } LDKParseOrSemanticError;
17110 * The contents of CResult_Bolt11InvoiceParseOrSemanticErrorZ
17112 typedef union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr {
17114 * A pointer to the contents in the success state.
17115 * Reading from this pointer when `result_ok` is not set is undefined.
17117 struct LDKBolt11Invoice *result;
17119 * A pointer to the contents in the error state.
17120 * Reading from this pointer when `result_ok` is set is undefined.
17122 struct LDKParseOrSemanticError *err;
17123 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr;
17126 * A CResult_Bolt11InvoiceParseOrSemanticErrorZ represents the result of a fallible operation,
17127 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::ParseOrSemanticError on failure.
17128 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17130 typedef struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ {
17132 * The contents of this CResult_Bolt11InvoiceParseOrSemanticErrorZ, accessible via either
17133 * `err` or `result` depending on the state of `result_ok`.
17135 union LDKCResult_Bolt11InvoiceParseOrSemanticErrorZPtr contents;
17137 * Whether this CResult_Bolt11InvoiceParseOrSemanticErrorZ represents a success state.
17140 } LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ;
17145 * Represents a signed [`RawBolt11Invoice`] with cached hash. The signature is not checked and may be
17149 * The hash has to be either from the deserialized invoice or from the serialized [`RawBolt11Invoice`].
17151 typedef struct MUST_USE_STRUCT LDKSignedRawBolt11Invoice {
17153 * A pointer to the opaque Rust object.
17154 * Nearly everywhere, inner must be non-null, however in places where
17155 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17157 LDKnativeSignedRawBolt11Invoice *inner;
17159 * Indicates that this is the only struct which contains the same pointer.
17160 * Rust functions which take ownership of an object provided via an argument require
17161 * this to be true and invalidate the object pointed to by inner.
17164 } LDKSignedRawBolt11Invoice;
17167 * The contents of CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ
17169 typedef union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr {
17171 * A pointer to the contents in the success state.
17172 * Reading from this pointer when `result_ok` is not set is undefined.
17174 struct LDKSignedRawBolt11Invoice *result;
17176 * A pointer to the contents in the error state.
17177 * Reading from this pointer when `result_ok` is set is undefined.
17179 struct LDKBolt11ParseError *err;
17180 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr;
17183 * A CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents the result of a fallible operation,
17184 * containing a crate::lightning_invoice::SignedRawBolt11Invoice on success and a crate::lightning_invoice::Bolt11ParseError on failure.
17185 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17187 typedef struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ {
17189 * The contents of this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ, accessible via either
17190 * `err` or `result` depending on the state of `result_ok`.
17192 union LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZPtr contents;
17194 * Whether this CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ represents a success state.
17197 } LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ;
17202 * Represents an syntactically correct [`Bolt11Invoice`] for a payment on the lightning network,
17203 * but without the signature information.
17204 * Decoding and encoding should not lead to information loss but may lead to different hashes.
17206 * For methods without docs see the corresponding methods in [`Bolt11Invoice`].
17208 typedef struct MUST_USE_STRUCT LDKRawBolt11Invoice {
17210 * A pointer to the opaque Rust object.
17211 * Nearly everywhere, inner must be non-null, however in places where
17212 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17214 LDKnativeRawBolt11Invoice *inner;
17216 * Indicates that this is the only struct which contains the same pointer.
17217 * Rust functions which take ownership of an object provided via an argument require
17218 * this to be true and invalidate the object pointed to by inner.
17221 } LDKRawBolt11Invoice;
17226 * Recoverable signature
17228 typedef struct MUST_USE_STRUCT LDKBolt11InvoiceSignature {
17230 * A pointer to the opaque Rust object.
17231 * Nearly everywhere, inner must be non-null, however in places where
17232 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17234 LDKnativeBolt11InvoiceSignature *inner;
17236 * Indicates that this is the only struct which contains the same pointer.
17237 * Rust functions which take ownership of an object provided via an argument require
17238 * this to be true and invalidate the object pointed to by inner.
17241 } LDKBolt11InvoiceSignature;
17244 * A tuple of 3 elements. See the individual fields for the types contained.
17246 typedef struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ {
17248 * The element at position 0
17250 struct LDKRawBolt11Invoice a;
17252 * The element at position 1
17254 struct LDKThirtyTwoBytes b;
17256 * The element at position 2
17258 struct LDKBolt11InvoiceSignature c;
17259 } LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ;
17266 typedef struct MUST_USE_STRUCT LDKPayeePubKey {
17268 * A pointer to the opaque Rust object.
17269 * Nearly everywhere, inner must be non-null, however in places where
17270 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17272 LDKnativePayeePubKey *inner;
17274 * Indicates that this is the only struct which contains the same pointer.
17275 * Rust functions which take ownership of an object provided via an argument require
17276 * this to be true and invalidate the object pointed to by inner.
17282 * The contents of CResult_PayeePubKeySecp256k1ErrorZ
17284 typedef union LDKCResult_PayeePubKeySecp256k1ErrorZPtr {
17286 * A pointer to the contents in the success state.
17287 * Reading from this pointer when `result_ok` is not set is undefined.
17289 struct LDKPayeePubKey *result;
17291 * A pointer to the contents in the error state.
17292 * Reading from this pointer when `result_ok` is set is undefined.
17294 enum LDKSecp256k1Error *err;
17295 } LDKCResult_PayeePubKeySecp256k1ErrorZPtr;
17298 * A CResult_PayeePubKeySecp256k1ErrorZ represents the result of a fallible operation,
17299 * containing a crate::lightning_invoice::PayeePubKey on success and a crate::c_types::Secp256k1Error on failure.
17300 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17302 typedef struct LDKCResult_PayeePubKeySecp256k1ErrorZ {
17304 * The contents of this CResult_PayeePubKeySecp256k1ErrorZ, accessible via either
17305 * `err` or `result` depending on the state of `result_ok`.
17307 union LDKCResult_PayeePubKeySecp256k1ErrorZPtr contents;
17309 * Whether this CResult_PayeePubKeySecp256k1ErrorZ represents a success state.
17312 } LDKCResult_PayeePubKeySecp256k1ErrorZ;
17317 * Private routing information
17320 * The encoded route has to be <1024 5bit characters long (<=639 bytes or <=12 hops)
17323 typedef struct MUST_USE_STRUCT LDKPrivateRoute {
17325 * A pointer to the opaque Rust object.
17326 * Nearly everywhere, inner must be non-null, however in places where
17327 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17329 LDKnativePrivateRoute *inner;
17331 * Indicates that this is the only struct which contains the same pointer.
17332 * Rust functions which take ownership of an object provided via an argument require
17333 * this to be true and invalidate the object pointed to by inner.
17339 * A dynamically-allocated array of crate::lightning_invoice::PrivateRoutes of arbitrary size.
17340 * This corresponds to std::vector in C++
17342 typedef struct LDKCVec_PrivateRouteZ {
17344 * The elements in the array.
17345 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
17347 struct LDKPrivateRoute *data;
17349 * The number of elements pointed to by `data`.
17352 } LDKCVec_PrivateRouteZ;
17357 * A timestamp that refers to a date after 1 January 1970.
17361 * The Unix timestamp representing the stored time has to be positive and no greater than
17362 * [`MAX_TIMESTAMP`].
17364 typedef struct MUST_USE_STRUCT LDKPositiveTimestamp {
17366 * A pointer to the opaque Rust object.
17367 * Nearly everywhere, inner must be non-null, however in places where
17368 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17370 LDKnativePositiveTimestamp *inner;
17372 * Indicates that this is the only struct which contains the same pointer.
17373 * Rust functions which take ownership of an object provided via an argument require
17374 * this to be true and invalidate the object pointed to by inner.
17377 } LDKPositiveTimestamp;
17380 * The contents of CResult_PositiveTimestampCreationErrorZ
17382 typedef union LDKCResult_PositiveTimestampCreationErrorZPtr {
17384 * A pointer to the contents in the success state.
17385 * Reading from this pointer when `result_ok` is not set is undefined.
17387 struct LDKPositiveTimestamp *result;
17389 * A pointer to the contents in the error state.
17390 * Reading from this pointer when `result_ok` is set is undefined.
17392 enum LDKCreationError *err;
17393 } LDKCResult_PositiveTimestampCreationErrorZPtr;
17396 * A CResult_PositiveTimestampCreationErrorZ represents the result of a fallible operation,
17397 * containing a crate::lightning_invoice::PositiveTimestamp on success and a crate::lightning_invoice::CreationError on failure.
17398 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17400 typedef struct LDKCResult_PositiveTimestampCreationErrorZ {
17402 * The contents of this CResult_PositiveTimestampCreationErrorZ, accessible via either
17403 * `err` or `result` depending on the state of `result_ok`.
17405 union LDKCResult_PositiveTimestampCreationErrorZPtr contents;
17407 * Whether this CResult_PositiveTimestampCreationErrorZ represents a success state.
17410 } LDKCResult_PositiveTimestampCreationErrorZ;
17413 * The contents of CResult_NoneBolt11SemanticErrorZ
17415 typedef union LDKCResult_NoneBolt11SemanticErrorZPtr {
17417 * Note that this value is always NULL, as there are no contents in the OK variant
17421 * A pointer to the contents in the error state.
17422 * Reading from this pointer when `result_ok` is set is undefined.
17424 enum LDKBolt11SemanticError *err;
17425 } LDKCResult_NoneBolt11SemanticErrorZPtr;
17428 * A CResult_NoneBolt11SemanticErrorZ represents the result of a fallible operation,
17429 * containing a () on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
17430 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17432 typedef struct LDKCResult_NoneBolt11SemanticErrorZ {
17434 * The contents of this CResult_NoneBolt11SemanticErrorZ, accessible via either
17435 * `err` or `result` depending on the state of `result_ok`.
17437 union LDKCResult_NoneBolt11SemanticErrorZPtr contents;
17439 * Whether this CResult_NoneBolt11SemanticErrorZ represents a success state.
17442 } LDKCResult_NoneBolt11SemanticErrorZ;
17445 * The contents of CResult_Bolt11InvoiceBolt11SemanticErrorZ
17447 typedef union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr {
17449 * A pointer to the contents in the success state.
17450 * Reading from this pointer when `result_ok` is not set is undefined.
17452 struct LDKBolt11Invoice *result;
17454 * A pointer to the contents in the error state.
17455 * Reading from this pointer when `result_ok` is set is undefined.
17457 enum LDKBolt11SemanticError *err;
17458 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr;
17461 * A CResult_Bolt11InvoiceBolt11SemanticErrorZ represents the result of a fallible operation,
17462 * containing a crate::lightning_invoice::Bolt11Invoice on success and a crate::lightning_invoice::Bolt11SemanticError on failure.
17463 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17465 typedef struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ {
17467 * The contents of this CResult_Bolt11InvoiceBolt11SemanticErrorZ, accessible via either
17468 * `err` or `result` depending on the state of `result_ok`.
17470 union LDKCResult_Bolt11InvoiceBolt11SemanticErrorZPtr contents;
17472 * Whether this CResult_Bolt11InvoiceBolt11SemanticErrorZ represents a success state.
17475 } LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ;
17480 * Description string
17483 * The description can be at most 639 __bytes__ long
17485 typedef struct MUST_USE_STRUCT LDKDescription {
17487 * A pointer to the opaque Rust object.
17488 * Nearly everywhere, inner must be non-null, however in places where
17489 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17491 LDKnativeDescription *inner;
17493 * Indicates that this is the only struct which contains the same pointer.
17494 * Rust functions which take ownership of an object provided via an argument require
17495 * this to be true and invalidate the object pointed to by inner.
17501 * The contents of CResult_DescriptionCreationErrorZ
17503 typedef union LDKCResult_DescriptionCreationErrorZPtr {
17505 * A pointer to the contents in the success state.
17506 * Reading from this pointer when `result_ok` is not set is undefined.
17508 struct LDKDescription *result;
17510 * A pointer to the contents in the error state.
17511 * Reading from this pointer when `result_ok` is set is undefined.
17513 enum LDKCreationError *err;
17514 } LDKCResult_DescriptionCreationErrorZPtr;
17517 * A CResult_DescriptionCreationErrorZ represents the result of a fallible operation,
17518 * containing a crate::lightning_invoice::Description on success and a crate::lightning_invoice::CreationError on failure.
17519 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17521 typedef struct LDKCResult_DescriptionCreationErrorZ {
17523 * The contents of this CResult_DescriptionCreationErrorZ, accessible via either
17524 * `err` or `result` depending on the state of `result_ok`.
17526 union LDKCResult_DescriptionCreationErrorZPtr contents;
17528 * Whether this CResult_DescriptionCreationErrorZ represents a success state.
17531 } LDKCResult_DescriptionCreationErrorZ;
17534 * The contents of CResult_PrivateRouteCreationErrorZ
17536 typedef union LDKCResult_PrivateRouteCreationErrorZPtr {
17538 * A pointer to the contents in the success state.
17539 * Reading from this pointer when `result_ok` is not set is undefined.
17541 struct LDKPrivateRoute *result;
17543 * A pointer to the contents in the error state.
17544 * Reading from this pointer when `result_ok` is set is undefined.
17546 enum LDKCreationError *err;
17547 } LDKCResult_PrivateRouteCreationErrorZPtr;
17550 * A CResult_PrivateRouteCreationErrorZ represents the result of a fallible operation,
17551 * containing a crate::lightning_invoice::PrivateRoute on success and a crate::lightning_invoice::CreationError on failure.
17552 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17554 typedef struct LDKCResult_PrivateRouteCreationErrorZ {
17556 * The contents of this CResult_PrivateRouteCreationErrorZ, accessible via either
17557 * `err` or `result` depending on the state of `result_ok`.
17559 union LDKCResult_PrivateRouteCreationErrorZPtr contents;
17561 * Whether this CResult_PrivateRouteCreationErrorZ represents a success state.
17564 } LDKCResult_PrivateRouteCreationErrorZ;
17567 * The contents of CResult_OutPointDecodeErrorZ
17569 typedef union LDKCResult_OutPointDecodeErrorZPtr {
17571 * A pointer to the contents in the success state.
17572 * Reading from this pointer when `result_ok` is not set is undefined.
17574 struct LDKOutPoint *result;
17576 * A pointer to the contents in the error state.
17577 * Reading from this pointer when `result_ok` is set is undefined.
17579 struct LDKDecodeError *err;
17580 } LDKCResult_OutPointDecodeErrorZPtr;
17583 * A CResult_OutPointDecodeErrorZ represents the result of a fallible operation,
17584 * containing a crate::lightning::chain::transaction::OutPoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
17585 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17587 typedef struct LDKCResult_OutPointDecodeErrorZ {
17589 * The contents of this CResult_OutPointDecodeErrorZ, accessible via either
17590 * `err` or `result` depending on the state of `result_ok`.
17592 union LDKCResult_OutPointDecodeErrorZPtr contents;
17594 * Whether this CResult_OutPointDecodeErrorZ represents a success state.
17597 } LDKCResult_OutPointDecodeErrorZ;
17602 * Lightning TLV uses a custom variable-length integer called `BigSize`. It is similar to Bitcoin's
17603 * variable-length integers except that it is serialized in big-endian instead of little-endian.
17605 * Like Bitcoin's variable-length integer, it exhibits ambiguity in that certain values can be
17606 * encoded in several different ways, which we must check for at deserialization-time. Thus, if
17607 * you're looking for an example of a variable-length integer to use for your own project, move
17608 * along, this is a rather poor design.
17610 typedef struct MUST_USE_STRUCT LDKBigSize {
17612 * A pointer to the opaque Rust object.
17613 * Nearly everywhere, inner must be non-null, however in places where
17614 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17616 LDKnativeBigSize *inner;
17618 * Indicates that this is the only struct which contains the same pointer.
17619 * Rust functions which take ownership of an object provided via an argument require
17620 * this to be true and invalidate the object pointed to by inner.
17626 * The contents of CResult_BigSizeDecodeErrorZ
17628 typedef union LDKCResult_BigSizeDecodeErrorZPtr {
17630 * A pointer to the contents in the success state.
17631 * Reading from this pointer when `result_ok` is not set is undefined.
17633 struct LDKBigSize *result;
17635 * A pointer to the contents in the error state.
17636 * Reading from this pointer when `result_ok` is set is undefined.
17638 struct LDKDecodeError *err;
17639 } LDKCResult_BigSizeDecodeErrorZPtr;
17642 * A CResult_BigSizeDecodeErrorZ represents the result of a fallible operation,
17643 * containing a crate::lightning::util::ser::BigSize on success and a crate::lightning::ln::msgs::DecodeError on failure.
17644 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17646 typedef struct LDKCResult_BigSizeDecodeErrorZ {
17648 * The contents of this CResult_BigSizeDecodeErrorZ, accessible via either
17649 * `err` or `result` depending on the state of `result_ok`.
17651 union LDKCResult_BigSizeDecodeErrorZPtr contents;
17653 * Whether this CResult_BigSizeDecodeErrorZ represents a success state.
17656 } LDKCResult_BigSizeDecodeErrorZ;
17659 * The contents of CResult_HostnameDecodeErrorZ
17661 typedef union LDKCResult_HostnameDecodeErrorZPtr {
17663 * A pointer to the contents in the success state.
17664 * Reading from this pointer when `result_ok` is not set is undefined.
17666 struct LDKHostname *result;
17668 * A pointer to the contents in the error state.
17669 * Reading from this pointer when `result_ok` is set is undefined.
17671 struct LDKDecodeError *err;
17672 } LDKCResult_HostnameDecodeErrorZPtr;
17675 * A CResult_HostnameDecodeErrorZ represents the result of a fallible operation,
17676 * containing a crate::lightning::util::ser::Hostname on success and a crate::lightning::ln::msgs::DecodeError on failure.
17677 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17679 typedef struct LDKCResult_HostnameDecodeErrorZ {
17681 * The contents of this CResult_HostnameDecodeErrorZ, accessible via either
17682 * `err` or `result` depending on the state of `result_ok`.
17684 union LDKCResult_HostnameDecodeErrorZPtr contents;
17686 * Whether this CResult_HostnameDecodeErrorZ represents a success state.
17689 } LDKCResult_HostnameDecodeErrorZ;
17694 * A wrapper for a `Transaction` which can only be constructed with [`TransactionU16LenLimited::new`]
17695 * if the `Transaction`'s consensus-serialized length is <= u16::MAX.
17697 * Use [`TransactionU16LenLimited::into_transaction`] to convert into the contained `Transaction`.
17699 typedef struct MUST_USE_STRUCT LDKTransactionU16LenLimited {
17701 * A pointer to the opaque Rust object.
17702 * Nearly everywhere, inner must be non-null, however in places where
17703 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17705 LDKnativeTransactionU16LenLimited *inner;
17707 * Indicates that this is the only struct which contains the same pointer.
17708 * Rust functions which take ownership of an object provided via an argument require
17709 * this to be true and invalidate the object pointed to by inner.
17712 } LDKTransactionU16LenLimited;
17715 * The contents of CResult_TransactionU16LenLimitedNoneZ
17717 typedef union LDKCResult_TransactionU16LenLimitedNoneZPtr {
17719 * A pointer to the contents in the success state.
17720 * Reading from this pointer when `result_ok` is not set is undefined.
17722 struct LDKTransactionU16LenLimited *result;
17724 * Note that this value is always NULL, as there are no contents in the Err variant
17727 } LDKCResult_TransactionU16LenLimitedNoneZPtr;
17730 * A CResult_TransactionU16LenLimitedNoneZ represents the result of a fallible operation,
17731 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a () on failure.
17732 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17734 typedef struct LDKCResult_TransactionU16LenLimitedNoneZ {
17736 * The contents of this CResult_TransactionU16LenLimitedNoneZ, accessible via either
17737 * `err` or `result` depending on the state of `result_ok`.
17739 union LDKCResult_TransactionU16LenLimitedNoneZPtr contents;
17741 * Whether this CResult_TransactionU16LenLimitedNoneZ represents a success state.
17744 } LDKCResult_TransactionU16LenLimitedNoneZ;
17747 * The contents of CResult_TransactionU16LenLimitedDecodeErrorZ
17749 typedef union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr {
17751 * A pointer to the contents in the success state.
17752 * Reading from this pointer when `result_ok` is not set is undefined.
17754 struct LDKTransactionU16LenLimited *result;
17756 * A pointer to the contents in the error state.
17757 * Reading from this pointer when `result_ok` is set is undefined.
17759 struct LDKDecodeError *err;
17760 } LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr;
17763 * A CResult_TransactionU16LenLimitedDecodeErrorZ represents the result of a fallible operation,
17764 * containing a crate::lightning::util::ser::TransactionU16LenLimited on success and a crate::lightning::ln::msgs::DecodeError on failure.
17765 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17767 typedef struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ {
17769 * The contents of this CResult_TransactionU16LenLimitedDecodeErrorZ, accessible via either
17770 * `err` or `result` depending on the state of `result_ok`.
17772 union LDKCResult_TransactionU16LenLimitedDecodeErrorZPtr contents;
17774 * Whether this CResult_TransactionU16LenLimitedDecodeErrorZ represents a success state.
17777 } LDKCResult_TransactionU16LenLimitedDecodeErrorZ;
17780 * The contents of CResult_UntrustedStringDecodeErrorZ
17782 typedef union LDKCResult_UntrustedStringDecodeErrorZPtr {
17784 * A pointer to the contents in the success state.
17785 * Reading from this pointer when `result_ok` is not set is undefined.
17787 struct LDKUntrustedString *result;
17789 * A pointer to the contents in the error state.
17790 * Reading from this pointer when `result_ok` is set is undefined.
17792 struct LDKDecodeError *err;
17793 } LDKCResult_UntrustedStringDecodeErrorZPtr;
17796 * A CResult_UntrustedStringDecodeErrorZ represents the result of a fallible operation,
17797 * containing a crate::lightning::util::string::UntrustedString on success and a crate::lightning::ln::msgs::DecodeError on failure.
17798 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17800 typedef struct LDKCResult_UntrustedStringDecodeErrorZ {
17802 * The contents of this CResult_UntrustedStringDecodeErrorZ, accessible via either
17803 * `err` or `result` depending on the state of `result_ok`.
17805 union LDKCResult_UntrustedStringDecodeErrorZPtr contents;
17807 * Whether this CResult_UntrustedStringDecodeErrorZ represents a success state.
17810 } LDKCResult_UntrustedStringDecodeErrorZ;
17813 * A tuple of 2 elements. See the individual fields for the types contained.
17815 typedef struct LDKC2Tuple__u832u16Z {
17817 * The element at position 0
17819 struct LDKThirtyTwoBytes a;
17821 * The element at position 1
17824 } LDKC2Tuple__u832u16Z;
17829 * Parameters for relaying over a given [`BlindedHop`].
17831 * [`BlindedHop`]: crate::blinded_path::BlindedHop
17833 typedef struct MUST_USE_STRUCT LDKPaymentRelay {
17835 * A pointer to the opaque Rust object.
17836 * Nearly everywhere, inner must be non-null, however in places where
17837 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17839 LDKnativePaymentRelay *inner;
17841 * Indicates that this is the only struct which contains the same pointer.
17842 * Rust functions which take ownership of an object provided via an argument require
17843 * this to be true and invalidate the object pointed to by inner.
17849 * The contents of CResult_PaymentRelayDecodeErrorZ
17851 typedef union LDKCResult_PaymentRelayDecodeErrorZPtr {
17853 * A pointer to the contents in the success state.
17854 * Reading from this pointer when `result_ok` is not set is undefined.
17856 struct LDKPaymentRelay *result;
17858 * A pointer to the contents in the error state.
17859 * Reading from this pointer when `result_ok` is set is undefined.
17861 struct LDKDecodeError *err;
17862 } LDKCResult_PaymentRelayDecodeErrorZPtr;
17865 * A CResult_PaymentRelayDecodeErrorZ represents the result of a fallible operation,
17866 * containing a crate::lightning::blinded_path::payment::PaymentRelay on success and a crate::lightning::ln::msgs::DecodeError on failure.
17867 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17869 typedef struct LDKCResult_PaymentRelayDecodeErrorZ {
17871 * The contents of this CResult_PaymentRelayDecodeErrorZ, accessible via either
17872 * `err` or `result` depending on the state of `result_ok`.
17874 union LDKCResult_PaymentRelayDecodeErrorZPtr contents;
17876 * Whether this CResult_PaymentRelayDecodeErrorZ represents a success state.
17879 } LDKCResult_PaymentRelayDecodeErrorZ;
17884 * Constraints for relaying over a given [`BlindedHop`].
17886 * [`BlindedHop`]: crate::blinded_path::BlindedHop
17888 typedef struct MUST_USE_STRUCT LDKPaymentConstraints {
17890 * A pointer to the opaque Rust object.
17891 * Nearly everywhere, inner must be non-null, however in places where
17892 * the Rust equivalent takes an Option, it may be set to null to indicate None.
17894 LDKnativePaymentConstraints *inner;
17896 * Indicates that this is the only struct which contains the same pointer.
17897 * Rust functions which take ownership of an object provided via an argument require
17898 * this to be true and invalidate the object pointed to by inner.
17901 } LDKPaymentConstraints;
17904 * The contents of CResult_PaymentConstraintsDecodeErrorZ
17906 typedef union LDKCResult_PaymentConstraintsDecodeErrorZPtr {
17908 * A pointer to the contents in the success state.
17909 * Reading from this pointer when `result_ok` is not set is undefined.
17911 struct LDKPaymentConstraints *result;
17913 * A pointer to the contents in the error state.
17914 * Reading from this pointer when `result_ok` is set is undefined.
17916 struct LDKDecodeError *err;
17917 } LDKCResult_PaymentConstraintsDecodeErrorZPtr;
17920 * A CResult_PaymentConstraintsDecodeErrorZ represents the result of a fallible operation,
17921 * containing a crate::lightning::blinded_path::payment::PaymentConstraints on success and a crate::lightning::ln::msgs::DecodeError on failure.
17922 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17924 typedef struct LDKCResult_PaymentConstraintsDecodeErrorZ {
17926 * The contents of this CResult_PaymentConstraintsDecodeErrorZ, accessible via either
17927 * `err` or `result` depending on the state of `result_ok`.
17929 union LDKCResult_PaymentConstraintsDecodeErrorZPtr contents;
17931 * Whether this CResult_PaymentConstraintsDecodeErrorZ represents a success state.
17934 } LDKCResult_PaymentConstraintsDecodeErrorZ;
17937 * A tuple of 3 elements. See the individual fields for the types contained.
17939 typedef struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ {
17941 * The element at position 0
17943 struct LDKThirtyTwoBytes a;
17945 * The element at position 1
17947 struct LDKRecipientOnionFields b;
17949 * The element at position 2
17951 struct LDKRouteParameters c;
17952 } LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ;
17955 * The contents of CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ
17957 typedef union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr {
17959 * A pointer to the contents in the success state.
17960 * Reading from this pointer when `result_ok` is not set is undefined.
17962 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *result;
17964 * Note that this value is always NULL, as there are no contents in the Err variant
17967 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr;
17970 * A CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents the result of a fallible operation,
17971 * containing a crate::c_types::derived::C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ on success and a () on failure.
17972 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
17974 typedef struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ {
17976 * The contents of this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ, accessible via either
17977 * `err` or `result` depending on the state of `result_ok`.
17979 union LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZPtr contents;
17981 * Whether this CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ represents a success state.
17984 } LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ;
17987 * The contents of CResult_StrSecp256k1ErrorZ
17989 typedef union LDKCResult_StrSecp256k1ErrorZPtr {
17991 * A pointer to the contents in the success state.
17992 * Reading from this pointer when `result_ok` is not set is undefined.
17994 struct LDKStr *result;
17996 * A pointer to the contents in the error state.
17997 * Reading from this pointer when `result_ok` is set is undefined.
17999 enum LDKSecp256k1Error *err;
18000 } LDKCResult_StrSecp256k1ErrorZPtr;
18003 * A CResult_StrSecp256k1ErrorZ represents the result of a fallible operation,
18004 * containing a crate::c_types::Str on success and a crate::c_types::Secp256k1Error on failure.
18005 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18007 typedef struct LDKCResult_StrSecp256k1ErrorZ {
18009 * The contents of this CResult_StrSecp256k1ErrorZ, accessible via either
18010 * `err` or `result` depending on the state of `result_ok`.
18012 union LDKCResult_StrSecp256k1ErrorZPtr contents;
18014 * Whether this CResult_StrSecp256k1ErrorZ represents a success state.
18017 } LDKCResult_StrSecp256k1ErrorZ;
18020 * A tuple of 3 elements. See the individual fields for the types contained.
18022 typedef struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ {
18024 * The element at position 0
18026 struct LDKPublicKey a;
18028 * The element at position 1
18030 struct LDKOnionMessage b;
18032 * The element at position 2
18034 struct LDKCOption_CVec_SocketAddressZZ c;
18035 } LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ;
18038 * Errors that may occur when [sending an onion message].
18040 * [sending an onion message]: OnionMessenger::send_onion_message
18042 typedef enum LDKSendError_Tag {
18044 * Errored computing onion message packet keys.
18046 LDKSendError_Secp256k1,
18048 * Because implementations such as Eclair will drop onion messages where the message packet
18049 * exceeds 32834 bytes, we refuse to send messages where the packet exceeds this size.
18051 LDKSendError_TooBigPacket,
18053 * The provided [`Destination`] was an invalid [`BlindedPath`] due to not having any blinded
18056 LDKSendError_TooFewBlindedHops,
18058 * The first hop is not a peer and doesn't have a known [`SocketAddress`].
18060 LDKSendError_InvalidFirstHop,
18062 * A path from the sender to the destination could not be found by the [`MessageRouter`].
18064 LDKSendError_PathNotFound,
18066 * Onion message contents must have a TLV type >= 64.
18068 LDKSendError_InvalidMessage,
18070 * Our next-hop peer's buffer was full or our total outbound buffer was full.
18072 LDKSendError_BufferFull,
18074 * Failed to retrieve our node id from the provided [`NodeSigner`].
18076 * [`NodeSigner`]: crate::sign::NodeSigner
18078 LDKSendError_GetNodeIdFailed,
18080 * We attempted to send to a blinded path where we are the introduction node, and failed to
18081 * advance the blinded path to make the second hop the new introduction node. Either
18082 * [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the
18083 * new blinding point, or we were attempting to send to ourselves.
18085 LDKSendError_BlindedPathAdvanceFailed,
18087 * Must be last for serialization purposes
18089 LDKSendError_Sentinel,
18090 } LDKSendError_Tag;
18092 typedef struct MUST_USE_STRUCT LDKSendError {
18093 LDKSendError_Tag tag;
18096 enum LDKSecp256k1Error secp256k1;
18099 struct LDKPublicKey invalid_first_hop;
18105 * The contents of CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ
18107 typedef union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr {
18109 * A pointer to the contents in the success state.
18110 * Reading from this pointer when `result_ok` is not set is undefined.
18112 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *result;
18114 * A pointer to the contents in the error state.
18115 * Reading from this pointer when `result_ok` is set is undefined.
18117 struct LDKSendError *err;
18118 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr;
18121 * A CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents the result of a fallible operation,
18122 * containing a crate::c_types::derived::C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ on success and a crate::lightning::onion_message::messenger::SendError on failure.
18123 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18125 typedef struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ {
18127 * The contents of this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ, accessible via either
18128 * `err` or `result` depending on the state of `result_ok`.
18130 union LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZPtr contents;
18132 * Whether this CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ represents a success state.
18135 } LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ;
18138 * The contents of an [`OnionMessage`] as read from the wire.
18140 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
18142 typedef enum LDKParsedOnionMessageContents_Tag {
18144 * A message related to BOLT 12 Offers.
18146 LDKParsedOnionMessageContents_Offers,
18148 * A custom onion message specified by the user.
18150 LDKParsedOnionMessageContents_Custom,
18152 * Must be last for serialization purposes
18154 LDKParsedOnionMessageContents_Sentinel,
18155 } LDKParsedOnionMessageContents_Tag;
18157 typedef struct MUST_USE_STRUCT LDKParsedOnionMessageContents {
18158 LDKParsedOnionMessageContents_Tag tag;
18161 struct LDKOffersMessage offers;
18164 struct LDKOnionMessageContents custom;
18167 } LDKParsedOnionMessageContents;
18170 * A processed incoming onion message, containing either a Forward (another onion message)
18171 * or a Receive payload with decrypted contents.
18173 typedef enum LDKPeeledOnion_Tag {
18175 * Forwarded onion, with the next node id and a new onion
18177 LDKPeeledOnion_Forward,
18179 * Received onion message, with decrypted contents, path_id, and reply path
18181 LDKPeeledOnion_Receive,
18183 * Must be last for serialization purposes
18185 LDKPeeledOnion_Sentinel,
18186 } LDKPeeledOnion_Tag;
18188 typedef struct LDKPeeledOnion_LDKForward_Body {
18189 struct LDKPublicKey _0;
18190 struct LDKOnionMessage _1;
18191 } LDKPeeledOnion_LDKForward_Body;
18193 typedef struct LDKPeeledOnion_LDKReceive_Body {
18194 struct LDKParsedOnionMessageContents _0;
18197 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18199 struct LDKThirtyTwoBytes _1;
18202 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
18204 struct LDKBlindedPath _2;
18205 } LDKPeeledOnion_LDKReceive_Body;
18207 typedef struct MUST_USE_STRUCT LDKPeeledOnion {
18208 LDKPeeledOnion_Tag tag;
18210 LDKPeeledOnion_LDKForward_Body forward;
18211 LDKPeeledOnion_LDKReceive_Body receive;
18216 * The contents of CResult_PeeledOnionNoneZ
18218 typedef union LDKCResult_PeeledOnionNoneZPtr {
18220 * A pointer to the contents in the success state.
18221 * Reading from this pointer when `result_ok` is not set is undefined.
18223 struct LDKPeeledOnion *result;
18225 * Note that this value is always NULL, as there are no contents in the Err variant
18228 } LDKCResult_PeeledOnionNoneZPtr;
18231 * A CResult_PeeledOnionNoneZ represents the result of a fallible operation,
18232 * containing a crate::lightning::onion_message::messenger::PeeledOnion on success and a () on failure.
18233 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18235 typedef struct LDKCResult_PeeledOnionNoneZ {
18237 * The contents of this CResult_PeeledOnionNoneZ, accessible via either
18238 * `err` or `result` depending on the state of `result_ok`.
18240 union LDKCResult_PeeledOnionNoneZPtr contents;
18242 * Whether this CResult_PeeledOnionNoneZ represents a success state.
18245 } LDKCResult_PeeledOnionNoneZ;
18248 * Result of successfully [sending an onion message].
18250 * [sending an onion message]: OnionMessenger::send_onion_message
18252 typedef enum LDKSendSuccess_Tag {
18254 * The message was buffered and will be sent once it is processed by
18255 * [`OnionMessageHandler::next_onion_message_for_peer`].
18257 LDKSendSuccess_Buffered,
18259 * The message was buffered and will be sent once the node is connected as a peer and it is
18260 * processed by [`OnionMessageHandler::next_onion_message_for_peer`].
18262 LDKSendSuccess_BufferedAwaitingConnection,
18264 * Must be last for serialization purposes
18266 LDKSendSuccess_Sentinel,
18267 } LDKSendSuccess_Tag;
18269 typedef struct MUST_USE_STRUCT LDKSendSuccess {
18270 LDKSendSuccess_Tag tag;
18273 struct LDKPublicKey buffered_awaiting_connection;
18279 * The contents of CResult_SendSuccessSendErrorZ
18281 typedef union LDKCResult_SendSuccessSendErrorZPtr {
18283 * A pointer to the contents in the success state.
18284 * Reading from this pointer when `result_ok` is not set is undefined.
18286 struct LDKSendSuccess *result;
18288 * A pointer to the contents in the error state.
18289 * Reading from this pointer when `result_ok` is set is undefined.
18291 struct LDKSendError *err;
18292 } LDKCResult_SendSuccessSendErrorZPtr;
18295 * A CResult_SendSuccessSendErrorZ represents the result of a fallible operation,
18296 * containing a crate::lightning::onion_message::messenger::SendSuccess on success and a crate::lightning::onion_message::messenger::SendError on failure.
18297 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18299 typedef struct LDKCResult_SendSuccessSendErrorZ {
18301 * The contents of this CResult_SendSuccessSendErrorZ, accessible via either
18302 * `err` or `result` depending on the state of `result_ok`.
18304 union LDKCResult_SendSuccessSendErrorZPtr contents;
18306 * Whether this CResult_SendSuccessSendErrorZ represents a success state.
18309 } LDKCResult_SendSuccessSendErrorZ;
18312 * The contents of CResult_BlindedPathNoneZ
18314 typedef union LDKCResult_BlindedPathNoneZPtr {
18316 * A pointer to the contents in the success state.
18317 * Reading from this pointer when `result_ok` is not set is undefined.
18319 struct LDKBlindedPath *result;
18321 * Note that this value is always NULL, as there are no contents in the Err variant
18324 } LDKCResult_BlindedPathNoneZPtr;
18327 * A CResult_BlindedPathNoneZ represents the result of a fallible operation,
18328 * containing a crate::lightning::blinded_path::BlindedPath on success and a () on failure.
18329 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18331 typedef struct LDKCResult_BlindedPathNoneZ {
18333 * The contents of this CResult_BlindedPathNoneZ, accessible via either
18334 * `err` or `result` depending on the state of `result_ok`.
18336 union LDKCResult_BlindedPathNoneZPtr contents;
18338 * Whether this CResult_BlindedPathNoneZ represents a success state.
18341 } LDKCResult_BlindedPathNoneZ;
18344 * The contents of CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ
18346 typedef union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr {
18348 * A pointer to the contents in the success state.
18349 * Reading from this pointer when `result_ok` is not set is undefined.
18351 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *result;
18353 * Note that this value is always NULL, as there are no contents in the Err variant
18356 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr;
18359 * A CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents the result of a fallible operation,
18360 * containing a crate::c_types::derived::C2Tuple_BlindedPayInfoBlindedPathZ on success and a () on failure.
18361 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18363 typedef struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ {
18365 * The contents of this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ, accessible via either
18366 * `err` or `result` depending on the state of `result_ok`.
18368 union LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZPtr contents;
18370 * Whether this CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ represents a success state.
18373 } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ;
18378 * An intermediate node, its outbound channel, and relay parameters.
18380 typedef struct MUST_USE_STRUCT LDKForwardNode {
18382 * A pointer to the opaque Rust object.
18383 * Nearly everywhere, inner must be non-null, however in places where
18384 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18386 LDKnativeForwardNode *inner;
18388 * Indicates that this is the only struct which contains the same pointer.
18389 * Rust functions which take ownership of an object provided via an argument require
18390 * this to be true and invalidate the object pointed to by inner.
18396 * A dynamically-allocated array of crate::lightning::blinded_path::payment::ForwardNodes of arbitrary size.
18397 * This corresponds to std::vector in C++
18399 typedef struct LDKCVec_ForwardNodeZ {
18401 * The elements in the array.
18402 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
18404 struct LDKForwardNode *data;
18406 * The number of elements pointed to by `data`.
18409 } LDKCVec_ForwardNodeZ;
18412 * The contents of CResult_BlindedPathDecodeErrorZ
18414 typedef union LDKCResult_BlindedPathDecodeErrorZPtr {
18416 * A pointer to the contents in the success state.
18417 * Reading from this pointer when `result_ok` is not set is undefined.
18419 struct LDKBlindedPath *result;
18421 * A pointer to the contents in the error state.
18422 * Reading from this pointer when `result_ok` is set is undefined.
18424 struct LDKDecodeError *err;
18425 } LDKCResult_BlindedPathDecodeErrorZPtr;
18428 * A CResult_BlindedPathDecodeErrorZ represents the result of a fallible operation,
18429 * containing a crate::lightning::blinded_path::BlindedPath on success and a crate::lightning::ln::msgs::DecodeError on failure.
18430 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18432 typedef struct LDKCResult_BlindedPathDecodeErrorZ {
18434 * The contents of this CResult_BlindedPathDecodeErrorZ, accessible via either
18435 * `err` or `result` depending on the state of `result_ok`.
18437 union LDKCResult_BlindedPathDecodeErrorZPtr contents;
18439 * Whether this CResult_BlindedPathDecodeErrorZ represents a success state.
18442 } LDKCResult_BlindedPathDecodeErrorZ;
18445 * The contents of CResult_BlindedHopDecodeErrorZ
18447 typedef union LDKCResult_BlindedHopDecodeErrorZPtr {
18449 * A pointer to the contents in the success state.
18450 * Reading from this pointer when `result_ok` is not set is undefined.
18452 struct LDKBlindedHop *result;
18454 * A pointer to the contents in the error state.
18455 * Reading from this pointer when `result_ok` is set is undefined.
18457 struct LDKDecodeError *err;
18458 } LDKCResult_BlindedHopDecodeErrorZPtr;
18461 * A CResult_BlindedHopDecodeErrorZ represents the result of a fallible operation,
18462 * containing a crate::lightning::blinded_path::BlindedHop on success and a crate::lightning::ln::msgs::DecodeError on failure.
18463 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18465 typedef struct LDKCResult_BlindedHopDecodeErrorZ {
18467 * The contents of this CResult_BlindedHopDecodeErrorZ, accessible via either
18468 * `err` or `result` depending on the state of `result_ok`.
18470 union LDKCResult_BlindedHopDecodeErrorZPtr contents;
18472 * Whether this CResult_BlindedHopDecodeErrorZ represents a success state.
18475 } LDKCResult_BlindedHopDecodeErrorZ;
18478 * The contents of CResult_InvoiceErrorDecodeErrorZ
18480 typedef union LDKCResult_InvoiceErrorDecodeErrorZPtr {
18482 * A pointer to the contents in the success state.
18483 * Reading from this pointer when `result_ok` is not set is undefined.
18485 struct LDKInvoiceError *result;
18487 * A pointer to the contents in the error state.
18488 * Reading from this pointer when `result_ok` is set is undefined.
18490 struct LDKDecodeError *err;
18491 } LDKCResult_InvoiceErrorDecodeErrorZPtr;
18494 * A CResult_InvoiceErrorDecodeErrorZ represents the result of a fallible operation,
18495 * containing a crate::lightning::offers::invoice_error::InvoiceError on success and a crate::lightning::ln::msgs::DecodeError on failure.
18496 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18498 typedef struct LDKCResult_InvoiceErrorDecodeErrorZ {
18500 * The contents of this CResult_InvoiceErrorDecodeErrorZ, accessible via either
18501 * `err` or `result` depending on the state of `result_ok`.
18503 union LDKCResult_InvoiceErrorDecodeErrorZPtr contents;
18505 * Whether this CResult_InvoiceErrorDecodeErrorZ represents a success state.
18508 } LDKCResult_InvoiceErrorDecodeErrorZ;
18513 * Base key used in conjunction with a `per_commitment_point` to generate a [`DelayedPaymentKey`].
18515 * The delayed payment key is used to pay the commitment state broadcaster their
18516 * non-HTLC-encumbered funds after a delay to give their counterparty a chance to punish if the
18517 * state broadcasted was previously revoked.
18519 typedef struct MUST_USE_STRUCT LDKDelayedPaymentBasepoint {
18521 * A pointer to the opaque Rust object.
18522 * Nearly everywhere, inner must be non-null, however in places where
18523 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18525 LDKnativeDelayedPaymentBasepoint *inner;
18527 * Indicates that this is the only struct which contains the same pointer.
18528 * Rust functions which take ownership of an object provided via an argument require
18529 * this to be true and invalidate the object pointed to by inner.
18532 } LDKDelayedPaymentBasepoint;
18535 * The contents of CResult_DelayedPaymentBasepointDecodeErrorZ
18537 typedef union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr {
18539 * A pointer to the contents in the success state.
18540 * Reading from this pointer when `result_ok` is not set is undefined.
18542 struct LDKDelayedPaymentBasepoint *result;
18544 * A pointer to the contents in the error state.
18545 * Reading from this pointer when `result_ok` is set is undefined.
18547 struct LDKDecodeError *err;
18548 } LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr;
18551 * A CResult_DelayedPaymentBasepointDecodeErrorZ represents the result of a fallible operation,
18552 * containing a crate::lightning::ln::channel_keys::DelayedPaymentBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
18553 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18555 typedef struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ {
18557 * The contents of this CResult_DelayedPaymentBasepointDecodeErrorZ, accessible via either
18558 * `err` or `result` depending on the state of `result_ok`.
18560 union LDKCResult_DelayedPaymentBasepointDecodeErrorZPtr contents;
18562 * Whether this CResult_DelayedPaymentBasepointDecodeErrorZ represents a success state.
18565 } LDKCResult_DelayedPaymentBasepointDecodeErrorZ;
18570 * A derived key built from a [`DelayedPaymentBasepoint`] and `per_commitment_point`.
18572 * The delayed payment key is used to pay the commitment state broadcaster their
18573 * non-HTLC-encumbered funds after a delay. This delay gives their counterparty a chance to
18574 * punish and claim all the channel funds if the state broadcasted was previously revoked.
18576 * [See the BOLT specs]
18577 * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
18578 * for more information on key derivation details.
18580 typedef struct MUST_USE_STRUCT LDKDelayedPaymentKey {
18582 * A pointer to the opaque Rust object.
18583 * Nearly everywhere, inner must be non-null, however in places where
18584 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18586 LDKnativeDelayedPaymentKey *inner;
18588 * Indicates that this is the only struct which contains the same pointer.
18589 * Rust functions which take ownership of an object provided via an argument require
18590 * this to be true and invalidate the object pointed to by inner.
18593 } LDKDelayedPaymentKey;
18596 * The contents of CResult_DelayedPaymentKeyDecodeErrorZ
18598 typedef union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr {
18600 * A pointer to the contents in the success state.
18601 * Reading from this pointer when `result_ok` is not set is undefined.
18603 struct LDKDelayedPaymentKey *result;
18605 * A pointer to the contents in the error state.
18606 * Reading from this pointer when `result_ok` is set is undefined.
18608 struct LDKDecodeError *err;
18609 } LDKCResult_DelayedPaymentKeyDecodeErrorZPtr;
18612 * A CResult_DelayedPaymentKeyDecodeErrorZ represents the result of a fallible operation,
18613 * containing a crate::lightning::ln::channel_keys::DelayedPaymentKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
18614 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18616 typedef struct LDKCResult_DelayedPaymentKeyDecodeErrorZ {
18618 * The contents of this CResult_DelayedPaymentKeyDecodeErrorZ, accessible via either
18619 * `err` or `result` depending on the state of `result_ok`.
18621 union LDKCResult_DelayedPaymentKeyDecodeErrorZPtr contents;
18623 * Whether this CResult_DelayedPaymentKeyDecodeErrorZ represents a success state.
18626 } LDKCResult_DelayedPaymentKeyDecodeErrorZ;
18631 * Base key used in conjunction with a `per_commitment_point` to generate an [`HtlcKey`].
18633 * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
18634 * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
18635 * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
18637 typedef struct MUST_USE_STRUCT LDKHtlcBasepoint {
18639 * A pointer to the opaque Rust object.
18640 * Nearly everywhere, inner must be non-null, however in places where
18641 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18643 LDKnativeHtlcBasepoint *inner;
18645 * Indicates that this is the only struct which contains the same pointer.
18646 * Rust functions which take ownership of an object provided via an argument require
18647 * this to be true and invalidate the object pointed to by inner.
18650 } LDKHtlcBasepoint;
18653 * The contents of CResult_HtlcBasepointDecodeErrorZ
18655 typedef union LDKCResult_HtlcBasepointDecodeErrorZPtr {
18657 * A pointer to the contents in the success state.
18658 * Reading from this pointer when `result_ok` is not set is undefined.
18660 struct LDKHtlcBasepoint *result;
18662 * A pointer to the contents in the error state.
18663 * Reading from this pointer when `result_ok` is set is undefined.
18665 struct LDKDecodeError *err;
18666 } LDKCResult_HtlcBasepointDecodeErrorZPtr;
18669 * A CResult_HtlcBasepointDecodeErrorZ represents the result of a fallible operation,
18670 * containing a crate::lightning::ln::channel_keys::HtlcBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
18671 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18673 typedef struct LDKCResult_HtlcBasepointDecodeErrorZ {
18675 * The contents of this CResult_HtlcBasepointDecodeErrorZ, accessible via either
18676 * `err` or `result` depending on the state of `result_ok`.
18678 union LDKCResult_HtlcBasepointDecodeErrorZPtr contents;
18680 * Whether this CResult_HtlcBasepointDecodeErrorZ represents a success state.
18683 } LDKCResult_HtlcBasepointDecodeErrorZ;
18688 * A derived key built from a [`HtlcBasepoint`] and `per_commitment_point`.
18690 * HTLC keys are used to ensure only the recipient of an HTLC can claim it on-chain with the HTLC
18691 * preimage and that only the sender of an HTLC can claim it on-chain after it has timed out.
18692 * Thus, both channel counterparties' HTLC keys will appears in each HTLC output's script.
18694 * [See the BOLT specs]
18695 * (https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation)
18696 * for more information on key derivation details.
18698 typedef struct MUST_USE_STRUCT LDKHtlcKey {
18700 * A pointer to the opaque Rust object.
18701 * Nearly everywhere, inner must be non-null, however in places where
18702 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18704 LDKnativeHtlcKey *inner;
18706 * Indicates that this is the only struct which contains the same pointer.
18707 * Rust functions which take ownership of an object provided via an argument require
18708 * this to be true and invalidate the object pointed to by inner.
18714 * The contents of CResult_HtlcKeyDecodeErrorZ
18716 typedef union LDKCResult_HtlcKeyDecodeErrorZPtr {
18718 * A pointer to the contents in the success state.
18719 * Reading from this pointer when `result_ok` is not set is undefined.
18721 struct LDKHtlcKey *result;
18723 * A pointer to the contents in the error state.
18724 * Reading from this pointer when `result_ok` is set is undefined.
18726 struct LDKDecodeError *err;
18727 } LDKCResult_HtlcKeyDecodeErrorZPtr;
18730 * A CResult_HtlcKeyDecodeErrorZ represents the result of a fallible operation,
18731 * containing a crate::lightning::ln::channel_keys::HtlcKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
18732 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18734 typedef struct LDKCResult_HtlcKeyDecodeErrorZ {
18736 * The contents of this CResult_HtlcKeyDecodeErrorZ, accessible via either
18737 * `err` or `result` depending on the state of `result_ok`.
18739 union LDKCResult_HtlcKeyDecodeErrorZPtr contents;
18741 * Whether this CResult_HtlcKeyDecodeErrorZ represents a success state.
18744 } LDKCResult_HtlcKeyDecodeErrorZ;
18749 * Master key used in conjunction with per_commitment_point to generate [htlcpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
18750 * A watcher can be given a [RevocationBasepoint] to generate per commitment [RevocationKey] to create justice transactions.
18752 typedef struct MUST_USE_STRUCT LDKRevocationBasepoint {
18754 * A pointer to the opaque Rust object.
18755 * Nearly everywhere, inner must be non-null, however in places where
18756 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18758 LDKnativeRevocationBasepoint *inner;
18760 * Indicates that this is the only struct which contains the same pointer.
18761 * Rust functions which take ownership of an object provided via an argument require
18762 * this to be true and invalidate the object pointed to by inner.
18765 } LDKRevocationBasepoint;
18768 * The contents of CResult_RevocationBasepointDecodeErrorZ
18770 typedef union LDKCResult_RevocationBasepointDecodeErrorZPtr {
18772 * A pointer to the contents in the success state.
18773 * Reading from this pointer when `result_ok` is not set is undefined.
18775 struct LDKRevocationBasepoint *result;
18777 * A pointer to the contents in the error state.
18778 * Reading from this pointer when `result_ok` is set is undefined.
18780 struct LDKDecodeError *err;
18781 } LDKCResult_RevocationBasepointDecodeErrorZPtr;
18784 * A CResult_RevocationBasepointDecodeErrorZ represents the result of a fallible operation,
18785 * containing a crate::lightning::ln::channel_keys::RevocationBasepoint on success and a crate::lightning::ln::msgs::DecodeError on failure.
18786 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18788 typedef struct LDKCResult_RevocationBasepointDecodeErrorZ {
18790 * The contents of this CResult_RevocationBasepointDecodeErrorZ, accessible via either
18791 * `err` or `result` depending on the state of `result_ok`.
18793 union LDKCResult_RevocationBasepointDecodeErrorZPtr contents;
18795 * Whether this CResult_RevocationBasepointDecodeErrorZ represents a success state.
18798 } LDKCResult_RevocationBasepointDecodeErrorZ;
18803 * The revocation key is used to allow a channel party to revoke their state - giving their
18804 * counterparty the required material to claim all of their funds if they broadcast that state.
18806 * Each commitment transaction has a revocation key based on the basepoint and
18807 * per_commitment_point which is used in both commitment and HTLC transactions.
18809 * See [the BOLT spec for derivation details]
18810 * (https://github.com/lightning/bolts/blob/master/03-transactions.md#revocationpubkey-derivation)
18812 typedef struct MUST_USE_STRUCT LDKRevocationKey {
18814 * A pointer to the opaque Rust object.
18815 * Nearly everywhere, inner must be non-null, however in places where
18816 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18818 LDKnativeRevocationKey *inner;
18820 * Indicates that this is the only struct which contains the same pointer.
18821 * Rust functions which take ownership of an object provided via an argument require
18822 * this to be true and invalidate the object pointed to by inner.
18825 } LDKRevocationKey;
18828 * The contents of CResult_RevocationKeyDecodeErrorZ
18830 typedef union LDKCResult_RevocationKeyDecodeErrorZPtr {
18832 * A pointer to the contents in the success state.
18833 * Reading from this pointer when `result_ok` is not set is undefined.
18835 struct LDKRevocationKey *result;
18837 * A pointer to the contents in the error state.
18838 * Reading from this pointer when `result_ok` is set is undefined.
18840 struct LDKDecodeError *err;
18841 } LDKCResult_RevocationKeyDecodeErrorZPtr;
18844 * A CResult_RevocationKeyDecodeErrorZ represents the result of a fallible operation,
18845 * containing a crate::lightning::ln::channel_keys::RevocationKey on success and a crate::lightning::ln::msgs::DecodeError on failure.
18846 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
18848 typedef struct LDKCResult_RevocationKeyDecodeErrorZ {
18850 * The contents of this CResult_RevocationKeyDecodeErrorZ, accessible via either
18851 * `err` or `result` depending on the state of `result_ok`.
18853 union LDKCResult_RevocationKeyDecodeErrorZPtr contents;
18855 * Whether this CResult_RevocationKeyDecodeErrorZ represents a success state.
18858 } LDKCResult_RevocationKeyDecodeErrorZ;
18863 * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
18865 * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
18866 * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
18867 * [`Confirm::transactions_confirmed`].
18869 * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
18870 * may have been spent there. See [`Filter::register_output`] for details.
18872 * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
18873 * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
18875 typedef struct MUST_USE_STRUCT LDKWatchedOutput {
18877 * A pointer to the opaque Rust object.
18878 * Nearly everywhere, inner must be non-null, however in places where
18879 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18881 LDKnativeWatchedOutput *inner;
18883 * Indicates that this is the only struct which contains the same pointer.
18884 * Rust functions which take ownership of an object provided via an argument require
18885 * this to be true and invalidate the object pointed to by inner.
18888 } LDKWatchedOutput;
18891 * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
18894 * This is useful in order to have a [`Watch`] implementation convey to a chain source which
18895 * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
18896 * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
18897 * receiving full blocks from a chain source, any further filtering is unnecessary.
18899 * After an output has been registered, subsequent block retrievals from the chain source must not
18900 * exclude any transactions matching the new criteria nor any in-block descendants of such
18903 * Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
18904 * should not block on I/O. Implementations should instead queue the newly monitored data to be
18905 * processed later. Then, in order to block until the data has been processed, any [`Watch`]
18906 * invocation that has called the `Filter` must return [`InProgress`].
18908 * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
18909 * [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
18910 * [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
18912 typedef struct LDKFilter {
18914 * An opaque pointer which is passed to your function implementations as an argument.
18915 * This has no meaning in the LDK, and can be NULL or any other value.
18919 * Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
18920 * a spending condition.
18922 void (*register_tx)(const void *this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey);
18924 * Registers interest in spends of a transaction output.
18926 * Note that this method might be called during processing of a new block. You therefore need
18927 * to ensure that also dependent output spents within an already connected block are correctly
18928 * handled, e.g., by re-scanning the block in question whenever new outputs have been
18929 * registered mid-processing.
18931 void (*register_output)(const void *this_arg, struct LDKWatchedOutput output);
18933 * Frees any resources associated with this object given its this_arg pointer.
18934 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
18936 void (*free)(void *this_arg);
18940 * An enum which can either contain a crate::lightning::chain::Filter or not
18942 typedef enum LDKCOption_FilterZ_Tag {
18944 * When we're in this state, this COption_FilterZ contains a crate::lightning::chain::Filter
18946 LDKCOption_FilterZ_Some,
18948 * When we're in this state, this COption_FilterZ contains nothing
18950 LDKCOption_FilterZ_None,
18952 * Must be last for serialization purposes
18954 LDKCOption_FilterZ_Sentinel,
18955 } LDKCOption_FilterZ_Tag;
18957 typedef struct LDKCOption_FilterZ {
18958 LDKCOption_FilterZ_Tag tag;
18961 struct LDKFilter some;
18964 } LDKCOption_FilterZ;
18969 * A read-only reference to a current ChannelMonitor.
18971 * Note that this holds a mutex in [`ChainMonitor`] and may block other events until it is
18974 typedef struct MUST_USE_STRUCT LDKLockedChannelMonitor {
18976 * A pointer to the opaque Rust object.
18977 * Nearly everywhere, inner must be non-null, however in places where
18978 * the Rust equivalent takes an Option, it may be set to null to indicate None.
18980 LDKnativeLockedChannelMonitor *inner;
18982 * Indicates that this is the only struct which contains the same pointer.
18983 * Rust functions which take ownership of an object provided via an argument require
18984 * this to be true and invalidate the object pointed to by inner.
18987 } LDKLockedChannelMonitor;
18990 * The contents of CResult_LockedChannelMonitorNoneZ
18992 typedef union LDKCResult_LockedChannelMonitorNoneZPtr {
18994 * A pointer to the contents in the success state.
18995 * Reading from this pointer when `result_ok` is not set is undefined.
18997 struct LDKLockedChannelMonitor *result;
18999 * Note that this value is always NULL, as there are no contents in the Err variant
19002 } LDKCResult_LockedChannelMonitorNoneZPtr;
19005 * A CResult_LockedChannelMonitorNoneZ represents the result of a fallible operation,
19006 * containing a crate::lightning::chain::chainmonitor::LockedChannelMonitor on success and a () on failure.
19007 * `result_ok` indicates the overall state, and the contents are provided via `contents`.
19009 typedef struct LDKCResult_LockedChannelMonitorNoneZ {
19011 * The contents of this CResult_LockedChannelMonitorNoneZ, accessible via either
19012 * `err` or `result` depending on the state of `result_ok`.
19014 union LDKCResult_LockedChannelMonitorNoneZPtr contents;
19016 * Whether this CResult_LockedChannelMonitorNoneZ represents a success state.
19019 } LDKCResult_LockedChannelMonitorNoneZ;
19022 * A dynamically-allocated array of crate::lightning::chain::transaction::OutPoints of arbitrary size.
19023 * This corresponds to std::vector in C++
19025 typedef struct LDKCVec_OutPointZ {
19027 * The elements in the array.
19028 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
19030 struct LDKOutPoint *data;
19032 * The number of elements pointed to by `data`.
19035 } LDKCVec_OutPointZ;
19040 * An opaque identifier describing a specific [`Persist`] method call.
19042 typedef struct MUST_USE_STRUCT LDKMonitorUpdateId {
19044 * A pointer to the opaque Rust object.
19045 * Nearly everywhere, inner must be non-null, however in places where
19046 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19048 LDKnativeMonitorUpdateId *inner;
19050 * Indicates that this is the only struct which contains the same pointer.
19051 * Rust functions which take ownership of an object provided via an argument require
19052 * this to be true and invalidate the object pointed to by inner.
19055 } LDKMonitorUpdateId;
19058 * A dynamically-allocated array of crate::lightning::chain::chainmonitor::MonitorUpdateIds of arbitrary size.
19059 * This corresponds to std::vector in C++
19061 typedef struct LDKCVec_MonitorUpdateIdZ {
19063 * The elements in the array.
19064 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
19066 struct LDKMonitorUpdateId *data;
19068 * The number of elements pointed to by `data`.
19071 } LDKCVec_MonitorUpdateIdZ;
19074 * A tuple of 2 elements. See the individual fields for the types contained.
19076 typedef struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ {
19078 * The element at position 0
19080 struct LDKOutPoint a;
19082 * The element at position 1
19084 struct LDKCVec_MonitorUpdateIdZ b;
19085 } LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ;
19088 * A dynamically-allocated array of crate::c_types::derived::C2Tuple_OutPointCVec_MonitorUpdateIdZZs of arbitrary size.
19089 * This corresponds to std::vector in C++
19091 typedef struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ {
19093 * The elements in the array.
19094 * If datalen is non-0 this must be a valid, non-NULL pointer allocated by malloc().
19096 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *data;
19098 * The number of elements pointed to by `data`.
19101 } LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ;
19104 * Provides an interface that allows storage and retrieval of persisted values that are associated
19107 * In order to avoid collisions the key space is segmented based on the given `primary_namespace`s
19108 * and `secondary_namespace`s. Implementations of this trait are free to handle them in different
19109 * ways, as long as per-namespace key uniqueness is asserted.
19111 * Keys and namespaces are required to be valid ASCII strings in the range of
19112 * [`KVSTORE_NAMESPACE_KEY_ALPHABET`] and no longer than [`KVSTORE_NAMESPACE_KEY_MAX_LEN`]. Empty
19113 * primary namespaces and secondary namespaces (`\"\"`) are assumed to be a valid, however, if
19114 * `primary_namespace` is empty, `secondary_namespace` is required to be empty, too. This means
19115 * that concerns should always be separated by primary namespace first, before secondary
19116 * namespaces are used. While the number of primary namespaces will be relatively small and is
19117 * determined at compile time, there may be many secondary namespaces per primary namespace. Note
19118 * that per-namespace uniqueness needs to also hold for keys *and* namespaces in any given
19119 * namespace, i.e., conflicts between keys and equally named
19120 * primary namespaces/secondary namespaces must be avoided.
19122 * **Note:** Users migrating custom persistence backends from the pre-v0.0.117 `KVStorePersister`
19123 * interface can use a concatenation of `[{primary_namespace}/[{secondary_namespace}/]]{key}` to
19124 * recover a `key` compatible with the data model previously assumed by `KVStorePersister::persist`.
19126 typedef struct LDKKVStore {
19128 * An opaque pointer which is passed to your function implementations as an argument.
19129 * This has no meaning in the LDK, and can be NULL or any other value.
19133 * Returns the data stored for the given `primary_namespace`, `secondary_namespace`, and
19136 * Returns an [`ErrorKind::NotFound`] if the given `key` could not be found in the given
19137 * `primary_namespace` and `secondary_namespace`.
19139 * [`ErrorKind::NotFound`]: io::ErrorKind::NotFound
19141 struct LDKCResult_CVec_u8ZIOErrorZ (*read)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key);
19143 * Persists the given data under the given `key`.
19145 * Will create the given `primary_namespace` and `secondary_namespace` if not already present
19148 struct LDKCResult_NoneIOErrorZ (*write)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, struct LDKu8slice buf);
19150 * Removes any data that had previously been persisted under the given `key`.
19152 * If the `lazy` flag is set to `true`, the backend implementation might choose to lazily
19153 * remove the given `key` at some point in time after the method returns, e.g., as part of an
19154 * eventual batch deletion of multiple keys. As a consequence, subsequent calls to
19155 * [`KVStore::list`] might include the removed key until the changes are actually persisted.
19157 * Note that while setting the `lazy` flag reduces the I/O burden of multiple subsequent
19158 * `remove` calls, it also influences the atomicity guarantees as lazy `remove`s could
19159 * potentially get lost on crash after the method returns. Therefore, this flag should only be
19160 * set for `remove` operations that can be safely replayed at a later time.
19162 * Returns successfully if no data will be stored for the given `primary_namespace`,
19163 * `secondary_namespace`, and `key`, independently of whether it was present before its
19164 * invokation or not.
19166 struct LDKCResult_NoneIOErrorZ (*remove)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace, struct LDKStr key, bool lazy);
19168 * Returns a list of keys that are stored under the given `secondary_namespace` in
19169 * `primary_namespace`.
19171 * Returns the keys in arbitrary order, so users requiring a particular order need to sort the
19172 * returned keys. Returns an empty list if `primary_namespace` or `secondary_namespace` is unknown.
19174 struct LDKCResult_CVec_StrZIOErrorZ (*list)(const void *this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace);
19176 * Frees any resources associated with this object given its this_arg pointer.
19177 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19179 void (*free)(void *this_arg);
19183 * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk.
19185 typedef struct LDKPersister {
19187 * An opaque pointer which is passed to your function implementations as an argument.
19188 * This has no meaning in the LDK, and can be NULL or any other value.
19192 * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed.
19194 struct LDKCResult_NoneIOErrorZ (*persist_manager)(const void *this_arg, const struct LDKChannelManager *NONNULL_PTR channel_manager);
19196 * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed.
19198 struct LDKCResult_NoneIOErrorZ (*persist_graph)(const void *this_arg, const struct LDKNetworkGraph *NONNULL_PTR network_graph);
19200 * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
19202 struct LDKCResult_NoneIOErrorZ (*persist_scorer)(const void *this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer);
19204 * Frees any resources associated with this object given its this_arg pointer.
19205 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19207 void (*free)(void *this_arg);
19213 * Implements [`Persist`] in a way that writes and reads both [`ChannelMonitor`]s and
19214 * [`ChannelMonitorUpdate`]s.
19218 * The main benefit this provides over the [`KVStore`]'s [`Persist`] implementation is decreased
19219 * I/O bandwidth and storage churn, at the expense of more IOPS (including listing, reading, and
19220 * deleting) and complexity. This is because it writes channel monitor differential updates,
19221 * whereas the other (default) implementation rewrites the entire monitor on each update. For
19222 * routing nodes, updates can happen many times per second to a channel, and monitors can be tens
19223 * of megabytes (or more). Updates can be as small as a few hundred bytes.
19225 * Note that monitors written with `MonitorUpdatingPersister` are _not_ backward-compatible with
19226 * the default [`KVStore`]'s [`Persist`] implementation. They have a prepended byte sequence,
19227 * [`MONITOR_UPDATING_PERSISTER_PREPEND_SENTINEL`], applied to prevent deserialization with other
19228 * persisters. This is because monitors written by this struct _may_ have unapplied updates. In
19229 * order to downgrade, you must ensure that all updates are applied to the monitor, and remove the
19232 * # Storing monitors
19234 * Monitors are stored by implementing the [`Persist`] trait, which has two functions:
19236 * - [`Persist::persist_new_channel`], which persists whole [`ChannelMonitor`]s.
19237 * - [`Persist::update_persisted_channel`], which persists only a [`ChannelMonitorUpdate`]
19239 * Whole [`ChannelMonitor`]s are stored in the [`CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE`],
19240 * using the familiar encoding of an [`OutPoint`] (for example, `[SOME-64-CHAR-HEX-STRING]_1`).
19242 * Each [`ChannelMonitorUpdate`] is stored in a dynamic secondary namespace, as follows:
19244 * - primary namespace: [`CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE`]
19245 * - secondary namespace: [the monitor's encoded outpoint name]
19247 * Under that secondary namespace, each update is stored with a number string, like `21`, which
19248 * represents its `update_id` value.
19250 * For example, consider this channel, named for its transaction ID and index, or [`OutPoint`]:
19252 * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
19255 * Full channel monitors would be stored at a single key:
19257 * `[CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
19259 * Updates would be stored as follows (with `/` delimiting primary_namespace/secondary_namespace/key):
19262 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/1
19263 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/2
19264 * [CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE]/deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1/3
19268 * # Reading channel state from storage
19270 * Channel state can be reconstructed by calling
19271 * [`MonitorUpdatingPersister::read_all_channel_monitors_with_updates`]. Alternatively, users can
19272 * list channel monitors themselves and load channels individually using
19273 * [`MonitorUpdatingPersister::read_channel_monitor_with_updates`].
19275 * ## EXTREMELY IMPORTANT
19277 * It is extremely important that your [`KVStore::read`] implementation uses the
19278 * [`io::ErrorKind::NotFound`] variant correctly: that is, when a file is not found, and _only_ in
19279 * that circumstance (not when there is really a permissions error, for example). This is because
19280 * neither channel monitor reading function lists updates. Instead, either reads the monitor, and
19281 * using its stored `update_id`, synthesizes update storage keys, and tries them in sequence until
19282 * one is not found. All _other_ errors will be bubbled up in the function's [`Result`].
19284 * # Pruning stale channel updates
19286 * Stale updates are pruned when the consolidation threshold is reached according to `maximum_pending_updates`.
19287 * Monitor updates in the range between the latest `update_id` and `update_id - maximum_pending_updates`
19289 * The `lazy` flag is used on the [`KVStore::remove`] method, so there are no guarantees that the deletions
19290 * will complete. However, stale updates are not a problem for data integrity, since updates are
19291 * only read that are higher than the stored [`ChannelMonitor`]'s `update_id`.
19293 * If you have many stale updates stored (such as after a crash with pending lazy deletes), and
19294 * would like to get rid of them, consider using the
19295 * [`MonitorUpdatingPersister::cleanup_stale_updates`] function.
19297 typedef struct MUST_USE_STRUCT LDKMonitorUpdatingPersister {
19299 * A pointer to the opaque Rust object.
19300 * Nearly everywhere, inner must be non-null, however in places where
19301 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19303 LDKnativeMonitorUpdatingPersister *inner;
19305 * Indicates that this is the only struct which contains the same pointer.
19306 * Rust functions which take ownership of an object provided via an argument require
19307 * this to be true and invalidate the object pointed to by inner.
19310 } LDKMonitorUpdatingPersister;
19313 * `Persist` defines behavior for persisting channel monitors: this could mean
19314 * writing once to disk, and/or uploading to one or more backup services.
19316 * Persistence can happen in one of two ways - synchronously completing before the trait method
19317 * calls return or asynchronously in the background.
19319 * # For those implementing synchronous persistence
19321 * * If persistence completes fully (including any relevant `fsync()` calls), the implementation
19322 * should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal channel operation
19325 * * If persistence fails for some reason, implementations should consider returning
19326 * [`ChannelMonitorUpdateStatus::InProgress`] and retry all pending persistence operations in
19327 * the background with [`ChainMonitor::list_pending_monitor_updates`] and
19328 * [`ChainMonitor::get_monitor`].
19330 * Once a full [`ChannelMonitor`] has been persisted, all pending updates for that channel can
19331 * be marked as complete via [`ChainMonitor::channel_monitor_updated`].
19333 * If at some point no further progress can be made towards persisting the pending updates, the
19334 * node should simply shut down.
19336 * * If the persistence has failed and cannot be retried further (e.g. because of an outage),
19337 * [`ChannelMonitorUpdateStatus::UnrecoverableError`] can be used, though this will result in
19338 * an immediate panic and future operations in LDK generally failing.
19340 * # For those implementing asynchronous persistence
19342 * All calls should generally spawn a background task and immediately return
19343 * [`ChannelMonitorUpdateStatus::InProgress`]. Once the update completes,
19344 * [`ChainMonitor::channel_monitor_updated`] should be called with the corresponding
19345 * [`MonitorUpdateId`].
19347 * Note that unlike the direct [`chain::Watch`] interface,
19348 * [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
19350 * If at some point no further progress can be made towards persisting a pending update, the node
19351 * should simply shut down. Until then, the background task should either loop indefinitely, or
19352 * persistence should be regularly retried with [`ChainMonitor::list_pending_monitor_updates`]
19353 * and [`ChainMonitor::get_monitor`] (note that if a full monitor is persisted all pending
19354 * monitor updates may be marked completed).
19356 * # Using remote watchtowers
19358 * Watchtowers may be updated as a part of an implementation of this trait, utilizing the async
19359 * update process described above while the watchtower is being updated. The following methods are
19360 * provided for bulding transactions for a watchtower:
19361 * [`ChannelMonitor::initial_counterparty_commitment_tx`],
19362 * [`ChannelMonitor::counterparty_commitment_txs_from_update`],
19363 * [`ChannelMonitor::sign_to_local_justice_tx`], [`TrustedCommitmentTransaction::revokeable_output_index`],
19364 * [`TrustedCommitmentTransaction::build_to_local_justice_tx`].
19366 * [`TrustedCommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::TrustedCommitmentTransaction::revokeable_output_index
19367 * [`TrustedCommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::TrustedCommitmentTransaction::build_to_local_justice_tx
19369 typedef struct LDKPersist {
19371 * An opaque pointer which is passed to your function implementations as an argument.
19372 * This has no meaning in the LDK, and can be NULL or any other value.
19376 * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
19377 * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
19379 * The data can be stored any way you want, but the identifier provided by LDK is the
19380 * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
19381 * and the stored channel data). Note that you **must** persist every new monitor to disk.
19383 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
19384 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
19386 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
19387 * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
19389 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
19390 * [`Writeable::write`]: crate::util::ser::Writeable::write
19392 enum LDKChannelMonitorUpdateStatus (*persist_new_channel)(const void *this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
19394 * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
19397 * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
19398 * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
19401 * During blockchain synchronization operations, and in some rare cases, this may be called with
19402 * no [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
19403 * Note that after the full [`ChannelMonitor`] is persisted any previous
19404 * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
19405 * applied to the persisted [`ChannelMonitor`] as they were already applied.
19407 * If an implementer chooses to persist the updates only, they need to make
19408 * sure that all the updates are applied to the `ChannelMonitors` *before*
19409 * the set of channel monitors is given to the `ChannelManager`
19410 * deserialization routine. See [`ChannelMonitor::update_monitor`] for
19411 * applying a monitor update to a monitor. If full `ChannelMonitors` are
19412 * persisted, then there is no need to persist individual updates.
19414 * Note that there could be a performance tradeoff between persisting complete
19415 * channel monitors on every update vs. persisting only updates and applying
19416 * them in batches. The size of each monitor grows `O(number of state updates)`
19417 * whereas updates are small and `O(1)`.
19419 * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
19420 * if you return [`ChannelMonitorUpdateStatus::InProgress`].
19422 * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
19423 * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
19424 * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
19426 * [`Writeable::write`]: crate::util::ser::Writeable::write
19428 * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
19430 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);
19432 * Frees any resources associated with this object given its this_arg pointer.
19433 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19435 void (*free)(void *this_arg);
19441 * A string that displays only printable characters, replacing control characters with
19442 * [`core::char::REPLACEMENT_CHARACTER`].
19444 typedef struct MUST_USE_STRUCT LDKPrintableString {
19446 * A pointer to the opaque Rust object.
19447 * Nearly everywhere, inner must be non-null, however in places where
19448 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19450 LDKnativePrintableString *inner;
19452 * Indicates that this is the only struct which contains the same pointer.
19453 * Rust functions which take ownership of an object provided via an argument require
19454 * this to be true and invalidate the object pointed to by inner.
19457 } LDKPrintableString;
19460 * A callback which is called when a [`Future`] completes.
19462 * Note that this MUST NOT call back into LDK directly, it must instead schedule actions to be
19463 * taken later. Rust users should use the [`std::future::Future`] implementation for [`Future`]
19466 * Note that the [`std::future::Future`] implementation may only work for runtimes which schedule
19467 * futures when they receive a wake, rather than immediately executing them.
19469 typedef struct LDKFutureCallback {
19471 * An opaque pointer which is passed to your function implementations as an argument.
19472 * This has no meaning in the LDK, and can be NULL or any other value.
19476 * The method which is called.
19478 void (*call)(const void *this_arg);
19480 * Frees any resources associated with this object given its this_arg pointer.
19481 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19483 void (*free)(void *this_arg);
19484 } LDKFutureCallback;
19489 * A struct which can be used to select across many [`Future`]s at once without relying on a full
19492 typedef struct MUST_USE_STRUCT LDKSleeper {
19494 * A pointer to the opaque Rust object.
19495 * Nearly everywhere, inner must be non-null, however in places where
19496 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19498 LDKnativeSleeper *inner;
19500 * Indicates that this is the only struct which contains the same pointer.
19501 * Rust functions which take ownership of an object provided via an argument require
19502 * this to be true and invalidate the object pointed to by inner.
19510 * Configuration we set when applicable.
19512 * Default::default() provides sane defaults.
19514 typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
19516 * A pointer to the opaque Rust object.
19517 * Nearly everywhere, inner must be non-null, however in places where
19518 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19520 LDKnativeChannelHandshakeConfig *inner;
19522 * Indicates that this is the only struct which contains the same pointer.
19523 * Rust functions which take ownership of an object provided via an argument require
19524 * this to be true and invalidate the object pointed to by inner.
19527 } LDKChannelHandshakeConfig;
19532 * Optional channel limits which are applied during channel creation.
19534 * These limits are only applied to our counterparty's limits, not our own.
19536 * Use 0/`<type>::max_value()` as appropriate to skip checking.
19538 * Provides sane defaults for most configurations.
19540 * Most additional limits are disabled except those with which specify a default in individual
19541 * field documentation. Note that this may result in barely-usable channels, but since they
19542 * are applied mostly only to incoming channels that's not much of a problem.
19544 typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
19546 * A pointer to the opaque Rust object.
19547 * Nearly everywhere, inner must be non-null, however in places where
19548 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19550 LDKnativeChannelHandshakeLimits *inner;
19552 * Indicates that this is the only struct which contains the same pointer.
19553 * Rust functions which take ownership of an object provided via an argument require
19554 * this to be true and invalidate the object pointed to by inner.
19557 } LDKChannelHandshakeLimits;
19562 * A parallel struct to [`ChannelConfig`] to define partial updates.
19564 typedef struct MUST_USE_STRUCT LDKChannelConfigUpdate {
19566 * A pointer to the opaque Rust object.
19567 * Nearly everywhere, inner must be non-null, however in places where
19568 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19570 LDKnativeChannelConfigUpdate *inner;
19572 * Indicates that this is the only struct which contains the same pointer.
19573 * Rust functions which take ownership of an object provided via an argument require
19574 * this to be true and invalidate the object pointed to by inner.
19577 } LDKChannelConfigUpdate;
19582 * Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
19584 * Default::default() provides sane defaults for most configurations
19585 * (but currently with 0 relay fees!)
19587 typedef struct MUST_USE_STRUCT LDKUserConfig {
19589 * A pointer to the opaque Rust object.
19590 * Nearly everywhere, inner must be non-null, however in places where
19591 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19593 LDKnativeUserConfig *inner;
19595 * Indicates that this is the only struct which contains the same pointer.
19596 * Rust functions which take ownership of an object provided via an argument require
19597 * this to be true and invalidate the object pointed to by inner.
19605 * The best known block as identified by its hash and height.
19607 typedef struct MUST_USE_STRUCT LDKBestBlock {
19609 * A pointer to the opaque Rust object.
19610 * Nearly everywhere, inner must be non-null, however in places where
19611 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19613 LDKnativeBestBlock *inner;
19615 * Indicates that this is the only struct which contains the same pointer.
19616 * Rust functions which take ownership of an object provided via an argument require
19617 * this to be true and invalidate the object pointed to by inner.
19623 * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
19626 * Useful when needing to replay chain data upon startup or as new chain events occur. Clients
19627 * sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`].
19628 * Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers
19631 * By using [`Listen::filtered_block_connected`] this interface supports clients fetching the
19632 * entire header chain and only blocks with matching transaction data using BIP 157 filters or
19633 * other similar filtering.
19635 typedef struct LDKListen {
19637 * An opaque pointer which is passed to your function implementations as an argument.
19638 * This has no meaning in the LDK, and can be NULL or any other value.
19642 * Notifies the listener that a block was added at the given height, with the transaction data
19643 * possibly filtered.
19645 void (*filtered_block_connected)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
19647 * Notifies the listener that a block was added at the given height.
19649 void (*block_connected)(const void *this_arg, struct LDKu8slice block, uint32_t height);
19651 * Notifies the listener that a block was removed at the given height.
19653 void (*block_disconnected)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
19655 * Frees any resources associated with this object given its this_arg pointer.
19656 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19658 void (*free)(void *this_arg);
19662 * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on
19663 * chain or unconfirmed during a chain reorganization.
19665 * Clients sourcing chain data using a transaction-oriented API should prefer this interface over
19666 * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement
19667 * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for
19668 * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes
19669 * with reference to the confirmation status of the monitored objects.
19672 * The intended use is as follows:
19673 * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or
19674 * outputs are, respectively, confirmed or spent on chain.
19675 * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by
19676 * [`get_relevant_txids`] is no longer confirmed in the block with the given block hash.
19677 * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available.
19681 * Clients must call these methods in chain order. Specifically:
19682 * - Transactions which are confirmed in a particular block must be given before transactions
19683 * confirmed in a later block.
19684 * - Dependent transactions within the same block must be given in topological order, possibly in
19686 * - All unconfirmed transactions must be given after the original confirmations and before *any*
19687 * reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should
19688 * never be interleaved, but always conduced *en bloc*.
19689 * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed
19690 * in regard to the new block.
19692 * See individual method documentation for further details.
19694 * [`transactions_confirmed`]: Self::transactions_confirmed
19695 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
19696 * [`best_block_updated`]: Self::best_block_updated
19697 * [`get_relevant_txids`]: Self::get_relevant_txids
19699 typedef struct LDKConfirm {
19701 * An opaque pointer which is passed to your function implementations as an argument.
19702 * This has no meaning in the LDK, and can be NULL or any other value.
19706 * Notifies LDK of transactions confirmed in a block with a given header and height.
19708 * Must be called for any transactions registered by [`Filter::register_tx`] or any
19709 * transactions spending an output registered by [`Filter::register_output`]. Such transactions
19710 * appearing in the same block do not need to be included in the same call; instead, multiple
19711 * calls with additional transactions may be made so long as they are made in [chain order].
19713 * May be called before or after [`best_block_updated`] for the corresponding block. However,
19714 * in the event of a chain reorganization, it must not be called with a `header` that is no
19715 * longer in the chain as of the last call to [`best_block_updated`].
19717 * [chain order]: Confirm#order
19718 * [`best_block_updated`]: Self::best_block_updated
19720 void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
19722 * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization.
19724 * Must be called for any transaction returned by [`get_relevant_txids`] if it has been
19725 * reorganized out of the best chain or if it is no longer confirmed in the block with the
19726 * given block hash. Once called, the given transaction will not be returned
19727 * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`].
19729 * [`get_relevant_txids`]: Self::get_relevant_txids
19730 * [`transactions_confirmed`]: Self::transactions_confirmed
19732 void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
19734 * Notifies LDK of an update to the best header connected at the given height.
19736 * Must be called whenever a new chain tip becomes available. May be skipped for intermediary
19739 void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
19741 * Returns transactions that must be monitored for reorganization out of the chain along
19742 * with the height and the hash of the block as part of which it had been previously confirmed.
19744 * Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
19745 * 0.0.112 and prior, in which case you need to manually track previous confirmations.
19747 * Will include any transactions passed to [`transactions_confirmed`] that have insufficient
19748 * confirmations to be safe from a chain reorganization. Will not include any transactions
19749 * passed to [`transaction_unconfirmed`], unless later reconfirmed.
19751 * Must be called to determine the subset of transactions that must be monitored for
19752 * reorganization. Will be idempotent between calls but may change as a result of calls to the
19753 * other interface methods. Thus, this is useful to determine which transactions must be
19754 * given to [`transaction_unconfirmed`].
19756 * If any of the returned transactions are confirmed in a block other than the one with the
19757 * given hash at the given height, they need to be unconfirmed and reconfirmed via
19758 * [`transaction_unconfirmed`] and [`transactions_confirmed`], respectively.
19760 * [`transactions_confirmed`]: Self::transactions_confirmed
19761 * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
19763 struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ (*get_relevant_txids)(const void *this_arg);
19765 * Frees any resources associated with this object given its this_arg pointer.
19766 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19768 void (*free)(void *this_arg);
19774 * An implementation of [`chain::Watch`] for monitoring channels.
19776 * Connected and disconnected blocks must be provided to `ChainMonitor` as documented by
19777 * [`chain::Watch`]. May be used in conjunction with [`ChannelManager`] to monitor channels locally
19778 * or used independently to monitor channels remotely. See the [module-level documentation] for
19781 * Note that `ChainMonitor` should regularly trigger rebroadcasts/fee bumps of pending claims from
19782 * a force-closed channel. This is crucial in preventing certain classes of pinning attacks,
19783 * detecting substantial mempool feerate changes between blocks, and ensuring reliability if
19784 * broadcasting fails. We recommend invoking this every 30 seconds, or lower if running in an
19785 * environment with spotty connections, like on mobile.
19787 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
19788 * [module-level documentation]: crate::chain::chainmonitor
19789 * [`rebroadcast_pending_claims`]: Self::rebroadcast_pending_claims
19791 typedef struct MUST_USE_STRUCT LDKChainMonitor {
19793 * A pointer to the opaque Rust object.
19794 * Nearly everywhere, inner must be non-null, however in places where
19795 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19797 LDKnativeChainMonitor *inner;
19799 * Indicates that this is the only struct which contains the same pointer.
19800 * Rust functions which take ownership of an object provided via an argument require
19801 * this to be true and invalidate the object pointed to by inner.
19807 * A trait implemented for objects handling events from [`EventsProvider`].
19809 * An async variation also exists for implementations of [`EventsProvider`] that support async
19810 * event handling. The async event handler should satisfy the generic bounds: `F:
19811 * core::future::Future, H: Fn(Event) -> F`.
19813 typedef struct LDKEventHandler {
19815 * An opaque pointer which is passed to your function implementations as an argument.
19816 * This has no meaning in the LDK, and can be NULL or any other value.
19820 * Handles the given [`Event`].
19822 * See [`EventsProvider`] for details that must be considered when implementing this method.
19824 void (*handle_event)(const void *this_arg, struct LDKEvent event);
19826 * Frees any resources associated with this object given its this_arg pointer.
19827 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19829 void (*free)(void *this_arg);
19833 * A trait indicating an object may generate events.
19835 * Events are processed by passing an [`EventHandler`] to [`process_pending_events`].
19837 * Implementations of this trait may also feature an async version of event handling, as shown with
19838 * [`ChannelManager::process_pending_events_async`] and
19839 * [`ChainMonitor::process_pending_events_async`].
19843 * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending
19844 * event since the last invocation.
19846 * In order to ensure no [`Event`]s are lost, implementors of this trait will persist [`Event`]s
19847 * and replay any unhandled events on startup. An [`Event`] is considered handled when
19848 * [`process_pending_events`] returns, thus handlers MUST fully handle [`Event`]s and persist any
19849 * relevant changes to disk *before* returning.
19851 * Further, because an application may crash between an [`Event`] being handled and the
19852 * implementor of this trait being re-serialized, [`Event`] handling must be idempotent - in
19853 * effect, [`Event`]s may be replayed.
19855 * Note, handlers may call back into the provider and thus deadlocking must be avoided. Be sure to
19856 * consult the provider's documentation on the implication of processing events and how a handler
19857 * may safely use the provider (e.g., see [`ChannelManager::process_pending_events`] and
19858 * [`ChainMonitor::process_pending_events`]).
19860 * (C-not implementable) As there is likely no reason for a user to implement this trait on their
19863 * [`process_pending_events`]: Self::process_pending_events
19864 * [`handle_event`]: EventHandler::handle_event
19865 * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events
19866 * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events
19867 * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async
19868 * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async
19870 typedef struct LDKEventsProvider {
19872 * An opaque pointer which is passed to your function implementations as an argument.
19873 * This has no meaning in the LDK, and can be NULL or any other value.
19877 * Processes any events generated since the last call using the given event handler.
19879 * See the trait-level documentation for requirements.
19881 void (*process_pending_events)(const void *this_arg, struct LDKEventHandler handler);
19883 * Frees any resources associated with this object given its this_arg pointer.
19884 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19886 void (*free)(void *this_arg);
19887 } LDKEventsProvider;
19890 * This enum is used to specify which error data to send to peers when failing back an HTLC
19891 * using [`ChannelManager::fail_htlc_backwards_with_reason`].
19893 * For more info on failure codes, see <https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages>.
19895 typedef enum LDKFailureCode_Tag {
19897 * We had a temporary error processing the payment. Useful if no other error codes fit
19898 * and you want to indicate that the payer may want to retry.
19900 LDKFailureCode_TemporaryNodeFailure,
19902 * We have a required feature which was not in this onion. For example, you may require
19903 * some additional metadata that was not provided with this payment.
19905 LDKFailureCode_RequiredNodeFeatureMissing,
19907 * You may wish to use this when a `payment_preimage` is unknown, or the CLTV expiry of
19908 * the HTLC is too close to the current block height for safe handling.
19909 * Using this failure code in [`ChannelManager::fail_htlc_backwards_with_reason`] is
19910 * equivalent to calling [`ChannelManager::fail_htlc_backwards`].
19912 LDKFailureCode_IncorrectOrUnknownPaymentDetails,
19914 * We failed to process the payload after the onion was decrypted. You may wish to
19915 * use this when receiving custom HTLC TLVs with even type numbers that you don't recognize.
19917 * If available, the tuple data may include the type number and byte offset in the
19918 * decrypted byte stream where the failure occurred.
19920 LDKFailureCode_InvalidOnionPayload,
19922 * Must be last for serialization purposes
19924 LDKFailureCode_Sentinel,
19925 } LDKFailureCode_Tag;
19927 typedef struct MUST_USE_STRUCT LDKFailureCode {
19928 LDKFailureCode_Tag tag;
19931 struct LDKCOption_C2Tuple_u64u16ZZ invalid_onion_payload;
19939 * Chain-related parameters used to construct a new `ChannelManager`.
19941 * Typically, the block-specific parameters are derived from the best block hash for the network,
19942 * as a newly constructed `ChannelManager` will not have created any channels yet. These parameters
19943 * are not needed when deserializing a previously constructed `ChannelManager`.
19945 typedef struct MUST_USE_STRUCT LDKChainParameters {
19947 * A pointer to the opaque Rust object.
19948 * Nearly everywhere, inner must be non-null, however in places where
19949 * the Rust equivalent takes an Option, it may be set to null to indicate None.
19951 LDKnativeChainParameters *inner;
19953 * Indicates that this is the only struct which contains the same pointer.
19954 * Rust functions which take ownership of an object provided via an argument require
19955 * this to be true and invalidate the object pointed to by inner.
19958 } LDKChainParameters;
19961 * A trait indicating an object may generate message send events
19963 typedef struct LDKMessageSendEventsProvider {
19965 * An opaque pointer which is passed to your function implementations as an argument.
19966 * This has no meaning in the LDK, and can be NULL or any other value.
19970 * Gets the list of pending events which were generated by previous actions, clearing the list
19973 struct LDKCVec_MessageSendEventZ (*get_and_clear_pending_msg_events)(const void *this_arg);
19975 * Frees any resources associated with this object given its this_arg pointer.
19976 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
19978 void (*free)(void *this_arg);
19979 } LDKMessageSendEventsProvider;
19982 * A trait to describe an object which can receive channel messages.
19984 * Messages MAY be called in parallel when they originate from different `their_node_ids`, however
19985 * they MUST NOT be called in parallel when the two calls have the same `their_node_id`.
19987 typedef struct LDKChannelMessageHandler {
19989 * An opaque pointer which is passed to your function implementations as an argument.
19990 * This has no meaning in the LDK, and can be NULL or any other value.
19994 * Handle an incoming `open_channel` message from the given peer.
19996 void (*handle_open_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannel *NONNULL_PTR msg);
19998 * Handle an incoming `open_channel2` message from the given peer.
20000 void (*handle_open_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKOpenChannelV2 *NONNULL_PTR msg);
20002 * Handle an incoming `accept_channel` message from the given peer.
20004 void (*handle_accept_channel)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannel *NONNULL_PTR msg);
20006 * Handle an incoming `accept_channel2` message from the given peer.
20008 void (*handle_accept_channel_v2)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAcceptChannelV2 *NONNULL_PTR msg);
20010 * Handle an incoming `funding_created` message from the given peer.
20012 void (*handle_funding_created)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
20014 * Handle an incoming `funding_signed` message from the given peer.
20016 void (*handle_funding_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
20018 * Handle an incoming `channel_ready` message from the given peer.
20020 void (*handle_channel_ready)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
20022 * Handle an incoming `shutdown` message from the given peer.
20024 void (*handle_shutdown)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg);
20026 * Handle an incoming `closing_signed` message from the given peer.
20028 void (*handle_closing_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
20030 * Handle an incoming `stfu` message from the given peer.
20032 void (*handle_stfu)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKStfu *NONNULL_PTR msg);
20034 * Handle an incoming `splice` message from the given peer.
20036 void (*handle_splice)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKSplice *NONNULL_PTR msg);
20038 * Handle an incoming `splice_ack` message from the given peer.
20040 void (*handle_splice_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKSpliceAck *NONNULL_PTR msg);
20042 * Handle an incoming `splice_locked` message from the given peer.
20044 void (*handle_splice_locked)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKSpliceLocked *NONNULL_PTR msg);
20046 * Handle an incoming `tx_add_input message` from the given peer.
20048 void (*handle_tx_add_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg);
20050 * Handle an incoming `tx_add_output` message from the given peer.
20052 void (*handle_tx_add_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg);
20054 * Handle an incoming `tx_remove_input` message from the given peer.
20056 void (*handle_tx_remove_input)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveInput *NONNULL_PTR msg);
20058 * Handle an incoming `tx_remove_output` message from the given peer.
20060 void (*handle_tx_remove_output)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxRemoveOutput *NONNULL_PTR msg);
20062 * Handle an incoming `tx_complete message` from the given peer.
20064 void (*handle_tx_complete)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxComplete *NONNULL_PTR msg);
20066 * Handle an incoming `tx_signatures` message from the given peer.
20068 void (*handle_tx_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxSignatures *NONNULL_PTR msg);
20070 * Handle an incoming `tx_init_rbf` message from the given peer.
20072 void (*handle_tx_init_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxInitRbf *NONNULL_PTR msg);
20074 * Handle an incoming `tx_ack_rbf` message from the given peer.
20076 void (*handle_tx_ack_rbf)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAckRbf *NONNULL_PTR msg);
20078 * Handle an incoming `tx_abort message` from the given peer.
20080 void (*handle_tx_abort)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAbort *NONNULL_PTR msg);
20082 * Handle an incoming `update_add_htlc` message from the given peer.
20084 void (*handle_update_add_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
20086 * Handle an incoming `update_fulfill_htlc` message from the given peer.
20088 void (*handle_update_fulfill_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
20090 * Handle an incoming `update_fail_htlc` message from the given peer.
20092 void (*handle_update_fail_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
20094 * Handle an incoming `update_fail_malformed_htlc` message from the given peer.
20096 void (*handle_update_fail_malformed_htlc)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
20098 * Handle an incoming `commitment_signed` message from the given peer.
20100 void (*handle_commitment_signed)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
20102 * Handle an incoming `revoke_and_ack` message from the given peer.
20104 void (*handle_revoke_and_ack)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
20106 * Handle an incoming `update_fee` message from the given peer.
20108 void (*handle_update_fee)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
20110 * Handle an incoming `announcement_signatures` message from the given peer.
20112 void (*handle_announcement_signatures)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
20114 * Indicates a connection to the peer failed/an existing connection was lost.
20116 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
20118 * Handle a peer reconnecting, possibly generating `channel_reestablish` message(s).
20120 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
20121 * with us. Implementors should be somewhat conservative about doing so, however, as other
20122 * message handlers may still wish to communicate with this peer.
20124 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg, bool inbound);
20126 * Handle an incoming `channel_reestablish` message from the given peer.
20128 void (*handle_channel_reestablish)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
20130 * Handle an incoming `channel_update` message from the given peer.
20132 void (*handle_channel_update)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
20134 * Handle an incoming `error` message from the given peer.
20136 void (*handle_error)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
20138 * Gets the node feature flags which this handler itself supports. All available handlers are
20139 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
20140 * which are broadcasted in our [`NodeAnnouncement`] message.
20142 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
20144 * Gets the init feature flags which should be sent to the given peer. All available handlers
20145 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
20146 * which are sent in our [`Init`] message.
20148 * Note that this method is called before [`Self::peer_connected`].
20150 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
20152 * Gets the chain hashes for this `ChannelMessageHandler` indicating which chains it supports.
20154 * If it's `None`, then no particular network chain hash compatibility will be enforced when
20155 * connecting to peers.
20157 struct LDKCOption_CVec_ThirtyTwoBytesZZ (*get_chain_hashes)(const void *this_arg);
20159 * Implementation of MessageSendEventsProvider for this object.
20161 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
20163 * Frees any resources associated with this object given its this_arg pointer.
20164 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20166 void (*free)(void *this_arg);
20167 } LDKChannelMessageHandler;
20170 * A handler for an [`OnionMessage`] containing a BOLT 12 Offers message as its payload.
20172 * [`OnionMessage`]: crate::ln::msgs::OnionMessage
20174 typedef struct LDKOffersMessageHandler {
20176 * An opaque pointer which is passed to your function implementations as an argument.
20177 * This has no meaning in the LDK, and can be NULL or any other value.
20181 * Handles the given message by either responding with an [`Bolt12Invoice`], sending a payment,
20182 * or replying with an error.
20184 * The returned [`OffersMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
20186 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
20188 struct LDKCOption_OffersMessageZ (*handle_message)(const void *this_arg, struct LDKOffersMessage message);
20190 * Releases any [`OffersMessage`]s that need to be sent.
20192 * Typically, this is used for messages initiating a payment flow rather than in response to
20193 * another message. The latter should use the return value of [`Self::handle_message`].
20195 struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ (*release_pending_messages)(const void *this_arg);
20197 * Frees any resources associated with this object given its this_arg pointer.
20198 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20200 void (*free)(void *this_arg);
20201 } LDKOffersMessageHandler;
20206 * Arguments for the creation of a ChannelManager that are not deserialized.
20208 * At a high-level, the process for deserializing a ChannelManager and resuming normal operation
20210 * 1) Deserialize all stored [`ChannelMonitor`]s.
20211 * 2) Deserialize the [`ChannelManager`] by filling in this struct and calling:
20212 * `<(BlockHash, ChannelManager)>::read(reader, args)`
20213 * This may result in closing some channels if the [`ChannelMonitor`] is newer than the stored
20214 * [`ChannelManager`] state to ensure no loss of funds. Thus, transactions may be broadcasted.
20215 * 3) If you are not fetching full blocks, register all relevant [`ChannelMonitor`] outpoints the
20216 * same way you would handle a [`chain::Filter`] call using
20217 * [`ChannelMonitor::get_outputs_to_watch`] and [`ChannelMonitor::get_funding_txo`].
20218 * 4) Reconnect blocks on your [`ChannelMonitor`]s.
20219 * 5) Disconnect/connect blocks on the [`ChannelManager`].
20220 * 6) Re-persist the [`ChannelMonitor`]s to ensure the latest state is on disk.
20221 * Note that if you're using a [`ChainMonitor`] for your [`chain::Watch`] implementation, you
20222 * will likely accomplish this as a side-effect of calling [`chain::Watch::watch_channel`] in
20224 * 7) Move the [`ChannelMonitor`]s into your local [`chain::Watch`]. If you're using a
20225 * [`ChainMonitor`], this is done by calling [`chain::Watch::watch_channel`].
20227 * Note that the ordering of #4-7 is not of importance, however all four must occur before you
20228 * call any other methods on the newly-deserialized [`ChannelManager`].
20230 * Note that because some channels may be closed during deserialization, it is critical that you
20231 * always deserialize only the latest version of a ChannelManager and ChannelMonitors available to
20232 * you. If you deserialize an old ChannelManager (during which force-closure transactions may be
20233 * broadcast), and then later deserialize a newer version of the same ChannelManager (which will
20234 * not force-close the same channels but consider them live), you may end up revoking a state for
20235 * which you've already broadcasted the transaction.
20237 * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor
20239 typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
20241 * A pointer to the opaque Rust object.
20242 * Nearly everywhere, inner must be non-null, however in places where
20243 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20245 LDKnativeChannelManagerReadArgs *inner;
20247 * Indicates that this is the only struct which contains the same pointer.
20248 * Rust functions which take ownership of an object provided via an argument require
20249 * this to be true and invalidate the object pointed to by inner.
20252 } LDKChannelManagerReadArgs;
20257 * A set of keys that were HKDF-expanded from an initial call to
20258 * [`NodeSigner::get_inbound_payment_key_material`].
20260 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
20262 typedef struct MUST_USE_STRUCT LDKExpandedKey {
20264 * A pointer to the opaque Rust object.
20265 * Nearly everywhere, inner must be non-null, however in places where
20266 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20268 LDKnativeExpandedKey *inner;
20270 * Indicates that this is the only struct which contains the same pointer.
20271 * Rust functions which take ownership of an object provided via an argument require
20272 * this to be true and invalidate the object pointed to by inner.
20280 * Packet of hop data for next peer
20282 typedef struct MUST_USE_STRUCT LDKPacket {
20284 * A pointer to the opaque Rust object.
20285 * Nearly everywhere, inner must be non-null, however in places where
20286 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20288 LDKnativePacket *inner;
20290 * Indicates that this is the only struct which contains the same pointer.
20291 * Rust functions which take ownership of an object provided via an argument require
20292 * this to be true and invalidate the object pointed to by inner.
20298 * A 3-byte byte array.
20300 typedef struct LDKThreeBytes {
20308 * A trait to describe an object which can receive routing messages.
20310 * # Implementor DoS Warnings
20312 * For messages enabled with the `gossip_queries` feature there are potential DoS vectors when
20313 * handling inbound queries. Implementors using an on-disk network graph should be aware of
20314 * repeated disk I/O for queries accessing different parts of the network graph.
20316 typedef struct LDKRoutingMessageHandler {
20318 * An opaque pointer which is passed to your function implementations as an argument.
20319 * This has no meaning in the LDK, and can be NULL or any other value.
20323 * Handle an incoming `node_announcement` message, returning `true` if it should be forwarded on,
20324 * `false` or returning an `Err` otherwise.
20326 struct LDKCResult_boolLightningErrorZ (*handle_node_announcement)(const void *this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
20328 * Handle a `channel_announcement` message, returning `true` if it should be forwarded on, `false`
20329 * or returning an `Err` otherwise.
20331 struct LDKCResult_boolLightningErrorZ (*handle_channel_announcement)(const void *this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg);
20333 * Handle an incoming `channel_update` message, returning true if it should be forwarded on,
20334 * `false` or returning an `Err` otherwise.
20336 struct LDKCResult_boolLightningErrorZ (*handle_channel_update)(const void *this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
20338 * Gets channel announcements and updates required to dump our routing table to a remote node,
20339 * starting at the `short_channel_id` indicated by `starting_point` and including announcements
20340 * for a single channel.
20342 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ (*get_next_channel_announcement)(const void *this_arg, uint64_t starting_point);
20344 * Gets a node announcement required to dump our routing table to a remote node, starting at
20345 * the node *after* the provided pubkey and including up to one announcement immediately
20346 * higher (as defined by `<PublicKey as Ord>::cmp`) than `starting_point`.
20347 * If `None` is provided for `starting_point`, we start at the first node.
20349 * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
20350 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20352 struct LDKNodeAnnouncement (*get_next_node_announcement)(const void *this_arg, struct LDKNodeId starting_point);
20354 * Called when a connection is established with a peer. This can be used to
20355 * perform routing table synchronization using a strategy defined by the
20358 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
20359 * with us. Implementors should be somewhat conservative about doing so, however, as other
20360 * message handlers may still wish to communicate with this peer.
20362 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
20364 * Handles the reply of a query we initiated to learn about channels
20365 * for a given range of blocks. We can expect to receive one or more
20366 * replies to a single query.
20368 struct LDKCResult_NoneLightningErrorZ (*handle_reply_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
20370 * Handles the reply of a query we initiated asking for routing gossip
20371 * messages for a list of channels. We should receive this message when
20372 * a node has completed its best effort to send us the pertaining routing
20375 struct LDKCResult_NoneLightningErrorZ (*handle_reply_short_channel_ids_end)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
20377 * Handles when a peer asks us to send a list of `short_channel_id`s
20378 * for the requested range of blocks.
20380 struct LDKCResult_NoneLightningErrorZ (*handle_query_channel_range)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
20382 * Handles when a peer asks us to send routing gossip messages for a
20383 * list of `short_channel_id`s.
20385 struct LDKCResult_NoneLightningErrorZ (*handle_query_short_channel_ids)(const void *this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
20387 * Indicates that there are a large number of [`ChannelAnnouncement`] (or other) messages
20388 * pending some async action. While there is no guarantee of the rate of future messages, the
20389 * caller should seek to reduce the rate of new gossip messages handled, especially
20390 * [`ChannelAnnouncement`]s.
20392 bool (*processing_queue_high)(const void *this_arg);
20394 * Gets the node feature flags which this handler itself supports. All available handlers are
20395 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
20396 * which are broadcasted in our [`NodeAnnouncement`] message.
20398 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
20400 * Gets the init feature flags which should be sent to the given peer. All available handlers
20401 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
20402 * which are sent in our [`Init`] message.
20404 * Note that this method is called before [`Self::peer_connected`].
20406 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
20408 * Implementation of MessageSendEventsProvider for this object.
20410 struct LDKMessageSendEventsProvider MessageSendEventsProvider;
20412 * Frees any resources associated with this object given its this_arg pointer.
20413 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20415 void (*free)(void *this_arg);
20416 } LDKRoutingMessageHandler;
20419 * A handler for received [`OnionMessage`]s and for providing generated ones to send.
20421 typedef struct LDKOnionMessageHandler {
20423 * An opaque pointer which is passed to your function implementations as an argument.
20424 * This has no meaning in the LDK, and can be NULL or any other value.
20428 * Because much of the lightning network does not yet support forwarding onion messages, we
20429 * may need to directly connect to a node which will forward a message for us. In such a case,
20430 * this method will return the set of nodes which need connection by node_id and the
20431 * corresponding socket addresses where they may accept incoming connections.
20433 * Thus, this method should be polled regularly to detect messages await such a direct
20436 struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ (*get_and_clear_connections_needed)(const void *this_arg);
20438 * Handle an incoming `onion_message` message from the given peer.
20440 void (*handle_onion_message)(const void *this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
20442 * Returns the next pending onion message for the peer with the given node id.
20444 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
20446 struct LDKOnionMessage (*next_onion_message_for_peer)(const void *this_arg, struct LDKPublicKey peer_node_id);
20448 * Called when a connection is established with a peer. Can be used to track which peers
20449 * advertise onion message support and are online.
20451 * May return an `Err(())` if the features the peer supports are not sufficient to communicate
20452 * with us. Implementors should be somewhat conservative about doing so, however, as other
20453 * message handlers may still wish to communicate with this peer.
20455 struct LDKCResult_NoneNoneZ (*peer_connected)(const void *this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init, bool inbound);
20457 * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
20458 * drop and refuse to forward onion messages to this peer.
20460 void (*peer_disconnected)(const void *this_arg, struct LDKPublicKey their_node_id);
20462 * Performs actions that should happen roughly every ten seconds after startup. Allows handlers
20463 * to drop any buffered onion messages intended for prospective peers.
20465 void (*timer_tick_occurred)(const void *this_arg);
20467 * Gets the node feature flags which this handler itself supports. All available handlers are
20468 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
20469 * which are broadcasted in our [`NodeAnnouncement`] message.
20471 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
20473 * Gets the init feature flags which should be sent to the given peer. All available handlers
20474 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
20475 * which are sent in our [`Init`] message.
20477 * Note that this method is called before [`Self::peer_connected`].
20479 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
20481 * Frees any resources associated with this object given its this_arg pointer.
20482 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20484 void (*free)(void *this_arg);
20485 } LDKOnionMessageHandler;
20488 * Trait to be implemented by custom message (unrelated to the channel/gossip LN layers)
20491 typedef struct LDKCustomMessageReader {
20493 * An opaque pointer which is passed to your function implementations as an argument.
20494 * This has no meaning in the LDK, and can be NULL or any other value.
20498 * Decodes a custom message to `CustomMessageType`. If the given message type is known to the
20499 * implementation and the message could be decoded, must return `Ok(Some(message))`. If the
20500 * message type is unknown to the implementation, must return `Ok(None)`. If a decoding error
20501 * occur, must return `Err(DecodeError::X)` where `X` details the encountered error.
20503 struct LDKCResult_COption_TypeZDecodeErrorZ (*read)(const void *this_arg, uint16_t message_type, struct LDKu8slice buffer);
20505 * Frees any resources associated with this object given its this_arg pointer.
20506 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20508 void (*free)(void *this_arg);
20509 } LDKCustomMessageReader;
20512 * A handler provided to [`PeerManager`] for reading and handling custom messages.
20514 * [BOLT 1] specifies a custom message type range for use with experimental or application-specific
20515 * messages. `CustomMessageHandler` allows for user-defined handling of such types. See the
20516 * [`lightning_custom_message`] crate for tools useful in composing more than one custom handler.
20518 * [BOLT 1]: https://github.com/lightning/bolts/blob/master/01-messaging.md
20519 * [`lightning_custom_message`]: https://docs.rs/lightning_custom_message/latest/lightning_custom_message
20521 typedef struct LDKCustomMessageHandler {
20523 * An opaque pointer which is passed to your function implementations as an argument.
20524 * This has no meaning in the LDK, and can be NULL or any other value.
20528 * Handles the given message sent from `sender_node_id`, possibly producing messages for
20529 * [`CustomMessageHandler::get_and_clear_pending_msg`] to return and thus for [`PeerManager`]
20532 struct LDKCResult_NoneLightningErrorZ (*handle_custom_message)(const void *this_arg, struct LDKType msg, struct LDKPublicKey sender_node_id);
20534 * Returns the list of pending messages that were generated by the handler, clearing the list
20535 * in the process. Each message is paired with the node id of the intended recipient. If no
20536 * connection to the node exists, then the message is simply not sent.
20538 struct LDKCVec_C2Tuple_PublicKeyTypeZZ (*get_and_clear_pending_msg)(const void *this_arg);
20540 * Gets the node feature flags which this handler itself supports. All available handlers are
20541 * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
20542 * which are broadcasted in our [`NodeAnnouncement`] message.
20544 * [`NodeAnnouncement`]: crate::ln::msgs::NodeAnnouncement
20546 struct LDKNodeFeatures (*provided_node_features)(const void *this_arg);
20548 * Gets the init feature flags which should be sent to the given peer. All available handlers
20549 * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
20550 * which are sent in our [`Init`] message.
20552 * [`Init`]: crate::ln::msgs::Init
20554 struct LDKInitFeatures (*provided_init_features)(const void *this_arg, struct LDKPublicKey their_node_id);
20556 * Implementation of CustomMessageReader for this object.
20558 struct LDKCustomMessageReader CustomMessageReader;
20560 * Frees any resources associated with this object given its this_arg pointer.
20561 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20563 void (*free)(void *this_arg);
20564 } LDKCustomMessageHandler;
20569 * A dummy struct which implements `RoutingMessageHandler` without storing any routing information
20570 * or doing any processing. You can provide one of these as the route_handler in a MessageHandler.
20572 typedef struct MUST_USE_STRUCT LDKIgnoringMessageHandler {
20574 * A pointer to the opaque Rust object.
20575 * Nearly everywhere, inner must be non-null, however in places where
20576 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20578 LDKnativeIgnoringMessageHandler *inner;
20580 * Indicates that this is the only struct which contains the same pointer.
20581 * Rust functions which take ownership of an object provided via an argument require
20582 * this to be true and invalidate the object pointed to by inner.
20585 } LDKIgnoringMessageHandler;
20588 * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
20589 * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
20590 * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
20591 * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
20594 * See [`OnionMessenger`] for example usage.
20596 * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
20597 * [`CustomMessage`]: Self::CustomMessage
20599 typedef struct LDKCustomOnionMessageHandler {
20601 * An opaque pointer which is passed to your function implementations as an argument.
20602 * This has no meaning in the LDK, and can be NULL or any other value.
20606 * Called with the custom message that was received, returning a response to send, if any.
20608 * The returned [`Self::CustomMessage`], if any, is enqueued to be sent by [`OnionMessenger`].
20610 struct LDKCOption_OnionMessageContentsZ (*handle_custom_message)(const void *this_arg, struct LDKOnionMessageContents msg);
20612 * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
20613 * message type is unknown.
20615 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ (*read_custom_message)(const void *this_arg, uint64_t message_type, struct LDKu8slice buffer);
20617 * Releases any [`Self::CustomMessage`]s that need to be sent.
20619 * Typically, this is used for messages initiating a message flow rather than in response to
20620 * another message. The latter should use the return value of [`Self::handle_custom_message`].
20622 struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ (*release_pending_custom_messages)(const void *this_arg);
20624 * Frees any resources associated with this object given its this_arg pointer.
20625 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20627 void (*free)(void *this_arg);
20628 } LDKCustomOnionMessageHandler;
20633 * A dummy struct which implements `ChannelMessageHandler` without having any channels.
20634 * You can provide one of these as the route_handler in a MessageHandler.
20636 typedef struct MUST_USE_STRUCT LDKErroringMessageHandler {
20638 * A pointer to the opaque Rust object.
20639 * Nearly everywhere, inner must be non-null, however in places where
20640 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20642 LDKnativeErroringMessageHandler *inner;
20644 * Indicates that this is the only struct which contains the same pointer.
20645 * Rust functions which take ownership of an object provided via an argument require
20646 * this to be true and invalidate the object pointed to by inner.
20649 } LDKErroringMessageHandler;
20654 * Provides references to trait impls which handle different types of messages.
20656 typedef struct MUST_USE_STRUCT LDKMessageHandler {
20658 * A pointer to the opaque Rust object.
20659 * Nearly everywhere, inner must be non-null, however in places where
20660 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20662 LDKnativeMessageHandler *inner;
20664 * Indicates that this is the only struct which contains the same pointer.
20665 * Rust functions which take ownership of an object provided via an argument require
20666 * this to be true and invalidate the object pointed to by inner.
20669 } LDKMessageHandler;
20672 * Provides an object which can be used to send data to and which uniquely identifies a connection
20673 * to a remote host. You will need to be able to generate multiple of these which meet Eq and
20674 * implement Hash to meet the PeerManager API.
20676 * For efficiency, [`Clone`] should be relatively cheap for this type.
20678 * Two descriptors may compare equal (by [`cmp::Eq`] and [`hash::Hash`]) as long as the original
20679 * has been disconnected, the [`PeerManager`] has been informed of the disconnection (either by it
20680 * having triggered the disconnection or a call to [`PeerManager::socket_disconnected`]), and no
20681 * further calls to the [`PeerManager`] related to the original socket occur. This allows you to
20682 * use a file descriptor for your SocketDescriptor directly, however for simplicity you may wish
20683 * to simply use another value which is guaranteed to be globally unique instead.
20685 typedef struct LDKSocketDescriptor {
20687 * An opaque pointer which is passed to your function implementations as an argument.
20688 * This has no meaning in the LDK, and can be NULL or any other value.
20692 * Attempts to send some data from the given slice to the peer.
20694 * Returns the amount of data which was sent, possibly 0 if the socket has since disconnected.
20695 * Note that in the disconnected case, [`PeerManager::socket_disconnected`] must still be
20696 * called and further write attempts may occur until that time.
20698 * If the returned size is smaller than `data.len()`, a
20699 * [`PeerManager::write_buffer_space_avail`] call must be made the next time more data can be
20700 * written. Additionally, until a `send_data` event completes fully, no further
20701 * [`PeerManager::read_event`] calls should be made for the same peer! Because this is to
20702 * prevent denial-of-service issues, you should not read or buffer any data from the socket
20705 * If a [`PeerManager::read_event`] call on this descriptor had previously returned true
20706 * (indicating that read events should be paused to prevent DoS in the send buffer),
20707 * `resume_read` may be set indicating that read events on this descriptor should resume. A
20708 * `resume_read` of false carries no meaning, and should not cause any action.
20710 uintptr_t (*send_data)(void *this_arg, struct LDKu8slice data, bool resume_read);
20712 * Disconnect the socket pointed to by this SocketDescriptor.
20714 * You do *not* need to call [`PeerManager::socket_disconnected`] with this socket after this
20715 * call (doing so is a noop).
20717 void (*disconnect_socket)(void *this_arg);
20719 * Checks if two objects are equal given this object's this_arg pointer and another object.
20721 bool (*eq)(const void *this_arg, const struct LDKSocketDescriptor *NONNULL_PTR other_arg);
20723 * Calculate a succinct non-cryptographic hash for an object given its this_arg pointer.
20724 * This is used, for example, for inclusion of this object in a hash map.
20726 uint64_t (*hash)(const void *this_arg);
20728 * Called, if set, after this SocketDescriptor has been cloned into a duplicate object.
20729 * The new SocketDescriptor is provided, and should be mutated as needed to perform a
20730 * deep copy of the object pointed to by this_arg or avoid any double-freeing.
20732 void (*cloned)(struct LDKSocketDescriptor *NONNULL_PTR new_SocketDescriptor);
20734 * Frees any resources associated with this object given its this_arg pointer.
20735 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
20737 void (*free)(void *this_arg);
20738 } LDKSocketDescriptor;
20743 * A PeerManager manages a set of peers, described by their [`SocketDescriptor`] and marshalls
20744 * socket events into messages which it passes on to its [`MessageHandler`].
20746 * Locks are taken internally, so you must never assume that reentrancy from a
20747 * [`SocketDescriptor`] call back into [`PeerManager`] methods will not deadlock.
20749 * Calls to [`read_event`] will decode relevant messages and pass them to the
20750 * [`ChannelMessageHandler`], likely doing message processing in-line. Thus, the primary form of
20751 * parallelism in Rust-Lightning is in calls to [`read_event`]. Note, however, that calls to any
20752 * [`PeerManager`] functions related to the same connection must occur only in serial, making new
20753 * calls only after previous ones have returned.
20755 * Rather than using a plain [`PeerManager`], it is preferable to use either a [`SimpleArcPeerManager`]
20756 * a [`SimpleRefPeerManager`], for conciseness. See their documentation for more details, but
20757 * essentially you should default to using a [`SimpleRefPeerManager`], and use a
20758 * [`SimpleArcPeerManager`] when you require a `PeerManager` with a static lifetime, such as when
20759 * you're using lightning-net-tokio.
20761 * [`read_event`]: PeerManager::read_event
20763 typedef struct MUST_USE_STRUCT LDKPeerManager {
20765 * A pointer to the opaque Rust object.
20766 * Nearly everywhere, inner must be non-null, however in places where
20767 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20769 LDKnativePeerManager *inner;
20771 * Indicates that this is the only struct which contains the same pointer.
20772 * Rust functions which take ownership of an object provided via an argument require
20773 * this to be true and invalidate the object pointed to by inner.
20781 * Static channel fields used to build transactions given per-commitment fields, organized by
20782 * broadcaster/countersignatory.
20784 * This is derived from the holder/counterparty-organized ChannelTransactionParameters via the
20785 * as_holder_broadcastable and as_counterparty_broadcastable functions.
20787 typedef struct MUST_USE_STRUCT LDKDirectedChannelTransactionParameters {
20789 * A pointer to the opaque Rust object.
20790 * Nearly everywhere, inner must be non-null, however in places where
20791 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20793 LDKnativeDirectedChannelTransactionParameters *inner;
20795 * Indicates that this is the only struct which contains the same pointer.
20796 * Rust functions which take ownership of an object provided via an argument require
20797 * this to be true and invalidate the object pointed to by inner.
20800 } LDKDirectedChannelTransactionParameters;
20805 * Features used within an `offer`.
20807 typedef struct MUST_USE_STRUCT LDKOfferFeatures {
20809 * A pointer to the opaque Rust object.
20810 * Nearly everywhere, inner must be non-null, however in places where
20811 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20813 LDKnativeOfferFeatures *inner;
20815 * Indicates that this is the only struct which contains the same pointer.
20816 * Rust functions which take ownership of an object provided via an argument require
20817 * this to be true and invalidate the object pointed to by inner.
20820 } LDKOfferFeatures;
20825 * Features used within an `invoice_request`.
20827 typedef struct MUST_USE_STRUCT LDKInvoiceRequestFeatures {
20829 * A pointer to the opaque Rust object.
20830 * Nearly everywhere, inner must be non-null, however in places where
20831 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20833 LDKnativeInvoiceRequestFeatures *inner;
20835 * Indicates that this is the only struct which contains the same pointer.
20836 * Rust functions which take ownership of an object provided via an argument require
20837 * this to be true and invalidate the object pointed to by inner.
20840 } LDKInvoiceRequestFeatures;
20845 * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or
20846 * another currency.
20848 typedef struct MUST_USE_STRUCT LDKAmount {
20850 * A pointer to the opaque Rust object.
20851 * Nearly everywhere, inner must be non-null, however in places where
20852 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20854 LDKnativeAmount *inner;
20856 * Indicates that this is the only struct which contains the same pointer.
20857 * Rust functions which take ownership of an object provided via an argument require
20858 * this to be true and invalidate the object pointed to by inner.
20866 * Quantity of items supported by an [`Offer`].
20868 typedef struct MUST_USE_STRUCT LDKQuantity {
20870 * A pointer to the opaque Rust object.
20871 * Nearly everywhere, inner must be non-null, however in places where
20872 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20874 LDKnativeQuantity *inner;
20876 * Indicates that this is the only struct which contains the same pointer.
20877 * Rust functions which take ownership of an object provided via an argument require
20878 * this to be true and invalidate the object pointed to by inner.
20886 * A hash for use in a specific context by tweaking with a context-dependent tag as per [BIP 340]
20887 * and computed over the merkle root of a TLV stream to sign as defined in [BOLT 12].
20889 * [BIP 340]: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki
20890 * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md#signature-calculation
20892 typedef struct MUST_USE_STRUCT LDKTaggedHash {
20894 * A pointer to the opaque Rust object.
20895 * Nearly everywhere, inner must be non-null, however in places where
20896 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20898 LDKnativeTaggedHash *inner;
20900 * Indicates that this is the only struct which contains the same pointer.
20901 * Rust functions which take ownership of an object provided via an argument require
20902 * this to be true and invalidate the object pointed to by inner.
20910 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
20912 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
20913 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
20915 typedef struct MUST_USE_STRUCT LDKErroneousField {
20917 * A pointer to the opaque Rust object.
20918 * Nearly everywhere, inner must be non-null, however in places where
20919 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20921 LDKnativeErroneousField *inner;
20923 * Indicates that this is the only struct which contains the same pointer.
20924 * Rust functions which take ownership of an object provided via an argument require
20925 * this to be true and invalidate the object pointed to by inner.
20928 } LDKErroneousField;
20933 * Receives and validates network updates from peers,
20934 * stores authentic and relevant data as a network graph.
20935 * This network graph is then used for routing payments.
20936 * Provides interface to help with initial routing sync by
20937 * serving historical announcements.
20939 typedef struct MUST_USE_STRUCT LDKP2PGossipSync {
20941 * A pointer to the opaque Rust object.
20942 * Nearly everywhere, inner must be non-null, however in places where
20943 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20945 LDKnativeP2PGossipSync *inner;
20947 * Indicates that this is the only struct which contains the same pointer.
20948 * Rust functions which take ownership of an object provided via an argument require
20949 * this to be true and invalidate the object pointed to by inner.
20952 } LDKP2PGossipSync;
20957 * A read-only view of [`NetworkGraph`].
20959 typedef struct MUST_USE_STRUCT LDKReadOnlyNetworkGraph {
20961 * A pointer to the opaque Rust object.
20962 * Nearly everywhere, inner must be non-null, however in places where
20963 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20965 LDKnativeReadOnlyNetworkGraph *inner;
20967 * Indicates that this is the only struct which contains the same pointer.
20968 * Rust functions which take ownership of an object provided via an argument require
20969 * this to be true and invalidate the object pointed to by inner.
20972 } LDKReadOnlyNetworkGraph;
20977 * A wrapper around [`ChannelInfo`] representing information about the channel as directed from a
20978 * source node to a target node.
20980 typedef struct MUST_USE_STRUCT LDKDirectedChannelInfo {
20982 * A pointer to the opaque Rust object.
20983 * Nearly everywhere, inner must be non-null, however in places where
20984 * the Rust equivalent takes an Option, it may be set to null to indicate None.
20986 LDKnativeDirectedChannelInfo *inner;
20988 * Indicates that this is the only struct which contains the same pointer.
20989 * Rust functions which take ownership of an object provided via an argument require
20990 * this to be true and invalidate the object pointed to by inner.
20993 } LDKDirectedChannelInfo;
20996 * The effective capacity of a channel for routing purposes.
20998 * While this may be smaller than the actual channel capacity, amounts greater than
20999 * [`Self::as_msat`] should not be routed through the channel.
21001 typedef enum LDKEffectiveCapacity_Tag {
21003 * The available liquidity in the channel known from being a channel counterparty, and thus a
21006 LDKEffectiveCapacity_ExactLiquidity,
21008 * The maximum HTLC amount in one direction as advertised on the gossip network.
21010 LDKEffectiveCapacity_AdvertisedMaxHTLC,
21012 * The total capacity of the channel as determined by the funding transaction.
21014 LDKEffectiveCapacity_Total,
21016 * A capacity sufficient to route any payment, typically used for private channels provided by
21019 LDKEffectiveCapacity_Infinite,
21021 * The maximum HTLC amount as provided by an invoice route hint.
21023 LDKEffectiveCapacity_HintMaxHTLC,
21025 * A capacity that is unknown possibly because either the chain state is unavailable to know
21026 * the total capacity or the `htlc_maximum_msat` was not advertised on the gossip network.
21028 LDKEffectiveCapacity_Unknown,
21030 * Must be last for serialization purposes
21032 LDKEffectiveCapacity_Sentinel,
21033 } LDKEffectiveCapacity_Tag;
21035 typedef struct LDKEffectiveCapacity_LDKExactLiquidity_Body {
21037 * Either the inbound or outbound liquidity depending on the direction, denominated in
21040 uint64_t liquidity_msat;
21041 } LDKEffectiveCapacity_LDKExactLiquidity_Body;
21043 typedef struct LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body {
21045 * The maximum HTLC amount denominated in millisatoshi.
21047 uint64_t amount_msat;
21048 } LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body;
21050 typedef struct LDKEffectiveCapacity_LDKTotal_Body {
21052 * The funding amount denominated in millisatoshi.
21054 uint64_t capacity_msat;
21056 * The maximum HTLC amount denominated in millisatoshi.
21058 uint64_t htlc_maximum_msat;
21059 } LDKEffectiveCapacity_LDKTotal_Body;
21061 typedef struct LDKEffectiveCapacity_LDKHintMaxHTLC_Body {
21063 * The maximum HTLC amount denominated in millisatoshi.
21065 uint64_t amount_msat;
21066 } LDKEffectiveCapacity_LDKHintMaxHTLC_Body;
21068 typedef struct MUST_USE_STRUCT LDKEffectiveCapacity {
21069 LDKEffectiveCapacity_Tag tag;
21071 LDKEffectiveCapacity_LDKExactLiquidity_Body exact_liquidity;
21072 LDKEffectiveCapacity_LDKAdvertisedMaxHTLC_Body advertised_max_htlc;
21073 LDKEffectiveCapacity_LDKTotal_Body total;
21074 LDKEffectiveCapacity_LDKHintMaxHTLC_Body hint_max_htlc;
21076 } LDKEffectiveCapacity;
21081 * A [`Router`] implemented using [`find_route`].
21083 typedef struct MUST_USE_STRUCT LDKDefaultRouter {
21085 * A pointer to the opaque Rust object.
21086 * Nearly everywhere, inner must be non-null, however in places where
21087 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21089 LDKnativeDefaultRouter *inner;
21091 * Indicates that this is the only struct which contains the same pointer.
21092 * Rust functions which take ownership of an object provided via an argument require
21093 * this to be true and invalidate the object pointed to by inner.
21096 } LDKDefaultRouter;
21101 * [`ScoreLookUp`] implementation that factors in in-flight HTLC liquidity.
21103 * Useful for custom [`Router`] implementations to wrap their [`ScoreLookUp`] on-the-fly when calling
21106 * [`ScoreLookUp`]: crate::routing::scoring::ScoreLookUp
21108 typedef struct MUST_USE_STRUCT LDKScorerAccountingForInFlightHtlcs {
21110 * A pointer to the opaque Rust object.
21111 * Nearly everywhere, inner must be non-null, however in places where
21112 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21114 LDKnativeScorerAccountingForInFlightHtlcs *inner;
21116 * Indicates that this is the only struct which contains the same pointer.
21117 * Rust functions which take ownership of an object provided via an argument require
21118 * this to be true and invalidate the object pointed to by inner.
21121 } LDKScorerAccountingForInFlightHtlcs;
21124 * The recipient of a payment, differing based on whether they've hidden their identity with route
21127 typedef enum LDKPayee_Tag {
21129 * The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
21130 * will be included in the final [`Route`].
21134 * The recipient included these route hints in their BOLT11 invoice.
21138 * Must be last for serialization purposes
21143 typedef struct LDKPayee_LDKBlinded_Body {
21145 * Aggregated routing info and blinded paths, for routing to the payee without knowing their
21148 struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints;
21150 * Features supported by the payee.
21152 * May be set from the payee's invoice. May be `None` if the invoice does not contain any
21155 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
21157 struct LDKBolt12InvoiceFeatures features;
21158 } LDKPayee_LDKBlinded_Body;
21160 typedef struct LDKPayee_LDKClear_Body {
21162 * The node id of the payee.
21164 struct LDKPublicKey node_id;
21166 * Hints for routing to the payee, containing channels connecting the payee to public nodes.
21168 struct LDKCVec_RouteHintZ route_hints;
21170 * Features supported by the payee.
21172 * May be set from the payee's invoice or via [`for_keysend`]. May be `None` if the invoice
21173 * does not contain any features.
21175 * [`for_keysend`]: PaymentParameters::for_keysend
21177 * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
21179 struct LDKBolt11InvoiceFeatures features;
21181 * The minimum CLTV delta at the end of the route. This value must not be zero.
21183 uint32_t final_cltv_expiry_delta;
21184 } LDKPayee_LDKClear_Body;
21186 typedef struct MUST_USE_STRUCT LDKPayee {
21189 LDKPayee_LDKBlinded_Body blinded;
21190 LDKPayee_LDKClear_Body clear;
21195 * A trait which can both lookup and update routing channel penalty scores.
21197 * This is used in places where both bounds are required and implemented for all types which
21198 * implement [`ScoreLookUp`] and [`ScoreUpdate`].
21200 * Bindings users may need to manually implement this for their custom scoring implementations.
21202 typedef struct LDKScore {
21204 * An opaque pointer which is passed to your function implementations as an argument.
21205 * This has no meaning in the LDK, and can be NULL or any other value.
21209 * Implementation of ScoreLookUp for this object.
21211 struct LDKScoreLookUp ScoreLookUp;
21213 * Implementation of ScoreUpdate for this object.
21215 struct LDKScoreUpdate ScoreUpdate;
21217 * Serialize the object into a byte array
21219 struct LDKCVec_u8Z (*write)(const void *this_arg);
21221 * Frees any resources associated with this object given its this_arg pointer.
21222 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21224 void (*free)(void *this_arg);
21230 * A concrete implementation of [`LockableScore`] which supports multi-threading.
21232 typedef struct MUST_USE_STRUCT LDKMultiThreadedLockableScore {
21234 * A pointer to the opaque Rust object.
21235 * Nearly everywhere, inner must be non-null, however in places where
21236 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21238 LDKnativeMultiThreadedLockableScore *inner;
21240 * Indicates that this is the only struct which contains the same pointer.
21241 * Rust functions which take ownership of an object provided via an argument require
21242 * this to be true and invalidate the object pointed to by inner.
21245 } LDKMultiThreadedLockableScore;
21250 * A locked `MultiThreadedLockableScore`.
21252 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockRead {
21254 * A pointer to the opaque Rust object.
21255 * Nearly everywhere, inner must be non-null, however in places where
21256 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21258 LDKnativeMultiThreadedScoreLockRead *inner;
21260 * Indicates that this is the only struct which contains the same pointer.
21261 * Rust functions which take ownership of an object provided via an argument require
21262 * this to be true and invalidate the object pointed to by inner.
21265 } LDKMultiThreadedScoreLockRead;
21270 * A locked `MultiThreadedLockableScore`.
21272 typedef struct MUST_USE_STRUCT LDKMultiThreadedScoreLockWrite {
21274 * A pointer to the opaque Rust object.
21275 * Nearly everywhere, inner must be non-null, however in places where
21276 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21278 LDKnativeMultiThreadedScoreLockWrite *inner;
21280 * Indicates that this is the only struct which contains the same pointer.
21281 * Rust functions which take ownership of an object provided via an argument require
21282 * this to be true and invalidate the object pointed to by inner.
21285 } LDKMultiThreadedScoreLockWrite;
21290 * Parameters for configuring [`ProbabilisticScorer`].
21292 * Used to configure decay parameters that are static throughout the lifetime of the scorer.
21293 * these decay parameters affect the score of the channel penalty and are not changed on a
21294 * per-route penalty cost call.
21296 typedef struct MUST_USE_STRUCT LDKProbabilisticScoringDecayParameters {
21298 * A pointer to the opaque Rust object.
21299 * Nearly everywhere, inner must be non-null, however in places where
21300 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21302 LDKnativeProbabilisticScoringDecayParameters *inner;
21304 * Indicates that this is the only struct which contains the same pointer.
21305 * Rust functions which take ownership of an object provided via an argument require
21306 * this to be true and invalidate the object pointed to by inner.
21309 } LDKProbabilisticScoringDecayParameters;
21314 * Simple implementation of [`EntropySource`], [`NodeSigner`], and [`SignerProvider`] that takes a
21315 * 32-byte seed for use as a BIP 32 extended key and derives keys from that.
21317 * Your `node_id` is seed/0'.
21318 * Unilateral closes may use seed/1'.
21319 * Cooperative closes may use seed/2'.
21320 * The two close keys may be needed to claim on-chain funds!
21322 * This struct cannot be used for nodes that wish to support receiving phantom payments;
21323 * [`PhantomKeysManager`] must be used instead.
21325 * Note that switching between this struct and [`PhantomKeysManager`] will invalidate any
21326 * previously issued invoices and attempts to pay previous invoices will fail.
21328 typedef struct MUST_USE_STRUCT LDKKeysManager {
21330 * A pointer to the opaque Rust object.
21331 * Nearly everywhere, inner must be non-null, however in places where
21332 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21334 LDKnativeKeysManager *inner;
21336 * Indicates that this is the only struct which contains the same pointer.
21337 * Rust functions which take ownership of an object provided via an argument require
21338 * this to be true and invalidate the object pointed to by inner.
21346 * Similar to [`KeysManager`], but allows the node using this struct to receive phantom node
21349 * A phantom node payment is a payment made to a phantom invoice, which is an invoice that can be
21350 * paid to one of multiple nodes. This works because we encode the invoice route hints such that
21351 * LDK will recognize an incoming payment as destined for a phantom node, and collect the payment
21352 * itself without ever needing to forward to this fake node.
21354 * Phantom node payments are useful for load balancing between multiple LDK nodes. They also
21355 * provide some fault tolerance, because payers will automatically retry paying other provided
21356 * nodes in the case that one node goes down.
21358 * Note that multi-path payments are not supported in phantom invoices for security reasons.
21359 * Switching between this struct and [`KeysManager`] will invalidate any previously issued
21360 * invoices and attempts to pay previous invoices will fail.
21362 typedef struct MUST_USE_STRUCT LDKPhantomKeysManager {
21364 * A pointer to the opaque Rust object.
21365 * Nearly everywhere, inner must be non-null, however in places where
21366 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21368 LDKnativePhantomKeysManager *inner;
21370 * Indicates that this is the only struct which contains the same pointer.
21371 * Rust functions which take ownership of an object provided via an argument require
21372 * this to be true and invalidate the object pointed to by inner.
21375 } LDKPhantomKeysManager;
21380 * A sender, receiver and forwarder of [`OnionMessage`]s.
21382 * # Handling Messages
21384 * `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
21385 * messages to peers or delegating to the appropriate handler for the message type. Currently, the
21386 * available handlers are:
21387 * * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
21388 * * [`CustomOnionMessageHandler`], for handling user-defined message types
21390 * # Sending Messages
21392 * [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
21393 * a message, the matched handler may return a response message which `OnionMessenger` will send
21399 * # extern crate bitcoin;
21400 * # use bitcoin::hashes::_export::_core::time::Duration;
21401 * # use bitcoin::hashes::hex::FromHex;
21402 * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self};
21403 * # use lightning::blinded_path::BlindedPath;
21404 * # use lightning::sign::{EntropySource, KeysManager};
21405 * # use lightning::ln::peer_handler::IgnoringMessageHandler;
21406 * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath, OnionMessenger};
21407 * # use lightning::onion_message::packet::OnionMessageContents;
21408 * # use lightning::util::logger::{Logger, Record};
21409 * # use lightning::util::ser::{Writeable, Writer};
21410 * # use lightning::io;
21411 * # use std::sync::Arc;
21412 * # struct FakeLogger;
21413 * # impl Logger for FakeLogger {
21414 * # fn log(&self, record: Record) { println!(\"{:?}\" , record); }
21416 * # struct FakeMessageRouter {}
21417 * # impl MessageRouter for FakeMessageRouter {
21418 * # fn find_path(&self, sender: PublicKey, peers: Vec<PublicKey>, destination: Destination) -> Result<OnionMessagePath, ()> {
21419 * # let secp_ctx = Secp256k1::new();
21420 * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
21421 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
21422 * # let hop_node_id2 = hop_node_id1;
21423 * # Ok(OnionMessagePath {
21424 * # intermediate_nodes: vec![hop_node_id1, hop_node_id2],
21426 * # first_node_addresses: None,
21429 * # fn create_blinded_paths<T: secp256k1::Signing + secp256k1::Verification>(
21430 * # &self, _recipient: PublicKey, _peers: Vec<PublicKey>, _secp_ctx: &Secp256k1<T>
21431 * # ) -> Result<Vec<BlindedPath>, ()> {
21435 * # let seed = [42u8; 32];
21436 * # let time = Duration::from_secs(123456);
21437 * # let keys_manager = KeysManager::new(&seed, time.as_secs(), time.subsec_nanos());
21438 * # let logger = Arc::new(FakeLogger {});
21439 * # let node_secret = SecretKey::from_slice(&<Vec<u8>>::from_hex(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
21440 * # let secp_ctx = Secp256k1::new();
21441 * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
21442 * # let (hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1);
21443 * # let destination_node_id = hop_node_id1;
21444 * # let message_router = Arc::new(FakeMessageRouter {});
21445 * # let custom_message_handler = IgnoringMessageHandler {};
21446 * # let offers_message_handler = IgnoringMessageHandler {};
21447 * // Create the onion messenger. This must use the same `keys_manager` as is passed to your
21448 * // ChannelManager.
21449 * let onion_messenger = OnionMessenger::new(
21450 * &keys_manager, &keys_manager, logger, message_router, &offers_message_handler,
21451 * &custom_message_handler
21454 * # #[derive(Debug, Clone)]
21455 * # struct YourCustomMessage {}
21456 * impl Writeable for YourCustomMessage {
21457 * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
21459 * \t\t// Write your custom onion message to `w`
21462 * impl OnionMessageContents for YourCustomMessage {
21463 * \tfn tlv_type(&self) -> u64 {
21464 * \t\t# let your_custom_message_type = 42;
21465 * \t\tyour_custom_message_type
21468 * // Send a custom onion message to a node id.
21469 * let destination = Destination::Node(destination_node_id);
21470 * let reply_path = None;
21471 * # let message = YourCustomMessage {};
21472 * onion_messenger.send_onion_message(message, destination, reply_path);
21474 * // Create a blinded path to yourself, for someone to send an onion message to.
21475 * # let your_node_id = hop_node_id1;
21476 * let hops = [hop_node_id3, hop_node_id4, your_node_id];
21477 * let blinded_path = BlindedPath::new_for_message(&hops, &keys_manager, &secp_ctx).unwrap();
21479 * // Send a custom onion message to a blinded path.
21480 * let destination = Destination::BlindedPath(blinded_path);
21481 * let reply_path = None;
21482 * # let message = YourCustomMessage {};
21483 * onion_messenger.send_onion_message(message, destination, reply_path);
21486 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
21487 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
21489 typedef struct MUST_USE_STRUCT LDKOnionMessenger {
21491 * A pointer to the opaque Rust object.
21492 * Nearly everywhere, inner must be non-null, however in places where
21493 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21495 LDKnativeOnionMessenger *inner;
21497 * Indicates that this is the only struct which contains the same pointer.
21498 * Rust functions which take ownership of an object provided via an argument require
21499 * this to be true and invalidate the object pointed to by inner.
21502 } LDKOnionMessenger;
21507 * A [`MessageRouter`] that can only route to a directly connected [`Destination`].
21509 typedef struct MUST_USE_STRUCT LDKDefaultMessageRouter {
21511 * A pointer to the opaque Rust object.
21512 * Nearly everywhere, inner must be non-null, however in places where
21513 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21515 LDKnativeDefaultMessageRouter *inner;
21517 * Indicates that this is the only struct which contains the same pointer.
21518 * Rust functions which take ownership of an object provided via an argument require
21519 * this to be true and invalidate the object pointed to by inner.
21522 } LDKDefaultMessageRouter;
21527 * Data to construct a [`BlindedHop`] for forwarding a payment.
21529 typedef struct MUST_USE_STRUCT LDKForwardTlvs {
21531 * A pointer to the opaque Rust object.
21532 * Nearly everywhere, inner must be non-null, however in places where
21533 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21535 LDKnativeForwardTlvs *inner;
21537 * Indicates that this is the only struct which contains the same pointer.
21538 * Rust functions which take ownership of an object provided via an argument require
21539 * this to be true and invalidate the object pointed to by inner.
21545 * An abstraction over a bitcoin wallet that can perform coin selection over a set of UTXOs and can
21546 * sign for them. The coin selection method aims to mimic Bitcoin Core's `fundrawtransaction` RPC,
21547 * which most wallets should be able to satisfy. Otherwise, consider implementing [`WalletSource`],
21548 * which can provide a default implementation of this trait when used with [`Wallet`].
21550 typedef struct LDKCoinSelectionSource {
21552 * An opaque pointer which is passed to your function implementations as an argument.
21553 * This has no meaning in the LDK, and can be NULL or any other value.
21557 * Performs coin selection of a set of UTXOs, with at least 1 confirmation each, that are
21558 * available to spend. Implementations are free to pick their coin selection algorithm of
21559 * choice, as long as the following requirements are met:
21561 * 1. `must_spend` contains a set of [`Input`]s that must be included in the transaction
21562 * throughout coin selection, but must not be returned as part of the result.
21563 * 2. `must_pay_to` contains a set of [`TxOut`]s that must be included in the transaction
21564 * throughout coin selection. In some cases, like when funding an anchor transaction, this
21565 * set is empty. Implementations should ensure they handle this correctly on their end,
21566 * e.g., Bitcoin Core's `fundrawtransaction` RPC requires at least one output to be
21567 * provided, in which case a zero-value empty OP_RETURN output can be used instead.
21568 * 3. Enough inputs must be selected/contributed for the resulting transaction (including the
21569 * inputs and outputs noted above) to meet `target_feerate_sat_per_1000_weight`.
21571 * Implementations must take note that [`Input::satisfaction_weight`] only tracks the weight of
21572 * the input's `script_sig` and `witness`. Some wallets, like Bitcoin Core's, may require
21573 * providing the full input weight. Failing to do so may lead to underestimating fee bumps and
21574 * delaying block inclusion.
21576 * The `claim_id` must map to the set of external UTXOs assigned to the claim, such that they
21577 * can be re-used within new fee-bumped iterations of the original claiming transaction,
21578 * ensuring that claims don't double spend each other. If a specific `claim_id` has never had a
21579 * transaction associated with it, and all of the available UTXOs have already been assigned to
21580 * other claims, implementations must be willing to double spend their UTXOs. The choice of
21581 * which UTXOs to double spend is left to the implementation, but it must strive to keep the
21582 * set of other claims being double spent to a minimum.
21584 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);
21586 * Signs and provides the full witness for all inputs within the transaction known to the
21587 * trait (i.e., any provided via [`CoinSelectionSource::select_confirmed_utxos`]).
21589 * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
21590 * unsigned transaction and then sign it with your wallet.
21592 struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
21594 * Frees any resources associated with this object given its this_arg pointer.
21595 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21597 void (*free)(void *this_arg);
21598 } LDKCoinSelectionSource;
21601 * An alternative to [`CoinSelectionSource`] that can be implemented and used along [`Wallet`] to
21602 * provide a default implementation to [`CoinSelectionSource`].
21604 typedef struct LDKWalletSource {
21606 * An opaque pointer which is passed to your function implementations as an argument.
21607 * This has no meaning in the LDK, and can be NULL or any other value.
21611 * Returns all UTXOs, with at least 1 confirmation each, that are available to spend.
21613 struct LDKCResult_CVec_UtxoZNoneZ (*list_confirmed_utxos)(const void *this_arg);
21615 * Returns a script to use for change above dust resulting from a successful coin selection
21618 struct LDKCResult_CVec_u8ZNoneZ (*get_change_script)(const void *this_arg);
21620 * Signs and provides the full [`TxIn::script_sig`] and [`TxIn::witness`] for all inputs within
21621 * the transaction known to the wallet (i.e., any provided via
21622 * [`WalletSource::list_confirmed_utxos`]).
21624 * If your wallet does not support signing PSBTs you can call `psbt.extract_tx()` to get the
21625 * unsigned transaction and then sign it with your wallet.
21627 struct LDKCResult_TransactionNoneZ (*sign_psbt)(const void *this_arg, struct LDKCVec_u8Z psbt);
21629 * Frees any resources associated with this object given its this_arg pointer.
21630 * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
21632 void (*free)(void *this_arg);
21638 * A wrapper over [`WalletSource`] that implements [`CoinSelection`] by preferring UTXOs that would
21639 * avoid conflicting double spends. If not enough UTXOs are available to do so, conflicting double
21640 * spends may happen.
21642 typedef struct MUST_USE_STRUCT LDKWallet {
21644 * A pointer to the opaque Rust object.
21645 * Nearly everywhere, inner must be non-null, however in places where
21646 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21648 LDKnativeWallet *inner;
21650 * Indicates that this is the only struct which contains the same pointer.
21651 * Rust functions which take ownership of an object provided via an argument require
21652 * this to be true and invalidate the object pointed to by inner.
21660 * A handler for [`Event::BumpTransaction`] events that sources confirmed UTXOs from a
21661 * [`CoinSelectionSource`] to fee bump transactions via Child-Pays-For-Parent (CPFP) or
21662 * Replace-By-Fee (RBF).
21664 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
21666 typedef struct MUST_USE_STRUCT LDKBumpTransactionEventHandler {
21668 * A pointer to the opaque Rust object.
21669 * Nearly everywhere, inner must be non-null, however in places where
21670 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21672 LDKnativeBumpTransactionEventHandler *inner;
21674 * Indicates that this is the only struct which contains the same pointer.
21675 * Rust functions which take ownership of an object provided via an argument require
21676 * this to be true and invalidate the object pointed to by inner.
21679 } LDKBumpTransactionEventHandler;
21684 * A [`KVStore`] implementation that writes to and reads from the file system.
21686 typedef struct MUST_USE_STRUCT LDKFilesystemStore {
21688 * A pointer to the opaque Rust object.
21689 * Nearly everywhere, inner must be non-null, however in places where
21690 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21692 LDKnativeFilesystemStore *inner;
21694 * Indicates that this is the only struct which contains the same pointer.
21695 * Rust functions which take ownership of an object provided via an argument require
21696 * this to be true and invalidate the object pointed to by inner.
21699 } LDKFilesystemStore;
21704 * `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
21705 * Rust-Lightning running properly, and (2) either can or should be run in the background. Its
21706 * responsibilities are:
21707 * * Processing [`Event`]s with a user-provided [`EventHandler`].
21708 * * Monitoring whether the [`ChannelManager`] needs to be re-persisted to disk, and if so,
21709 * writing it to disk/backups by invoking the callback given to it at startup.
21710 * [`ChannelManager`] persistence should be done in the background.
21711 * * Calling [`ChannelManager::timer_tick_occurred`], [`ChainMonitor::rebroadcast_pending_claims`]
21712 * and [`PeerManager::timer_tick_occurred`] at the appropriate intervals.
21713 * * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
21714 * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
21716 * It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
21717 * upon as doing so may result in high latency.
21721 * If [`ChannelManager`] persistence fails and the persisted manager becomes out-of-date, then
21722 * there is a risk of channels force-closing on startup when the manager realizes it's outdated.
21723 * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for
21724 * unilateral chain closure fees are at risk.
21726 * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor
21727 * [`Event`]: lightning::events::Event
21728 * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred
21729 * [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
21730 *BackgroundProcessor will immediately stop on drop. It should be stored until shutdown.
21732 typedef struct MUST_USE_STRUCT LDKBackgroundProcessor {
21734 * A pointer to the opaque Rust object.
21735 * Nearly everywhere, inner must be non-null, however in places where
21736 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21738 LDKnativeBackgroundProcessor *inner;
21740 * Indicates that this is the only struct which contains the same pointer.
21741 * Rust functions which take ownership of an object provided via an argument require
21742 * this to be true and invalidate the object pointed to by inner.
21745 } LDKBackgroundProcessor;
21750 * The main Rapid Gossip Sync object.
21752 * See [crate-level documentation] for usage.
21754 * [crate-level documentation]: crate
21756 typedef struct MUST_USE_STRUCT LDKRapidGossipSync {
21758 * A pointer to the opaque Rust object.
21759 * Nearly everywhere, inner must be non-null, however in places where
21760 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21762 LDKnativeRapidGossipSync *inner;
21764 * Indicates that this is the only struct which contains the same pointer.
21765 * Rust functions which take ownership of an object provided via an argument require
21766 * this to be true and invalidate the object pointed to by inner.
21769 } LDKRapidGossipSync;
21772 * Either [`P2PGossipSync`] or [`RapidGossipSync`].
21774 typedef enum LDKGossipSync_Tag {
21776 * Gossip sync via the lightning peer-to-peer network as defined by BOLT 7.
21780 * Rapid gossip sync from a trusted server.
21782 LDKGossipSync_Rapid,
21786 LDKGossipSync_None,
21788 * Must be last for serialization purposes
21790 LDKGossipSync_Sentinel,
21791 } LDKGossipSync_Tag;
21793 typedef struct MUST_USE_STRUCT LDKGossipSync {
21794 LDKGossipSync_Tag tag;
21798 * Note that this field is expected to be a reference.
21800 struct LDKP2PGossipSync p2p;
21804 * Note that this field is expected to be a reference.
21806 struct LDKRapidGossipSync rapid;
21814 * Data of the [`RawBolt11Invoice`] that is encoded in the data part
21816 typedef struct MUST_USE_STRUCT LDKRawDataPart {
21818 * A pointer to the opaque Rust object.
21819 * Nearly everywhere, inner must be non-null, however in places where
21820 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21822 LDKnativeRawDataPart *inner;
21824 * Indicates that this is the only struct which contains the same pointer.
21825 * Rust functions which take ownership of an object provided via an argument require
21826 * this to be true and invalidate the object pointed to by inner.
21836 typedef struct MUST_USE_STRUCT LDKSha256 {
21838 * A pointer to the opaque Rust object.
21839 * Nearly everywhere, inner must be non-null, however in places where
21840 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21842 LDKnativeSha256 *inner;
21844 * Indicates that this is the only struct which contains the same pointer.
21845 * Rust functions which take ownership of an object provided via an argument require
21846 * this to be true and invalidate the object pointed to by inner.
21854 * Positive duration that defines when (relatively to the timestamp) in the future the invoice
21857 typedef struct MUST_USE_STRUCT LDKExpiryTime {
21859 * A pointer to the opaque Rust object.
21860 * Nearly everywhere, inner must be non-null, however in places where
21861 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21863 LDKnativeExpiryTime *inner;
21865 * Indicates that this is the only struct which contains the same pointer.
21866 * Rust functions which take ownership of an object provided via an argument require
21867 * this to be true and invalidate the object pointed to by inner.
21875 * `min_final_cltv_expiry_delta` to use for the last HTLC in the route
21877 typedef struct MUST_USE_STRUCT LDKMinFinalCltvExpiryDelta {
21879 * A pointer to the opaque Rust object.
21880 * Nearly everywhere, inner must be non-null, however in places where
21881 * the Rust equivalent takes an Option, it may be set to null to indicate None.
21883 LDKnativeMinFinalCltvExpiryDelta *inner;
21885 * Indicates that this is the only struct which contains the same pointer.
21886 * Rust functions which take ownership of an object provided via an argument require
21887 * this to be true and invalidate the object pointed to by inner.
21890 } LDKMinFinalCltvExpiryDelta;
21893 * A 20-byte byte array.
21895 typedef struct LDKTwentyBytes {
21903 * Fallback address in case no LN payment is possible
21905 typedef enum LDKFallback_Tag {
21906 LDKFallback_SegWitProgram,
21907 LDKFallback_PubKeyHash,
21908 LDKFallback_ScriptHash,
21910 * Must be last for serialization purposes
21912 LDKFallback_Sentinel,
21915 typedef struct LDKFallback_LDKSegWitProgram_Body {
21916 struct LDKWitnessVersion version;
21917 struct LDKCVec_u8Z program;
21918 } LDKFallback_LDKSegWitProgram_Body;
21920 typedef struct MUST_USE_STRUCT LDKFallback {
21921 LDKFallback_Tag tag;
21923 LDKFallback_LDKSegWitProgram_Body seg_wit_program;
21925 struct LDKTwentyBytes pub_key_hash;
21928 struct LDKTwentyBytes script_hash;
21933 extern const uintptr_t MAX_BUF_SIZE;
21935 extern const uintptr_t KVSTORE_NAMESPACE_KEY_MAX_LEN;
21937 extern const uint64_t MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;
21939 extern const uint32_t FEERATE_FLOOR_SATS_PER_KW;
21941 extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
21943 extern const uint32_t ANTI_REORG_DELAY;
21945 extern const uint16_t BREAKDOWN_TIMEOUT;
21947 extern const uint16_t MIN_CLTV_EXPIRY_DELTA;
21949 extern const uint16_t MIN_FINAL_CLTV_EXPIRY_DELTA;
21951 extern const uint16_t MAX_HTLCS;
21953 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT;
21955 extern const uintptr_t OFFERED_HTLC_SCRIPT_WEIGHT_ANCHORS;
21957 extern const uintptr_t MAX_ACCEPTED_HTLC_SCRIPT_WEIGHT;
21959 extern const uint64_t ANCHOR_INPUT_WITNESS_WEIGHT;
21961 extern const uint64_t HTLC_TIMEOUT_INPUT_ANCHOR_WITNESS_WEIGHT;
21963 extern const uint64_t HTLC_SUCCESS_INPUT_ANCHOR_WITNESS_WEIGHT;
21965 extern const uintptr_t REVOKEABLE_REDEEMSCRIPT_MAX_LENGTH;
21967 extern const uint64_t UNKNOWN_CHANNEL_CAPACITY_MSAT;
21969 extern const uint32_t DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA;
21971 extern const uint8_t DEFAULT_MAX_PATH_COUNT;
21973 extern const uint64_t MAX_TIMESTAMP;
21975 extern const uint64_t DEFAULT_EXPIRY_TIME;
21977 extern const uint64_t DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA;
21979 extern const uint8_t TAG_PAYMENT_HASH;
21981 extern const uint8_t TAG_DESCRIPTION;
21983 extern const uint8_t TAG_PAYEE_PUB_KEY;
21985 extern const uint8_t TAG_DESCRIPTION_HASH;
21987 extern const uint8_t TAG_EXPIRY_TIME;
21989 extern const uint8_t TAG_MIN_FINAL_CLTV_EXPIRY_DELTA;
21991 extern const uint8_t TAG_FALLBACK;
21993 extern const uint8_t TAG_PRIVATE_ROUTE;
21995 extern const uint8_t TAG_PAYMENT_SECRET;
21997 extern const uint8_t TAG_PAYMENT_METADATA;
21999 extern const uint8_t TAG_FEATURES;
22001 struct LDKStr _ldk_get_compiled_version(void);
22003 struct LDKStr _ldk_c_bindings_get_compiled_version(void);
22006 * Gets the 128-bit integer, as 16 little-endian bytes
22008 struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val);
22011 * Constructs a new U128 from 16 little-endian bytes
22013 struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes);
22016 * Constructs a new WitnessProgram given a version and program bytes.
22018 * The program MUST be at least 2 bytes and no longer than 40 bytes long.
22019 * Further, if the version is 0, the program MUST be either exactly 20 or exactly 32 bytes long.
22021 struct LDKWitnessProgram WitnessProgram_new(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
22024 * Gets the `WitnessVersion` of the given `WitnessProgram`
22026 struct LDKWitnessVersion WitnessProgram_get_version(const struct LDKWitnessProgram *NONNULL_PTR prog);
22029 * Gets the witness program bytes of the given `WitnessProgram`
22031 struct LDKu8slice WitnessProgram_get_program(const struct LDKWitnessProgram *NONNULL_PTR prog);
22034 * Creates a new WitnessProgram which has the same data as `orig`
22036 struct LDKWitnessProgram WitnessProgram_clone(const struct LDKWitnessProgram *NONNULL_PTR orig);
22039 * Releases any memory held by the given `WitnessProgram` (which is currently none)
22041 void WitnessProgram_free(struct LDKWitnessProgram o);
22044 * Convenience function for constructing a new BigEndianScalar
22046 struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes);
22049 * Creates a new Bech32Error which has the same data as `orig`
22051 struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig);
22054 * Releases any memory held by the given `Bech32Error` (which is currently none)
22056 void Bech32Error_free(struct LDKBech32Error o);
22059 * Frees the data buffer, if data_is_owned is set and datalen > 0.
22061 void Transaction_free(struct LDKTransaction _res);
22064 * Creates a new Witness which has the same data as `orig` but with a new buffer.
22066 struct LDKWitness Witness_clone(const struct LDKWitness *NONNULL_PTR orig);
22069 * Frees the data pointed to by data
22071 void Witness_free(struct LDKWitness _res);
22074 * Convenience function for constructing a new TxIn
22076 struct LDKTxIn TxIn_new(struct LDKWitness witness, struct LDKCVec_u8Z script_sig, uint32_t sequence, struct LDKThirtyTwoBytes previous_txid, uint32_t previous_vout);
22079 * Gets the `witness` in the given `TxIn`.
22081 struct LDKWitness TxIn_get_witness(const struct LDKTxIn *NONNULL_PTR txin);
22084 * Gets the `script_sig` in the given `TxIn`.
22086 struct LDKu8slice TxIn_get_script_sig(const struct LDKTxIn *NONNULL_PTR txin);
22089 * Gets the `sequence` in the given `TxIn`.
22091 uint32_t TxIn_get_sequence(const struct LDKTxIn *NONNULL_PTR txin);
22094 * Gets the previous outpoint txid in the given `TxIn`.
22096 struct LDKThirtyTwoBytes TxIn_get_previous_txid(const struct LDKTxIn *NONNULL_PTR txin);
22099 * Gets the previout outpoint index in the given `TxIn`.
22101 uint32_t TxIn_get_previous_vout(const struct LDKTxIn *NONNULL_PTR txin);
22104 * Frees the witness and script_sig in a TxIn
22106 void TxIn_free(struct LDKTxIn _res);
22109 * Convenience function for constructing a new TxOut
22111 struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
22114 * Gets the `script_pubkey` in the given `TxOut`.
22116 struct LDKu8slice TxOut_get_script_pubkey(const struct LDKTxOut *NONNULL_PTR txout);
22119 * Gets the value in the given `TxOut`.
22121 uint64_t TxOut_get_value(const struct LDKTxOut *NONNULL_PTR txout);
22124 * Frees the data pointed to by script_pubkey.
22126 void TxOut_free(struct LDKTxOut _res);
22129 * Creates a new TxOut which has the same data as `orig` but with a new script buffer.
22131 struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
22134 * Frees the data buffer, if chars_is_owned is set and len > 0.
22136 void Str_free(struct LDKStr _res);
22138 #if defined(LDK_DEBUG_BUILD)
22140 * This function exists for memory safety testing purposes. It should never be used in production
22143 const void *__unmangle_inner_ptr(const void *ptr);
22147 * Constructs a new COption_u64Z containing a u64
22149 struct LDKCOption_u64Z COption_u64Z_some(uint64_t o);
22152 * Constructs a new COption_u64Z containing nothing
22154 struct LDKCOption_u64Z COption_u64Z_none(void);
22157 * Frees any resources associated with the u64, if we are in the Some state
22159 void COption_u64Z_free(struct LDKCOption_u64Z _res);
22162 * Creates a new COption_u64Z which has the same data as `orig`
22163 * but with all dynamically-allocated buffers duplicated in new buffers.
22165 struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig);
22168 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22170 void CVec_BlindedPathZ_free(struct LDKCVec_BlindedPathZ _res);
22173 * Creates a new CResult_RefundBolt12ParseErrorZ in the success state.
22175 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_ok(struct LDKRefund o);
22178 * Creates a new CResult_RefundBolt12ParseErrorZ in the error state.
22180 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
22183 * Checks if the given object is currently in the success state
22185 bool CResult_RefundBolt12ParseErrorZ_is_ok(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR o);
22188 * Frees any resources used by the CResult_RefundBolt12ParseErrorZ.
22190 void CResult_RefundBolt12ParseErrorZ_free(struct LDKCResult_RefundBolt12ParseErrorZ _res);
22193 * Creates a new CResult_RefundBolt12ParseErrorZ which has the same data as `orig`
22194 * but with all dynamically-allocated buffers duplicated in new buffers.
22196 struct LDKCResult_RefundBolt12ParseErrorZ CResult_RefundBolt12ParseErrorZ_clone(const struct LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR orig);
22199 * Creates a new CResult_RetryDecodeErrorZ in the success state.
22201 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_ok(struct LDKRetry o);
22204 * Creates a new CResult_RetryDecodeErrorZ in the error state.
22206 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_err(struct LDKDecodeError e);
22209 * Checks if the given object is currently in the success state
22211 bool CResult_RetryDecodeErrorZ_is_ok(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR o);
22214 * Frees any resources used by the CResult_RetryDecodeErrorZ.
22216 void CResult_RetryDecodeErrorZ_free(struct LDKCResult_RetryDecodeErrorZ _res);
22219 * Creates a new CResult_RetryDecodeErrorZ which has the same data as `orig`
22220 * but with all dynamically-allocated buffers duplicated in new buffers.
22222 struct LDKCResult_RetryDecodeErrorZ CResult_RetryDecodeErrorZ_clone(const struct LDKCResult_RetryDecodeErrorZ *NONNULL_PTR orig);
22225 * Creates a new CResult_NoneAPIErrorZ in the success state.
22227 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void);
22230 * Creates a new CResult_NoneAPIErrorZ in the error state.
22232 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e);
22235 * Checks if the given object is currently in the success state
22237 bool CResult_NoneAPIErrorZ_is_ok(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR o);
22240 * Frees any resources used by the CResult_NoneAPIErrorZ.
22242 void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res);
22245 * Creates a new CResult_NoneAPIErrorZ which has the same data as `orig`
22246 * but with all dynamically-allocated buffers duplicated in new buffers.
22248 struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_clone(const struct LDKCResult_NoneAPIErrorZ *NONNULL_PTR orig);
22251 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22253 void CVec_CResult_NoneAPIErrorZZ_free(struct LDKCVec_CResult_NoneAPIErrorZZ _res);
22256 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22258 void CVec_APIErrorZ_free(struct LDKCVec_APIErrorZ _res);
22261 * Constructs a new COption_ThirtyTwoBytesZ containing a crate::c_types::ThirtyTwoBytes
22263 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_some(struct LDKThirtyTwoBytes o);
22266 * Constructs a new COption_ThirtyTwoBytesZ containing nothing
22268 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_none(void);
22271 * Frees any resources associated with the crate::c_types::ThirtyTwoBytes, if we are in the Some state
22273 void COption_ThirtyTwoBytesZ_free(struct LDKCOption_ThirtyTwoBytesZ _res);
22276 * Creates a new COption_ThirtyTwoBytesZ which has the same data as `orig`
22277 * but with all dynamically-allocated buffers duplicated in new buffers.
22279 struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_clone(const struct LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR orig);
22282 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22284 void CVec_u8Z_free(struct LDKCVec_u8Z _res);
22287 * Constructs a new COption_CVec_u8ZZ containing a crate::c_types::derived::CVec_u8Z
22289 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o);
22292 * Constructs a new COption_CVec_u8ZZ containing nothing
22294 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void);
22297 * Frees any resources associated with the crate::c_types::derived::CVec_u8Z, if we are in the Some state
22299 void COption_CVec_u8ZZ_free(struct LDKCOption_CVec_u8ZZ _res);
22302 * Creates a new COption_CVec_u8ZZ which has the same data as `orig`
22303 * but with all dynamically-allocated buffers duplicated in new buffers.
22305 struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_clone(const struct LDKCOption_CVec_u8ZZ *NONNULL_PTR orig);
22308 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state.
22310 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_ok(struct LDKRecipientOnionFields o);
22313 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the error state.
22315 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_err(struct LDKDecodeError e);
22318 * Checks if the given object is currently in the success state
22320 bool CResult_RecipientOnionFieldsDecodeErrorZ_is_ok(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR o);
22323 * Frees any resources used by the CResult_RecipientOnionFieldsDecodeErrorZ.
22325 void CResult_RecipientOnionFieldsDecodeErrorZ_free(struct LDKCResult_RecipientOnionFieldsDecodeErrorZ _res);
22328 * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ which has the same data as `orig`
22329 * but with all dynamically-allocated buffers duplicated in new buffers.
22331 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ CResult_RecipientOnionFieldsDecodeErrorZ_clone(const struct LDKCResult_RecipientOnionFieldsDecodeErrorZ *NONNULL_PTR orig);
22334 * Creates a new tuple which has the same data as `orig`
22335 * but with all dynamically-allocated buffers duplicated in new buffers.
22337 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_clone(const struct LDKC2Tuple_u64CVec_u8ZZ *NONNULL_PTR orig);
22340 * Creates a new C2Tuple_u64CVec_u8ZZ from the contained elements.
22342 struct LDKC2Tuple_u64CVec_u8ZZ C2Tuple_u64CVec_u8ZZ_new(uint64_t a, struct LDKCVec_u8Z b);
22345 * Frees any resources used by the C2Tuple_u64CVec_u8ZZ.
22347 void C2Tuple_u64CVec_u8ZZ_free(struct LDKC2Tuple_u64CVec_u8ZZ _res);
22350 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22352 void CVec_C2Tuple_u64CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u64CVec_u8ZZZ _res);
22355 * Creates a new CResult_RecipientOnionFieldsNoneZ in the success state.
22357 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_ok(struct LDKRecipientOnionFields o);
22360 * Creates a new CResult_RecipientOnionFieldsNoneZ in the error state.
22362 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_err(void);
22365 * Checks if the given object is currently in the success state
22367 bool CResult_RecipientOnionFieldsNoneZ_is_ok(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR o);
22370 * Frees any resources used by the CResult_RecipientOnionFieldsNoneZ.
22372 void CResult_RecipientOnionFieldsNoneZ_free(struct LDKCResult_RecipientOnionFieldsNoneZ _res);
22375 * Creates a new CResult_RecipientOnionFieldsNoneZ which has the same data as `orig`
22376 * but with all dynamically-allocated buffers duplicated in new buffers.
22378 struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig);
22381 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22383 void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res);
22386 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing a crate::c_types::derived::CVec_ThirtyTwoBytesZ
22388 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o);
22391 * Constructs a new COption_CVec_ThirtyTwoBytesZZ containing nothing
22393 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_none(void);
22396 * Frees any resources associated with the crate::c_types::derived::CVec_ThirtyTwoBytesZ, if we are in the Some state
22398 void COption_CVec_ThirtyTwoBytesZZ_free(struct LDKCOption_CVec_ThirtyTwoBytesZZ _res);
22401 * Creates a new COption_CVec_ThirtyTwoBytesZZ which has the same data as `orig`
22402 * but with all dynamically-allocated buffers duplicated in new buffers.
22404 struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_clone(const struct LDKCOption_CVec_ThirtyTwoBytesZZ *NONNULL_PTR orig);
22407 * Creates a new CResult_ThirtyTwoBytesNoneZ in the success state.
22409 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_ok(struct LDKThirtyTwoBytes o);
22412 * Creates a new CResult_ThirtyTwoBytesNoneZ in the error state.
22414 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_err(void);
22417 * Checks if the given object is currently in the success state
22419 bool CResult_ThirtyTwoBytesNoneZ_is_ok(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR o);
22422 * Frees any resources used by the CResult_ThirtyTwoBytesNoneZ.
22424 void CResult_ThirtyTwoBytesNoneZ_free(struct LDKCResult_ThirtyTwoBytesNoneZ _res);
22427 * Creates a new CResult_ThirtyTwoBytesNoneZ which has the same data as `orig`
22428 * but with all dynamically-allocated buffers duplicated in new buffers.
22430 struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_clone(const struct LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR orig);
22433 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state.
22435 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_ok(struct LDKBlindedPayInfo o);
22438 * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the error state.
22440 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_err(struct LDKDecodeError e);
22443 * Checks if the given object is currently in the success state
22445 bool CResult_BlindedPayInfoDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR o);
22448 * Frees any resources used by the CResult_BlindedPayInfoDecodeErrorZ.
22450 void CResult_BlindedPayInfoDecodeErrorZ_free(struct LDKCResult_BlindedPayInfoDecodeErrorZ _res);
22453 * Creates a new CResult_BlindedPayInfoDecodeErrorZ which has the same data as `orig`
22454 * but with all dynamically-allocated buffers duplicated in new buffers.
22456 struct LDKCResult_BlindedPayInfoDecodeErrorZ CResult_BlindedPayInfoDecodeErrorZ_clone(const struct LDKCResult_BlindedPayInfoDecodeErrorZ *NONNULL_PTR orig);
22459 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state.
22461 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKDelayedPaymentOutputDescriptor o);
22464 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
22466 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
22469 * Checks if the given object is currently in the success state
22471 bool CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
22474 * Frees any resources used by the CResult_DelayedPaymentOutputDescriptorDecodeErrorZ.
22476 void CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res);
22479 * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
22480 * but with all dynamically-allocated buffers duplicated in new buffers.
22482 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
22485 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state.
22487 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(struct LDKStaticPaymentOutputDescriptor o);
22490 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
22492 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
22495 * Checks if the given object is currently in the success state
22497 bool CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
22500 * Frees any resources used by the CResult_StaticPaymentOutputDescriptorDecodeErrorZ.
22502 void CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res);
22505 * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ which has the same data as `orig`
22506 * but with all dynamically-allocated buffers duplicated in new buffers.
22508 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
22511 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state.
22513 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o);
22516 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
22518 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
22521 * Checks if the given object is currently in the success state
22523 bool CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR o);
22526 * Frees any resources used by the CResult_SpendableOutputDescriptorDecodeErrorZ.
22528 void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res);
22531 * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ which has the same data as `orig`
22532 * but with all dynamically-allocated buffers duplicated in new buffers.
22534 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_clone(const struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR orig);
22537 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22539 void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res);
22542 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22544 void CVec_TxOutZ_free(struct LDKCVec_TxOutZ _res);
22547 * Constructs a new COption_u32Z containing a u32
22549 struct LDKCOption_u32Z COption_u32Z_some(uint32_t o);
22552 * Constructs a new COption_u32Z containing nothing
22554 struct LDKCOption_u32Z COption_u32Z_none(void);
22557 * Frees any resources associated with the u32, if we are in the Some state
22559 void COption_u32Z_free(struct LDKCOption_u32Z _res);
22562 * Creates a new COption_u32Z which has the same data as `orig`
22563 * but with all dynamically-allocated buffers duplicated in new buffers.
22565 struct LDKCOption_u32Z COption_u32Z_clone(const struct LDKCOption_u32Z *NONNULL_PTR orig);
22568 * Creates a new tuple which has the same data as `orig`
22569 * but with all dynamically-allocated buffers duplicated in new buffers.
22571 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_clone(const struct LDKC2Tuple_CVec_u8Zu64Z *NONNULL_PTR orig);
22574 * Creates a new C2Tuple_CVec_u8Zu64Z from the contained elements.
22576 struct LDKC2Tuple_CVec_u8Zu64Z C2Tuple_CVec_u8Zu64Z_new(struct LDKCVec_u8Z a, uint64_t b);
22579 * Frees any resources used by the C2Tuple_CVec_u8Zu64Z.
22581 void C2Tuple_CVec_u8Zu64Z_free(struct LDKC2Tuple_CVec_u8Zu64Z _res);
22584 * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the success state.
22586 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_ok(struct LDKC2Tuple_CVec_u8Zu64Z o);
22589 * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the error state.
22591 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_err(void);
22594 * Checks if the given object is currently in the success state
22596 bool CResult_C2Tuple_CVec_u8Zu64ZNoneZ_is_ok(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR o);
22599 * Frees any resources used by the CResult_C2Tuple_CVec_u8Zu64ZNoneZ.
22601 void CResult_C2Tuple_CVec_u8Zu64ZNoneZ_free(struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ _res);
22604 * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ which has the same data as `orig`
22605 * but with all dynamically-allocated buffers duplicated in new buffers.
22607 struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ CResult_C2Tuple_CVec_u8Zu64ZNoneZ_clone(const struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ *NONNULL_PTR orig);
22610 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the success state.
22612 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_ok(struct LDKChannelDerivationParameters o);
22615 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the error state.
22617 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_err(struct LDKDecodeError e);
22620 * Checks if the given object is currently in the success state
22622 bool CResult_ChannelDerivationParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR o);
22625 * Frees any resources used by the CResult_ChannelDerivationParametersDecodeErrorZ.
22627 void CResult_ChannelDerivationParametersDecodeErrorZ_free(struct LDKCResult_ChannelDerivationParametersDecodeErrorZ _res);
22630 * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ which has the same data as `orig`
22631 * but with all dynamically-allocated buffers duplicated in new buffers.
22633 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ CResult_ChannelDerivationParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelDerivationParametersDecodeErrorZ *NONNULL_PTR orig);
22636 * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the success state.
22638 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_ok(struct LDKHTLCDescriptor o);
22641 * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the error state.
22643 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_err(struct LDKDecodeError e);
22646 * Checks if the given object is currently in the success state
22648 bool CResult_HTLCDescriptorDecodeErrorZ_is_ok(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR o);
22651 * Frees any resources used by the CResult_HTLCDescriptorDecodeErrorZ.
22653 void CResult_HTLCDescriptorDecodeErrorZ_free(struct LDKCResult_HTLCDescriptorDecodeErrorZ _res);
22656 * Creates a new CResult_HTLCDescriptorDecodeErrorZ which has the same data as `orig`
22657 * but with all dynamically-allocated buffers duplicated in new buffers.
22659 struct LDKCResult_HTLCDescriptorDecodeErrorZ CResult_HTLCDescriptorDecodeErrorZ_clone(const struct LDKCResult_HTLCDescriptorDecodeErrorZ *NONNULL_PTR orig);
22662 * Creates a new CResult_NoneNoneZ in the success state.
22664 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void);
22667 * Creates a new CResult_NoneNoneZ in the error state.
22669 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void);
22672 * Checks if the given object is currently in the success state
22674 bool CResult_NoneNoneZ_is_ok(const struct LDKCResult_NoneNoneZ *NONNULL_PTR o);
22677 * Frees any resources used by the CResult_NoneNoneZ.
22679 void CResult_NoneNoneZ_free(struct LDKCResult_NoneNoneZ _res);
22682 * Creates a new CResult_NoneNoneZ which has the same data as `orig`
22683 * but with all dynamically-allocated buffers duplicated in new buffers.
22685 struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_clone(const struct LDKCResult_NoneNoneZ *NONNULL_PTR orig);
22688 * Creates a new CResult_PublicKeyNoneZ in the success state.
22690 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
22693 * Creates a new CResult_PublicKeyNoneZ in the error state.
22695 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
22698 * Checks if the given object is currently in the success state
22700 bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
22703 * Frees any resources used by the CResult_PublicKeyNoneZ.
22705 void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
22708 * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
22709 * but with all dynamically-allocated buffers duplicated in new buffers.
22711 struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
22714 * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar
22716 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_some(struct LDKBigEndianScalar o);
22719 * Constructs a new COption_BigEndianScalarZ containing nothing
22721 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_none(void);
22724 * Frees any resources associated with the crate::c_types::BigEndianScalar, if we are in the Some state
22726 void COption_BigEndianScalarZ_free(struct LDKCOption_BigEndianScalarZ _res);
22729 * Creates a new COption_BigEndianScalarZ which has the same data as `orig`
22730 * but with all dynamically-allocated buffers duplicated in new buffers.
22732 struct LDKCOption_BigEndianScalarZ COption_BigEndianScalarZ_clone(const struct LDKCOption_BigEndianScalarZ *NONNULL_PTR orig);
22735 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22737 void CVec_U5Z_free(struct LDKCVec_U5Z _res);
22740 * Creates a new CResult_RecoverableSignatureNoneZ in the success state.
22742 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o);
22745 * Creates a new CResult_RecoverableSignatureNoneZ in the error state.
22747 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void);
22750 * Checks if the given object is currently in the success state
22752 bool CResult_RecoverableSignatureNoneZ_is_ok(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR o);
22755 * Frees any resources used by the CResult_RecoverableSignatureNoneZ.
22757 void CResult_RecoverableSignatureNoneZ_free(struct LDKCResult_RecoverableSignatureNoneZ _res);
22760 * Creates a new CResult_RecoverableSignatureNoneZ which has the same data as `orig`
22761 * but with all dynamically-allocated buffers duplicated in new buffers.
22763 struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig);
22766 * Creates a new CResult_SchnorrSignatureNoneZ in the success state.
22768 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o);
22771 * Creates a new CResult_SchnorrSignatureNoneZ in the error state.
22773 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void);
22776 * Checks if the given object is currently in the success state
22778 bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o);
22781 * Frees any resources used by the CResult_SchnorrSignatureNoneZ.
22783 void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res);
22786 * Creates a new CResult_SchnorrSignatureNoneZ which has the same data as `orig`
22787 * but with all dynamically-allocated buffers duplicated in new buffers.
22789 struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig);
22792 * Creates a new CResult_ECDSASignatureNoneZ in the success state.
22794 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_ok(struct LDKECDSASignature o);
22797 * Creates a new CResult_ECDSASignatureNoneZ in the error state.
22799 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_err(void);
22802 * Checks if the given object is currently in the success state
22804 bool CResult_ECDSASignatureNoneZ_is_ok(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR o);
22807 * Frees any resources used by the CResult_ECDSASignatureNoneZ.
22809 void CResult_ECDSASignatureNoneZ_free(struct LDKCResult_ECDSASignatureNoneZ _res);
22812 * Creates a new CResult_ECDSASignatureNoneZ which has the same data as `orig`
22813 * but with all dynamically-allocated buffers duplicated in new buffers.
22815 struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_clone(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR orig);
22818 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
22820 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o);
22823 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the error state.
22825 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e);
22828 * Checks if the given object is currently in the success state
22830 bool CResult_WriteableEcdsaChannelSignerDecodeErrorZ_is_ok(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR o);
22833 * Frees any resources used by the CResult_WriteableEcdsaChannelSignerDecodeErrorZ.
22835 void CResult_WriteableEcdsaChannelSignerDecodeErrorZ_free(struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ _res);
22838 * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ which has the same data as `orig`
22839 * but with all dynamically-allocated buffers duplicated in new buffers.
22841 struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_clone(const struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ *NONNULL_PTR orig);
22844 * Creates a new CResult_CVec_u8ZNoneZ in the success state.
22846 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_ok(struct LDKCVec_u8Z o);
22849 * Creates a new CResult_CVec_u8ZNoneZ in the error state.
22851 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_err(void);
22854 * Checks if the given object is currently in the success state
22856 bool CResult_CVec_u8ZNoneZ_is_ok(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR o);
22859 * Frees any resources used by the CResult_CVec_u8ZNoneZ.
22861 void CResult_CVec_u8ZNoneZ_free(struct LDKCResult_CVec_u8ZNoneZ _res);
22864 * Creates a new CResult_CVec_u8ZNoneZ which has the same data as `orig`
22865 * but with all dynamically-allocated buffers duplicated in new buffers.
22867 struct LDKCResult_CVec_u8ZNoneZ CResult_CVec_u8ZNoneZ_clone(const struct LDKCResult_CVec_u8ZNoneZ *NONNULL_PTR orig);
22870 * Creates a new CResult_ShutdownScriptNoneZ in the success state.
22872 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_ok(struct LDKShutdownScript o);
22875 * Creates a new CResult_ShutdownScriptNoneZ in the error state.
22877 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_err(void);
22880 * Checks if the given object is currently in the success state
22882 bool CResult_ShutdownScriptNoneZ_is_ok(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR o);
22885 * Frees any resources used by the CResult_ShutdownScriptNoneZ.
22887 void CResult_ShutdownScriptNoneZ_free(struct LDKCResult_ShutdownScriptNoneZ _res);
22890 * Creates a new CResult_ShutdownScriptNoneZ which has the same data as `orig`
22891 * but with all dynamically-allocated buffers duplicated in new buffers.
22893 struct LDKCResult_ShutdownScriptNoneZ CResult_ShutdownScriptNoneZ_clone(const struct LDKCResult_ShutdownScriptNoneZ *NONNULL_PTR orig);
22896 * Constructs a new COption_u16Z containing a u16
22898 struct LDKCOption_u16Z COption_u16Z_some(uint16_t o);
22901 * Constructs a new COption_u16Z containing nothing
22903 struct LDKCOption_u16Z COption_u16Z_none(void);
22906 * Frees any resources associated with the u16, if we are in the Some state
22908 void COption_u16Z_free(struct LDKCOption_u16Z _res);
22911 * Creates a new COption_u16Z which has the same data as `orig`
22912 * but with all dynamically-allocated buffers duplicated in new buffers.
22914 struct LDKCOption_u16Z COption_u16Z_clone(const struct LDKCOption_u16Z *NONNULL_PTR orig);
22917 * Constructs a new COption_boolZ containing a bool
22919 struct LDKCOption_boolZ COption_boolZ_some(bool o);
22922 * Constructs a new COption_boolZ containing nothing
22924 struct LDKCOption_boolZ COption_boolZ_none(void);
22927 * Frees any resources associated with the bool, if we are in the Some state
22929 void COption_boolZ_free(struct LDKCOption_boolZ _res);
22932 * Creates a new COption_boolZ which has the same data as `orig`
22933 * but with all dynamically-allocated buffers duplicated in new buffers.
22935 struct LDKCOption_boolZ COption_boolZ_clone(const struct LDKCOption_boolZ *NONNULL_PTR orig);
22938 * Creates a new CResult_WitnessNoneZ in the success state.
22940 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_ok(struct LDKWitness o);
22943 * Creates a new CResult_WitnessNoneZ in the error state.
22945 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_err(void);
22948 * Checks if the given object is currently in the success state
22950 bool CResult_WitnessNoneZ_is_ok(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR o);
22953 * Frees any resources used by the CResult_WitnessNoneZ.
22955 void CResult_WitnessNoneZ_free(struct LDKCResult_WitnessNoneZ _res);
22958 * Creates a new CResult_WitnessNoneZ which has the same data as `orig`
22959 * but with all dynamically-allocated buffers duplicated in new buffers.
22961 struct LDKCResult_WitnessNoneZ CResult_WitnessNoneZ_clone(const struct LDKCResult_WitnessNoneZ *NONNULL_PTR orig);
22964 * Frees the buffer pointed to by `data` if `datalen` is non-0.
22966 void CVec_ECDSASignatureZ_free(struct LDKCVec_ECDSASignatureZ _res);
22969 * Creates a new tuple which has the same data as `orig`
22970 * but with all dynamically-allocated buffers duplicated in new buffers.
22972 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_clone(const struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR orig);
22975 * Creates a new C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ from the contained elements.
22977 struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_new(struct LDKECDSASignature a, struct LDKCVec_ECDSASignatureZ b);
22980 * Frees any resources used by the C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ.
22982 void C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_free(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ _res);
22985 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the success state.
22987 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(struct LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ o);
22990 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the error state.
22992 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_err(void);
22995 * Checks if the given object is currently in the success state
22997 bool CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR o);
23000 * Frees any resources used by the CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.
23002 void CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_free(struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ _res);
23005 * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ which has the same data as `orig`
23006 * but with all dynamically-allocated buffers duplicated in new buffers.
23008 struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_clone(const struct LDKCResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ *NONNULL_PTR orig);
23011 * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state.
23013 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_ok(struct LDKInMemorySigner o);
23016 * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
23018 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_err(struct LDKDecodeError e);
23021 * Checks if the given object is currently in the success state
23023 bool CResult_InMemorySignerDecodeErrorZ_is_ok(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR o);
23026 * Frees any resources used by the CResult_InMemorySignerDecodeErrorZ.
23028 void CResult_InMemorySignerDecodeErrorZ_free(struct LDKCResult_InMemorySignerDecodeErrorZ _res);
23031 * Creates a new CResult_InMemorySignerDecodeErrorZ which has the same data as `orig`
23032 * but with all dynamically-allocated buffers duplicated in new buffers.
23034 struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig);
23037 * Creates a new CResult_TransactionNoneZ in the success state.
23039 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o);
23042 * Creates a new CResult_TransactionNoneZ in the error state.
23044 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void);
23047 * Checks if the given object is currently in the success state
23049 bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o);
23052 * Frees any resources used by the CResult_TransactionNoneZ.
23054 void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res);
23057 * Creates a new CResult_TransactionNoneZ which has the same data as `orig`
23058 * but with all dynamically-allocated buffers duplicated in new buffers.
23060 struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig);
23063 * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
23065 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o);
23068 * Constructs a new COption_WriteableScoreZ containing nothing
23070 struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void);
23073 * Frees any resources associated with the crate::lightning::routing::scoring::WriteableScore, if we are in the Some state
23075 void COption_WriteableScoreZ_free(struct LDKCOption_WriteableScoreZ _res);
23078 * Creates a new CResult_NoneIOErrorZ in the success state.
23080 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_ok(void);
23083 * Creates a new CResult_NoneIOErrorZ in the error state.
23085 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_err(enum LDKIOError e);
23088 * Checks if the given object is currently in the success state
23090 bool CResult_NoneIOErrorZ_is_ok(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR o);
23093 * Frees any resources used by the CResult_NoneIOErrorZ.
23095 void CResult_NoneIOErrorZ_free(struct LDKCResult_NoneIOErrorZ _res);
23098 * Creates a new CResult_NoneIOErrorZ which has the same data as `orig`
23099 * but with all dynamically-allocated buffers duplicated in new buffers.
23101 struct LDKCResult_NoneIOErrorZ CResult_NoneIOErrorZ_clone(const struct LDKCResult_NoneIOErrorZ *NONNULL_PTR orig);
23104 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23106 void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res);
23109 * Creates a new CResult_RouteLightningErrorZ in the success state.
23111 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o);
23114 * Creates a new CResult_RouteLightningErrorZ in the error state.
23116 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e);
23119 * Checks if the given object is currently in the success state
23121 bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o);
23124 * Frees any resources used by the CResult_RouteLightningErrorZ.
23126 void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res);
23129 * Creates a new CResult_RouteLightningErrorZ which has the same data as `orig`
23130 * but with all dynamically-allocated buffers duplicated in new buffers.
23132 struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig);
23135 * Creates a new tuple which has the same data as `orig`
23136 * but with all dynamically-allocated buffers duplicated in new buffers.
23138 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_clone(const struct LDKC2Tuple_BlindedPayInfoBlindedPathZ *NONNULL_PTR orig);
23141 * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements.
23143 struct LDKC2Tuple_BlindedPayInfoBlindedPathZ C2Tuple_BlindedPayInfoBlindedPathZ_new(struct LDKBlindedPayInfo a, struct LDKBlindedPath b);
23146 * Frees any resources used by the C2Tuple_BlindedPayInfoBlindedPathZ.
23148 void C2Tuple_BlindedPayInfoBlindedPathZ_free(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ _res);
23151 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23153 void CVec_C2Tuple_BlindedPayInfoBlindedPathZZ_free(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ _res);
23156 * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the success state.
23158 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ o);
23161 * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the error state.
23163 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_err(void);
23166 * Checks if the given object is currently in the success state
23168 bool CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_is_ok(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR o);
23171 * Frees any resources used by the CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.
23173 void CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_free(struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ _res);
23176 * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ which has the same data as `orig`
23177 * but with all dynamically-allocated buffers duplicated in new buffers.
23179 struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_clone(const struct LDKCResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ *NONNULL_PTR orig);
23182 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23184 void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res);
23187 * Creates a new CResult_OnionMessagePathNoneZ in the success state.
23189 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_ok(struct LDKOnionMessagePath o);
23192 * Creates a new CResult_OnionMessagePathNoneZ in the error state.
23194 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_err(void);
23197 * Checks if the given object is currently in the success state
23199 bool CResult_OnionMessagePathNoneZ_is_ok(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR o);
23202 * Frees any resources used by the CResult_OnionMessagePathNoneZ.
23204 void CResult_OnionMessagePathNoneZ_free(struct LDKCResult_OnionMessagePathNoneZ _res);
23207 * Creates a new CResult_OnionMessagePathNoneZ which has the same data as `orig`
23208 * but with all dynamically-allocated buffers duplicated in new buffers.
23210 struct LDKCResult_OnionMessagePathNoneZ CResult_OnionMessagePathNoneZ_clone(const struct LDKCResult_OnionMessagePathNoneZ *NONNULL_PTR orig);
23213 * Creates a new CResult_CVec_BlindedPathZNoneZ in the success state.
23215 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_ok(struct LDKCVec_BlindedPathZ o);
23218 * Creates a new CResult_CVec_BlindedPathZNoneZ in the error state.
23220 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_err(void);
23223 * Checks if the given object is currently in the success state
23225 bool CResult_CVec_BlindedPathZNoneZ_is_ok(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR o);
23228 * Frees any resources used by the CResult_CVec_BlindedPathZNoneZ.
23230 void CResult_CVec_BlindedPathZNoneZ_free(struct LDKCResult_CVec_BlindedPathZNoneZ _res);
23233 * Creates a new CResult_CVec_BlindedPathZNoneZ which has the same data as `orig`
23234 * but with all dynamically-allocated buffers duplicated in new buffers.
23236 struct LDKCResult_CVec_BlindedPathZNoneZ CResult_CVec_BlindedPathZNoneZ_clone(const struct LDKCResult_CVec_BlindedPathZNoneZ *NONNULL_PTR orig);
23239 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state.
23241 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o);
23244 * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
23246 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e);
23249 * Checks if the given object is currently in the success state
23251 bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o);
23254 * Frees any resources used by the CResult_InFlightHtlcsDecodeErrorZ.
23256 void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res);
23259 * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig`
23260 * but with all dynamically-allocated buffers duplicated in new buffers.
23262 struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig);
23265 * Creates a new CResult_RouteHopDecodeErrorZ in the success state.
23267 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o);
23270 * Creates a new CResult_RouteHopDecodeErrorZ in the error state.
23272 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e);
23275 * Checks if the given object is currently in the success state
23277 bool CResult_RouteHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR o);
23280 * Frees any resources used by the CResult_RouteHopDecodeErrorZ.
23282 void CResult_RouteHopDecodeErrorZ_free(struct LDKCResult_RouteHopDecodeErrorZ _res);
23285 * Creates a new CResult_RouteHopDecodeErrorZ which has the same data as `orig`
23286 * but with all dynamically-allocated buffers duplicated in new buffers.
23288 struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig);
23291 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23293 void CVec_BlindedHopZ_free(struct LDKCVec_BlindedHopZ _res);
23296 * Creates a new CResult_BlindedTailDecodeErrorZ in the success state.
23298 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_ok(struct LDKBlindedTail o);
23301 * Creates a new CResult_BlindedTailDecodeErrorZ in the error state.
23303 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_err(struct LDKDecodeError e);
23306 * Checks if the given object is currently in the success state
23308 bool CResult_BlindedTailDecodeErrorZ_is_ok(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR o);
23311 * Frees any resources used by the CResult_BlindedTailDecodeErrorZ.
23313 void CResult_BlindedTailDecodeErrorZ_free(struct LDKCResult_BlindedTailDecodeErrorZ _res);
23316 * Creates a new CResult_BlindedTailDecodeErrorZ which has the same data as `orig`
23317 * but with all dynamically-allocated buffers duplicated in new buffers.
23319 struct LDKCResult_BlindedTailDecodeErrorZ CResult_BlindedTailDecodeErrorZ_clone(const struct LDKCResult_BlindedTailDecodeErrorZ *NONNULL_PTR orig);
23322 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23324 void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res);
23327 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23329 void CVec_PathZ_free(struct LDKCVec_PathZ _res);
23332 * Creates a new CResult_RouteDecodeErrorZ in the success state.
23334 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o);
23337 * Creates a new CResult_RouteDecodeErrorZ in the error state.
23339 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e);
23342 * Checks if the given object is currently in the success state
23344 bool CResult_RouteDecodeErrorZ_is_ok(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR o);
23347 * Frees any resources used by the CResult_RouteDecodeErrorZ.
23349 void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res);
23352 * Creates a new CResult_RouteDecodeErrorZ which has the same data as `orig`
23353 * but with all dynamically-allocated buffers duplicated in new buffers.
23355 struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_clone(const struct LDKCResult_RouteDecodeErrorZ *NONNULL_PTR orig);
23358 * Creates a new CResult_RouteParametersDecodeErrorZ in the success state.
23360 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_ok(struct LDKRouteParameters o);
23363 * Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
23365 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_err(struct LDKDecodeError e);
23368 * Checks if the given object is currently in the success state
23370 bool CResult_RouteParametersDecodeErrorZ_is_ok(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR o);
23373 * Frees any resources used by the CResult_RouteParametersDecodeErrorZ.
23375 void CResult_RouteParametersDecodeErrorZ_free(struct LDKCResult_RouteParametersDecodeErrorZ _res);
23378 * Creates a new CResult_RouteParametersDecodeErrorZ which has the same data as `orig`
23379 * but with all dynamically-allocated buffers duplicated in new buffers.
23381 struct LDKCResult_RouteParametersDecodeErrorZ CResult_RouteParametersDecodeErrorZ_clone(const struct LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR orig);
23384 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23386 void CVec_u64Z_free(struct LDKCVec_u64Z _res);
23389 * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state.
23391 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o);
23394 * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
23396 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_err(struct LDKDecodeError e);
23399 * Checks if the given object is currently in the success state
23401 bool CResult_PaymentParametersDecodeErrorZ_is_ok(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR o);
23404 * Frees any resources used by the CResult_PaymentParametersDecodeErrorZ.
23406 void CResult_PaymentParametersDecodeErrorZ_free(struct LDKCResult_PaymentParametersDecodeErrorZ _res);
23409 * Creates a new CResult_PaymentParametersDecodeErrorZ which has the same data as `orig`
23410 * but with all dynamically-allocated buffers duplicated in new buffers.
23412 struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_clone(const struct LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR orig);
23415 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23417 void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res);
23420 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23422 void CVec_RouteHintHopZ_free(struct LDKCVec_RouteHintHopZ _res);
23425 * Creates a new CResult_RouteHintDecodeErrorZ in the success state.
23427 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_ok(struct LDKRouteHint o);
23430 * Creates a new CResult_RouteHintDecodeErrorZ in the error state.
23432 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_err(struct LDKDecodeError e);
23435 * Checks if the given object is currently in the success state
23437 bool CResult_RouteHintDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR o);
23440 * Frees any resources used by the CResult_RouteHintDecodeErrorZ.
23442 void CResult_RouteHintDecodeErrorZ_free(struct LDKCResult_RouteHintDecodeErrorZ _res);
23445 * Creates a new CResult_RouteHintDecodeErrorZ which has the same data as `orig`
23446 * but with all dynamically-allocated buffers duplicated in new buffers.
23448 struct LDKCResult_RouteHintDecodeErrorZ CResult_RouteHintDecodeErrorZ_clone(const struct LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR orig);
23451 * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state.
23453 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_ok(struct LDKRouteHintHop o);
23456 * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
23458 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_err(struct LDKDecodeError e);
23461 * Checks if the given object is currently in the success state
23463 bool CResult_RouteHintHopDecodeErrorZ_is_ok(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR o);
23466 * Frees any resources used by the CResult_RouteHintHopDecodeErrorZ.
23468 void CResult_RouteHintHopDecodeErrorZ_free(struct LDKCResult_RouteHintHopDecodeErrorZ _res);
23471 * Creates a new CResult_RouteHintHopDecodeErrorZ which has the same data as `orig`
23472 * but with all dynamically-allocated buffers duplicated in new buffers.
23474 struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig);
23477 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state.
23479 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_ok(struct LDKFixedPenaltyScorer o);
23482 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
23484 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_err(struct LDKDecodeError e);
23487 * Checks if the given object is currently in the success state
23489 bool CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR o);
23492 * Frees any resources used by the CResult_FixedPenaltyScorerDecodeErrorZ.
23494 void CResult_FixedPenaltyScorerDecodeErrorZ_free(struct LDKCResult_FixedPenaltyScorerDecodeErrorZ _res);
23497 * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ which has the same data as `orig`
23498 * but with all dynamically-allocated buffers duplicated in new buffers.
23500 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ CResult_FixedPenaltyScorerDecodeErrorZ_clone(const struct LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR orig);
23503 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23505 void CVec_NodeIdZ_free(struct LDKCVec_NodeIdZ _res);
23508 * Creates a new tuple which has the same data as `orig`
23509 * but with all dynamically-allocated buffers duplicated in new buffers.
23511 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_clone(const struct LDKC2Tuple_u64u64Z *NONNULL_PTR orig);
23514 * Creates a new C2Tuple_u64u64Z from the contained elements.
23516 struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
23519 * Frees any resources used by the C2Tuple_u64u64Z.
23521 void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res);
23524 * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z
23526 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_some(struct LDKC2Tuple_u64u64Z o);
23529 * Constructs a new COption_C2Tuple_u64u64ZZ containing nothing
23531 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_none(void);
23534 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u64Z, if we are in the Some state
23536 void COption_C2Tuple_u64u64ZZ_free(struct LDKCOption_C2Tuple_u64u64ZZ _res);
23539 * Creates a new COption_C2Tuple_u64u64ZZ which has the same data as `orig`
23540 * but with all dynamically-allocated buffers duplicated in new buffers.
23542 struct LDKCOption_C2Tuple_u64u64ZZ COption_C2Tuple_u64u64ZZ_clone(const struct LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR orig);
23545 * Creates a new C2Tuple_Z from the contained elements.
23547 struct LDKC2Tuple_Z C2Tuple_Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
23550 * Frees any resources used by the C2Tuple_Z.
23552 void C2Tuple_Z_free(struct LDKC2Tuple_Z _res);
23555 * Creates a new C2Tuple__u1632_u1632Z from the contained elements.
23557 struct LDKC2Tuple__u1632_u1632Z C2Tuple__u1632_u1632Z_new(struct LDKThirtyTwoU16s a, struct LDKThirtyTwoU16s b);
23560 * Frees any resources used by the C2Tuple__u1632_u1632Z.
23562 void C2Tuple__u1632_u1632Z_free(struct LDKC2Tuple__u1632_u1632Z _res);
23565 * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z
23567 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(struct LDKC2Tuple__u1632_u1632Z o);
23570 * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing nothing
23572 struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_none(void);
23575 * Frees any resources associated with the crate::c_types::derived::C2Tuple__u1632_u1632Z, if we are in the Some state
23577 void COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_free(struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ _res);
23580 * Constructs a new COption_f64Z containing a f64
23582 struct LDKCOption_f64Z COption_f64Z_some(double o);
23585 * Constructs a new COption_f64Z containing nothing
23587 struct LDKCOption_f64Z COption_f64Z_none(void);
23590 * Frees any resources associated with the f64, if we are in the Some state
23592 void COption_f64Z_free(struct LDKCOption_f64Z _res);
23595 * Creates a new COption_f64Z which has the same data as `orig`
23596 * but with all dynamically-allocated buffers duplicated in new buffers.
23598 struct LDKCOption_f64Z COption_f64Z_clone(const struct LDKCOption_f64Z *NONNULL_PTR orig);
23601 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
23603 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_ok(struct LDKProbabilisticScorer o);
23606 * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
23608 struct LDKCResult_ProbabilisticScorerDecodeErrorZ CResult_ProbabilisticScorerDecodeErrorZ_err(struct LDKDecodeError e);
23611 * Checks if the given object is currently in the success state
23613 bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(const struct LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR o);
23616 * Frees any resources used by the CResult_ProbabilisticScorerDecodeErrorZ.
23618 void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res);
23621 * Creates a new tuple which has the same data as `orig`
23622 * but with all dynamically-allocated buffers duplicated in new buffers.
23624 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig);
23627 * Creates a new C2Tuple_usizeTransactionZ from the contained elements.
23629 struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b);
23632 * Frees any resources used by the C2Tuple_usizeTransactionZ.
23634 void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res);
23637 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23639 void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res);
23642 * Creates a new tuple which has the same data as `orig`
23643 * but with all dynamically-allocated buffers duplicated in new buffers.
23645 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ *NONNULL_PTR orig);
23648 * Creates a new C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ from the contained elements.
23650 struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_new(struct LDKThirtyTwoBytes a, uint32_t b, struct LDKCOption_ThirtyTwoBytesZ c);
23653 * Frees any resources used by the C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ.
23655 void C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ_free(struct LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ _res);
23658 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23660 void CVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ_free(struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ _res);
23663 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the success state.
23665 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_ok(enum LDKChannelMonitorUpdateStatus o);
23668 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ in the error state.
23670 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_err(void);
23673 * Checks if the given object is currently in the success state
23675 bool CResult_ChannelMonitorUpdateStatusNoneZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR o);
23678 * Frees any resources used by the CResult_ChannelMonitorUpdateStatusNoneZ.
23680 void CResult_ChannelMonitorUpdateStatusNoneZ_free(struct LDKCResult_ChannelMonitorUpdateStatusNoneZ _res);
23683 * Creates a new CResult_ChannelMonitorUpdateStatusNoneZ which has the same data as `orig`
23684 * but with all dynamically-allocated buffers duplicated in new buffers.
23686 struct LDKCResult_ChannelMonitorUpdateStatusNoneZ CResult_ChannelMonitorUpdateStatusNoneZ_clone(const struct LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR orig);
23689 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23691 void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
23694 * Creates a new tuple which has the same data as `orig`
23695 * but with all dynamically-allocated buffers duplicated in new buffers.
23697 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig);
23700 * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements.
23702 struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c);
23705 * Frees any resources used by the C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ.
23707 void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res);
23710 * Frees the buffer pointed to by `data` if `datalen` is non-0.
23712 void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res);
23715 * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state.
23717 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o);
23720 * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
23722 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23725 * Checks if the given object is currently in the success state
23727 bool CResult_InitFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR o);
23730 * Frees any resources used by the CResult_InitFeaturesDecodeErrorZ.
23732 void CResult_InitFeaturesDecodeErrorZ_free(struct LDKCResult_InitFeaturesDecodeErrorZ _res);
23735 * Creates a new CResult_InitFeaturesDecodeErrorZ which has the same data as `orig`
23736 * but with all dynamically-allocated buffers duplicated in new buffers.
23738 struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_clone(const struct LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR orig);
23741 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state.
23743 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_ok(struct LDKChannelFeatures o);
23746 * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
23748 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23751 * Checks if the given object is currently in the success state
23753 bool CResult_ChannelFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR o);
23756 * Frees any resources used by the CResult_ChannelFeaturesDecodeErrorZ.
23758 void CResult_ChannelFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelFeaturesDecodeErrorZ _res);
23761 * Creates a new CResult_ChannelFeaturesDecodeErrorZ which has the same data as `orig`
23762 * but with all dynamically-allocated buffers duplicated in new buffers.
23764 struct LDKCResult_ChannelFeaturesDecodeErrorZ CResult_ChannelFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR orig);
23767 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state.
23769 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_ok(struct LDKNodeFeatures o);
23772 * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
23774 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23777 * Checks if the given object is currently in the success state
23779 bool CResult_NodeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR o);
23782 * Frees any resources used by the CResult_NodeFeaturesDecodeErrorZ.
23784 void CResult_NodeFeaturesDecodeErrorZ_free(struct LDKCResult_NodeFeaturesDecodeErrorZ _res);
23787 * Creates a new CResult_NodeFeaturesDecodeErrorZ which has the same data as `orig`
23788 * but with all dynamically-allocated buffers duplicated in new buffers.
23790 struct LDKCResult_NodeFeaturesDecodeErrorZ CResult_NodeFeaturesDecodeErrorZ_clone(const struct LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR orig);
23793 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state.
23795 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt11InvoiceFeatures o);
23798 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the error state.
23800 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23803 * Checks if the given object is currently in the success state
23805 bool CResult_Bolt11InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
23808 * Frees any resources used by the CResult_Bolt11InvoiceFeaturesDecodeErrorZ.
23810 void CResult_Bolt11InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ _res);
23813 * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
23814 * but with all dynamically-allocated buffers duplicated in new buffers.
23816 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ CResult_Bolt11InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
23819 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state.
23821 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(struct LDKBolt12InvoiceFeatures o);
23824 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the error state.
23826 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23829 * Checks if the given object is currently in the success state
23831 bool CResult_Bolt12InvoiceFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR o);
23834 * Frees any resources used by the CResult_Bolt12InvoiceFeaturesDecodeErrorZ.
23836 void CResult_Bolt12InvoiceFeaturesDecodeErrorZ_free(struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ _res);
23839 * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ which has the same data as `orig`
23840 * but with all dynamically-allocated buffers duplicated in new buffers.
23842 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ CResult_Bolt12InvoiceFeaturesDecodeErrorZ_clone(const struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ *NONNULL_PTR orig);
23845 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state.
23847 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_ok(struct LDKBlindedHopFeatures o);
23850 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the error state.
23852 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23855 * Checks if the given object is currently in the success state
23857 bool CResult_BlindedHopFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR o);
23860 * Frees any resources used by the CResult_BlindedHopFeaturesDecodeErrorZ.
23862 void CResult_BlindedHopFeaturesDecodeErrorZ_free(struct LDKCResult_BlindedHopFeaturesDecodeErrorZ _res);
23865 * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ which has the same data as `orig`
23866 * but with all dynamically-allocated buffers duplicated in new buffers.
23868 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ CResult_BlindedHopFeaturesDecodeErrorZ_clone(const struct LDKCResult_BlindedHopFeaturesDecodeErrorZ *NONNULL_PTR orig);
23871 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state.
23873 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_ok(struct LDKChannelTypeFeatures o);
23876 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
23878 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_err(struct LDKDecodeError e);
23881 * Checks if the given object is currently in the success state
23883 bool CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR o);
23886 * Frees any resources used by the CResult_ChannelTypeFeaturesDecodeErrorZ.
23888 void CResult_ChannelTypeFeaturesDecodeErrorZ_free(struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res);
23891 * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ which has the same data as `orig`
23892 * but with all dynamically-allocated buffers duplicated in new buffers.
23894 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig);
23897 * Creates a new CResult_OfferBolt12ParseErrorZ in the success state.
23899 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o);
23902 * Creates a new CResult_OfferBolt12ParseErrorZ in the error state.
23904 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e);
23907 * Checks if the given object is currently in the success state
23909 bool CResult_OfferBolt12ParseErrorZ_is_ok(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR o);
23912 * Frees any resources used by the CResult_OfferBolt12ParseErrorZ.
23914 void CResult_OfferBolt12ParseErrorZ_free(struct LDKCResult_OfferBolt12ParseErrorZ _res);
23917 * Creates a new CResult_OfferBolt12ParseErrorZ which has the same data as `orig`
23918 * but with all dynamically-allocated buffers duplicated in new buffers.
23920 struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig);
23923 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the success state.
23925 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o);
23928 * Creates a new CResult_PublicKeySecp256k1ErrorZ in the error state.
23930 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
23933 * Checks if the given object is currently in the success state
23935 bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o);
23938 * Frees any resources used by the CResult_PublicKeySecp256k1ErrorZ.
23940 void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res);
23943 * Creates a new CResult_PublicKeySecp256k1ErrorZ which has the same data as `orig`
23944 * but with all dynamically-allocated buffers duplicated in new buffers.
23946 struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig);
23949 * Creates a new CResult_NodeIdDecodeErrorZ in the success state.
23951 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o);
23954 * Creates a new CResult_NodeIdDecodeErrorZ in the error state.
23956 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e);
23959 * Checks if the given object is currently in the success state
23961 bool CResult_NodeIdDecodeErrorZ_is_ok(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR o);
23964 * Frees any resources used by the CResult_NodeIdDecodeErrorZ.
23966 void CResult_NodeIdDecodeErrorZ_free(struct LDKCResult_NodeIdDecodeErrorZ _res);
23969 * Creates a new CResult_NodeIdDecodeErrorZ which has the same data as `orig`
23970 * but with all dynamically-allocated buffers duplicated in new buffers.
23972 struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig);
23975 * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate
23977 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o);
23980 * Constructs a new COption_NetworkUpdateZ containing nothing
23982 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void);
23985 * Frees any resources associated with the crate::lightning::routing::gossip::NetworkUpdate, if we are in the Some state
23987 void COption_NetworkUpdateZ_free(struct LDKCOption_NetworkUpdateZ _res);
23990 * Creates a new COption_NetworkUpdateZ which has the same data as `orig`
23991 * but with all dynamically-allocated buffers duplicated in new buffers.
23993 struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_clone(const struct LDKCOption_NetworkUpdateZ *NONNULL_PTR orig);
23996 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state.
23998 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_ok(struct LDKCOption_NetworkUpdateZ o);
24001 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
24003 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_err(struct LDKDecodeError e);
24006 * Checks if the given object is currently in the success state
24008 bool CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR o);
24011 * Frees any resources used by the CResult_COption_NetworkUpdateZDecodeErrorZ.
24013 void CResult_COption_NetworkUpdateZDecodeErrorZ_free(struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res);
24016 * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ which has the same data as `orig`
24017 * but with all dynamically-allocated buffers duplicated in new buffers.
24019 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ CResult_COption_NetworkUpdateZDecodeErrorZ_clone(const struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR orig);
24022 * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
24024 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_some(struct LDKUtxoLookup o);
24027 * Constructs a new COption_UtxoLookupZ containing nothing
24029 struct LDKCOption_UtxoLookupZ COption_UtxoLookupZ_none(void);
24032 * Frees any resources associated with the crate::lightning::routing::utxo::UtxoLookup, if we are in the Some state
24034 void COption_UtxoLookupZ_free(struct LDKCOption_UtxoLookupZ _res);
24037 * Creates a new CResult_NoneLightningErrorZ in the success state.
24039 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
24042 * Creates a new CResult_NoneLightningErrorZ in the error state.
24044 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e);
24047 * Checks if the given object is currently in the success state
24049 bool CResult_NoneLightningErrorZ_is_ok(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR o);
24052 * Frees any resources used by the CResult_NoneLightningErrorZ.
24054 void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res);
24057 * Creates a new CResult_NoneLightningErrorZ which has the same data as `orig`
24058 * but with all dynamically-allocated buffers duplicated in new buffers.
24060 struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_clone(const struct LDKCResult_NoneLightningErrorZ *NONNULL_PTR orig);
24063 * Creates a new CResult_boolLightningErrorZ in the success state.
24065 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o);
24068 * Creates a new CResult_boolLightningErrorZ in the error state.
24070 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e);
24073 * Checks if the given object is currently in the success state
24075 bool CResult_boolLightningErrorZ_is_ok(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR o);
24078 * Frees any resources used by the CResult_boolLightningErrorZ.
24080 void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res);
24083 * Creates a new CResult_boolLightningErrorZ which has the same data as `orig`
24084 * but with all dynamically-allocated buffers duplicated in new buffers.
24086 struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_clone(const struct LDKCResult_boolLightningErrorZ *NONNULL_PTR orig);
24089 * Creates a new tuple which has the same data as `orig`
24090 * but with all dynamically-allocated buffers duplicated in new buffers.
24092 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(const struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR orig);
24095 * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements.
24097 struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c);
24100 * Frees any resources used by the C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.
24102 void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res);
24105 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ
24107 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o);
24110 * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing nothing
24112 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_none(void);
24115 * Frees any resources associated with the crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ, if we are in the Some state
24117 void COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res);
24120 * Creates a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ which has the same data as `orig`
24121 * but with all dynamically-allocated buffers duplicated in new buffers.
24123 struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const struct LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *NONNULL_PTR orig);
24126 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24128 void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res);
24131 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state.
24133 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_ok(struct LDKChannelUpdateInfo o);
24136 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
24138 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_err(struct LDKDecodeError e);
24141 * Checks if the given object is currently in the success state
24143 bool CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR o);
24146 * Frees any resources used by the CResult_ChannelUpdateInfoDecodeErrorZ.
24148 void CResult_ChannelUpdateInfoDecodeErrorZ_free(struct LDKCResult_ChannelUpdateInfoDecodeErrorZ _res);
24151 * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ which has the same data as `orig`
24152 * but with all dynamically-allocated buffers duplicated in new buffers.
24154 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ CResult_ChannelUpdateInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR orig);
24157 * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state.
24159 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_ok(struct LDKChannelInfo o);
24162 * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
24164 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_err(struct LDKDecodeError e);
24167 * Checks if the given object is currently in the success state
24169 bool CResult_ChannelInfoDecodeErrorZ_is_ok(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR o);
24172 * Frees any resources used by the CResult_ChannelInfoDecodeErrorZ.
24174 void CResult_ChannelInfoDecodeErrorZ_free(struct LDKCResult_ChannelInfoDecodeErrorZ _res);
24177 * Creates a new CResult_ChannelInfoDecodeErrorZ which has the same data as `orig`
24178 * but with all dynamically-allocated buffers duplicated in new buffers.
24180 struct LDKCResult_ChannelInfoDecodeErrorZ CResult_ChannelInfoDecodeErrorZ_clone(const struct LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR orig);
24183 * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state.
24185 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o);
24188 * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
24190 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e);
24193 * Checks if the given object is currently in the success state
24195 bool CResult_RoutingFeesDecodeErrorZ_is_ok(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR o);
24198 * Frees any resources used by the CResult_RoutingFeesDecodeErrorZ.
24200 void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res);
24203 * Creates a new CResult_RoutingFeesDecodeErrorZ which has the same data as `orig`
24204 * but with all dynamically-allocated buffers duplicated in new buffers.
24206 struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_clone(const struct LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR orig);
24209 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24211 void CVec_SocketAddressZ_free(struct LDKCVec_SocketAddressZ _res);
24214 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state.
24216 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o);
24219 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
24221 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e);
24224 * Checks if the given object is currently in the success state
24226 bool CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR o);
24229 * Frees any resources used by the CResult_NodeAnnouncementInfoDecodeErrorZ.
24231 void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res);
24234 * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ which has the same data as `orig`
24235 * but with all dynamically-allocated buffers duplicated in new buffers.
24237 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR orig);
24240 * Creates a new CResult_NodeAliasDecodeErrorZ in the success state.
24242 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_ok(struct LDKNodeAlias o);
24245 * Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
24247 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_err(struct LDKDecodeError e);
24250 * Checks if the given object is currently in the success state
24252 bool CResult_NodeAliasDecodeErrorZ_is_ok(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR o);
24255 * Frees any resources used by the CResult_NodeAliasDecodeErrorZ.
24257 void CResult_NodeAliasDecodeErrorZ_free(struct LDKCResult_NodeAliasDecodeErrorZ _res);
24260 * Creates a new CResult_NodeAliasDecodeErrorZ which has the same data as `orig`
24261 * but with all dynamically-allocated buffers duplicated in new buffers.
24263 struct LDKCResult_NodeAliasDecodeErrorZ CResult_NodeAliasDecodeErrorZ_clone(const struct LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR orig);
24266 * Creates a new CResult_NodeInfoDecodeErrorZ in the success state.
24268 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o);
24271 * Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
24273 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e);
24276 * Checks if the given object is currently in the success state
24278 bool CResult_NodeInfoDecodeErrorZ_is_ok(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR o);
24281 * Frees any resources used by the CResult_NodeInfoDecodeErrorZ.
24283 void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res);
24286 * Creates a new CResult_NodeInfoDecodeErrorZ which has the same data as `orig`
24287 * but with all dynamically-allocated buffers duplicated in new buffers.
24289 struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_clone(const struct LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR orig);
24292 * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
24294 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o);
24297 * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
24299 struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e);
24302 * Checks if the given object is currently in the success state
24304 bool CResult_NetworkGraphDecodeErrorZ_is_ok(const struct LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR o);
24307 * Frees any resources used by the CResult_NetworkGraphDecodeErrorZ.
24309 void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res);
24312 * Constructs a new COption_CVec_SocketAddressZZ containing a crate::c_types::derived::CVec_SocketAddressZ
24314 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_some(struct LDKCVec_SocketAddressZ o);
24317 * Constructs a new COption_CVec_SocketAddressZZ containing nothing
24319 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_none(void);
24322 * Frees any resources associated with the crate::c_types::derived::CVec_SocketAddressZ, if we are in the Some state
24324 void COption_CVec_SocketAddressZZ_free(struct LDKCOption_CVec_SocketAddressZZ _res);
24327 * Creates a new COption_CVec_SocketAddressZZ which has the same data as `orig`
24328 * but with all dynamically-allocated buffers duplicated in new buffers.
24330 struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_clone(const struct LDKCOption_CVec_SocketAddressZZ *NONNULL_PTR orig);
24333 * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the success state.
24335 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_ok(struct LDKPendingHTLCInfo o);
24338 * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the error state.
24340 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_err(struct LDKInboundHTLCErr e);
24343 * Checks if the given object is currently in the success state
24345 bool CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(const struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR o);
24348 * Frees any resources used by the CResult_PendingHTLCInfoInboundHTLCErrZ.
24350 void CResult_PendingHTLCInfoInboundHTLCErrZ_free(struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ _res);
24353 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24355 void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res);
24358 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24360 void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res);
24363 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24365 void CVec_UtxoZ_free(struct LDKCVec_UtxoZ _res);
24368 * Constructs a new COption_TxOutZ containing a crate::c_types::TxOut
24370 struct LDKCOption_TxOutZ COption_TxOutZ_some(struct LDKTxOut o);
24373 * Constructs a new COption_TxOutZ containing nothing
24375 struct LDKCOption_TxOutZ COption_TxOutZ_none(void);
24378 * Frees any resources associated with the crate::c_types::TxOut, if we are in the Some state
24380 void COption_TxOutZ_free(struct LDKCOption_TxOutZ _res);
24383 * Creates a new COption_TxOutZ which has the same data as `orig`
24384 * but with all dynamically-allocated buffers duplicated in new buffers.
24386 struct LDKCOption_TxOutZ COption_TxOutZ_clone(const struct LDKCOption_TxOutZ *NONNULL_PTR orig);
24389 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24391 void CVec_InputZ_free(struct LDKCVec_InputZ _res);
24394 * Creates a new CResult_CoinSelectionNoneZ in the success state.
24396 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_ok(struct LDKCoinSelection o);
24399 * Creates a new CResult_CoinSelectionNoneZ in the error state.
24401 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_err(void);
24404 * Checks if the given object is currently in the success state
24406 bool CResult_CoinSelectionNoneZ_is_ok(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR o);
24409 * Frees any resources used by the CResult_CoinSelectionNoneZ.
24411 void CResult_CoinSelectionNoneZ_free(struct LDKCResult_CoinSelectionNoneZ _res);
24414 * Creates a new CResult_CoinSelectionNoneZ which has the same data as `orig`
24415 * but with all dynamically-allocated buffers duplicated in new buffers.
24417 struct LDKCResult_CoinSelectionNoneZ CResult_CoinSelectionNoneZ_clone(const struct LDKCResult_CoinSelectionNoneZ *NONNULL_PTR orig);
24420 * Creates a new CResult_CVec_UtxoZNoneZ in the success state.
24422 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_ok(struct LDKCVec_UtxoZ o);
24425 * Creates a new CResult_CVec_UtxoZNoneZ in the error state.
24427 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_err(void);
24430 * Checks if the given object is currently in the success state
24432 bool CResult_CVec_UtxoZNoneZ_is_ok(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR o);
24435 * Frees any resources used by the CResult_CVec_UtxoZNoneZ.
24437 void CResult_CVec_UtxoZNoneZ_free(struct LDKCResult_CVec_UtxoZNoneZ _res);
24440 * Creates a new CResult_CVec_UtxoZNoneZ which has the same data as `orig`
24441 * but with all dynamically-allocated buffers duplicated in new buffers.
24443 struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig);
24446 * Creates a new tuple which has the same data as `orig`
24447 * but with all dynamically-allocated buffers duplicated in new buffers.
24449 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_clone(const struct LDKC2Tuple_u64u16Z *NONNULL_PTR orig);
24452 * Creates a new C2Tuple_u64u16Z from the contained elements.
24454 struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_new(uint64_t a, uint16_t b);
24457 * Frees any resources used by the C2Tuple_u64u16Z.
24459 void C2Tuple_u64u16Z_free(struct LDKC2Tuple_u64u16Z _res);
24462 * Constructs a new COption_C2Tuple_u64u16ZZ containing a crate::c_types::derived::C2Tuple_u64u16Z
24464 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_some(struct LDKC2Tuple_u64u16Z o);
24467 * Constructs a new COption_C2Tuple_u64u16ZZ containing nothing
24469 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_none(void);
24472 * Frees any resources associated with the crate::c_types::derived::C2Tuple_u64u16Z, if we are in the Some state
24474 void COption_C2Tuple_u64u16ZZ_free(struct LDKCOption_C2Tuple_u64u16ZZ _res);
24477 * Creates a new COption_C2Tuple_u64u16ZZ which has the same data as `orig`
24478 * but with all dynamically-allocated buffers duplicated in new buffers.
24480 struct LDKCOption_C2Tuple_u64u16ZZ COption_C2Tuple_u64u16ZZ_clone(const struct LDKCOption_C2Tuple_u64u16ZZ *NONNULL_PTR orig);
24483 * Constructs a new COption_ChannelShutdownStateZ containing a crate::lightning::ln::channelmanager::ChannelShutdownState
24485 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_some(enum LDKChannelShutdownState o);
24488 * Constructs a new COption_ChannelShutdownStateZ containing nothing
24490 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_none(void);
24493 * Frees any resources associated with the crate::lightning::ln::channelmanager::ChannelShutdownState, if we are in the Some state
24495 void COption_ChannelShutdownStateZ_free(struct LDKCOption_ChannelShutdownStateZ _res);
24498 * Creates a new COption_ChannelShutdownStateZ which has the same data as `orig`
24499 * but with all dynamically-allocated buffers duplicated in new buffers.
24501 struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig);
24504 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the success state.
24506 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o);
24509 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ in the error state.
24511 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e);
24514 * Checks if the given object is currently in the success state
24516 bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o);
24519 * Frees any resources used by the CResult_ThirtyTwoBytesAPIErrorZ.
24521 void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res);
24524 * Creates a new CResult_ThirtyTwoBytesAPIErrorZ which has the same data as `orig`
24525 * but with all dynamically-allocated buffers duplicated in new buffers.
24527 struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig);
24530 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24532 void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res);
24535 * Creates a new CResult_NonePaymentSendFailureZ in the success state.
24537 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void);
24540 * Creates a new CResult_NonePaymentSendFailureZ in the error state.
24542 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
24545 * Checks if the given object is currently in the success state
24547 bool CResult_NonePaymentSendFailureZ_is_ok(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR o);
24550 * Frees any resources used by the CResult_NonePaymentSendFailureZ.
24552 void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res);
24555 * Creates a new CResult_NonePaymentSendFailureZ which has the same data as `orig`
24556 * but with all dynamically-allocated buffers duplicated in new buffers.
24558 struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig);
24561 * Creates a new CResult_NoneRetryableSendFailureZ in the success state.
24563 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_ok(void);
24566 * Creates a new CResult_NoneRetryableSendFailureZ in the error state.
24568 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
24571 * Checks if the given object is currently in the success state
24573 bool CResult_NoneRetryableSendFailureZ_is_ok(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR o);
24576 * Frees any resources used by the CResult_NoneRetryableSendFailureZ.
24578 void CResult_NoneRetryableSendFailureZ_free(struct LDKCResult_NoneRetryableSendFailureZ _res);
24581 * Creates a new CResult_NoneRetryableSendFailureZ which has the same data as `orig`
24582 * but with all dynamically-allocated buffers duplicated in new buffers.
24584 struct LDKCResult_NoneRetryableSendFailureZ CResult_NoneRetryableSendFailureZ_clone(const struct LDKCResult_NoneRetryableSendFailureZ *NONNULL_PTR orig);
24587 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the success state.
24589 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o);
24592 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ in the error state.
24594 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
24597 * Checks if the given object is currently in the success state
24599 bool CResult_ThirtyTwoBytesPaymentSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR o);
24602 * Frees any resources used by the CResult_ThirtyTwoBytesPaymentSendFailureZ.
24604 void CResult_ThirtyTwoBytesPaymentSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ _res);
24607 * Creates a new CResult_ThirtyTwoBytesPaymentSendFailureZ which has the same data as `orig`
24608 * but with all dynamically-allocated buffers duplicated in new buffers.
24610 struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ CResult_ThirtyTwoBytesPaymentSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ *NONNULL_PTR orig);
24613 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the success state.
24615 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_ok(struct LDKThirtyTwoBytes o);
24618 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ in the error state.
24620 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_err(enum LDKRetryableSendFailure e);
24623 * Checks if the given object is currently in the success state
24625 bool CResult_ThirtyTwoBytesRetryableSendFailureZ_is_ok(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR o);
24628 * Frees any resources used by the CResult_ThirtyTwoBytesRetryableSendFailureZ.
24630 void CResult_ThirtyTwoBytesRetryableSendFailureZ_free(struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ _res);
24633 * Creates a new CResult_ThirtyTwoBytesRetryableSendFailureZ which has the same data as `orig`
24634 * but with all dynamically-allocated buffers duplicated in new buffers.
24636 struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ CResult_ThirtyTwoBytesRetryableSendFailureZ_clone(const struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ *NONNULL_PTR orig);
24639 * Creates a new tuple which has the same data as `orig`
24640 * but with all dynamically-allocated buffers duplicated in new buffers.
24642 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ *NONNULL_PTR orig);
24645 * Creates a new C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ from the contained elements.
24647 struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b);
24650 * Frees any resources used by the C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ.
24652 void C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_free(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ _res);
24655 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state.
24657 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
24660 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the error state.
24662 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_err(struct LDKPaymentSendFailure e);
24665 * Checks if the given object is currently in the success state
24667 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR o);
24670 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.
24672 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ _res);
24675 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ which has the same data as `orig`
24676 * but with all dynamically-allocated buffers duplicated in new buffers.
24678 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ *NONNULL_PTR orig);
24681 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24683 void CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ _res);
24686 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the success state.
24688 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZ o);
24691 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the error state.
24693 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_err(struct LDKProbeSendFailure e);
24696 * Checks if the given object is currently in the success state
24698 bool CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR o);
24701 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.
24703 void CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ _res);
24706 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ which has the same data as `orig`
24707 * but with all dynamically-allocated buffers duplicated in new buffers.
24709 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR orig);
24712 * Creates a new tuple which has the same data as `orig`
24713 * but with all dynamically-allocated buffers duplicated in new buffers.
24715 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR orig);
24718 * Creates a new C2Tuple_ThirtyTwoBytesPublicKeyZ from the contained elements.
24720 struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_new(struct LDKThirtyTwoBytes a, struct LDKPublicKey b);
24723 * Frees any resources used by the C2Tuple_ThirtyTwoBytesPublicKeyZ.
24725 void C2Tuple_ThirtyTwoBytesPublicKeyZ_free(struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ _res);
24728 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24730 void CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ _res);
24733 * Constructs a new COption_StrZ containing a crate::c_types::Str
24735 struct LDKCOption_StrZ COption_StrZ_some(struct LDKStr o);
24738 * Constructs a new COption_StrZ containing nothing
24740 struct LDKCOption_StrZ COption_StrZ_none(void);
24743 * Frees any resources associated with the crate::c_types::Str, if we are in the Some state
24745 void COption_StrZ_free(struct LDKCOption_StrZ _res);
24748 * Creates a new COption_StrZ which has the same data as `orig`
24749 * but with all dynamically-allocated buffers duplicated in new buffers.
24751 struct LDKCOption_StrZ COption_StrZ_clone(const struct LDKCOption_StrZ *NONNULL_PTR orig);
24754 * Creates a new CResult_NoneBolt12SemanticErrorZ in the success state.
24756 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_ok(void);
24759 * Creates a new CResult_NoneBolt12SemanticErrorZ in the error state.
24761 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e);
24764 * Checks if the given object is currently in the success state
24766 bool CResult_NoneBolt12SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR o);
24769 * Frees any resources used by the CResult_NoneBolt12SemanticErrorZ.
24771 void CResult_NoneBolt12SemanticErrorZ_free(struct LDKCResult_NoneBolt12SemanticErrorZ _res);
24774 * Creates a new CResult_NoneBolt12SemanticErrorZ which has the same data as `orig`
24775 * but with all dynamically-allocated buffers duplicated in new buffers.
24777 struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_clone(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR orig);
24780 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the success state.
24782 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o);
24785 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the error state.
24787 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void);
24790 * Checks if the given object is currently in the success state
24792 bool CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR o);
24795 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.
24797 void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ _res);
24800 * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ which has the same data as `orig`
24801 * but with all dynamically-allocated buffers duplicated in new buffers.
24803 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR orig);
24806 * Constructs a new COption_OffersMessageZ containing a crate::lightning::onion_message::offers::OffersMessage
24808 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o);
24811 * Constructs a new COption_OffersMessageZ containing nothing
24813 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void);
24816 * Frees any resources associated with the crate::lightning::onion_message::offers::OffersMessage, if we are in the Some state
24818 void COption_OffersMessageZ_free(struct LDKCOption_OffersMessageZ _res);
24821 * Creates a new COption_OffersMessageZ which has the same data as `orig`
24822 * but with all dynamically-allocated buffers duplicated in new buffers.
24824 struct LDKCOption_OffersMessageZ COption_OffersMessageZ_clone(const struct LDKCOption_OffersMessageZ *NONNULL_PTR orig);
24827 * Creates a new tuple which has the same data as `orig`
24828 * but with all dynamically-allocated buffers duplicated in new buffers.
24830 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ *NONNULL_PTR orig);
24833 * Creates a new C3Tuple_OffersMessageDestinationBlindedPathZ from the contained elements.
24835 struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ C3Tuple_OffersMessageDestinationBlindedPathZ_new(struct LDKOffersMessage a, struct LDKDestination b, struct LDKBlindedPath c);
24838 * Frees any resources used by the C3Tuple_OffersMessageDestinationBlindedPathZ.
24840 void C3Tuple_OffersMessageDestinationBlindedPathZ_free(struct LDKC3Tuple_OffersMessageDestinationBlindedPathZ _res);
24843 * Frees the buffer pointed to by `data` if `datalen` is non-0.
24845 void CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ _res);
24848 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state.
24850 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(struct LDKCounterpartyForwardingInfo o);
24853 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
24855 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_err(struct LDKDecodeError e);
24858 * Checks if the given object is currently in the success state
24860 bool CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR o);
24863 * Frees any resources used by the CResult_CounterpartyForwardingInfoDecodeErrorZ.
24865 void CResult_CounterpartyForwardingInfoDecodeErrorZ_free(struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res);
24868 * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ which has the same data as `orig`
24869 * but with all dynamically-allocated buffers duplicated in new buffers.
24871 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(const struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR orig);
24874 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state.
24876 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_ok(struct LDKChannelCounterparty o);
24879 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
24881 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_err(struct LDKDecodeError e);
24884 * Checks if the given object is currently in the success state
24886 bool CResult_ChannelCounterpartyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR o);
24889 * Frees any resources used by the CResult_ChannelCounterpartyDecodeErrorZ.
24891 void CResult_ChannelCounterpartyDecodeErrorZ_free(struct LDKCResult_ChannelCounterpartyDecodeErrorZ _res);
24894 * Creates a new CResult_ChannelCounterpartyDecodeErrorZ which has the same data as `orig`
24895 * but with all dynamically-allocated buffers duplicated in new buffers.
24897 struct LDKCResult_ChannelCounterpartyDecodeErrorZ CResult_ChannelCounterpartyDecodeErrorZ_clone(const struct LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR orig);
24900 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state.
24902 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o);
24905 * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
24907 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e);
24910 * Checks if the given object is currently in the success state
24912 bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o);
24915 * Frees any resources used by the CResult_ChannelDetailsDecodeErrorZ.
24917 void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res);
24920 * Creates a new CResult_ChannelDetailsDecodeErrorZ which has the same data as `orig`
24921 * but with all dynamically-allocated buffers duplicated in new buffers.
24923 struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig);
24926 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state.
24928 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o);
24931 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
24933 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e);
24936 * Checks if the given object is currently in the success state
24938 bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o);
24941 * Frees any resources used by the CResult_PhantomRouteHintsDecodeErrorZ.
24943 void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res);
24946 * Creates a new CResult_PhantomRouteHintsDecodeErrorZ which has the same data as `orig`
24947 * but with all dynamically-allocated buffers duplicated in new buffers.
24949 struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig);
24952 * Creates a new CResult_BlindedForwardDecodeErrorZ in the success state.
24954 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_ok(struct LDKBlindedForward o);
24957 * Creates a new CResult_BlindedForwardDecodeErrorZ in the error state.
24959 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_err(struct LDKDecodeError e);
24962 * Checks if the given object is currently in the success state
24964 bool CResult_BlindedForwardDecodeErrorZ_is_ok(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR o);
24967 * Frees any resources used by the CResult_BlindedForwardDecodeErrorZ.
24969 void CResult_BlindedForwardDecodeErrorZ_free(struct LDKCResult_BlindedForwardDecodeErrorZ _res);
24972 * Creates a new CResult_BlindedForwardDecodeErrorZ which has the same data as `orig`
24973 * but with all dynamically-allocated buffers duplicated in new buffers.
24975 struct LDKCResult_BlindedForwardDecodeErrorZ CResult_BlindedForwardDecodeErrorZ_clone(const struct LDKCResult_BlindedForwardDecodeErrorZ *NONNULL_PTR orig);
24978 * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the success state.
24980 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_ok(struct LDKPendingHTLCRouting o);
24983 * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ in the error state.
24985 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_err(struct LDKDecodeError e);
24988 * Checks if the given object is currently in the success state
24990 bool CResult_PendingHTLCRoutingDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR o);
24993 * Frees any resources used by the CResult_PendingHTLCRoutingDecodeErrorZ.
24995 void CResult_PendingHTLCRoutingDecodeErrorZ_free(struct LDKCResult_PendingHTLCRoutingDecodeErrorZ _res);
24998 * Creates a new CResult_PendingHTLCRoutingDecodeErrorZ which has the same data as `orig`
24999 * but with all dynamically-allocated buffers duplicated in new buffers.
25001 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ CResult_PendingHTLCRoutingDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR orig);
25004 * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the success state.
25006 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_ok(struct LDKPendingHTLCInfo o);
25009 * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the error state.
25011 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_err(struct LDKDecodeError e);
25014 * Checks if the given object is currently in the success state
25016 bool CResult_PendingHTLCInfoDecodeErrorZ_is_ok(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR o);
25019 * Frees any resources used by the CResult_PendingHTLCInfoDecodeErrorZ.
25021 void CResult_PendingHTLCInfoDecodeErrorZ_free(struct LDKCResult_PendingHTLCInfoDecodeErrorZ _res);
25024 * Creates a new CResult_PendingHTLCInfoDecodeErrorZ which has the same data as `orig`
25025 * but with all dynamically-allocated buffers duplicated in new buffers.
25027 struct LDKCResult_PendingHTLCInfoDecodeErrorZ CResult_PendingHTLCInfoDecodeErrorZ_clone(const struct LDKCResult_PendingHTLCInfoDecodeErrorZ *NONNULL_PTR orig);
25030 * Creates a new CResult_BlindedFailureDecodeErrorZ in the success state.
25032 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_ok(enum LDKBlindedFailure o);
25035 * Creates a new CResult_BlindedFailureDecodeErrorZ in the error state.
25037 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_err(struct LDKDecodeError e);
25040 * Checks if the given object is currently in the success state
25042 bool CResult_BlindedFailureDecodeErrorZ_is_ok(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR o);
25045 * Frees any resources used by the CResult_BlindedFailureDecodeErrorZ.
25047 void CResult_BlindedFailureDecodeErrorZ_free(struct LDKCResult_BlindedFailureDecodeErrorZ _res);
25050 * Creates a new CResult_BlindedFailureDecodeErrorZ which has the same data as `orig`
25051 * but with all dynamically-allocated buffers duplicated in new buffers.
25053 struct LDKCResult_BlindedFailureDecodeErrorZ CResult_BlindedFailureDecodeErrorZ_clone(const struct LDKCResult_BlindedFailureDecodeErrorZ *NONNULL_PTR orig);
25056 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the success state.
25058 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_ok(enum LDKChannelShutdownState o);
25061 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ in the error state.
25063 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_err(struct LDKDecodeError e);
25066 * Checks if the given object is currently in the success state
25068 bool CResult_ChannelShutdownStateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR o);
25071 * Frees any resources used by the CResult_ChannelShutdownStateDecodeErrorZ.
25073 void CResult_ChannelShutdownStateDecodeErrorZ_free(struct LDKCResult_ChannelShutdownStateDecodeErrorZ _res);
25076 * Creates a new CResult_ChannelShutdownStateDecodeErrorZ which has the same data as `orig`
25077 * but with all dynamically-allocated buffers duplicated in new buffers.
25079 struct LDKCResult_ChannelShutdownStateDecodeErrorZ CResult_ChannelShutdownStateDecodeErrorZ_clone(const struct LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR orig);
25082 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25084 void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res);
25087 * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements.
25089 struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ C2Tuple_ThirtyTwoBytesChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b);
25092 * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelManagerZ.
25094 void C2Tuple_ThirtyTwoBytesChannelManagerZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ _res);
25097 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state.
25099 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelManagerZ o);
25102 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the error state.
25104 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e);
25107 * Checks if the given object is currently in the success state
25109 bool CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ *NONNULL_PTR o);
25112 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.
25114 void CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ _res);
25117 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the success state.
25119 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_ok(struct LDKMaxDustHTLCExposure o);
25122 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ in the error state.
25124 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_err(struct LDKDecodeError e);
25127 * Checks if the given object is currently in the success state
25129 bool CResult_MaxDustHTLCExposureDecodeErrorZ_is_ok(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR o);
25132 * Frees any resources used by the CResult_MaxDustHTLCExposureDecodeErrorZ.
25134 void CResult_MaxDustHTLCExposureDecodeErrorZ_free(struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ _res);
25137 * Creates a new CResult_MaxDustHTLCExposureDecodeErrorZ which has the same data as `orig`
25138 * but with all dynamically-allocated buffers duplicated in new buffers.
25140 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ CResult_MaxDustHTLCExposureDecodeErrorZ_clone(const struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ *NONNULL_PTR orig);
25143 * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state.
25145 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o);
25148 * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
25150 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e);
25153 * Checks if the given object is currently in the success state
25155 bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o);
25158 * Frees any resources used by the CResult_ChannelConfigDecodeErrorZ.
25160 void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res);
25163 * Creates a new CResult_ChannelConfigDecodeErrorZ which has the same data as `orig`
25164 * but with all dynamically-allocated buffers duplicated in new buffers.
25166 struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig);
25169 * Constructs a new COption_MaxDustHTLCExposureZ containing a crate::lightning::util::config::MaxDustHTLCExposure
25171 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_some(struct LDKMaxDustHTLCExposure o);
25174 * Constructs a new COption_MaxDustHTLCExposureZ containing nothing
25176 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_none(void);
25179 * Frees any resources associated with the crate::lightning::util::config::MaxDustHTLCExposure, if we are in the Some state
25181 void COption_MaxDustHTLCExposureZ_free(struct LDKCOption_MaxDustHTLCExposureZ _res);
25184 * Creates a new COption_MaxDustHTLCExposureZ which has the same data as `orig`
25185 * but with all dynamically-allocated buffers duplicated in new buffers.
25187 struct LDKCOption_MaxDustHTLCExposureZ COption_MaxDustHTLCExposureZ_clone(const struct LDKCOption_MaxDustHTLCExposureZ *NONNULL_PTR orig);
25190 * Constructs a new COption_APIErrorZ containing a crate::lightning::util::errors::APIError
25192 struct LDKCOption_APIErrorZ COption_APIErrorZ_some(struct LDKAPIError o);
25195 * Constructs a new COption_APIErrorZ containing nothing
25197 struct LDKCOption_APIErrorZ COption_APIErrorZ_none(void);
25200 * Frees any resources associated with the crate::lightning::util::errors::APIError, if we are in the Some state
25202 void COption_APIErrorZ_free(struct LDKCOption_APIErrorZ _res);
25205 * Creates a new COption_APIErrorZ which has the same data as `orig`
25206 * but with all dynamically-allocated buffers duplicated in new buffers.
25208 struct LDKCOption_APIErrorZ COption_APIErrorZ_clone(const struct LDKCOption_APIErrorZ *NONNULL_PTR orig);
25211 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the success state.
25213 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_ok(struct LDKCOption_APIErrorZ o);
25216 * Creates a new CResult_COption_APIErrorZDecodeErrorZ in the error state.
25218 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_err(struct LDKDecodeError e);
25221 * Checks if the given object is currently in the success state
25223 bool CResult_COption_APIErrorZDecodeErrorZ_is_ok(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR o);
25226 * Frees any resources used by the CResult_COption_APIErrorZDecodeErrorZ.
25228 void CResult_COption_APIErrorZDecodeErrorZ_free(struct LDKCResult_COption_APIErrorZDecodeErrorZ _res);
25231 * Creates a new CResult_COption_APIErrorZDecodeErrorZ which has the same data as `orig`
25232 * but with all dynamically-allocated buffers duplicated in new buffers.
25234 struct LDKCResult_COption_APIErrorZDecodeErrorZ CResult_COption_APIErrorZDecodeErrorZ_clone(const struct LDKCResult_COption_APIErrorZDecodeErrorZ *NONNULL_PTR orig);
25237 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state.
25239 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o);
25242 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
25244 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e);
25247 * Checks if the given object is currently in the success state
25249 bool CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR o);
25252 * Frees any resources used by the CResult_ChannelMonitorUpdateDecodeErrorZ.
25254 void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res);
25257 * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ which has the same data as `orig`
25258 * but with all dynamically-allocated buffers duplicated in new buffers.
25260 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR orig);
25263 * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent
25265 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_some(struct LDKMonitorEvent o);
25268 * Constructs a new COption_MonitorEventZ containing nothing
25270 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_none(void);
25273 * Frees any resources associated with the crate::lightning::chain::channelmonitor::MonitorEvent, if we are in the Some state
25275 void COption_MonitorEventZ_free(struct LDKCOption_MonitorEventZ _res);
25278 * Creates a new COption_MonitorEventZ which has the same data as `orig`
25279 * but with all dynamically-allocated buffers duplicated in new buffers.
25281 struct LDKCOption_MonitorEventZ COption_MonitorEventZ_clone(const struct LDKCOption_MonitorEventZ *NONNULL_PTR orig);
25284 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state.
25286 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_ok(struct LDKCOption_MonitorEventZ o);
25289 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
25291 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_err(struct LDKDecodeError e);
25294 * Checks if the given object is currently in the success state
25296 bool CResult_COption_MonitorEventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR o);
25299 * Frees any resources used by the CResult_COption_MonitorEventZDecodeErrorZ.
25301 void CResult_COption_MonitorEventZDecodeErrorZ_free(struct LDKCResult_COption_MonitorEventZDecodeErrorZ _res);
25304 * Creates a new CResult_COption_MonitorEventZDecodeErrorZ which has the same data as `orig`
25305 * but with all dynamically-allocated buffers duplicated in new buffers.
25307 struct LDKCResult_COption_MonitorEventZDecodeErrorZ CResult_COption_MonitorEventZDecodeErrorZ_clone(const struct LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR orig);
25310 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state.
25312 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_ok(struct LDKHTLCUpdate o);
25315 * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
25317 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_err(struct LDKDecodeError e);
25320 * Checks if the given object is currently in the success state
25322 bool CResult_HTLCUpdateDecodeErrorZ_is_ok(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR o);
25325 * Frees any resources used by the CResult_HTLCUpdateDecodeErrorZ.
25327 void CResult_HTLCUpdateDecodeErrorZ_free(struct LDKCResult_HTLCUpdateDecodeErrorZ _res);
25330 * Creates a new CResult_HTLCUpdateDecodeErrorZ which has the same data as `orig`
25331 * but with all dynamically-allocated buffers duplicated in new buffers.
25333 struct LDKCResult_HTLCUpdateDecodeErrorZ CResult_HTLCUpdateDecodeErrorZ_clone(const struct LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR orig);
25336 * Creates a new tuple which has the same data as `orig`
25337 * but with all dynamically-allocated buffers duplicated in new buffers.
25339 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_clone(const struct LDKC2Tuple_OutPointCVec_u8ZZ *NONNULL_PTR orig);
25342 * Creates a new C2Tuple_OutPointCVec_u8ZZ from the contained elements.
25344 struct LDKC2Tuple_OutPointCVec_u8ZZ C2Tuple_OutPointCVec_u8ZZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b);
25347 * Frees any resources used by the C2Tuple_OutPointCVec_u8ZZ.
25349 void C2Tuple_OutPointCVec_u8ZZ_free(struct LDKC2Tuple_OutPointCVec_u8ZZ _res);
25352 * Creates a new tuple which has the same data as `orig`
25353 * but with all dynamically-allocated buffers duplicated in new buffers.
25355 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_clone(const struct LDKC2Tuple_u32CVec_u8ZZ *NONNULL_PTR orig);
25358 * Creates a new C2Tuple_u32CVec_u8ZZ from the contained elements.
25360 struct LDKC2Tuple_u32CVec_u8ZZ C2Tuple_u32CVec_u8ZZ_new(uint32_t a, struct LDKCVec_u8Z b);
25363 * Frees any resources used by the C2Tuple_u32CVec_u8ZZ.
25365 void C2Tuple_u32CVec_u8ZZ_free(struct LDKC2Tuple_u32CVec_u8ZZ _res);
25368 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25370 void CVec_C2Tuple_u32CVec_u8ZZZ_free(struct LDKCVec_C2Tuple_u32CVec_u8ZZZ _res);
25373 * Creates a new tuple which has the same data as `orig`
25374 * but with all dynamically-allocated buffers duplicated in new buffers.
25376 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ *NONNULL_PTR orig);
25379 * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ from the contained elements.
25381 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32CVec_u8ZZZ b);
25384 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.
25386 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ _res);
25389 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25391 void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ _res);
25394 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25396 void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res);
25399 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25401 void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res);
25404 * Creates a new tuple which has the same data as `orig`
25405 * but with all dynamically-allocated buffers duplicated in new buffers.
25407 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig);
25410 * Creates a new C2Tuple_u32TxOutZ from the contained elements.
25412 struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b);
25415 * Frees any resources used by the C2Tuple_u32TxOutZ.
25417 void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res);
25420 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25422 void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res);
25425 * Creates a new tuple which has the same data as `orig`
25426 * but with all dynamically-allocated buffers duplicated in new buffers.
25428 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR orig);
25431 * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ from the contained elements.
25433 struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b);
25436 * Frees any resources used by the C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.
25438 void C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ _res);
25441 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25443 void CVec_TransactionOutputsZ_free(struct LDKCVec_TransactionOutputsZ _res);
25446 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25448 void CVec_BalanceZ_free(struct LDKCVec_BalanceZ _res);
25451 * Creates a new tuple which has the same data as `orig`
25452 * but with all dynamically-allocated buffers duplicated in new buffers.
25454 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ *NONNULL_PTR orig);
25457 * Creates a new C2Tuple_ThirtyTwoBytesChannelMonitorZ from the contained elements.
25459 struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b);
25462 * Frees any resources used by the C2Tuple_ThirtyTwoBytesChannelMonitorZ.
25464 void C2Tuple_ThirtyTwoBytesChannelMonitorZ_free(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ _res);
25467 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the success state.
25469 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
25472 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the error state.
25474 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e);
25477 * Checks if the given object is currently in the success state
25479 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR o);
25482 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.
25484 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ _res);
25487 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ which has the same data as `orig`
25488 * but with all dynamically-allocated buffers duplicated in new buffers.
25490 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ *NONNULL_PTR orig);
25493 * Creates a new tuple which has the same data as `orig`
25494 * but with all dynamically-allocated buffers duplicated in new buffers.
25496 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_clone(const struct LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR orig);
25499 * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
25501 struct LDKC2Tuple_PublicKeyTypeZ C2Tuple_PublicKeyTypeZ_new(struct LDKPublicKey a, struct LDKType b);
25504 * Frees any resources used by the C2Tuple_PublicKeyTypeZ.
25506 void C2Tuple_PublicKeyTypeZ_free(struct LDKC2Tuple_PublicKeyTypeZ _res);
25509 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25511 void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
25514 * Creates a new tuple which has the same data as `orig`
25515 * but with all dynamically-allocated buffers duplicated in new buffers.
25517 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ *NONNULL_PTR orig);
25520 * Creates a new C2Tuple_PublicKeyCVec_SocketAddressZZ from the contained elements.
25522 struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ C2Tuple_PublicKeyCVec_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCVec_SocketAddressZ b);
25525 * Frees any resources used by the C2Tuple_PublicKeyCVec_SocketAddressZZ.
25527 void C2Tuple_PublicKeyCVec_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCVec_SocketAddressZZ _res);
25530 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25532 void CVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ _res);
25535 * Constructs a new COption_OnionMessageContentsZ containing a crate::lightning::onion_message::packet::OnionMessageContents
25537 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_some(struct LDKOnionMessageContents o);
25540 * Constructs a new COption_OnionMessageContentsZ containing nothing
25542 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_none(void);
25545 * Frees any resources associated with the crate::lightning::onion_message::packet::OnionMessageContents, if we are in the Some state
25547 void COption_OnionMessageContentsZ_free(struct LDKCOption_OnionMessageContentsZ _res);
25550 * Creates a new COption_OnionMessageContentsZ which has the same data as `orig`
25551 * but with all dynamically-allocated buffers duplicated in new buffers.
25553 struct LDKCOption_OnionMessageContentsZ COption_OnionMessageContentsZ_clone(const struct LDKCOption_OnionMessageContentsZ *NONNULL_PTR orig);
25556 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the success state.
25558 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_OnionMessageContentsZ o);
25561 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ in the error state.
25563 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
25566 * Checks if the given object is currently in the success state
25568 bool CResult_COption_OnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
25571 * Frees any resources used by the CResult_COption_OnionMessageContentsZDecodeErrorZ.
25573 void CResult_COption_OnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ _res);
25576 * Creates a new CResult_COption_OnionMessageContentsZDecodeErrorZ which has the same data as `orig`
25577 * but with all dynamically-allocated buffers duplicated in new buffers.
25579 struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ CResult_COption_OnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_OnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig);
25582 * Creates a new tuple which has the same data as `orig`
25583 * but with all dynamically-allocated buffers duplicated in new buffers.
25585 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_clone(const struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ *NONNULL_PTR orig);
25588 * Creates a new C3Tuple_OnionMessageContentsDestinationBlindedPathZ from the contained elements.
25590 struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(struct LDKOnionMessageContents a, struct LDKDestination b, struct LDKBlindedPath c);
25593 * Frees any resources used by the C3Tuple_OnionMessageContentsDestinationBlindedPathZ.
25595 void C3Tuple_OnionMessageContentsDestinationBlindedPathZ_free(struct LDKC3Tuple_OnionMessageContentsDestinationBlindedPathZ _res);
25598 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25600 void CVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ_free(struct LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ _res);
25603 * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
25605 struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o);
25608 * Constructs a new COption_TypeZ containing nothing
25610 struct LDKCOption_TypeZ COption_TypeZ_none(void);
25613 * Frees any resources associated with the crate::lightning::ln::wire::Type, if we are in the Some state
25615 void COption_TypeZ_free(struct LDKCOption_TypeZ _res);
25618 * Creates a new COption_TypeZ which has the same data as `orig`
25619 * but with all dynamically-allocated buffers duplicated in new buffers.
25621 struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig);
25624 * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state.
25626 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o);
25629 * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
25631 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e);
25634 * Checks if the given object is currently in the success state
25636 bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o);
25639 * Frees any resources used by the CResult_COption_TypeZDecodeErrorZ.
25641 void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res);
25644 * Creates a new CResult_COption_TypeZDecodeErrorZ which has the same data as `orig`
25645 * but with all dynamically-allocated buffers duplicated in new buffers.
25647 struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig);
25650 * Constructs a new COption_SocketAddressZ containing a crate::lightning::ln::msgs::SocketAddress
25652 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_some(struct LDKSocketAddress o);
25655 * Constructs a new COption_SocketAddressZ containing nothing
25657 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_none(void);
25660 * Frees any resources associated with the crate::lightning::ln::msgs::SocketAddress, if we are in the Some state
25662 void COption_SocketAddressZ_free(struct LDKCOption_SocketAddressZ _res);
25665 * Creates a new COption_SocketAddressZ which has the same data as `orig`
25666 * but with all dynamically-allocated buffers duplicated in new buffers.
25668 struct LDKCOption_SocketAddressZ COption_SocketAddressZ_clone(const struct LDKCOption_SocketAddressZ *NONNULL_PTR orig);
25671 * Creates a new tuple which has the same data as `orig`
25672 * but with all dynamically-allocated buffers duplicated in new buffers.
25674 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR orig);
25677 * Creates a new C2Tuple_PublicKeyCOption_SocketAddressZZ from the contained elements.
25679 struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCOption_SocketAddressZ b);
25682 * Frees any resources used by the C2Tuple_PublicKeyCOption_SocketAddressZZ.
25684 void C2Tuple_PublicKeyCOption_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ _res);
25687 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25689 void CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ _res);
25692 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the success state.
25694 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o);
25697 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state.
25699 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e);
25702 * Checks if the given object is currently in the success state
25704 bool CResult_CVec_u8ZPeerHandleErrorZ_is_ok(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR o);
25707 * Frees any resources used by the CResult_CVec_u8ZPeerHandleErrorZ.
25709 void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res);
25712 * Creates a new CResult_CVec_u8ZPeerHandleErrorZ which has the same data as `orig`
25713 * but with all dynamically-allocated buffers duplicated in new buffers.
25715 struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_clone(const struct LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR orig);
25718 * Creates a new CResult_NonePeerHandleErrorZ in the success state.
25720 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void);
25723 * Creates a new CResult_NonePeerHandleErrorZ in the error state.
25725 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e);
25728 * Checks if the given object is currently in the success state
25730 bool CResult_NonePeerHandleErrorZ_is_ok(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR o);
25733 * Frees any resources used by the CResult_NonePeerHandleErrorZ.
25735 void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res);
25738 * Creates a new CResult_NonePeerHandleErrorZ which has the same data as `orig`
25739 * but with all dynamically-allocated buffers duplicated in new buffers.
25741 struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_clone(const struct LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR orig);
25744 * Creates a new CResult_boolPeerHandleErrorZ in the success state.
25746 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o);
25749 * Creates a new CResult_boolPeerHandleErrorZ in the error state.
25751 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e);
25754 * Checks if the given object is currently in the success state
25756 bool CResult_boolPeerHandleErrorZ_is_ok(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR o);
25759 * Frees any resources used by the CResult_boolPeerHandleErrorZ.
25761 void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res);
25764 * Creates a new CResult_boolPeerHandleErrorZ which has the same data as `orig`
25765 * but with all dynamically-allocated buffers duplicated in new buffers.
25767 struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_clone(const struct LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR orig);
25770 * Creates a new CResult_u32GraphSyncErrorZ in the success state.
25772 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_ok(uint32_t o);
25775 * Creates a new CResult_u32GraphSyncErrorZ in the error state.
25777 struct LDKCResult_u32GraphSyncErrorZ CResult_u32GraphSyncErrorZ_err(struct LDKGraphSyncError e);
25780 * Checks if the given object is currently in the success state
25782 bool CResult_u32GraphSyncErrorZ_is_ok(const struct LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR o);
25785 * Frees any resources used by the CResult_u32GraphSyncErrorZ.
25787 void CResult_u32GraphSyncErrorZ_free(struct LDKCResult_u32GraphSyncErrorZ _res);
25790 * Creates a new CResult_CVec_u8ZIOErrorZ in the success state.
25792 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_ok(struct LDKCVec_u8Z o);
25795 * Creates a new CResult_CVec_u8ZIOErrorZ in the error state.
25797 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_err(enum LDKIOError e);
25800 * Checks if the given object is currently in the success state
25802 bool CResult_CVec_u8ZIOErrorZ_is_ok(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR o);
25805 * Frees any resources used by the CResult_CVec_u8ZIOErrorZ.
25807 void CResult_CVec_u8ZIOErrorZ_free(struct LDKCResult_CVec_u8ZIOErrorZ _res);
25810 * Creates a new CResult_CVec_u8ZIOErrorZ which has the same data as `orig`
25811 * but with all dynamically-allocated buffers duplicated in new buffers.
25813 struct LDKCResult_CVec_u8ZIOErrorZ CResult_CVec_u8ZIOErrorZ_clone(const struct LDKCResult_CVec_u8ZIOErrorZ *NONNULL_PTR orig);
25816 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25818 void CVec_StrZ_free(struct LDKCVec_StrZ _res);
25821 * Creates a new CResult_CVec_StrZIOErrorZ in the success state.
25823 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_ok(struct LDKCVec_StrZ o);
25826 * Creates a new CResult_CVec_StrZIOErrorZ in the error state.
25828 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_err(enum LDKIOError e);
25831 * Checks if the given object is currently in the success state
25833 bool CResult_CVec_StrZIOErrorZ_is_ok(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR o);
25836 * Frees any resources used by the CResult_CVec_StrZIOErrorZ.
25838 void CResult_CVec_StrZIOErrorZ_free(struct LDKCResult_CVec_StrZIOErrorZ _res);
25841 * Creates a new CResult_CVec_StrZIOErrorZ which has the same data as `orig`
25842 * but with all dynamically-allocated buffers duplicated in new buffers.
25844 struct LDKCResult_CVec_StrZIOErrorZ CResult_CVec_StrZIOErrorZ_clone(const struct LDKCResult_CVec_StrZIOErrorZ *NONNULL_PTR orig);
25847 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25849 void CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ _res);
25852 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the success state.
25854 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(struct LDKCVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZ o);
25857 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the error state.
25859 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_err(enum LDKIOError e);
25862 * Checks if the given object is currently in the success state
25864 bool CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_is_ok(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR o);
25867 * Frees any resources used by the CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.
25869 void CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_free(struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ _res);
25872 * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ which has the same data as `orig`
25873 * but with all dynamically-allocated buffers duplicated in new buffers.
25875 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ *NONNULL_PTR orig);
25878 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the success state.
25880 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(struct LDKC2Tuple_ThirtyTwoBytesChannelMonitorZ o);
25883 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the error state.
25885 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_err(enum LDKIOError e);
25888 * Checks if the given object is currently in the success state
25890 bool CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_is_ok(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR o);
25893 * Frees any resources used by the CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.
25895 void CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_free(struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ _res);
25898 * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ which has the same data as `orig`
25899 * but with all dynamically-allocated buffers duplicated in new buffers.
25901 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig);
25904 * Constructs a new COption_SecretKeyZ containing a crate::c_types::SecretKey
25906 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o);
25909 * Constructs a new COption_SecretKeyZ containing nothing
25911 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void);
25914 * Frees any resources associated with the crate::c_types::SecretKey, if we are in the Some state
25916 void COption_SecretKeyZ_free(struct LDKCOption_SecretKeyZ _res);
25919 * Creates a new COption_SecretKeyZ which has the same data as `orig`
25920 * but with all dynamically-allocated buffers duplicated in new buffers.
25922 struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig);
25925 * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the success state.
25927 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_ok(struct LDKVerifiedInvoiceRequest o);
25930 * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the error state.
25932 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_err(void);
25935 * Checks if the given object is currently in the success state
25937 bool CResult_VerifiedInvoiceRequestNoneZ_is_ok(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR o);
25940 * Frees any resources used by the CResult_VerifiedInvoiceRequestNoneZ.
25942 void CResult_VerifiedInvoiceRequestNoneZ_free(struct LDKCResult_VerifiedInvoiceRequestNoneZ _res);
25945 * Creates a new CResult_VerifiedInvoiceRequestNoneZ which has the same data as `orig`
25946 * but with all dynamically-allocated buffers duplicated in new buffers.
25948 struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_clone(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR orig);
25951 * Constructs a new COption_NoneZ containing a
25953 enum LDKCOption_NoneZ COption_NoneZ_some(void);
25956 * Constructs a new COption_NoneZ containing nothing
25958 enum LDKCOption_NoneZ COption_NoneZ_none(void);
25961 * Frees any resources associated with the , if we are in the Some state
25963 void COption_NoneZ_free(enum LDKCOption_NoneZ _res);
25966 * Frees the buffer pointed to by `data` if `datalen` is non-0.
25968 void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res);
25971 * Constructs a new COption_i64Z containing a i64
25973 struct LDKCOption_i64Z COption_i64Z_some(int64_t o);
25976 * Constructs a new COption_i64Z containing nothing
25978 struct LDKCOption_i64Z COption_i64Z_none(void);
25981 * Frees any resources associated with the i64, if we are in the Some state
25983 void COption_i64Z_free(struct LDKCOption_i64Z _res);
25986 * Creates a new COption_i64Z which has the same data as `orig`
25987 * but with all dynamically-allocated buffers duplicated in new buffers.
25989 struct LDKCOption_i64Z COption_i64Z_clone(const struct LDKCOption_i64Z *NONNULL_PTR orig);
25992 * Creates a new CResult_SocketAddressDecodeErrorZ in the success state.
25994 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_ok(struct LDKSocketAddress o);
25997 * Creates a new CResult_SocketAddressDecodeErrorZ in the error state.
25999 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_err(struct LDKDecodeError e);
26002 * Checks if the given object is currently in the success state
26004 bool CResult_SocketAddressDecodeErrorZ_is_ok(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR o);
26007 * Frees any resources used by the CResult_SocketAddressDecodeErrorZ.
26009 void CResult_SocketAddressDecodeErrorZ_free(struct LDKCResult_SocketAddressDecodeErrorZ _res);
26012 * Creates a new CResult_SocketAddressDecodeErrorZ which has the same data as `orig`
26013 * but with all dynamically-allocated buffers duplicated in new buffers.
26015 struct LDKCResult_SocketAddressDecodeErrorZ CResult_SocketAddressDecodeErrorZ_clone(const struct LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR orig);
26018 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the success state.
26020 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_ok(struct LDKSocketAddress o);
26023 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ in the error state.
26025 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_err(enum LDKSocketAddressParseError e);
26028 * Checks if the given object is currently in the success state
26030 bool CResult_SocketAddressSocketAddressParseErrorZ_is_ok(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR o);
26033 * Frees any resources used by the CResult_SocketAddressSocketAddressParseErrorZ.
26035 void CResult_SocketAddressSocketAddressParseErrorZ_free(struct LDKCResult_SocketAddressSocketAddressParseErrorZ _res);
26038 * Creates a new CResult_SocketAddressSocketAddressParseErrorZ which has the same data as `orig`
26039 * but with all dynamically-allocated buffers duplicated in new buffers.
26041 struct LDKCResult_SocketAddressSocketAddressParseErrorZ CResult_SocketAddressSocketAddressParseErrorZ_clone(const struct LDKCResult_SocketAddressSocketAddressParseErrorZ *NONNULL_PTR orig);
26044 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26046 void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res);
26049 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26051 void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res);
26054 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26056 void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res);
26059 * Frees the buffer pointed to by `data` if `datalen` is non-0.
26061 void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res);
26064 * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state.
26066 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_ok(struct LDKAcceptChannel o);
26069 * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
26071 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_err(struct LDKDecodeError e);
26074 * Checks if the given object is currently in the success state
26076 bool CResult_AcceptChannelDecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR o);
26079 * Frees any resources used by the CResult_AcceptChannelDecodeErrorZ.
26081 void CResult_AcceptChannelDecodeErrorZ_free(struct LDKCResult_AcceptChannelDecodeErrorZ _res);
26084 * Creates a new CResult_AcceptChannelDecodeErrorZ which has the same data as `orig`
26085 * but with all dynamically-allocated buffers duplicated in new buffers.
26087 struct LDKCResult_AcceptChannelDecodeErrorZ CResult_AcceptChannelDecodeErrorZ_clone(const struct LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR orig);
26090 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state.
26092 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_ok(struct LDKAcceptChannelV2 o);
26095 * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the error state.
26097 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
26100 * Checks if the given object is currently in the success state
26102 bool CResult_AcceptChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR o);
26105 * Frees any resources used by the CResult_AcceptChannelV2DecodeErrorZ.
26107 void CResult_AcceptChannelV2DecodeErrorZ_free(struct LDKCResult_AcceptChannelV2DecodeErrorZ _res);
26110 * Creates a new CResult_AcceptChannelV2DecodeErrorZ which has the same data as `orig`
26111 * but with all dynamically-allocated buffers duplicated in new buffers.
26113 struct LDKCResult_AcceptChannelV2DecodeErrorZ CResult_AcceptChannelV2DecodeErrorZ_clone(const struct LDKCResult_AcceptChannelV2DecodeErrorZ *NONNULL_PTR orig);
26116 * Creates a new CResult_StfuDecodeErrorZ in the success state.
26118 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_ok(struct LDKStfu o);
26121 * Creates a new CResult_StfuDecodeErrorZ in the error state.
26123 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_err(struct LDKDecodeError e);
26126 * Checks if the given object is currently in the success state
26128 bool CResult_StfuDecodeErrorZ_is_ok(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR o);
26131 * Frees any resources used by the CResult_StfuDecodeErrorZ.
26133 void CResult_StfuDecodeErrorZ_free(struct LDKCResult_StfuDecodeErrorZ _res);
26136 * Creates a new CResult_StfuDecodeErrorZ which has the same data as `orig`
26137 * but with all dynamically-allocated buffers duplicated in new buffers.
26139 struct LDKCResult_StfuDecodeErrorZ CResult_StfuDecodeErrorZ_clone(const struct LDKCResult_StfuDecodeErrorZ *NONNULL_PTR orig);
26142 * Creates a new CResult_SpliceDecodeErrorZ in the success state.
26144 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_ok(struct LDKSplice o);
26147 * Creates a new CResult_SpliceDecodeErrorZ in the error state.
26149 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_err(struct LDKDecodeError e);
26152 * Checks if the given object is currently in the success state
26154 bool CResult_SpliceDecodeErrorZ_is_ok(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR o);
26157 * Frees any resources used by the CResult_SpliceDecodeErrorZ.
26159 void CResult_SpliceDecodeErrorZ_free(struct LDKCResult_SpliceDecodeErrorZ _res);
26162 * Creates a new CResult_SpliceDecodeErrorZ which has the same data as `orig`
26163 * but with all dynamically-allocated buffers duplicated in new buffers.
26165 struct LDKCResult_SpliceDecodeErrorZ CResult_SpliceDecodeErrorZ_clone(const struct LDKCResult_SpliceDecodeErrorZ *NONNULL_PTR orig);
26168 * Creates a new CResult_SpliceAckDecodeErrorZ in the success state.
26170 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_ok(struct LDKSpliceAck o);
26173 * Creates a new CResult_SpliceAckDecodeErrorZ in the error state.
26175 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_err(struct LDKDecodeError e);
26178 * Checks if the given object is currently in the success state
26180 bool CResult_SpliceAckDecodeErrorZ_is_ok(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR o);
26183 * Frees any resources used by the CResult_SpliceAckDecodeErrorZ.
26185 void CResult_SpliceAckDecodeErrorZ_free(struct LDKCResult_SpliceAckDecodeErrorZ _res);
26188 * Creates a new CResult_SpliceAckDecodeErrorZ which has the same data as `orig`
26189 * but with all dynamically-allocated buffers duplicated in new buffers.
26191 struct LDKCResult_SpliceAckDecodeErrorZ CResult_SpliceAckDecodeErrorZ_clone(const struct LDKCResult_SpliceAckDecodeErrorZ *NONNULL_PTR orig);
26194 * Creates a new CResult_SpliceLockedDecodeErrorZ in the success state.
26196 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_ok(struct LDKSpliceLocked o);
26199 * Creates a new CResult_SpliceLockedDecodeErrorZ in the error state.
26201 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_err(struct LDKDecodeError e);
26204 * Checks if the given object is currently in the success state
26206 bool CResult_SpliceLockedDecodeErrorZ_is_ok(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR o);
26209 * Frees any resources used by the CResult_SpliceLockedDecodeErrorZ.
26211 void CResult_SpliceLockedDecodeErrorZ_free(struct LDKCResult_SpliceLockedDecodeErrorZ _res);
26214 * Creates a new CResult_SpliceLockedDecodeErrorZ which has the same data as `orig`
26215 * but with all dynamically-allocated buffers duplicated in new buffers.
26217 struct LDKCResult_SpliceLockedDecodeErrorZ CResult_SpliceLockedDecodeErrorZ_clone(const struct LDKCResult_SpliceLockedDecodeErrorZ *NONNULL_PTR orig);
26220 * Creates a new CResult_TxAddInputDecodeErrorZ in the success state.
26222 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_ok(struct LDKTxAddInput o);
26225 * Creates a new CResult_TxAddInputDecodeErrorZ in the error state.
26227 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_err(struct LDKDecodeError e);
26230 * Checks if the given object is currently in the success state
26232 bool CResult_TxAddInputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR o);
26235 * Frees any resources used by the CResult_TxAddInputDecodeErrorZ.
26237 void CResult_TxAddInputDecodeErrorZ_free(struct LDKCResult_TxAddInputDecodeErrorZ _res);
26240 * Creates a new CResult_TxAddInputDecodeErrorZ which has the same data as `orig`
26241 * but with all dynamically-allocated buffers duplicated in new buffers.
26243 struct LDKCResult_TxAddInputDecodeErrorZ CResult_TxAddInputDecodeErrorZ_clone(const struct LDKCResult_TxAddInputDecodeErrorZ *NONNULL_PTR orig);
26246 * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state.
26248 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_ok(struct LDKTxAddOutput o);
26251 * Creates a new CResult_TxAddOutputDecodeErrorZ in the error state.
26253 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_err(struct LDKDecodeError e);
26256 * Checks if the given object is currently in the success state
26258 bool CResult_TxAddOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR o);
26261 * Frees any resources used by the CResult_TxAddOutputDecodeErrorZ.
26263 void CResult_TxAddOutputDecodeErrorZ_free(struct LDKCResult_TxAddOutputDecodeErrorZ _res);
26266 * Creates a new CResult_TxAddOutputDecodeErrorZ which has the same data as `orig`
26267 * but with all dynamically-allocated buffers duplicated in new buffers.
26269 struct LDKCResult_TxAddOutputDecodeErrorZ CResult_TxAddOutputDecodeErrorZ_clone(const struct LDKCResult_TxAddOutputDecodeErrorZ *NONNULL_PTR orig);
26272 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state.
26274 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_ok(struct LDKTxRemoveInput o);
26277 * Creates a new CResult_TxRemoveInputDecodeErrorZ in the error state.
26279 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_err(struct LDKDecodeError e);
26282 * Checks if the given object is currently in the success state
26284 bool CResult_TxRemoveInputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR o);
26287 * Frees any resources used by the CResult_TxRemoveInputDecodeErrorZ.
26289 void CResult_TxRemoveInputDecodeErrorZ_free(struct LDKCResult_TxRemoveInputDecodeErrorZ _res);
26292 * Creates a new CResult_TxRemoveInputDecodeErrorZ which has the same data as `orig`
26293 * but with all dynamically-allocated buffers duplicated in new buffers.
26295 struct LDKCResult_TxRemoveInputDecodeErrorZ CResult_TxRemoveInputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveInputDecodeErrorZ *NONNULL_PTR orig);
26298 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state.
26300 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_ok(struct LDKTxRemoveOutput o);
26303 * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the error state.
26305 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_err(struct LDKDecodeError e);
26308 * Checks if the given object is currently in the success state
26310 bool CResult_TxRemoveOutputDecodeErrorZ_is_ok(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR o);
26313 * Frees any resources used by the CResult_TxRemoveOutputDecodeErrorZ.
26315 void CResult_TxRemoveOutputDecodeErrorZ_free(struct LDKCResult_TxRemoveOutputDecodeErrorZ _res);
26318 * Creates a new CResult_TxRemoveOutputDecodeErrorZ which has the same data as `orig`
26319 * but with all dynamically-allocated buffers duplicated in new buffers.
26321 struct LDKCResult_TxRemoveOutputDecodeErrorZ CResult_TxRemoveOutputDecodeErrorZ_clone(const struct LDKCResult_TxRemoveOutputDecodeErrorZ *NONNULL_PTR orig);
26324 * Creates a new CResult_TxCompleteDecodeErrorZ in the success state.
26326 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_ok(struct LDKTxComplete o);
26329 * Creates a new CResult_TxCompleteDecodeErrorZ in the error state.
26331 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_err(struct LDKDecodeError e);
26334 * Checks if the given object is currently in the success state
26336 bool CResult_TxCompleteDecodeErrorZ_is_ok(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR o);
26339 * Frees any resources used by the CResult_TxCompleteDecodeErrorZ.
26341 void CResult_TxCompleteDecodeErrorZ_free(struct LDKCResult_TxCompleteDecodeErrorZ _res);
26344 * Creates a new CResult_TxCompleteDecodeErrorZ which has the same data as `orig`
26345 * but with all dynamically-allocated buffers duplicated in new buffers.
26347 struct LDKCResult_TxCompleteDecodeErrorZ CResult_TxCompleteDecodeErrorZ_clone(const struct LDKCResult_TxCompleteDecodeErrorZ *NONNULL_PTR orig);
26350 * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state.
26352 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_ok(struct LDKTxSignatures o);
26355 * Creates a new CResult_TxSignaturesDecodeErrorZ in the error state.
26357 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
26360 * Checks if the given object is currently in the success state
26362 bool CResult_TxSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR o);
26365 * Frees any resources used by the CResult_TxSignaturesDecodeErrorZ.
26367 void CResult_TxSignaturesDecodeErrorZ_free(struct LDKCResult_TxSignaturesDecodeErrorZ _res);
26370 * Creates a new CResult_TxSignaturesDecodeErrorZ which has the same data as `orig`
26371 * but with all dynamically-allocated buffers duplicated in new buffers.
26373 struct LDKCResult_TxSignaturesDecodeErrorZ CResult_TxSignaturesDecodeErrorZ_clone(const struct LDKCResult_TxSignaturesDecodeErrorZ *NONNULL_PTR orig);
26376 * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state.
26378 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_ok(struct LDKTxInitRbf o);
26381 * Creates a new CResult_TxInitRbfDecodeErrorZ in the error state.
26383 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_err(struct LDKDecodeError e);
26386 * Checks if the given object is currently in the success state
26388 bool CResult_TxInitRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR o);
26391 * Frees any resources used by the CResult_TxInitRbfDecodeErrorZ.
26393 void CResult_TxInitRbfDecodeErrorZ_free(struct LDKCResult_TxInitRbfDecodeErrorZ _res);
26396 * Creates a new CResult_TxInitRbfDecodeErrorZ which has the same data as `orig`
26397 * but with all dynamically-allocated buffers duplicated in new buffers.
26399 struct LDKCResult_TxInitRbfDecodeErrorZ CResult_TxInitRbfDecodeErrorZ_clone(const struct LDKCResult_TxInitRbfDecodeErrorZ *NONNULL_PTR orig);
26402 * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state.
26404 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_ok(struct LDKTxAckRbf o);
26407 * Creates a new CResult_TxAckRbfDecodeErrorZ in the error state.
26409 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_err(struct LDKDecodeError e);
26412 * Checks if the given object is currently in the success state
26414 bool CResult_TxAckRbfDecodeErrorZ_is_ok(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR o);
26417 * Frees any resources used by the CResult_TxAckRbfDecodeErrorZ.
26419 void CResult_TxAckRbfDecodeErrorZ_free(struct LDKCResult_TxAckRbfDecodeErrorZ _res);
26422 * Creates a new CResult_TxAckRbfDecodeErrorZ which has the same data as `orig`
26423 * but with all dynamically-allocated buffers duplicated in new buffers.
26425 struct LDKCResult_TxAckRbfDecodeErrorZ CResult_TxAckRbfDecodeErrorZ_clone(const struct LDKCResult_TxAckRbfDecodeErrorZ *NONNULL_PTR orig);
26428 * Creates a new CResult_TxAbortDecodeErrorZ in the success state.
26430 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_ok(struct LDKTxAbort o);
26433 * Creates a new CResult_TxAbortDecodeErrorZ in the error state.
26435 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_err(struct LDKDecodeError e);
26438 * Checks if the given object is currently in the success state
26440 bool CResult_TxAbortDecodeErrorZ_is_ok(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR o);
26443 * Frees any resources used by the CResult_TxAbortDecodeErrorZ.
26445 void CResult_TxAbortDecodeErrorZ_free(struct LDKCResult_TxAbortDecodeErrorZ _res);
26448 * Creates a new CResult_TxAbortDecodeErrorZ which has the same data as `orig`
26449 * but with all dynamically-allocated buffers duplicated in new buffers.
26451 struct LDKCResult_TxAbortDecodeErrorZ CResult_TxAbortDecodeErrorZ_clone(const struct LDKCResult_TxAbortDecodeErrorZ *NONNULL_PTR orig);
26454 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state.
26456 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_ok(struct LDKAnnouncementSignatures o);
26459 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
26461 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_err(struct LDKDecodeError e);
26464 * Checks if the given object is currently in the success state
26466 bool CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR o);
26469 * Frees any resources used by the CResult_AnnouncementSignaturesDecodeErrorZ.
26471 void CResult_AnnouncementSignaturesDecodeErrorZ_free(struct LDKCResult_AnnouncementSignaturesDecodeErrorZ _res);
26474 * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ which has the same data as `orig`
26475 * but with all dynamically-allocated buffers duplicated in new buffers.
26477 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ CResult_AnnouncementSignaturesDecodeErrorZ_clone(const struct LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR orig);
26480 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state.
26482 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o);
26485 * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
26487 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e);
26490 * Checks if the given object is currently in the success state
26492 bool CResult_ChannelReestablishDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR o);
26495 * Frees any resources used by the CResult_ChannelReestablishDecodeErrorZ.
26497 void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res);
26500 * Creates a new CResult_ChannelReestablishDecodeErrorZ which has the same data as `orig`
26501 * but with all dynamically-allocated buffers duplicated in new buffers.
26503 struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_clone(const struct LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR orig);
26506 * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state.
26508 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_ok(struct LDKClosingSigned o);
26511 * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
26513 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_err(struct LDKDecodeError e);
26516 * Checks if the given object is currently in the success state
26518 bool CResult_ClosingSignedDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR o);
26521 * Frees any resources used by the CResult_ClosingSignedDecodeErrorZ.
26523 void CResult_ClosingSignedDecodeErrorZ_free(struct LDKCResult_ClosingSignedDecodeErrorZ _res);
26526 * Creates a new CResult_ClosingSignedDecodeErrorZ which has the same data as `orig`
26527 * but with all dynamically-allocated buffers duplicated in new buffers.
26529 struct LDKCResult_ClosingSignedDecodeErrorZ CResult_ClosingSignedDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR orig);
26532 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state.
26534 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(struct LDKClosingSignedFeeRange o);
26537 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
26539 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_err(struct LDKDecodeError e);
26542 * Checks if the given object is currently in the success state
26544 bool CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR o);
26547 * Frees any resources used by the CResult_ClosingSignedFeeRangeDecodeErrorZ.
26549 void CResult_ClosingSignedFeeRangeDecodeErrorZ_free(struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res);
26552 * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ which has the same data as `orig`
26553 * but with all dynamically-allocated buffers duplicated in new buffers.
26555 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(const struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR orig);
26558 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state.
26560 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_ok(struct LDKCommitmentSigned o);
26563 * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
26565 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_err(struct LDKDecodeError e);
26568 * Checks if the given object is currently in the success state
26570 bool CResult_CommitmentSignedDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR o);
26573 * Frees any resources used by the CResult_CommitmentSignedDecodeErrorZ.
26575 void CResult_CommitmentSignedDecodeErrorZ_free(struct LDKCResult_CommitmentSignedDecodeErrorZ _res);
26578 * Creates a new CResult_CommitmentSignedDecodeErrorZ which has the same data as `orig`
26579 * but with all dynamically-allocated buffers duplicated in new buffers.
26581 struct LDKCResult_CommitmentSignedDecodeErrorZ CResult_CommitmentSignedDecodeErrorZ_clone(const struct LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR orig);
26584 * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state.
26586 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_ok(struct LDKFundingCreated o);
26589 * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
26591 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_err(struct LDKDecodeError e);
26594 * Checks if the given object is currently in the success state
26596 bool CResult_FundingCreatedDecodeErrorZ_is_ok(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR o);
26599 * Frees any resources used by the CResult_FundingCreatedDecodeErrorZ.
26601 void CResult_FundingCreatedDecodeErrorZ_free(struct LDKCResult_FundingCreatedDecodeErrorZ _res);
26604 * Creates a new CResult_FundingCreatedDecodeErrorZ which has the same data as `orig`
26605 * but with all dynamically-allocated buffers duplicated in new buffers.
26607 struct LDKCResult_FundingCreatedDecodeErrorZ CResult_FundingCreatedDecodeErrorZ_clone(const struct LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR orig);
26610 * Creates a new CResult_FundingSignedDecodeErrorZ in the success state.
26612 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_ok(struct LDKFundingSigned o);
26615 * Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
26617 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_err(struct LDKDecodeError e);
26620 * Checks if the given object is currently in the success state
26622 bool CResult_FundingSignedDecodeErrorZ_is_ok(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR o);
26625 * Frees any resources used by the CResult_FundingSignedDecodeErrorZ.
26627 void CResult_FundingSignedDecodeErrorZ_free(struct LDKCResult_FundingSignedDecodeErrorZ _res);
26630 * Creates a new CResult_FundingSignedDecodeErrorZ which has the same data as `orig`
26631 * but with all dynamically-allocated buffers duplicated in new buffers.
26633 struct LDKCResult_FundingSignedDecodeErrorZ CResult_FundingSignedDecodeErrorZ_clone(const struct LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR orig);
26636 * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state.
26638 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_ok(struct LDKChannelReady o);
26641 * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
26643 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_err(struct LDKDecodeError e);
26646 * Checks if the given object is currently in the success state
26648 bool CResult_ChannelReadyDecodeErrorZ_is_ok(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR o);
26651 * Frees any resources used by the CResult_ChannelReadyDecodeErrorZ.
26653 void CResult_ChannelReadyDecodeErrorZ_free(struct LDKCResult_ChannelReadyDecodeErrorZ _res);
26656 * Creates a new CResult_ChannelReadyDecodeErrorZ which has the same data as `orig`
26657 * but with all dynamically-allocated buffers duplicated in new buffers.
26659 struct LDKCResult_ChannelReadyDecodeErrorZ CResult_ChannelReadyDecodeErrorZ_clone(const struct LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR orig);
26662 * Creates a new CResult_InitDecodeErrorZ in the success state.
26664 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o);
26667 * Creates a new CResult_InitDecodeErrorZ in the error state.
26669 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e);
26672 * Checks if the given object is currently in the success state
26674 bool CResult_InitDecodeErrorZ_is_ok(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR o);
26677 * Frees any resources used by the CResult_InitDecodeErrorZ.
26679 void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res);
26682 * Creates a new CResult_InitDecodeErrorZ which has the same data as `orig`
26683 * but with all dynamically-allocated buffers duplicated in new buffers.
26685 struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_clone(const struct LDKCResult_InitDecodeErrorZ *NONNULL_PTR orig);
26688 * Creates a new CResult_OpenChannelDecodeErrorZ in the success state.
26690 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_ok(struct LDKOpenChannel o);
26693 * Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
26695 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_err(struct LDKDecodeError e);
26698 * Checks if the given object is currently in the success state
26700 bool CResult_OpenChannelDecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR o);
26703 * Frees any resources used by the CResult_OpenChannelDecodeErrorZ.
26705 void CResult_OpenChannelDecodeErrorZ_free(struct LDKCResult_OpenChannelDecodeErrorZ _res);
26708 * Creates a new CResult_OpenChannelDecodeErrorZ which has the same data as `orig`
26709 * but with all dynamically-allocated buffers duplicated in new buffers.
26711 struct LDKCResult_OpenChannelDecodeErrorZ CResult_OpenChannelDecodeErrorZ_clone(const struct LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR orig);
26714 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state.
26716 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_ok(struct LDKOpenChannelV2 o);
26719 * Creates a new CResult_OpenChannelV2DecodeErrorZ in the error state.
26721 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_err(struct LDKDecodeError e);
26724 * Checks if the given object is currently in the success state
26726 bool CResult_OpenChannelV2DecodeErrorZ_is_ok(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR o);
26729 * Frees any resources used by the CResult_OpenChannelV2DecodeErrorZ.
26731 void CResult_OpenChannelV2DecodeErrorZ_free(struct LDKCResult_OpenChannelV2DecodeErrorZ _res);
26734 * Creates a new CResult_OpenChannelV2DecodeErrorZ which has the same data as `orig`
26735 * but with all dynamically-allocated buffers duplicated in new buffers.
26737 struct LDKCResult_OpenChannelV2DecodeErrorZ CResult_OpenChannelV2DecodeErrorZ_clone(const struct LDKCResult_OpenChannelV2DecodeErrorZ *NONNULL_PTR orig);
26740 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state.
26742 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_ok(struct LDKRevokeAndACK o);
26745 * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
26747 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_err(struct LDKDecodeError e);
26750 * Checks if the given object is currently in the success state
26752 bool CResult_RevokeAndACKDecodeErrorZ_is_ok(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR o);
26755 * Frees any resources used by the CResult_RevokeAndACKDecodeErrorZ.
26757 void CResult_RevokeAndACKDecodeErrorZ_free(struct LDKCResult_RevokeAndACKDecodeErrorZ _res);
26760 * Creates a new CResult_RevokeAndACKDecodeErrorZ which has the same data as `orig`
26761 * but with all dynamically-allocated buffers duplicated in new buffers.
26763 struct LDKCResult_RevokeAndACKDecodeErrorZ CResult_RevokeAndACKDecodeErrorZ_clone(const struct LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR orig);
26766 * Creates a new CResult_ShutdownDecodeErrorZ in the success state.
26768 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_ok(struct LDKShutdown o);
26771 * Creates a new CResult_ShutdownDecodeErrorZ in the error state.
26773 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_err(struct LDKDecodeError e);
26776 * Checks if the given object is currently in the success state
26778 bool CResult_ShutdownDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR o);
26781 * Frees any resources used by the CResult_ShutdownDecodeErrorZ.
26783 void CResult_ShutdownDecodeErrorZ_free(struct LDKCResult_ShutdownDecodeErrorZ _res);
26786 * Creates a new CResult_ShutdownDecodeErrorZ which has the same data as `orig`
26787 * but with all dynamically-allocated buffers duplicated in new buffers.
26789 struct LDKCResult_ShutdownDecodeErrorZ CResult_ShutdownDecodeErrorZ_clone(const struct LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR orig);
26792 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state.
26794 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_ok(struct LDKUpdateFailHTLC o);
26797 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
26799 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_err(struct LDKDecodeError e);
26802 * Checks if the given object is currently in the success state
26804 bool CResult_UpdateFailHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR o);
26807 * Frees any resources used by the CResult_UpdateFailHTLCDecodeErrorZ.
26809 void CResult_UpdateFailHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailHTLCDecodeErrorZ _res);
26812 * Creates a new CResult_UpdateFailHTLCDecodeErrorZ which has the same data as `orig`
26813 * but with all dynamically-allocated buffers duplicated in new buffers.
26815 struct LDKCResult_UpdateFailHTLCDecodeErrorZ CResult_UpdateFailHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR orig);
26818 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state.
26820 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(struct LDKUpdateFailMalformedHTLC o);
26823 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
26825 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
26828 * Checks if the given object is currently in the success state
26830 bool CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR o);
26833 * Frees any resources used by the CResult_UpdateFailMalformedHTLCDecodeErrorZ.
26835 void CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res);
26838 * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ which has the same data as `orig`
26839 * but with all dynamically-allocated buffers duplicated in new buffers.
26841 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR orig);
26844 * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state.
26846 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_ok(struct LDKUpdateFee o);
26849 * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
26851 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_err(struct LDKDecodeError e);
26854 * Checks if the given object is currently in the success state
26856 bool CResult_UpdateFeeDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR o);
26859 * Frees any resources used by the CResult_UpdateFeeDecodeErrorZ.
26861 void CResult_UpdateFeeDecodeErrorZ_free(struct LDKCResult_UpdateFeeDecodeErrorZ _res);
26864 * Creates a new CResult_UpdateFeeDecodeErrorZ which has the same data as `orig`
26865 * but with all dynamically-allocated buffers duplicated in new buffers.
26867 struct LDKCResult_UpdateFeeDecodeErrorZ CResult_UpdateFeeDecodeErrorZ_clone(const struct LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR orig);
26870 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state.
26872 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_ok(struct LDKUpdateFulfillHTLC o);
26875 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
26877 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_err(struct LDKDecodeError e);
26880 * Checks if the given object is currently in the success state
26882 bool CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR o);
26885 * Frees any resources used by the CResult_UpdateFulfillHTLCDecodeErrorZ.
26887 void CResult_UpdateFulfillHTLCDecodeErrorZ_free(struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res);
26890 * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ which has the same data as `orig`
26891 * but with all dynamically-allocated buffers duplicated in new buffers.
26893 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ CResult_UpdateFulfillHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR orig);
26896 * Creates a new CResult_OnionPacketDecodeErrorZ in the success state.
26898 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_ok(struct LDKOnionPacket o);
26901 * Creates a new CResult_OnionPacketDecodeErrorZ in the error state.
26903 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_err(struct LDKDecodeError e);
26906 * Checks if the given object is currently in the success state
26908 bool CResult_OnionPacketDecodeErrorZ_is_ok(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR o);
26911 * Frees any resources used by the CResult_OnionPacketDecodeErrorZ.
26913 void CResult_OnionPacketDecodeErrorZ_free(struct LDKCResult_OnionPacketDecodeErrorZ _res);
26916 * Creates a new CResult_OnionPacketDecodeErrorZ which has the same data as `orig`
26917 * but with all dynamically-allocated buffers duplicated in new buffers.
26919 struct LDKCResult_OnionPacketDecodeErrorZ CResult_OnionPacketDecodeErrorZ_clone(const struct LDKCResult_OnionPacketDecodeErrorZ *NONNULL_PTR orig);
26922 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state.
26924 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_ok(struct LDKUpdateAddHTLC o);
26927 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
26929 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_err(struct LDKDecodeError e);
26932 * Checks if the given object is currently in the success state
26934 bool CResult_UpdateAddHTLCDecodeErrorZ_is_ok(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR o);
26937 * Frees any resources used by the CResult_UpdateAddHTLCDecodeErrorZ.
26939 void CResult_UpdateAddHTLCDecodeErrorZ_free(struct LDKCResult_UpdateAddHTLCDecodeErrorZ _res);
26942 * Creates a new CResult_UpdateAddHTLCDecodeErrorZ which has the same data as `orig`
26943 * but with all dynamically-allocated buffers duplicated in new buffers.
26945 struct LDKCResult_UpdateAddHTLCDecodeErrorZ CResult_UpdateAddHTLCDecodeErrorZ_clone(const struct LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR orig);
26948 * Creates a new CResult_OnionMessageDecodeErrorZ in the success state.
26950 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_ok(struct LDKOnionMessage o);
26953 * Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
26955 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_err(struct LDKDecodeError e);
26958 * Checks if the given object is currently in the success state
26960 bool CResult_OnionMessageDecodeErrorZ_is_ok(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR o);
26963 * Frees any resources used by the CResult_OnionMessageDecodeErrorZ.
26965 void CResult_OnionMessageDecodeErrorZ_free(struct LDKCResult_OnionMessageDecodeErrorZ _res);
26968 * Creates a new CResult_OnionMessageDecodeErrorZ which has the same data as `orig`
26969 * but with all dynamically-allocated buffers duplicated in new buffers.
26971 struct LDKCResult_OnionMessageDecodeErrorZ CResult_OnionMessageDecodeErrorZ_clone(const struct LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR orig);
26974 * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the success state.
26976 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_ok(struct LDKFinalOnionHopData o);
26979 * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the error state.
26981 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_err(struct LDKDecodeError e);
26984 * Checks if the given object is currently in the success state
26986 bool CResult_FinalOnionHopDataDecodeErrorZ_is_ok(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR o);
26989 * Frees any resources used by the CResult_FinalOnionHopDataDecodeErrorZ.
26991 void CResult_FinalOnionHopDataDecodeErrorZ_free(struct LDKCResult_FinalOnionHopDataDecodeErrorZ _res);
26994 * Creates a new CResult_FinalOnionHopDataDecodeErrorZ which has the same data as `orig`
26995 * but with all dynamically-allocated buffers duplicated in new buffers.
26997 struct LDKCResult_FinalOnionHopDataDecodeErrorZ CResult_FinalOnionHopDataDecodeErrorZ_clone(const struct LDKCResult_FinalOnionHopDataDecodeErrorZ *NONNULL_PTR orig);
27000 * Creates a new CResult_PingDecodeErrorZ in the success state.
27002 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o);
27005 * Creates a new CResult_PingDecodeErrorZ in the error state.
27007 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e);
27010 * Checks if the given object is currently in the success state
27012 bool CResult_PingDecodeErrorZ_is_ok(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR o);
27015 * Frees any resources used by the CResult_PingDecodeErrorZ.
27017 void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res);
27020 * Creates a new CResult_PingDecodeErrorZ which has the same data as `orig`
27021 * but with all dynamically-allocated buffers duplicated in new buffers.
27023 struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_clone(const struct LDKCResult_PingDecodeErrorZ *NONNULL_PTR orig);
27026 * Creates a new CResult_PongDecodeErrorZ in the success state.
27028 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o);
27031 * Creates a new CResult_PongDecodeErrorZ in the error state.
27033 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e);
27036 * Checks if the given object is currently in the success state
27038 bool CResult_PongDecodeErrorZ_is_ok(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR o);
27041 * Frees any resources used by the CResult_PongDecodeErrorZ.
27043 void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res);
27046 * Creates a new CResult_PongDecodeErrorZ which has the same data as `orig`
27047 * but with all dynamically-allocated buffers duplicated in new buffers.
27049 struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_clone(const struct LDKCResult_PongDecodeErrorZ *NONNULL_PTR orig);
27052 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state.
27054 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o);
27057 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
27059 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
27062 * Checks if the given object is currently in the success state
27064 bool CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
27067 * Frees any resources used by the CResult_UnsignedChannelAnnouncementDecodeErrorZ.
27069 void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res);
27072 * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ which has the same data as `orig`
27073 * but with all dynamically-allocated buffers duplicated in new buffers.
27075 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
27078 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state.
27080 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_ok(struct LDKChannelAnnouncement o);
27083 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
27085 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
27088 * Checks if the given object is currently in the success state
27090 bool CResult_ChannelAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR o);
27093 * Frees any resources used by the CResult_ChannelAnnouncementDecodeErrorZ.
27095 void CResult_ChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_ChannelAnnouncementDecodeErrorZ _res);
27098 * Creates a new CResult_ChannelAnnouncementDecodeErrorZ which has the same data as `orig`
27099 * but with all dynamically-allocated buffers duplicated in new buffers.
27101 struct LDKCResult_ChannelAnnouncementDecodeErrorZ CResult_ChannelAnnouncementDecodeErrorZ_clone(const struct LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR orig);
27104 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state.
27106 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o);
27109 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
27111 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
27114 * Checks if the given object is currently in the success state
27116 bool CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR o);
27119 * Frees any resources used by the CResult_UnsignedChannelUpdateDecodeErrorZ.
27121 void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res);
27124 * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ which has the same data as `orig`
27125 * but with all dynamically-allocated buffers duplicated in new buffers.
27127 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
27130 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state.
27132 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_ok(struct LDKChannelUpdate o);
27135 * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
27137 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e);
27140 * Checks if the given object is currently in the success state
27142 bool CResult_ChannelUpdateDecodeErrorZ_is_ok(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR o);
27145 * Frees any resources used by the CResult_ChannelUpdateDecodeErrorZ.
27147 void CResult_ChannelUpdateDecodeErrorZ_free(struct LDKCResult_ChannelUpdateDecodeErrorZ _res);
27150 * Creates a new CResult_ChannelUpdateDecodeErrorZ which has the same data as `orig`
27151 * but with all dynamically-allocated buffers duplicated in new buffers.
27153 struct LDKCResult_ChannelUpdateDecodeErrorZ CResult_ChannelUpdateDecodeErrorZ_clone(const struct LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR orig);
27156 * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state.
27158 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o);
27161 * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
27163 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e);
27166 * Checks if the given object is currently in the success state
27168 bool CResult_ErrorMessageDecodeErrorZ_is_ok(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR o);
27171 * Frees any resources used by the CResult_ErrorMessageDecodeErrorZ.
27173 void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res);
27176 * Creates a new CResult_ErrorMessageDecodeErrorZ which has the same data as `orig`
27177 * but with all dynamically-allocated buffers duplicated in new buffers.
27179 struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_clone(const struct LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR orig);
27182 * Creates a new CResult_WarningMessageDecodeErrorZ in the success state.
27184 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_ok(struct LDKWarningMessage o);
27187 * Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
27189 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_err(struct LDKDecodeError e);
27192 * Checks if the given object is currently in the success state
27194 bool CResult_WarningMessageDecodeErrorZ_is_ok(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR o);
27197 * Frees any resources used by the CResult_WarningMessageDecodeErrorZ.
27199 void CResult_WarningMessageDecodeErrorZ_free(struct LDKCResult_WarningMessageDecodeErrorZ _res);
27202 * Creates a new CResult_WarningMessageDecodeErrorZ which has the same data as `orig`
27203 * but with all dynamically-allocated buffers duplicated in new buffers.
27205 struct LDKCResult_WarningMessageDecodeErrorZ CResult_WarningMessageDecodeErrorZ_clone(const struct LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR orig);
27208 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state.
27210 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o);
27213 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
27215 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
27218 * Checks if the given object is currently in the success state
27220 bool CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
27223 * Frees any resources used by the CResult_UnsignedNodeAnnouncementDecodeErrorZ.
27225 void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res);
27228 * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ which has the same data as `orig`
27229 * but with all dynamically-allocated buffers duplicated in new buffers.
27231 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
27234 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state.
27236 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_ok(struct LDKNodeAnnouncement o);
27239 * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
27241 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e);
27244 * Checks if the given object is currently in the success state
27246 bool CResult_NodeAnnouncementDecodeErrorZ_is_ok(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR o);
27249 * Frees any resources used by the CResult_NodeAnnouncementDecodeErrorZ.
27251 void CResult_NodeAnnouncementDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementDecodeErrorZ _res);
27254 * Creates a new CResult_NodeAnnouncementDecodeErrorZ which has the same data as `orig`
27255 * but with all dynamically-allocated buffers duplicated in new buffers.
27257 struct LDKCResult_NodeAnnouncementDecodeErrorZ CResult_NodeAnnouncementDecodeErrorZ_clone(const struct LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR orig);
27260 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state.
27262 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o);
27265 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
27267 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e);
27270 * Checks if the given object is currently in the success state
27272 bool CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR o);
27275 * Frees any resources used by the CResult_QueryShortChannelIdsDecodeErrorZ.
27277 void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res);
27280 * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ which has the same data as `orig`
27281 * but with all dynamically-allocated buffers duplicated in new buffers.
27283 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_clone(const struct LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR orig);
27286 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state.
27288 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o);
27291 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
27293 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e);
27296 * Checks if the given object is currently in the success state
27298 bool CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR o);
27301 * Frees any resources used by the CResult_ReplyShortChannelIdsEndDecodeErrorZ.
27303 void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res);
27306 * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ which has the same data as `orig`
27307 * but with all dynamically-allocated buffers duplicated in new buffers.
27309 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(const struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR orig);
27312 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state.
27314 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o);
27317 * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
27319 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
27322 * Checks if the given object is currently in the success state
27324 bool CResult_QueryChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR o);
27327 * Frees any resources used by the CResult_QueryChannelRangeDecodeErrorZ.
27329 void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res);
27332 * Creates a new CResult_QueryChannelRangeDecodeErrorZ which has the same data as `orig`
27333 * but with all dynamically-allocated buffers duplicated in new buffers.
27335 struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_clone(const struct LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR orig);
27338 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state.
27340 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o);
27343 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
27345 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e);
27348 * Checks if the given object is currently in the success state
27350 bool CResult_ReplyChannelRangeDecodeErrorZ_is_ok(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR o);
27353 * Frees any resources used by the CResult_ReplyChannelRangeDecodeErrorZ.
27355 void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res);
27358 * Creates a new CResult_ReplyChannelRangeDecodeErrorZ which has the same data as `orig`
27359 * but with all dynamically-allocated buffers duplicated in new buffers.
27361 struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_clone(const struct LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR orig);
27364 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state.
27366 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o);
27369 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
27371 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e);
27374 * Checks if the given object is currently in the success state
27376 bool CResult_GossipTimestampFilterDecodeErrorZ_is_ok(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR o);
27379 * Frees any resources used by the CResult_GossipTimestampFilterDecodeErrorZ.
27381 void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res);
27384 * Creates a new CResult_GossipTimestampFilterDecodeErrorZ which has the same data as `orig`
27385 * but with all dynamically-allocated buffers duplicated in new buffers.
27387 struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_clone(const struct LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR orig);
27390 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27392 void CVec_PhantomRouteHintsZ_free(struct LDKCVec_PhantomRouteHintsZ _res);
27395 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state.
27397 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(struct LDKBolt11Invoice o);
27400 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the error state.
27402 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_err(struct LDKSignOrCreationError e);
27405 * Checks if the given object is currently in the success state
27407 bool CResult_Bolt11InvoiceSignOrCreationErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR o);
27410 * Frees any resources used by the CResult_Bolt11InvoiceSignOrCreationErrorZ.
27412 void CResult_Bolt11InvoiceSignOrCreationErrorZ_free(struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ _res);
27415 * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ which has the same data as `orig`
27416 * but with all dynamically-allocated buffers duplicated in new buffers.
27418 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ CResult_Bolt11InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
27421 * Frees the buffer pointed to by `data` if `datalen` is non-0.
27423 void CVec_FutureZ_free(struct LDKCVec_FutureZ _res);
27426 * Creates a new CResult_OffersMessageDecodeErrorZ in the success state.
27428 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_ok(struct LDKOffersMessage o);
27431 * Creates a new CResult_OffersMessageDecodeErrorZ in the error state.
27433 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_err(struct LDKDecodeError e);
27436 * Checks if the given object is currently in the success state
27438 bool CResult_OffersMessageDecodeErrorZ_is_ok(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR o);
27441 * Frees any resources used by the CResult_OffersMessageDecodeErrorZ.
27443 void CResult_OffersMessageDecodeErrorZ_free(struct LDKCResult_OffersMessageDecodeErrorZ _res);
27446 * Creates a new CResult_OffersMessageDecodeErrorZ which has the same data as `orig`
27447 * but with all dynamically-allocated buffers duplicated in new buffers.
27449 struct LDKCResult_OffersMessageDecodeErrorZ CResult_OffersMessageDecodeErrorZ_clone(const struct LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR orig);
27452 * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim
27454 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o);
27457 * Constructs a new COption_HTLCClaimZ containing nothing
27459 struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void);
27462 * Frees any resources associated with the crate::lightning::ln::chan_utils::HTLCClaim, if we are in the Some state
27464 void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res);
27467 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state.
27469 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(struct LDKCounterpartyCommitmentSecrets o);
27472 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
27474 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(struct LDKDecodeError e);
27477 * Checks if the given object is currently in the success state
27479 bool CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR o);
27482 * Frees any resources used by the CResult_CounterpartyCommitmentSecretsDecodeErrorZ.
27484 void CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res);
27487 * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ which has the same data as `orig`
27488 * but with all dynamically-allocated buffers duplicated in new buffers.
27490 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig);
27493 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state.
27495 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o);
27498 * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
27500 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e);
27503 * Checks if the given object is currently in the success state
27505 bool CResult_TxCreationKeysDecodeErrorZ_is_ok(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR o);
27508 * Frees any resources used by the CResult_TxCreationKeysDecodeErrorZ.
27510 void CResult_TxCreationKeysDecodeErrorZ_free(struct LDKCResult_TxCreationKeysDecodeErrorZ _res);
27513 * Creates a new CResult_TxCreationKeysDecodeErrorZ which has the same data as `orig`
27514 * but with all dynamically-allocated buffers duplicated in new buffers.
27516 struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_clone(const struct LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR orig);
27519 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state.
27521 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_ok(struct LDKChannelPublicKeys o);
27524 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
27526 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_err(struct LDKDecodeError e);
27529 * Checks if the given object is currently in the success state
27531 bool CResult_ChannelPublicKeysDecodeErrorZ_is_ok(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR o);
27534 * Frees any resources used by the CResult_ChannelPublicKeysDecodeErrorZ.
27536 void CResult_ChannelPublicKeysDecodeErrorZ_free(struct LDKCResult_ChannelPublicKeysDecodeErrorZ _res);
27539 * Creates a new CResult_ChannelPublicKeysDecodeErrorZ which has the same data as `orig`
27540 * but with all dynamically-allocated buffers duplicated in new buffers.
27542 struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig);
27545 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state.
27547 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(struct LDKHTLCOutputInCommitment o);
27550 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
27552 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_err(struct LDKDecodeError e);
27555 * Checks if the given object is currently in the success state
27557 bool CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR o);
27560 * Frees any resources used by the CResult_HTLCOutputInCommitmentDecodeErrorZ.
27562 void CResult_HTLCOutputInCommitmentDecodeErrorZ_free(struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res);
27565 * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ which has the same data as `orig`
27566 * but with all dynamically-allocated buffers duplicated in new buffers.
27568 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(const struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR orig);
27571 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state.
27573 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(struct LDKCounterpartyChannelTransactionParameters o);
27576 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
27578 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
27581 * Checks if the given object is currently in the success state
27583 bool CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
27586 * Frees any resources used by the CResult_CounterpartyChannelTransactionParametersDecodeErrorZ.
27588 void CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res);
27591 * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
27592 * but with all dynamically-allocated buffers duplicated in new buffers.
27594 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
27597 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state.
27599 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_ok(struct LDKChannelTransactionParameters o);
27602 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
27604 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_err(struct LDKDecodeError e);
27607 * Checks if the given object is currently in the success state
27609 bool CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR o);
27612 * Frees any resources used by the CResult_ChannelTransactionParametersDecodeErrorZ.
27614 void CResult_ChannelTransactionParametersDecodeErrorZ_free(struct LDKCResult_ChannelTransactionParametersDecodeErrorZ _res);
27617 * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ which has the same data as `orig`
27618 * but with all dynamically-allocated buffers duplicated in new buffers.
27620 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ CResult_ChannelTransactionParametersDecodeErrorZ_clone(const struct LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR orig);
27623 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state.
27625 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_ok(struct LDKHolderCommitmentTransaction o);
27628 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
27630 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
27633 * Checks if the given object is currently in the success state
27635 bool CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
27638 * Frees any resources used by the CResult_HolderCommitmentTransactionDecodeErrorZ.
27640 void CResult_HolderCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res);
27643 * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ which has the same data as `orig`
27644 * but with all dynamically-allocated buffers duplicated in new buffers.
27646 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ CResult_HolderCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
27649 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state.
27651 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(struct LDKBuiltCommitmentTransaction o);
27654 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
27656 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
27659 * Checks if the given object is currently in the success state
27661 bool CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
27664 * Frees any resources used by the CResult_BuiltCommitmentTransactionDecodeErrorZ.
27666 void CResult_BuiltCommitmentTransactionDecodeErrorZ_free(struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res);
27669 * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ which has the same data as `orig`
27670 * but with all dynamically-allocated buffers duplicated in new buffers.
27672 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
27675 * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state.
27677 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_ok(struct LDKTrustedClosingTransaction o);
27680 * Creates a new CResult_TrustedClosingTransactionNoneZ in the error state.
27682 struct LDKCResult_TrustedClosingTransactionNoneZ CResult_TrustedClosingTransactionNoneZ_err(void);
27685 * Checks if the given object is currently in the success state
27687 bool CResult_TrustedClosingTransactionNoneZ_is_ok(const struct LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR o);
27690 * Frees any resources used by the CResult_TrustedClosingTransactionNoneZ.
27692 void CResult_TrustedClosingTransactionNoneZ_free(struct LDKCResult_TrustedClosingTransactionNoneZ _res);
27695 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state.
27697 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_ok(struct LDKCommitmentTransaction o);
27700 * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
27702 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_err(struct LDKDecodeError e);
27705 * Checks if the given object is currently in the success state
27707 bool CResult_CommitmentTransactionDecodeErrorZ_is_ok(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR o);
27710 * Frees any resources used by the CResult_CommitmentTransactionDecodeErrorZ.
27712 void CResult_CommitmentTransactionDecodeErrorZ_free(struct LDKCResult_CommitmentTransactionDecodeErrorZ _res);
27715 * Creates a new CResult_CommitmentTransactionDecodeErrorZ which has the same data as `orig`
27716 * but with all dynamically-allocated buffers duplicated in new buffers.
27718 struct LDKCResult_CommitmentTransactionDecodeErrorZ CResult_CommitmentTransactionDecodeErrorZ_clone(const struct LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR orig);
27721 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state.
27723 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o);
27726 * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the error state.
27728 struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void);
27731 * Checks if the given object is currently in the success state
27733 bool CResult_TrustedCommitmentTransactionNoneZ_is_ok(const struct LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR o);
27736 * Frees any resources used by the CResult_TrustedCommitmentTransactionNoneZ.
27738 void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res);
27741 * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the success state.
27743 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_ok(struct LDKCVec_ECDSASignatureZ o);
27746 * Creates a new CResult_CVec_ECDSASignatureZNoneZ in the error state.
27748 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_err(void);
27751 * Checks if the given object is currently in the success state
27753 bool CResult_CVec_ECDSASignatureZNoneZ_is_ok(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR o);
27756 * Frees any resources used by the CResult_CVec_ECDSASignatureZNoneZ.
27758 void CResult_CVec_ECDSASignatureZNoneZ_free(struct LDKCResult_CVec_ECDSASignatureZNoneZ _res);
27761 * Creates a new CResult_CVec_ECDSASignatureZNoneZ which has the same data as `orig`
27762 * but with all dynamically-allocated buffers duplicated in new buffers.
27764 struct LDKCResult_CVec_ECDSASignatureZNoneZ CResult_CVec_ECDSASignatureZNoneZ_clone(const struct LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR orig);
27767 * Constructs a new COption_usizeZ containing a usize
27769 struct LDKCOption_usizeZ COption_usizeZ_some(uintptr_t o);
27772 * Constructs a new COption_usizeZ containing nothing
27774 struct LDKCOption_usizeZ COption_usizeZ_none(void);
27777 * Frees any resources associated with the usize, if we are in the Some state
27779 void COption_usizeZ_free(struct LDKCOption_usizeZ _res);
27782 * Creates a new COption_usizeZ which has the same data as `orig`
27783 * but with all dynamically-allocated buffers duplicated in new buffers.
27785 struct LDKCOption_usizeZ COption_usizeZ_clone(const struct LDKCOption_usizeZ *NONNULL_PTR orig);
27788 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state.
27790 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_ok(struct LDKShutdownScript o);
27793 * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
27795 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_err(struct LDKDecodeError e);
27798 * Checks if the given object is currently in the success state
27800 bool CResult_ShutdownScriptDecodeErrorZ_is_ok(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR o);
27803 * Frees any resources used by the CResult_ShutdownScriptDecodeErrorZ.
27805 void CResult_ShutdownScriptDecodeErrorZ_free(struct LDKCResult_ShutdownScriptDecodeErrorZ _res);
27808 * Creates a new CResult_ShutdownScriptDecodeErrorZ which has the same data as `orig`
27809 * but with all dynamically-allocated buffers duplicated in new buffers.
27811 struct LDKCResult_ShutdownScriptDecodeErrorZ CResult_ShutdownScriptDecodeErrorZ_clone(const struct LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR orig);
27814 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state.
27816 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_ok(struct LDKShutdownScript o);
27819 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state.
27821 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_err(struct LDKInvalidShutdownScript e);
27824 * Checks if the given object is currently in the success state
27826 bool CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR o);
27829 * Frees any resources used by the CResult_ShutdownScriptInvalidShutdownScriptZ.
27831 void CResult_ShutdownScriptInvalidShutdownScriptZ_free(struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res);
27834 * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ which has the same data as `orig`
27835 * but with all dynamically-allocated buffers duplicated in new buffers.
27837 struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig);
27840 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state.
27842 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o);
27845 * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
27847 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e);
27850 * Checks if the given object is currently in the success state
27852 bool CResult_PaymentPurposeDecodeErrorZ_is_ok(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR o);
27855 * Frees any resources used by the CResult_PaymentPurposeDecodeErrorZ.
27857 void CResult_PaymentPurposeDecodeErrorZ_free(struct LDKCResult_PaymentPurposeDecodeErrorZ _res);
27860 * Creates a new CResult_PaymentPurposeDecodeErrorZ which has the same data as `orig`
27861 * but with all dynamically-allocated buffers duplicated in new buffers.
27863 struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_clone(const struct LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR orig);
27866 * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the success state.
27868 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_ok(struct LDKClaimedHTLC o);
27871 * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the error state.
27873 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_err(struct LDKDecodeError e);
27876 * Checks if the given object is currently in the success state
27878 bool CResult_ClaimedHTLCDecodeErrorZ_is_ok(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR o);
27881 * Frees any resources used by the CResult_ClaimedHTLCDecodeErrorZ.
27883 void CResult_ClaimedHTLCDecodeErrorZ_free(struct LDKCResult_ClaimedHTLCDecodeErrorZ _res);
27886 * Creates a new CResult_ClaimedHTLCDecodeErrorZ which has the same data as `orig`
27887 * but with all dynamically-allocated buffers duplicated in new buffers.
27889 struct LDKCResult_ClaimedHTLCDecodeErrorZ CResult_ClaimedHTLCDecodeErrorZ_clone(const struct LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR orig);
27892 * Constructs a new COption_PathFailureZ containing a crate::lightning::events::PathFailure
27894 struct LDKCOption_PathFailureZ COption_PathFailureZ_some(struct LDKPathFailure o);
27897 * Constructs a new COption_PathFailureZ containing nothing
27899 struct LDKCOption_PathFailureZ COption_PathFailureZ_none(void);
27902 * Frees any resources associated with the crate::lightning::events::PathFailure, if we are in the Some state
27904 void COption_PathFailureZ_free(struct LDKCOption_PathFailureZ _res);
27907 * Creates a new COption_PathFailureZ which has the same data as `orig`
27908 * but with all dynamically-allocated buffers duplicated in new buffers.
27910 struct LDKCOption_PathFailureZ COption_PathFailureZ_clone(const struct LDKCOption_PathFailureZ *NONNULL_PTR orig);
27913 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the success state.
27915 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_ok(struct LDKCOption_PathFailureZ o);
27918 * Creates a new CResult_COption_PathFailureZDecodeErrorZ in the error state.
27920 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_err(struct LDKDecodeError e);
27923 * Checks if the given object is currently in the success state
27925 bool CResult_COption_PathFailureZDecodeErrorZ_is_ok(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR o);
27928 * Frees any resources used by the CResult_COption_PathFailureZDecodeErrorZ.
27930 void CResult_COption_PathFailureZDecodeErrorZ_free(struct LDKCResult_COption_PathFailureZDecodeErrorZ _res);
27933 * Creates a new CResult_COption_PathFailureZDecodeErrorZ which has the same data as `orig`
27934 * but with all dynamically-allocated buffers duplicated in new buffers.
27936 struct LDKCResult_COption_PathFailureZDecodeErrorZ CResult_COption_PathFailureZDecodeErrorZ_clone(const struct LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR orig);
27939 * Constructs a new COption_ClosureReasonZ containing a crate::lightning::events::ClosureReason
27941 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_some(struct LDKClosureReason o);
27944 * Constructs a new COption_ClosureReasonZ containing nothing
27946 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_none(void);
27949 * Frees any resources associated with the crate::lightning::events::ClosureReason, if we are in the Some state
27951 void COption_ClosureReasonZ_free(struct LDKCOption_ClosureReasonZ _res);
27954 * Creates a new COption_ClosureReasonZ which has the same data as `orig`
27955 * but with all dynamically-allocated buffers duplicated in new buffers.
27957 struct LDKCOption_ClosureReasonZ COption_ClosureReasonZ_clone(const struct LDKCOption_ClosureReasonZ *NONNULL_PTR orig);
27960 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state.
27962 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_ok(struct LDKCOption_ClosureReasonZ o);
27965 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
27967 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_err(struct LDKDecodeError e);
27970 * Checks if the given object is currently in the success state
27972 bool CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR o);
27975 * Frees any resources used by the CResult_COption_ClosureReasonZDecodeErrorZ.
27977 void CResult_COption_ClosureReasonZDecodeErrorZ_free(struct LDKCResult_COption_ClosureReasonZDecodeErrorZ _res);
27980 * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ which has the same data as `orig`
27981 * but with all dynamically-allocated buffers duplicated in new buffers.
27983 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ CResult_COption_ClosureReasonZDecodeErrorZ_clone(const struct LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR orig);
27986 * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::events::HTLCDestination
27988 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_some(struct LDKHTLCDestination o);
27991 * Constructs a new COption_HTLCDestinationZ containing nothing
27993 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_none(void);
27996 * Frees any resources associated with the crate::lightning::events::HTLCDestination, if we are in the Some state
27998 void COption_HTLCDestinationZ_free(struct LDKCOption_HTLCDestinationZ _res);
28001 * Creates a new COption_HTLCDestinationZ which has the same data as `orig`
28002 * but with all dynamically-allocated buffers duplicated in new buffers.
28004 struct LDKCOption_HTLCDestinationZ COption_HTLCDestinationZ_clone(const struct LDKCOption_HTLCDestinationZ *NONNULL_PTR orig);
28007 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state.
28009 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_ok(struct LDKCOption_HTLCDestinationZ o);
28012 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
28014 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_err(struct LDKDecodeError e);
28017 * Checks if the given object is currently in the success state
28019 bool CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR o);
28022 * Frees any resources used by the CResult_COption_HTLCDestinationZDecodeErrorZ.
28024 void CResult_COption_HTLCDestinationZDecodeErrorZ_free(struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res);
28027 * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ which has the same data as `orig`
28028 * but with all dynamically-allocated buffers duplicated in new buffers.
28030 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig);
28033 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the success state.
28035 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_ok(enum LDKPaymentFailureReason o);
28038 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ in the error state.
28040 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_err(struct LDKDecodeError e);
28043 * Checks if the given object is currently in the success state
28045 bool CResult_PaymentFailureReasonDecodeErrorZ_is_ok(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR o);
28048 * Frees any resources used by the CResult_PaymentFailureReasonDecodeErrorZ.
28050 void CResult_PaymentFailureReasonDecodeErrorZ_free(struct LDKCResult_PaymentFailureReasonDecodeErrorZ _res);
28053 * Creates a new CResult_PaymentFailureReasonDecodeErrorZ which has the same data as `orig`
28054 * but with all dynamically-allocated buffers duplicated in new buffers.
28056 struct LDKCResult_PaymentFailureReasonDecodeErrorZ CResult_PaymentFailureReasonDecodeErrorZ_clone(const struct LDKCResult_PaymentFailureReasonDecodeErrorZ *NONNULL_PTR orig);
28059 * Constructs a new COption_U128Z containing a crate::c_types::U128
28061 struct LDKCOption_U128Z COption_U128Z_some(struct LDKU128 o);
28064 * Constructs a new COption_U128Z containing nothing
28066 struct LDKCOption_U128Z COption_U128Z_none(void);
28069 * Frees any resources associated with the crate::c_types::U128, if we are in the Some state
28071 void COption_U128Z_free(struct LDKCOption_U128Z _res);
28074 * Creates a new COption_U128Z which has the same data as `orig`
28075 * but with all dynamically-allocated buffers duplicated in new buffers.
28077 struct LDKCOption_U128Z COption_U128Z_clone(const struct LDKCOption_U128Z *NONNULL_PTR orig);
28080 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28082 void CVec_ClaimedHTLCZ_free(struct LDKCVec_ClaimedHTLCZ _res);
28085 * Constructs a new COption_PaymentFailureReasonZ containing a crate::lightning::events::PaymentFailureReason
28087 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_some(enum LDKPaymentFailureReason o);
28090 * Constructs a new COption_PaymentFailureReasonZ containing nothing
28092 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_none(void);
28095 * Frees any resources associated with the crate::lightning::events::PaymentFailureReason, if we are in the Some state
28097 void COption_PaymentFailureReasonZ_free(struct LDKCOption_PaymentFailureReasonZ _res);
28100 * Creates a new COption_PaymentFailureReasonZ which has the same data as `orig`
28101 * but with all dynamically-allocated buffers duplicated in new buffers.
28103 struct LDKCOption_PaymentFailureReasonZ COption_PaymentFailureReasonZ_clone(const struct LDKCOption_PaymentFailureReasonZ *NONNULL_PTR orig);
28106 * Constructs a new COption_EventZ containing a crate::lightning::events::Event
28108 struct LDKCOption_EventZ COption_EventZ_some(struct LDKEvent o);
28111 * Constructs a new COption_EventZ containing nothing
28113 struct LDKCOption_EventZ COption_EventZ_none(void);
28116 * Frees any resources associated with the crate::lightning::events::Event, if we are in the Some state
28118 void COption_EventZ_free(struct LDKCOption_EventZ _res);
28121 * Creates a new COption_EventZ which has the same data as `orig`
28122 * but with all dynamically-allocated buffers duplicated in new buffers.
28124 struct LDKCOption_EventZ COption_EventZ_clone(const struct LDKCOption_EventZ *NONNULL_PTR orig);
28127 * Creates a new CResult_COption_EventZDecodeErrorZ in the success state.
28129 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_ok(struct LDKCOption_EventZ o);
28132 * Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
28134 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_err(struct LDKDecodeError e);
28137 * Checks if the given object is currently in the success state
28139 bool CResult_COption_EventZDecodeErrorZ_is_ok(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR o);
28142 * Frees any resources used by the CResult_COption_EventZDecodeErrorZ.
28144 void CResult_COption_EventZDecodeErrorZ_free(struct LDKCResult_COption_EventZDecodeErrorZ _res);
28147 * Creates a new CResult_COption_EventZDecodeErrorZ which has the same data as `orig`
28148 * but with all dynamically-allocated buffers duplicated in new buffers.
28150 struct LDKCResult_COption_EventZDecodeErrorZ CResult_COption_EventZDecodeErrorZ_clone(const struct LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR orig);
28153 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the success state.
28155 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_ok(enum LDKSiPrefix o);
28158 * Creates a new CResult_SiPrefixBolt11ParseErrorZ in the error state.
28160 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
28163 * Checks if the given object is currently in the success state
28165 bool CResult_SiPrefixBolt11ParseErrorZ_is_ok(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR o);
28168 * Frees any resources used by the CResult_SiPrefixBolt11ParseErrorZ.
28170 void CResult_SiPrefixBolt11ParseErrorZ_free(struct LDKCResult_SiPrefixBolt11ParseErrorZ _res);
28173 * Creates a new CResult_SiPrefixBolt11ParseErrorZ which has the same data as `orig`
28174 * but with all dynamically-allocated buffers duplicated in new buffers.
28176 struct LDKCResult_SiPrefixBolt11ParseErrorZ CResult_SiPrefixBolt11ParseErrorZ_clone(const struct LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR orig);
28179 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state.
28181 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(struct LDKBolt11Invoice o);
28184 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the error state.
28186 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e);
28189 * Checks if the given object is currently in the success state
28191 bool CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR o);
28194 * Frees any resources used by the CResult_Bolt11InvoiceParseOrSemanticErrorZ.
28196 void CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res);
28199 * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ which has the same data as `orig`
28200 * but with all dynamically-allocated buffers duplicated in new buffers.
28202 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig);
28205 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state.
28207 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(struct LDKSignedRawBolt11Invoice o);
28210 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the error state.
28212 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(struct LDKBolt11ParseError e);
28215 * Checks if the given object is currently in the success state
28217 bool CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR o);
28220 * Frees any resources used by the CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ.
28222 void CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res);
28225 * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ which has the same data as `orig`
28226 * but with all dynamically-allocated buffers duplicated in new buffers.
28228 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(const struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR orig);
28231 * Creates a new tuple which has the same data as `orig`
28232 * but with all dynamically-allocated buffers duplicated in new buffers.
28234 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR orig);
28237 * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements.
28239 struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(struct LDKRawBolt11Invoice a, struct LDKThirtyTwoBytes b, struct LDKBolt11InvoiceSignature c);
28242 * Frees any resources used by the C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.
28244 void C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res);
28247 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state.
28249 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_ok(struct LDKPayeePubKey o);
28252 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the error state.
28254 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
28257 * Checks if the given object is currently in the success state
28259 bool CResult_PayeePubKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR o);
28262 * Frees any resources used by the CResult_PayeePubKeySecp256k1ErrorZ.
28264 void CResult_PayeePubKeySecp256k1ErrorZ_free(struct LDKCResult_PayeePubKeySecp256k1ErrorZ _res);
28267 * Creates a new CResult_PayeePubKeySecp256k1ErrorZ which has the same data as `orig`
28268 * but with all dynamically-allocated buffers duplicated in new buffers.
28270 struct LDKCResult_PayeePubKeySecp256k1ErrorZ CResult_PayeePubKeySecp256k1ErrorZ_clone(const struct LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR orig);
28273 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28275 void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res);
28278 * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state.
28280 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o);
28283 * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
28285 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e);
28288 * Checks if the given object is currently in the success state
28290 bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o);
28293 * Frees any resources used by the CResult_PositiveTimestampCreationErrorZ.
28295 void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res);
28298 * Creates a new CResult_PositiveTimestampCreationErrorZ which has the same data as `orig`
28299 * but with all dynamically-allocated buffers duplicated in new buffers.
28301 struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig);
28304 * Creates a new CResult_NoneBolt11SemanticErrorZ in the success state.
28306 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_ok(void);
28309 * Creates a new CResult_NoneBolt11SemanticErrorZ in the error state.
28311 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
28314 * Checks if the given object is currently in the success state
28316 bool CResult_NoneBolt11SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR o);
28319 * Frees any resources used by the CResult_NoneBolt11SemanticErrorZ.
28321 void CResult_NoneBolt11SemanticErrorZ_free(struct LDKCResult_NoneBolt11SemanticErrorZ _res);
28324 * Creates a new CResult_NoneBolt11SemanticErrorZ which has the same data as `orig`
28325 * but with all dynamically-allocated buffers duplicated in new buffers.
28327 struct LDKCResult_NoneBolt11SemanticErrorZ CResult_NoneBolt11SemanticErrorZ_clone(const struct LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR orig);
28330 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state.
28332 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(struct LDKBolt11Invoice o);
28335 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the error state.
28337 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(enum LDKBolt11SemanticError e);
28340 * Checks if the given object is currently in the success state
28342 bool CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR o);
28345 * Frees any resources used by the CResult_Bolt11InvoiceBolt11SemanticErrorZ.
28347 void CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res);
28350 * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ which has the same data as `orig`
28351 * but with all dynamically-allocated buffers duplicated in new buffers.
28353 struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(const struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR orig);
28356 * Creates a new CResult_DescriptionCreationErrorZ in the success state.
28358 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o);
28361 * Creates a new CResult_DescriptionCreationErrorZ in the error state.
28363 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e);
28366 * Checks if the given object is currently in the success state
28368 bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o);
28371 * Frees any resources used by the CResult_DescriptionCreationErrorZ.
28373 void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res);
28376 * Creates a new CResult_DescriptionCreationErrorZ which has the same data as `orig`
28377 * but with all dynamically-allocated buffers duplicated in new buffers.
28379 struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig);
28382 * Creates a new CResult_PrivateRouteCreationErrorZ in the success state.
28384 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o);
28387 * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
28389 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e);
28392 * Checks if the given object is currently in the success state
28394 bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o);
28397 * Frees any resources used by the CResult_PrivateRouteCreationErrorZ.
28399 void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res);
28402 * Creates a new CResult_PrivateRouteCreationErrorZ which has the same data as `orig`
28403 * but with all dynamically-allocated buffers duplicated in new buffers.
28405 struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig);
28408 * Creates a new CResult_OutPointDecodeErrorZ in the success state.
28410 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o);
28413 * Creates a new CResult_OutPointDecodeErrorZ in the error state.
28415 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e);
28418 * Checks if the given object is currently in the success state
28420 bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o);
28423 * Frees any resources used by the CResult_OutPointDecodeErrorZ.
28425 void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res);
28428 * Creates a new CResult_OutPointDecodeErrorZ which has the same data as `orig`
28429 * but with all dynamically-allocated buffers duplicated in new buffers.
28431 struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig);
28434 * Creates a new CResult_BigSizeDecodeErrorZ in the success state.
28436 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_ok(struct LDKBigSize o);
28439 * Creates a new CResult_BigSizeDecodeErrorZ in the error state.
28441 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_err(struct LDKDecodeError e);
28444 * Checks if the given object is currently in the success state
28446 bool CResult_BigSizeDecodeErrorZ_is_ok(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR o);
28449 * Frees any resources used by the CResult_BigSizeDecodeErrorZ.
28451 void CResult_BigSizeDecodeErrorZ_free(struct LDKCResult_BigSizeDecodeErrorZ _res);
28454 * Creates a new CResult_BigSizeDecodeErrorZ which has the same data as `orig`
28455 * but with all dynamically-allocated buffers duplicated in new buffers.
28457 struct LDKCResult_BigSizeDecodeErrorZ CResult_BigSizeDecodeErrorZ_clone(const struct LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR orig);
28460 * Creates a new CResult_HostnameDecodeErrorZ in the success state.
28462 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_ok(struct LDKHostname o);
28465 * Creates a new CResult_HostnameDecodeErrorZ in the error state.
28467 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_err(struct LDKDecodeError e);
28470 * Checks if the given object is currently in the success state
28472 bool CResult_HostnameDecodeErrorZ_is_ok(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR o);
28475 * Frees any resources used by the CResult_HostnameDecodeErrorZ.
28477 void CResult_HostnameDecodeErrorZ_free(struct LDKCResult_HostnameDecodeErrorZ _res);
28480 * Creates a new CResult_HostnameDecodeErrorZ which has the same data as `orig`
28481 * but with all dynamically-allocated buffers duplicated in new buffers.
28483 struct LDKCResult_HostnameDecodeErrorZ CResult_HostnameDecodeErrorZ_clone(const struct LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR orig);
28486 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state.
28488 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_ok(struct LDKTransactionU16LenLimited o);
28491 * Creates a new CResult_TransactionU16LenLimitedNoneZ in the error state.
28493 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_err(void);
28496 * Checks if the given object is currently in the success state
28498 bool CResult_TransactionU16LenLimitedNoneZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR o);
28501 * Frees any resources used by the CResult_TransactionU16LenLimitedNoneZ.
28503 void CResult_TransactionU16LenLimitedNoneZ_free(struct LDKCResult_TransactionU16LenLimitedNoneZ _res);
28506 * Creates a new CResult_TransactionU16LenLimitedNoneZ which has the same data as `orig`
28507 * but with all dynamically-allocated buffers duplicated in new buffers.
28509 struct LDKCResult_TransactionU16LenLimitedNoneZ CResult_TransactionU16LenLimitedNoneZ_clone(const struct LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR orig);
28512 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state.
28514 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_ok(struct LDKTransactionU16LenLimited o);
28517 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the error state.
28519 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_err(struct LDKDecodeError e);
28522 * Checks if the given object is currently in the success state
28524 bool CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR o);
28527 * Frees any resources used by the CResult_TransactionU16LenLimitedDecodeErrorZ.
28529 void CResult_TransactionU16LenLimitedDecodeErrorZ_free(struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res);
28532 * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ which has the same data as `orig`
28533 * but with all dynamically-allocated buffers duplicated in new buffers.
28535 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ CResult_TransactionU16LenLimitedDecodeErrorZ_clone(const struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR orig);
28538 * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state.
28540 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_ok(struct LDKUntrustedString o);
28543 * Creates a new CResult_UntrustedStringDecodeErrorZ in the error state.
28545 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_err(struct LDKDecodeError e);
28548 * Checks if the given object is currently in the success state
28550 bool CResult_UntrustedStringDecodeErrorZ_is_ok(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR o);
28553 * Frees any resources used by the CResult_UntrustedStringDecodeErrorZ.
28555 void CResult_UntrustedStringDecodeErrorZ_free(struct LDKCResult_UntrustedStringDecodeErrorZ _res);
28558 * Creates a new CResult_UntrustedStringDecodeErrorZ which has the same data as `orig`
28559 * but with all dynamically-allocated buffers duplicated in new buffers.
28561 struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig);
28564 * Creates a new tuple which has the same data as `orig`
28565 * but with all dynamically-allocated buffers duplicated in new buffers.
28567 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_clone(const struct LDKC2Tuple__u832u16Z *NONNULL_PTR orig);
28570 * Creates a new C2Tuple__u832u16Z from the contained elements.
28572 struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_new(struct LDKThirtyTwoBytes a, uint16_t b);
28575 * Frees any resources used by the C2Tuple__u832u16Z.
28577 void C2Tuple__u832u16Z_free(struct LDKC2Tuple__u832u16Z _res);
28580 * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state.
28582 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_ok(struct LDKPaymentRelay o);
28585 * Creates a new CResult_PaymentRelayDecodeErrorZ in the error state.
28587 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_err(struct LDKDecodeError e);
28590 * Checks if the given object is currently in the success state
28592 bool CResult_PaymentRelayDecodeErrorZ_is_ok(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR o);
28595 * Frees any resources used by the CResult_PaymentRelayDecodeErrorZ.
28597 void CResult_PaymentRelayDecodeErrorZ_free(struct LDKCResult_PaymentRelayDecodeErrorZ _res);
28600 * Creates a new CResult_PaymentRelayDecodeErrorZ which has the same data as `orig`
28601 * but with all dynamically-allocated buffers duplicated in new buffers.
28603 struct LDKCResult_PaymentRelayDecodeErrorZ CResult_PaymentRelayDecodeErrorZ_clone(const struct LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR orig);
28606 * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the success state.
28608 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_ok(struct LDKPaymentConstraints o);
28611 * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the error state.
28613 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_err(struct LDKDecodeError e);
28616 * Checks if the given object is currently in the success state
28618 bool CResult_PaymentConstraintsDecodeErrorZ_is_ok(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR o);
28621 * Frees any resources used by the CResult_PaymentConstraintsDecodeErrorZ.
28623 void CResult_PaymentConstraintsDecodeErrorZ_free(struct LDKCResult_PaymentConstraintsDecodeErrorZ _res);
28626 * Creates a new CResult_PaymentConstraintsDecodeErrorZ which has the same data as `orig`
28627 * but with all dynamically-allocated buffers duplicated in new buffers.
28629 struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_clone(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR orig);
28632 * Creates a new tuple which has the same data as `orig`
28633 * but with all dynamically-allocated buffers duplicated in new buffers.
28635 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR orig);
28638 * Creates a new C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ from the contained elements.
28640 struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(struct LDKThirtyTwoBytes a, struct LDKRecipientOnionFields b, struct LDKRouteParameters c);
28643 * Frees any resources used by the C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.
28645 void C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res);
28648 * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the success state.
28650 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o);
28653 * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the error state.
28655 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(void);
28658 * Checks if the given object is currently in the success state
28660 bool CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR o);
28663 * Frees any resources used by the CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.
28665 void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res);
28668 * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ which has the same data as `orig`
28669 * but with all dynamically-allocated buffers duplicated in new buffers.
28671 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR orig);
28674 * Creates a new CResult_StrSecp256k1ErrorZ in the success state.
28676 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o);
28679 * Creates a new CResult_StrSecp256k1ErrorZ in the error state.
28681 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e);
28684 * Checks if the given object is currently in the success state
28686 bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o);
28689 * Frees any resources used by the CResult_StrSecp256k1ErrorZ.
28691 void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res);
28694 * Creates a new CResult_StrSecp256k1ErrorZ which has the same data as `orig`
28695 * but with all dynamically-allocated buffers duplicated in new buffers.
28697 struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig);
28700 * Creates a new CResult_TxOutUtxoLookupErrorZ in the success state.
28702 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o);
28705 * Creates a new CResult_TxOutUtxoLookupErrorZ in the error state.
28707 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e);
28710 * Checks if the given object is currently in the success state
28712 bool CResult_TxOutUtxoLookupErrorZ_is_ok(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR o);
28715 * Frees any resources used by the CResult_TxOutUtxoLookupErrorZ.
28717 void CResult_TxOutUtxoLookupErrorZ_free(struct LDKCResult_TxOutUtxoLookupErrorZ _res);
28720 * Creates a new CResult_TxOutUtxoLookupErrorZ which has the same data as `orig`
28721 * but with all dynamically-allocated buffers duplicated in new buffers.
28723 struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_clone(const struct LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR orig);
28726 * Creates a new tuple which has the same data as `orig`
28727 * but with all dynamically-allocated buffers duplicated in new buffers.
28729 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(const struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR orig);
28732 * Creates a new C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ from the contained elements.
28734 struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(struct LDKPublicKey a, struct LDKOnionMessage b, struct LDKCOption_CVec_SocketAddressZZ c);
28737 * Frees any resources used by the C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.
28739 void C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res);
28742 * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the success state.
28744 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(struct LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o);
28747 * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the error state.
28749 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(struct LDKSendError e);
28752 * Checks if the given object is currently in the success state
28754 bool CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR o);
28757 * Frees any resources used by the CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.
28759 void CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res);
28762 * Creates a new CResult_PeeledOnionNoneZ in the success state.
28764 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_ok(struct LDKPeeledOnion o);
28767 * Creates a new CResult_PeeledOnionNoneZ in the error state.
28769 struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_err(void);
28772 * Checks if the given object is currently in the success state
28774 bool CResult_PeeledOnionNoneZ_is_ok(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR o);
28777 * Frees any resources used by the CResult_PeeledOnionNoneZ.
28779 void CResult_PeeledOnionNoneZ_free(struct LDKCResult_PeeledOnionNoneZ _res);
28782 * Creates a new CResult_SendSuccessSendErrorZ in the success state.
28784 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_ok(struct LDKSendSuccess o);
28787 * Creates a new CResult_SendSuccessSendErrorZ in the error state.
28789 struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_err(struct LDKSendError e);
28792 * Checks if the given object is currently in the success state
28794 bool CResult_SendSuccessSendErrorZ_is_ok(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR o);
28797 * Frees any resources used by the CResult_SendSuccessSendErrorZ.
28799 void CResult_SendSuccessSendErrorZ_free(struct LDKCResult_SendSuccessSendErrorZ _res);
28802 * Creates a new CResult_BlindedPathNoneZ in the success state.
28804 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o);
28807 * Creates a new CResult_BlindedPathNoneZ in the error state.
28809 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void);
28812 * Checks if the given object is currently in the success state
28814 bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o);
28817 * Frees any resources used by the CResult_BlindedPathNoneZ.
28819 void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res);
28822 * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig`
28823 * but with all dynamically-allocated buffers duplicated in new buffers.
28825 struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig);
28828 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state.
28830 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(struct LDKC2Tuple_BlindedPayInfoBlindedPathZ o);
28833 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the error state.
28835 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(void);
28838 * Checks if the given object is currently in the success state
28840 bool CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR o);
28843 * Frees any resources used by the CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.
28845 void CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res);
28848 * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ which has the same data as `orig`
28849 * but with all dynamically-allocated buffers duplicated in new buffers.
28851 struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(const struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR orig);
28854 * Frees the buffer pointed to by `data` if `datalen` is non-0.
28856 void CVec_ForwardNodeZ_free(struct LDKCVec_ForwardNodeZ _res);
28859 * Creates a new CResult_BlindedPathDecodeErrorZ in the success state.
28861 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o);
28864 * Creates a new CResult_BlindedPathDecodeErrorZ in the error state.
28866 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e);
28869 * Checks if the given object is currently in the success state
28871 bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o);
28874 * Frees any resources used by the CResult_BlindedPathDecodeErrorZ.
28876 void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res);
28879 * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig`
28880 * but with all dynamically-allocated buffers duplicated in new buffers.
28882 struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig);
28885 * Creates a new CResult_BlindedHopDecodeErrorZ in the success state.
28887 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o);
28890 * Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
28892 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e);
28895 * Checks if the given object is currently in the success state
28897 bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o);
28900 * Frees any resources used by the CResult_BlindedHopDecodeErrorZ.
28902 void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res);
28905 * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig`
28906 * but with all dynamically-allocated buffers duplicated in new buffers.
28908 struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig);
28911 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state.
28913 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_ok(struct LDKInvoiceError o);
28916 * Creates a new CResult_InvoiceErrorDecodeErrorZ in the error state.
28918 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_err(struct LDKDecodeError e);
28921 * Checks if the given object is currently in the success state
28923 bool CResult_InvoiceErrorDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR o);
28926 * Frees any resources used by the CResult_InvoiceErrorDecodeErrorZ.
28928 void CResult_InvoiceErrorDecodeErrorZ_free(struct LDKCResult_InvoiceErrorDecodeErrorZ _res);
28931 * Creates a new CResult_InvoiceErrorDecodeErrorZ which has the same data as `orig`
28932 * but with all dynamically-allocated buffers duplicated in new buffers.
28934 struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig);
28937 * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the success state.
28939 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_ok(struct LDKDelayedPaymentBasepoint o);
28942 * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the error state.
28944 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_err(struct LDKDecodeError e);
28947 * Checks if the given object is currently in the success state
28949 bool CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR o);
28952 * Frees any resources used by the CResult_DelayedPaymentBasepointDecodeErrorZ.
28954 void CResult_DelayedPaymentBasepointDecodeErrorZ_free(struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ _res);
28957 * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ which has the same data as `orig`
28958 * but with all dynamically-allocated buffers duplicated in new buffers.
28960 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR orig);
28963 * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the success state.
28965 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_ok(struct LDKDelayedPaymentKey o);
28968 * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the error state.
28970 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_err(struct LDKDecodeError e);
28973 * Checks if the given object is currently in the success state
28975 bool CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR o);
28978 * Frees any resources used by the CResult_DelayedPaymentKeyDecodeErrorZ.
28980 void CResult_DelayedPaymentKeyDecodeErrorZ_free(struct LDKCResult_DelayedPaymentKeyDecodeErrorZ _res);
28983 * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ which has the same data as `orig`
28984 * but with all dynamically-allocated buffers duplicated in new buffers.
28986 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ CResult_DelayedPaymentKeyDecodeErrorZ_clone(const struct LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR orig);
28989 * Creates a new CResult_HtlcBasepointDecodeErrorZ in the success state.
28991 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_ok(struct LDKHtlcBasepoint o);
28994 * Creates a new CResult_HtlcBasepointDecodeErrorZ in the error state.
28996 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_err(struct LDKDecodeError e);
28999 * Checks if the given object is currently in the success state
29001 bool CResult_HtlcBasepointDecodeErrorZ_is_ok(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR o);
29004 * Frees any resources used by the CResult_HtlcBasepointDecodeErrorZ.
29006 void CResult_HtlcBasepointDecodeErrorZ_free(struct LDKCResult_HtlcBasepointDecodeErrorZ _res);
29009 * Creates a new CResult_HtlcBasepointDecodeErrorZ which has the same data as `orig`
29010 * but with all dynamically-allocated buffers duplicated in new buffers.
29012 struct LDKCResult_HtlcBasepointDecodeErrorZ CResult_HtlcBasepointDecodeErrorZ_clone(const struct LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR orig);
29015 * Creates a new CResult_HtlcKeyDecodeErrorZ in the success state.
29017 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_ok(struct LDKHtlcKey o);
29020 * Creates a new CResult_HtlcKeyDecodeErrorZ in the error state.
29022 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_err(struct LDKDecodeError e);
29025 * Checks if the given object is currently in the success state
29027 bool CResult_HtlcKeyDecodeErrorZ_is_ok(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR o);
29030 * Frees any resources used by the CResult_HtlcKeyDecodeErrorZ.
29032 void CResult_HtlcKeyDecodeErrorZ_free(struct LDKCResult_HtlcKeyDecodeErrorZ _res);
29035 * Creates a new CResult_HtlcKeyDecodeErrorZ which has the same data as `orig`
29036 * but with all dynamically-allocated buffers duplicated in new buffers.
29038 struct LDKCResult_HtlcKeyDecodeErrorZ CResult_HtlcKeyDecodeErrorZ_clone(const struct LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR orig);
29041 * Creates a new CResult_RevocationBasepointDecodeErrorZ in the success state.
29043 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_ok(struct LDKRevocationBasepoint o);
29046 * Creates a new CResult_RevocationBasepointDecodeErrorZ in the error state.
29048 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_err(struct LDKDecodeError e);
29051 * Checks if the given object is currently in the success state
29053 bool CResult_RevocationBasepointDecodeErrorZ_is_ok(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR o);
29056 * Frees any resources used by the CResult_RevocationBasepointDecodeErrorZ.
29058 void CResult_RevocationBasepointDecodeErrorZ_free(struct LDKCResult_RevocationBasepointDecodeErrorZ _res);
29061 * Creates a new CResult_RevocationBasepointDecodeErrorZ which has the same data as `orig`
29062 * but with all dynamically-allocated buffers duplicated in new buffers.
29064 struct LDKCResult_RevocationBasepointDecodeErrorZ CResult_RevocationBasepointDecodeErrorZ_clone(const struct LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR orig);
29067 * Creates a new CResult_RevocationKeyDecodeErrorZ in the success state.
29069 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_ok(struct LDKRevocationKey o);
29072 * Creates a new CResult_RevocationKeyDecodeErrorZ in the error state.
29074 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_err(struct LDKDecodeError e);
29077 * Checks if the given object is currently in the success state
29079 bool CResult_RevocationKeyDecodeErrorZ_is_ok(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR o);
29082 * Frees any resources used by the CResult_RevocationKeyDecodeErrorZ.
29084 void CResult_RevocationKeyDecodeErrorZ_free(struct LDKCResult_RevocationKeyDecodeErrorZ _res);
29087 * Creates a new CResult_RevocationKeyDecodeErrorZ which has the same data as `orig`
29088 * but with all dynamically-allocated buffers duplicated in new buffers.
29090 struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_clone(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR orig);
29093 * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
29095 struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o);
29098 * Constructs a new COption_FilterZ containing nothing
29100 struct LDKCOption_FilterZ COption_FilterZ_none(void);
29103 * Frees any resources associated with the crate::lightning::chain::Filter, if we are in the Some state
29105 void COption_FilterZ_free(struct LDKCOption_FilterZ _res);
29108 * Creates a new CResult_LockedChannelMonitorNoneZ in the success state.
29110 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o);
29113 * Creates a new CResult_LockedChannelMonitorNoneZ in the error state.
29115 struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void);
29118 * Checks if the given object is currently in the success state
29120 bool CResult_LockedChannelMonitorNoneZ_is_ok(const struct LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR o);
29123 * Frees any resources used by the CResult_LockedChannelMonitorNoneZ.
29125 void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res);
29128 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29130 void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res);
29133 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29135 void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res);
29138 * Creates a new tuple which has the same data as `orig`
29139 * but with all dynamically-allocated buffers duplicated in new buffers.
29141 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig);
29144 * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements.
29146 struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b);
29149 * Frees any resources used by the C2Tuple_OutPointCVec_MonitorUpdateIdZZ.
29151 void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res);
29154 * Frees the buffer pointed to by `data` if `datalen` is non-0.
29156 void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res);
29159 * Frees any resources used by the APIError
29161 void APIError_free(struct LDKAPIError this_ptr);
29164 * Creates a copy of the APIError
29166 struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
29169 * Utility method to constructs a new APIMisuseError-variant APIError
29171 struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
29174 * Utility method to constructs a new FeeRateTooHigh-variant APIError
29176 struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
29179 * Utility method to constructs a new InvalidRoute-variant APIError
29181 struct LDKAPIError APIError_invalid_route(struct LDKStr err);
29184 * Utility method to constructs a new ChannelUnavailable-variant APIError
29186 struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
29189 * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
29191 struct LDKAPIError APIError_monitor_update_in_progress(void);
29194 * Utility method to constructs a new IncompatibleShutdownScript-variant APIError
29196 struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
29199 * Checks if two APIErrors contain equal inner contents.
29200 * This ignores pointers and is_owned flags and looks at the values in fields.
29202 bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
29205 * Serialize the APIError object into a byte array which can be read by APIError_read
29207 struct LDKCVec_u8Z APIError_write(const struct LDKAPIError *NONNULL_PTR obj);
29210 * Read a APIError from a byte array, created by APIError_write
29212 struct LDKCResult_COption_APIErrorZDecodeErrorZ APIError_read(struct LDKu8slice ser);
29215 * Frees any resources used by the BigSize, if is_owned is set and inner is non-NULL.
29217 void BigSize_free(struct LDKBigSize this_obj);
29219 uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
29221 void BigSize_set_a(struct LDKBigSize *NONNULL_PTR this_ptr, uint64_t val);
29224 * Constructs a new BigSize given each field
29226 MUST_USE_RES struct LDKBigSize BigSize_new(uint64_t a_arg);
29229 * Creates a copy of the BigSize
29231 struct LDKBigSize BigSize_clone(const struct LDKBigSize *NONNULL_PTR orig);
29234 * Generates a non-cryptographic 64-bit hash of the BigSize.
29236 uint64_t BigSize_hash(const struct LDKBigSize *NONNULL_PTR o);
29239 * Checks if two BigSizes contain equal inner contents.
29240 * This ignores pointers and is_owned flags and looks at the values in fields.
29241 * Two objects with NULL inner values will be considered "equal" here.
29243 bool BigSize_eq(const struct LDKBigSize *NONNULL_PTR a, const struct LDKBigSize *NONNULL_PTR b);
29246 * Serialize the BigSize object into a byte array which can be read by BigSize_read
29248 struct LDKCVec_u8Z BigSize_write(const struct LDKBigSize *NONNULL_PTR obj);
29251 * Read a BigSize from a byte array, created by BigSize_write
29253 struct LDKCResult_BigSizeDecodeErrorZ BigSize_read(struct LDKu8slice ser);
29256 * Frees any resources used by the Hostname, if is_owned is set and inner is non-NULL.
29258 void Hostname_free(struct LDKHostname this_obj);
29261 * Creates a copy of the Hostname
29263 struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
29266 * Generates a non-cryptographic 64-bit hash of the Hostname.
29268 uint64_t Hostname_hash(const struct LDKHostname *NONNULL_PTR o);
29271 * Checks if two Hostnames contain equal inner contents.
29272 * This ignores pointers and is_owned flags and looks at the values in fields.
29273 * Two objects with NULL inner values will be considered "equal" here.
29275 bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
29278 * Returns the length of the hostname.
29280 MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
29283 * Serialize the Hostname object into a byte array which can be read by Hostname_read
29285 struct LDKCVec_u8Z Hostname_write(const struct LDKHostname *NONNULL_PTR obj);
29288 * Read a Hostname from a byte array, created by Hostname_write
29290 struct LDKCResult_HostnameDecodeErrorZ Hostname_read(struct LDKu8slice ser);
29293 * Frees any resources used by the TransactionU16LenLimited, if is_owned is set and inner is non-NULL.
29295 void TransactionU16LenLimited_free(struct LDKTransactionU16LenLimited this_obj);
29298 * Creates a copy of the TransactionU16LenLimited
29300 struct LDKTransactionU16LenLimited TransactionU16LenLimited_clone(const struct LDKTransactionU16LenLimited *NONNULL_PTR orig);
29303 * Generates a non-cryptographic 64-bit hash of the TransactionU16LenLimited.
29305 uint64_t TransactionU16LenLimited_hash(const struct LDKTransactionU16LenLimited *NONNULL_PTR o);
29308 * Checks if two TransactionU16LenLimiteds contain equal inner contents.
29309 * This ignores pointers and is_owned flags and looks at the values in fields.
29310 * Two objects with NULL inner values will be considered "equal" here.
29312 bool TransactionU16LenLimited_eq(const struct LDKTransactionU16LenLimited *NONNULL_PTR a, const struct LDKTransactionU16LenLimited *NONNULL_PTR b);
29315 * Constructs a new `TransactionU16LenLimited` from a `Transaction` only if it's consensus-
29316 * serialized length is <= u16::MAX.
29318 MUST_USE_RES struct LDKCResult_TransactionU16LenLimitedNoneZ TransactionU16LenLimited_new(struct LDKTransaction transaction);
29321 * Consumes this `TransactionU16LenLimited` and returns its contained `Transaction`.
29323 MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg);
29326 * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read
29328 struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj);
29331 * Read a TransactionU16LenLimited from a byte array, created by TransactionU16LenLimited_write
29333 struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser);
29336 * Creates a digital signature of a message given a SecretKey, like the node's secret.
29337 * 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.
29338 * Signatures are EC recoverable, meaning that given the message and the signature the PublicKey of the signer can be extracted.
29340 struct LDKCResult_StrSecp256k1ErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
29343 * Recovers the PublicKey of the signer of the message given the message and the signature.
29345 struct LDKCResult_PublicKeySecp256k1ErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
29348 * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
29349 * and the PublicKey.
29351 bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk);
29354 * Construct the invoice's HRP and signatureless data into a preimage to be hashed.
29356 struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z data_without_signature);
29359 * Calls the free function if one is set
29361 void KVStore_free(struct LDKKVStore this_ptr);
29364 * Calls the free function if one is set
29366 void Persister_free(struct LDKPersister this_ptr);
29369 * Read previously persisted [`ChannelMonitor`]s from the store.
29371 struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ read_channel_monitors(struct LDKKVStore kv_store, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
29374 * Frees any resources used by the MonitorUpdatingPersister, if is_owned is set and inner is non-NULL.
29376 void MonitorUpdatingPersister_free(struct LDKMonitorUpdatingPersister this_obj);
29379 * Constructs a new [`MonitorUpdatingPersister`].
29381 * The `maximum_pending_updates` parameter controls how many updates may be stored before a
29382 * [`MonitorUpdatingPersister`] consolidates updates by writing a full monitor. Note that
29383 * consolidation will frequently occur with fewer updates than what you set here; this number
29384 * is merely the maximum that may be stored. When setting this value, consider that for higher
29385 * values of `maximum_pending_updates`:
29387 * - [`MonitorUpdatingPersister`] will tend to write more [`ChannelMonitorUpdate`]s than
29388 * [`ChannelMonitor`]s, approaching one [`ChannelMonitor`] write for every
29389 * `maximum_pending_updates` [`ChannelMonitorUpdate`]s.
29390 * - [`MonitorUpdatingPersister`] will issue deletes differently. Lazy deletes will come in
29391 * \"waves\" for each [`ChannelMonitor`] write. A larger `maximum_pending_updates` means bigger,
29392 * less frequent \"waves.\"
29393 * - [`MonitorUpdatingPersister`] will potentially have more listing to do if you need to run
29394 * [`MonitorUpdatingPersister::cleanup_stale_updates`].
29396 MUST_USE_RES struct LDKMonitorUpdatingPersister MonitorUpdatingPersister_new(struct LDKKVStore kv_store, struct LDKLogger logger, uint64_t maximum_pending_updates, struct LDKEntropySource entropy_source, struct LDKSignerProvider signer_provider);
29399 * Reads all stored channel monitors, along with any stored updates for them.
29401 * It is extremely important that your [`KVStore::read`] implementation uses the
29402 * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
29403 * documentation for [`MonitorUpdatingPersister`].
29405 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ MonitorUpdatingPersister_read_all_channel_monitors_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator);
29408 * Read a single channel monitor, along with any stored updates for it.
29410 * It is extremely important that your [`KVStore::read`] implementation uses the
29411 * [`io::ErrorKind::NotFound`] variant correctly. For more information, please see the
29412 * documentation for [`MonitorUpdatingPersister`].
29414 * For `monitor_key`, channel storage keys be the channel's transaction ID and index, or
29415 * [`OutPoint`], with an underscore `_` between them. For example, given:
29417 * - Transaction ID: `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef`
29420 * The correct `monitor_key` would be:
29421 * `deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_1`
29423 * Loading a large number of monitors will be faster if done in parallel. You can use this
29424 * function to accomplish this. Take care to limit the number of parallel readers.
29426 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ MonitorUpdatingPersister_read_channel_monitor_with_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, struct LDKStr monitor_key);
29429 * Cleans up stale updates for all monitors.
29431 * This function works by first listing all monitors, and then for each of them, listing all
29432 * updates. The updates that have an `update_id` less than or equal to than the stored monitor
29433 * are deleted. The deletion can either be lazy or non-lazy based on the `lazy` flag; this will
29434 * be passed to [`KVStore::remove`].
29436 MUST_USE_RES struct LDKCResult_NoneIOErrorZ MonitorUpdatingPersister_cleanup_stale_updates(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg, bool lazy);
29439 * Constructs a new Persist which calls the relevant methods on this_arg.
29440 * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is
29442 struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg);
29445 * Frees any resources used by the UntrustedString, if is_owned is set and inner is non-NULL.
29447 void UntrustedString_free(struct LDKUntrustedString this_obj);
29449 struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr);
29451 void UntrustedString_set_a(struct LDKUntrustedString *NONNULL_PTR this_ptr, struct LDKStr val);
29454 * Constructs a new UntrustedString given each field
29456 MUST_USE_RES struct LDKUntrustedString UntrustedString_new(struct LDKStr a_arg);
29459 * Creates a copy of the UntrustedString
29461 struct LDKUntrustedString UntrustedString_clone(const struct LDKUntrustedString *NONNULL_PTR orig);
29464 * Checks if two UntrustedStrings contain equal inner contents.
29465 * This ignores pointers and is_owned flags and looks at the values in fields.
29466 * Two objects with NULL inner values will be considered "equal" here.
29468 bool UntrustedString_eq(const struct LDKUntrustedString *NONNULL_PTR a, const struct LDKUntrustedString *NONNULL_PTR b);
29471 * Generates a non-cryptographic 64-bit hash of the UntrustedString.
29473 uint64_t UntrustedString_hash(const struct LDKUntrustedString *NONNULL_PTR o);
29476 * Serialize the UntrustedString object into a byte array which can be read by UntrustedString_read
29478 struct LDKCVec_u8Z UntrustedString_write(const struct LDKUntrustedString *NONNULL_PTR obj);
29481 * Read a UntrustedString from a byte array, created by UntrustedString_write
29483 struct LDKCResult_UntrustedStringDecodeErrorZ UntrustedString_read(struct LDKu8slice ser);
29486 * Frees any resources used by the PrintableString, if is_owned is set and inner is non-NULL.
29488 void PrintableString_free(struct LDKPrintableString this_obj);
29490 struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr);
29492 void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val);
29495 * Constructs a new PrintableString given each field
29497 MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg);
29500 * Calls the free function if one is set
29502 void FutureCallback_free(struct LDKFutureCallback this_ptr);
29505 * Frees any resources used by the Future, if is_owned is set and inner is non-NULL.
29507 void Future_free(struct LDKFuture this_obj);
29510 * Creates a copy of the Future
29512 struct LDKFuture Future_clone(const struct LDKFuture *NONNULL_PTR orig);
29515 * Registers a callback to be called upon completion of this future. If the future has already
29516 * completed, the callback will be called immediately.
29518 void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback);
29521 * Waits until this [`Future`] completes.
29523 void Future_wait(struct LDKFuture this_arg);
29526 * Waits until this [`Future`] completes or the given amount of time has elapsed.
29528 * Returns true if the [`Future`] completed, false if the time elapsed.
29530 MUST_USE_RES bool Future_wait_timeout(struct LDKFuture this_arg, uint64_t max_wait);
29533 * Frees any resources used by the Sleeper, if is_owned is set and inner is non-NULL.
29535 void Sleeper_free(struct LDKSleeper this_obj);
29538 * Constructs a new sleeper from one future, allowing blocking on it.
29540 MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(struct LDKFuture future);
29543 * Constructs a new sleeper from two futures, allowing blocking on both at once.
29545 MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(struct LDKFuture fut_a, struct LDKFuture fut_b);
29548 * Constructs a new sleeper on many futures, allowing blocking on all at once.
29550 MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures);
29553 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed.
29555 void Sleeper_wait(const struct LDKSleeper *NONNULL_PTR this_arg);
29558 * Wait until one of the [`Future`]s registered with this [`Sleeper`] has completed or the
29559 * given amount of time has elapsed. Returns true if a [`Future`] completed, false if the time
29562 MUST_USE_RES bool Sleeper_wait_timeout(const struct LDKSleeper *NONNULL_PTR this_arg, uint64_t max_wait);
29565 * Creates a copy of the Level
29567 enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
29570 * Utility method to constructs a new Gossip-variant Level
29572 enum LDKLevel Level_gossip(void);
29575 * Utility method to constructs a new Trace-variant Level
29577 enum LDKLevel Level_trace(void);
29580 * Utility method to constructs a new Debug-variant Level
29582 enum LDKLevel Level_debug(void);
29585 * Utility method to constructs a new Info-variant Level
29587 enum LDKLevel Level_info(void);
29590 * Utility method to constructs a new Warn-variant Level
29592 enum LDKLevel Level_warn(void);
29595 * Utility method to constructs a new Error-variant Level
29597 enum LDKLevel Level_error(void);
29600 * Checks if two Levels contain equal inner contents.
29601 * This ignores pointers and is_owned flags and looks at the values in fields.
29603 bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
29606 * Generates a non-cryptographic 64-bit hash of the Level.
29608 uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
29611 * Returns the most verbose logging level.
29613 MUST_USE_RES enum LDKLevel Level_max(void);
29616 * Frees any resources used by the Record, if is_owned is set and inner is non-NULL.
29618 void Record_free(struct LDKRecord this_obj);
29621 * The verbosity level of the message.
29623 enum LDKLevel Record_get_level(const struct LDKRecord *NONNULL_PTR this_ptr);
29626 * The verbosity level of the message.
29628 void Record_set_level(struct LDKRecord *NONNULL_PTR this_ptr, enum LDKLevel val);
29631 * The node id of the peer pertaining to the logged record.
29633 * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
29634 * `None`, depending on if the peer information is readily available in LDK when the log is
29637 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
29639 struct LDKPublicKey Record_get_peer_id(const struct LDKRecord *NONNULL_PTR this_ptr);
29642 * The node id of the peer pertaining to the logged record.
29644 * Note that in some cases a [`Self::channel_id`] may be filled in but this may still be
29645 * `None`, depending on if the peer information is readily available in LDK when the log is
29648 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
29650 void Record_set_peer_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKPublicKey val);
29653 * The channel id of the channel pertaining to the logged record. May be a temporary id before
29654 * the channel has been funded.
29656 struct LDKCOption_ThirtyTwoBytesZ Record_get_channel_id(const struct LDKRecord *NONNULL_PTR this_ptr);
29659 * The channel id of the channel pertaining to the logged record. May be a temporary id before
29660 * the channel has been funded.
29662 void Record_set_channel_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
29665 * The message body.
29667 struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr);
29670 * The message body.
29672 void Record_set_args(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
29675 * The module path of the message.
29677 struct LDKStr Record_get_module_path(const struct LDKRecord *NONNULL_PTR this_ptr);
29680 * The module path of the message.
29682 void Record_set_module_path(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
29685 * The source file containing the message.
29687 struct LDKStr Record_get_file(const struct LDKRecord *NONNULL_PTR this_ptr);
29690 * The source file containing the message.
29692 void Record_set_file(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKStr val);
29695 * The line containing the message.
29697 uint32_t Record_get_line(const struct LDKRecord *NONNULL_PTR this_ptr);
29700 * The line containing the message.
29702 void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val);
29705 * Constructs a new Record given each field
29707 * Note that peer_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
29709 MUST_USE_RES struct LDKRecord Record_new(enum LDKLevel level_arg, struct LDKPublicKey peer_id_arg, struct LDKCOption_ThirtyTwoBytesZ channel_id_arg, struct LDKStr args_arg, struct LDKStr module_path_arg, struct LDKStr file_arg, uint32_t line_arg);
29712 * Creates a copy of the Record
29714 struct LDKRecord Record_clone(const struct LDKRecord *NONNULL_PTR orig);
29717 * Calls the free function if one is set
29719 void Logger_free(struct LDKLogger this_ptr);
29722 * Frees any resources used by the ChannelHandshakeConfig, if is_owned is set and inner is non-NULL.
29724 void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_obj);
29727 * Confirmations we will wait for before considering the channel locked in.
29728 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
29729 * equivalent limit applied to outbound channels).
29731 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
29732 * transaction before operation. If you wish to accept channels with zero confirmations, see
29733 * [`UserConfig::manually_accept_inbound_channels`] and
29734 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
29736 * Default value: 6.
29738 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
29739 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
29741 uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29744 * Confirmations we will wait for before considering the channel locked in.
29745 * Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
29746 * equivalent limit applied to outbound channels).
29748 * A lower-bound of 1 is applied, requiring all channels to have a confirmed commitment
29749 * transaction before operation. If you wish to accept channels with zero confirmations, see
29750 * [`UserConfig::manually_accept_inbound_channels`] and
29751 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`].
29753 * Default value: 6.
29755 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
29756 * [`ChannelManager::accept_inbound_channel_from_trusted_peer_0conf`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel_from_trusted_peer_0conf
29758 void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
29761 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
29762 * the number of blocks we have to punish our counterparty if they broadcast a revoked
29765 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
29766 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
29767 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
29768 * possibly with time in between to RBF the spending transaction).
29770 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
29771 * case of an honest unilateral channel close, which implicitly decrease the economic value of
29774 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
29775 * can tweak config to ask for more security, not less.
29777 uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29780 * Set to the number of blocks we require our counterparty to wait to claim their money (ie
29781 * the number of blocks we have to punish our counterparty if they broadcast a revoked
29784 * This is one of the main parameters of our security model. We (or one of our watchtowers) MUST
29785 * be online to check for revoked transactions on-chain at least once every our_to_self_delay
29786 * blocks (minus some margin to allow us enough time to broadcast and confirm a transaction,
29787 * possibly with time in between to RBF the spending transaction).
29789 * Meanwhile, asking for a too high delay, we bother peer to freeze funds for nothing in
29790 * case of an honest unilateral channel close, which implicitly decrease the economic value of
29793 * Default value: [`BREAKDOWN_TIMEOUT`], we enforce it as a minimum at channel opening so you
29794 * can tweak config to ask for more security, not less.
29796 void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
29799 * Set to the smallest value HTLC we will accept to process.
29801 * This value is sent to our counterparty on channel-open and we close the channel any time
29802 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
29804 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
29807 uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29810 * Set to the smallest value HTLC we will accept to process.
29812 * This value is sent to our counterparty on channel-open and we close the channel any time
29813 * our counterparty misbehaves by sending us an HTLC with a value smaller than this.
29815 * Default value: 1. If the value is less than 1, it is ignored and set to 1, as is required
29818 void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val);
29821 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
29824 * This can be set to a value between 1-100, where the value corresponds to the percent of the
29825 * channel value in whole percentages.
29828 * * If configured to another value than the default value 10, any new channels created with
29829 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
29830 * `ChannelManager`.
29832 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
29833 * no way to configure the cap for the total value of outbound HTLCs in-flight.
29835 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
29836 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
29837 * restrict exposure to loss due to being offline for too long.
29838 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
29839 * for more information.
29841 * Default value: 10.
29842 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
29843 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
29845 uint8_t ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29848 * Sets the percentage of the channel value we will cap the total value of outstanding inbound
29851 * This can be set to a value between 1-100, where the value corresponds to the percent of the
29852 * channel value in whole percentages.
29855 * * If configured to another value than the default value 10, any new channels created with
29856 * the non default value will cause versions of LDK prior to 0.0.104 to refuse to read the
29857 * `ChannelManager`.
29859 * * This caps the total value for inbound HTLCs in-flight only, and there's currently
29860 * no way to configure the cap for the total value of outbound HTLCs in-flight.
29862 * * The requirements for your node being online to ensure the safety of HTLC-encumbered funds
29863 * are different from the non-HTLC-encumbered funds. This makes this an important knob to
29864 * restrict exposure to loss due to being offline for too long.
29865 * See [`ChannelHandshakeConfig::our_to_self_delay`] and [`ChannelConfig::cltv_expiry_delta`]
29866 * for more information.
29868 * Default value: 10.
29869 * Minimum value: 1, any values less than 1 will be treated as 1 instead.
29870 * Maximum value: 100, any values larger than 100 will be treated as 100 instead.
29872 void ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint8_t val);
29875 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
29876 * BOLTs) option for outbound private channels. This provides better privacy by not including
29877 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
29878 * relay HTLCs to us using the channel's SCID alias.
29880 * If this option is set, channels may be created that will not be readable by LDK versions
29881 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
29882 * [`DecodeError::InvalidValue`].
29884 * Note that setting this to true does *not* prevent us from opening channels with
29885 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
29886 * private channel without that option.
29888 * Ignored if the channel is negotiated to be announced, see
29889 * [`ChannelHandshakeConfig::announced_channel`] and
29890 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
29892 * Default value: false. This value is likely to change to true in the future.
29894 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
29895 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
29897 bool ChannelHandshakeConfig_get_negotiate_scid_privacy(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29900 * If set, we attempt to negotiate the `scid_privacy` (referred to as `scid_alias` in the
29901 * BOLTs) option for outbound private channels. This provides better privacy by not including
29902 * our real on-chain channel UTXO in each invoice and requiring that our counterparty only
29903 * relay HTLCs to us using the channel's SCID alias.
29905 * If this option is set, channels may be created that will not be readable by LDK versions
29906 * prior to 0.0.106, causing [`ChannelManager`]'s read method to return a
29907 * [`DecodeError::InvalidValue`].
29909 * Note that setting this to true does *not* prevent us from opening channels with
29910 * counterparties that do not support the `scid_alias` option; we will simply fall back to a
29911 * private channel without that option.
29913 * Ignored if the channel is negotiated to be announced, see
29914 * [`ChannelHandshakeConfig::announced_channel`] and
29915 * [`ChannelHandshakeLimits::force_announced_channel_preference`] for more.
29917 * Default value: false. This value is likely to change to true in the future.
29919 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
29920 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
29922 void ChannelHandshakeConfig_set_negotiate_scid_privacy(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
29925 * Set to announce the channel publicly and notify all nodes that they can route via this
29928 * This should only be set to true for nodes which expect to be online reliably.
29930 * As the node which funds a channel picks this value this will only apply for new outbound
29931 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
29933 * Default value: false.
29935 bool ChannelHandshakeConfig_get_announced_channel(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29938 * Set to announce the channel publicly and notify all nodes that they can route via this
29941 * This should only be set to true for nodes which expect to be online reliably.
29943 * As the node which funds a channel picks this value this will only apply for new outbound
29944 * channels unless [`ChannelHandshakeLimits::force_announced_channel_preference`] is set.
29946 * Default value: false.
29948 void ChannelHandshakeConfig_set_announced_channel(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
29951 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
29952 * supports it, they will then enforce the mutual-close output to us matches what we provided
29953 * at intialization, preventing us from closing to an alternate pubkey.
29955 * This is set to true by default to provide a slight increase in security, though ultimately
29956 * any attacker who is able to take control of a channel can just as easily send the funds via
29957 * lightning payments, so we never require that our counterparties support this option.
29959 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
29961 * Default value: true.
29963 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
29965 bool ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
29968 * When set, we commit to an upfront shutdown_pubkey at channel open. If our counterparty
29969 * supports it, they will then enforce the mutual-close output to us matches what we provided
29970 * at intialization, preventing us from closing to an alternate pubkey.
29972 * This is set to true by default to provide a slight increase in security, though ultimately
29973 * any attacker who is able to take control of a channel can just as easily send the funds via
29974 * lightning payments, so we never require that our counterparties support this option.
29976 * The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
29978 * Default value: true.
29980 * [`SignerProvider::get_shutdown_scriptpubkey`]: crate::sign::SignerProvider::get_shutdown_scriptpubkey
29982 void ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
29985 * The Proportion of the channel value to configure as counterparty's channel reserve,
29986 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
29988 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
29989 * on their side, at all times.
29990 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
29991 * claiming at least this value on chain.
29993 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
29994 * amount can never be used for payments.
29995 * Also, if our selected channel reserve for counterparty and counterparty's selected
29996 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
29999 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
30000 * other than the default value.
30002 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
30003 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
30004 * as 1000 sats instead, which is a safe implementation-specific lower bound.
30005 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
30006 * instead, although channel negotiations will fail in that case.
30008 uint32_t ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
30011 * The Proportion of the channel value to configure as counterparty's channel reserve,
30012 * i.e., `their_channel_reserve_satoshis` for both outbound and inbound channels.
30014 * `their_channel_reserve_satoshis` is the minimum balance that the other node has to maintain
30015 * on their side, at all times.
30016 * This ensures that if our counterparty broadcasts a revoked state, we can punish them by
30017 * claiming at least this value on chain.
30019 * Channel reserve values greater than 30% could be considered highly unreasonable, since that
30020 * amount can never be used for payments.
30021 * Also, if our selected channel reserve for counterparty and counterparty's selected
30022 * channel reserve for us sum up to equal or greater than channel value, channel negotiations
30025 * Note: Versions of LDK earlier than v0.0.104 will fail to read channels with any channel reserve
30026 * other than the default value.
30028 * Default value: 1% of channel value, i.e., configured as 10,000 millionths.
30029 * Minimum value: If the calculated proportional value is less than 1000 sats, it will be treated
30030 * as 1000 sats instead, which is a safe implementation-specific lower bound.
30031 * Maximum value: 1,000,000, any values larger than 1 Million will be treated as 1 Million (or 100%)
30032 * instead, although channel negotiations will fail in that case.
30034 void ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val);
30037 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
30038 * channels. This feature requires having a reserve of onchain funds readily available to bump
30039 * transactions in the event of a channel force close to avoid the possibility of losing funds.
30041 * Note that if you wish accept inbound channels with anchor outputs, you must enable
30042 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
30043 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
30044 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
30045 * channels featuring anchor outputs in the event of a force close.
30047 * If this option is set, channels may be created that will not be readable by LDK versions
30048 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
30049 * [`DecodeError::InvalidValue`].
30051 * Note that setting this to true does *not* prevent us from opening channels with
30052 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
30053 * fall back to a `static_remote_key` channel.
30055 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
30056 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
30057 * Considered Harmful`] mailing list post.
30059 * Default value: false. This value is likely to change to true in the future.
30061 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
30062 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
30063 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
30064 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
30066 bool ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
30069 * If set, we attempt to negotiate the `anchors_zero_fee_htlc_tx`option for all future
30070 * channels. This feature requires having a reserve of onchain funds readily available to bump
30071 * transactions in the event of a channel force close to avoid the possibility of losing funds.
30073 * Note that if you wish accept inbound channels with anchor outputs, you must enable
30074 * [`UserConfig::manually_accept_inbound_channels`] and manually accept them with
30075 * [`ChannelManager::accept_inbound_channel`]. This is done to give you the chance to check
30076 * whether your reserve of onchain funds is enough to cover the fees for all existing and new
30077 * channels featuring anchor outputs in the event of a force close.
30079 * If this option is set, channels may be created that will not be readable by LDK versions
30080 * prior to 0.0.116, causing [`ChannelManager`]'s read method to return a
30081 * [`DecodeError::InvalidValue`].
30083 * Note that setting this to true does *not* prevent us from opening channels with
30084 * counterparties that do not support the `anchors_zero_fee_htlc_tx` option; we will simply
30085 * fall back to a `static_remote_key` channel.
30087 * LDK will not support the legacy `option_anchors` commitment version due to a discovered
30088 * vulnerability after its deployment. For more context, see the [`SIGHASH_SINGLE + update_fee
30089 * Considered Harmful`] mailing list post.
30091 * Default value: false. This value is likely to change to true in the future.
30093 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
30094 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
30095 * [`DecodeError::InvalidValue`]: crate::ln::msgs::DecodeError::InvalidValue
30096 * [`SIGHASH_SINGLE + update_fee Considered Harmful`]: https://lists.linuxfoundation.org/pipermail/lightning-dev/2020-September/002796.html
30098 void ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, bool val);
30101 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
30103 * Increasing the value can help improve liquidity and stability in
30104 * routing at the cost of higher long term disk / DB usage.
30106 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
30107 * other than the default value.
30109 * Default value: 50
30110 * Maximum value: 483, any values larger will be treated as 483.
30111 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
30113 uint16_t ChannelHandshakeConfig_get_our_max_accepted_htlcs(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr);
30116 * The maximum number of HTLCs in-flight from our counterparty towards us at the same time.
30118 * Increasing the value can help improve liquidity and stability in
30119 * routing at the cost of higher long term disk / DB usage.
30121 * Note: Versions of LDK earlier than v0.0.115 will fail to read channels with a configuration
30122 * other than the default value.
30124 * Default value: 50
30125 * Maximum value: 483, any values larger will be treated as 483.
30126 * This is the BOLT #2 spec limit on `max_accepted_htlcs`.
30128 void ChannelHandshakeConfig_set_our_max_accepted_htlcs(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val);
30131 * Constructs a new ChannelHandshakeConfig given each field
30133 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);
30136 * Creates a copy of the ChannelHandshakeConfig
30138 struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig);
30141 * Creates a "default" ChannelHandshakeConfig. See struct and individual field documentaiton for details on which values are used.
30143 MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
30146 * Frees any resources used by the ChannelHandshakeLimits, if is_owned is set and inner is non-NULL.
30148 void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_obj);
30151 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
30152 * only applies to inbound channels.
30154 * Default value: 0.
30156 uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30159 * Minimum allowed satoshis when a channel is funded. This is supplied by the sender and so
30160 * only applies to inbound channels.
30162 * Default value: 0.
30164 void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
30167 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
30168 * only applies to inbound channels.
30170 * Default value: 2^24 - 1.
30172 uint64_t ChannelHandshakeLimits_get_max_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30175 * Maximum allowed satoshis when a channel is funded. This is supplied by the sender and so
30176 * only applies to inbound channels.
30178 * Default value: 2^24 - 1.
30180 void ChannelHandshakeLimits_set_max_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
30183 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
30184 * you to limit the maximum minimum-size they can require.
30186 * Default value: u64::max_value.
30188 uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30191 * The remote node sets a limit on the minimum size of HTLCs we can send to them. This allows
30192 * you to limit the maximum minimum-size they can require.
30194 * Default value: u64::max_value.
30196 void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
30199 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
30200 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
30202 * Default value: 0.
30204 uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30207 * The remote node sets a limit on the maximum value of pending HTLCs to them at any given
30208 * time to limit their funds exposure to HTLCs. This allows you to set a minimum such value.
30210 * Default value: 0.
30212 void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
30215 * The remote node will require we keep a certain amount in direct payment to ourselves at all
30216 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
30217 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
30219 * Default value: u64::max_value.
30221 uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30224 * The remote node will require we keep a certain amount in direct payment to ourselves at all
30225 * time, ensuring that we are able to be punished if we broadcast an old state. This allows to
30226 * you limit the amount which we will have to keep to ourselves (and cannot use for HTLCs).
30228 * Default value: u64::max_value.
30230 void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val);
30233 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
30234 * time. This allows you to set a minimum such value.
30236 * Default value: 0.
30238 uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30241 * The remote node sets a limit on the maximum number of pending HTLCs to them at any given
30242 * time. This allows you to set a minimum such value.
30244 * Default value: 0.
30246 void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
30249 * Before a channel is usable the funding transaction will need to be confirmed by at least a
30250 * certain number of blocks, specified by the node which is not the funder (as the funder can
30251 * assume they aren't going to double-spend themselves).
30252 * This config allows you to set a limit on the maximum amount of time to wait.
30254 * Default value: 144, or roughly one day and only applies to outbound channels.
30256 uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30259 * Before a channel is usable the funding transaction will need to be confirmed by at least a
30260 * certain number of blocks, specified by the node which is not the funder (as the funder can
30261 * assume they aren't going to double-spend themselves).
30262 * This config allows you to set a limit on the maximum amount of time to wait.
30264 * Default value: 144, or roughly one day and only applies to outbound channels.
30266 void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val);
30269 * Whether we implicitly trust funding transactions generated by us for our own outbound
30270 * channels to not be double-spent.
30272 * If this is set, we assume that our own funding transactions are *never* double-spent, and
30273 * thus we can trust them without any confirmations. This is generally a reasonable
30274 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
30275 * control of the signing keys).
30277 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
30278 * double-spend the funding transaction to RBF with an alternative channel open.
30280 * This only applies if our counterparty set their confirmations-required value to 0, and we
30281 * always trust our own funding transaction at 1 confirmation irrespective of this value.
30282 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
30283 * `true` (0) and `false` (1).
30285 * Default value: true
30287 bool ChannelHandshakeLimits_get_trust_own_funding_0conf(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30290 * Whether we implicitly trust funding transactions generated by us for our own outbound
30291 * channels to not be double-spent.
30293 * If this is set, we assume that our own funding transactions are *never* double-spent, and
30294 * thus we can trust them without any confirmations. This is generally a reasonable
30295 * assumption, given we're the only ones who could ever double-spend it (assuming we have sole
30296 * control of the signing keys).
30298 * You may wish to un-set this if you allow the user to (or do in an automated fashion)
30299 * double-spend the funding transaction to RBF with an alternative channel open.
30301 * This only applies if our counterparty set their confirmations-required value to 0, and we
30302 * always trust our own funding transaction at 1 confirmation irrespective of this value.
30303 * Thus, this effectively acts as a `min_minimum_depth`, with the only possible values being
30304 * `true` (0) and `false` (1).
30306 * Default value: true
30308 void ChannelHandshakeLimits_set_trust_own_funding_0conf(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
30311 * Set to force an incoming channel to match our announced channel preference in
30312 * [`ChannelHandshakeConfig::announced_channel`].
30314 * For a node which is not online reliably, this should be set to true and
30315 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
30316 * channels will ever be opened.
30318 * Default value: true.
30320 bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30323 * Set to force an incoming channel to match our announced channel preference in
30324 * [`ChannelHandshakeConfig::announced_channel`].
30326 * For a node which is not online reliably, this should be set to true and
30327 * [`ChannelHandshakeConfig::announced_channel`] set to false, ensuring that no announced (aka public)
30328 * channels will ever be opened.
30330 * Default value: true.
30332 void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val);
30335 * Set to the amount of time we're willing to wait to claim money back to us.
30337 * Not checking this value would be a security issue, as our peer would be able to set it to
30338 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
30340 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
30341 * reduce the loss of having useless locked funds (if your peer accepts)
30343 uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr);
30346 * Set to the amount of time we're willing to wait to claim money back to us.
30348 * Not checking this value would be a security issue, as our peer would be able to set it to
30349 * max relative lock-time (a year) and we would \"lose\" money as it would be locked for a long time.
30351 * Default value: 2016, which we also enforce as a maximum value so you can tweak config to
30352 * reduce the loss of having useless locked funds (if your peer accepts)
30354 void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val);
30357 * Constructs a new ChannelHandshakeLimits given each field
30359 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);
30362 * Creates a copy of the ChannelHandshakeLimits
30364 struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig);
30367 * Creates a "default" ChannelHandshakeLimits. See struct and individual field documentaiton for details on which values are used.
30369 MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
30372 * Frees any resources used by the MaxDustHTLCExposure
30374 void MaxDustHTLCExposure_free(struct LDKMaxDustHTLCExposure this_ptr);
30377 * Creates a copy of the MaxDustHTLCExposure
30379 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_clone(const struct LDKMaxDustHTLCExposure *NONNULL_PTR orig);
30382 * Utility method to constructs a new FixedLimitMsat-variant MaxDustHTLCExposure
30384 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fixed_limit_msat(uint64_t a);
30387 * Utility method to constructs a new FeeRateMultiplier-variant MaxDustHTLCExposure
30389 struct LDKMaxDustHTLCExposure MaxDustHTLCExposure_fee_rate_multiplier(uint64_t a);
30392 * Checks if two MaxDustHTLCExposures contain equal inner contents.
30393 * This ignores pointers and is_owned flags and looks at the values in fields.
30395 bool MaxDustHTLCExposure_eq(const struct LDKMaxDustHTLCExposure *NONNULL_PTR a, const struct LDKMaxDustHTLCExposure *NONNULL_PTR b);
30398 * Serialize the MaxDustHTLCExposure object into a byte array which can be read by MaxDustHTLCExposure_read
30400 struct LDKCVec_u8Z MaxDustHTLCExposure_write(const struct LDKMaxDustHTLCExposure *NONNULL_PTR obj);
30403 * Read a MaxDustHTLCExposure from a byte array, created by MaxDustHTLCExposure_write
30405 struct LDKCResult_MaxDustHTLCExposureDecodeErrorZ MaxDustHTLCExposure_read(struct LDKu8slice ser);
30408 * Frees any resources used by the ChannelConfig, if is_owned is set and inner is non-NULL.
30410 void ChannelConfig_free(struct LDKChannelConfig this_obj);
30413 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
30414 * over the channel.
30415 * This may be allowed to change at runtime in a later update, however doing so must result in
30416 * update messages sent to notify all nodes of our updated relay fee.
30418 * Default value: 0.
30420 uint32_t ChannelConfig_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
30423 * Amount (in millionths of a satoshi) charged per satoshi for payments forwarded outbound
30424 * over the channel.
30425 * This may be allowed to change at runtime in a later update, however doing so must result in
30426 * update messages sent to notify all nodes of our updated relay fee.
30428 * Default value: 0.
30430 void ChannelConfig_set_forwarding_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
30433 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
30434 * excess of [`forwarding_fee_proportional_millionths`].
30435 * This may be allowed to change at runtime in a later update, however doing so must result in
30436 * update messages sent to notify all nodes of our updated relay fee.
30438 * The default value of a single satoshi roughly matches the market rate on many routing nodes
30439 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
30442 * Default value: 1000.
30444 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
30446 uint32_t ChannelConfig_get_forwarding_fee_base_msat(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
30449 * Amount (in milli-satoshi) charged for payments forwarded outbound over the channel, in
30450 * excess of [`forwarding_fee_proportional_millionths`].
30451 * This may be allowed to change at runtime in a later update, however doing so must result in
30452 * update messages sent to notify all nodes of our updated relay fee.
30454 * The default value of a single satoshi roughly matches the market rate on many routing nodes
30455 * as of July 2021. Adjusting it upwards or downwards may change whether nodes route through
30458 * Default value: 1000.
30460 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
30462 void ChannelConfig_set_forwarding_fee_base_msat(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val);
30465 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
30466 * the channel this config applies to.
30468 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
30469 * HTLC balance when a channel appears on-chain whereas
30470 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
30471 * (non-HTLC-encumbered) balance.
30473 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
30474 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
30475 * commitment transaction at least once per this many blocks (minus some margin to allow us
30476 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
30477 * the spending transaction).
30479 * Default value: 72 (12 hours at an average of 6 blocks/hour).
30480 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
30481 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
30483 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
30485 uint16_t ChannelConfig_get_cltv_expiry_delta(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
30488 * The difference in the CLTV value between incoming HTLCs and an outbound HTLC forwarded over
30489 * the channel this config applies to.
30491 * This is analogous to [`ChannelHandshakeConfig::our_to_self_delay`] but applies to in-flight
30492 * HTLC balance when a channel appears on-chain whereas
30493 * [`ChannelHandshakeConfig::our_to_self_delay`] applies to the remaining
30494 * (non-HTLC-encumbered) balance.
30496 * Thus, for HTLC-encumbered balances to be enforced on-chain when a channel is force-closed,
30497 * we (or one of our watchtowers) MUST be online to check for broadcast of the current
30498 * commitment transaction at least once per this many blocks (minus some margin to allow us
30499 * enough time to broadcast and confirm a transaction, possibly with time in between to RBF
30500 * the spending transaction).
30502 * Default value: 72 (12 hours at an average of 6 blocks/hour).
30503 * Minimum value: [`MIN_CLTV_EXPIRY_DELTA`], any values less than this will be treated as
30504 * [`MIN_CLTV_EXPIRY_DELTA`] instead.
30506 * [`MIN_CLTV_EXPIRY_DELTA`]: crate::ln::channelmanager::MIN_CLTV_EXPIRY_DELTA
30508 void ChannelConfig_set_cltv_expiry_delta(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint16_t val);
30511 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
30512 * small to claim on-chain.
30514 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
30515 * not be claimable on-chain, instead being turned into additional miner fees if either
30516 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
30517 * to such payments may be sustantial if there are many dust HTLCs present when the
30518 * channel is force-closed.
30520 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
30521 * channel negotiated throughout the channel open process, along with the fees required to have
30522 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
30523 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
30524 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
30525 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
30526 * variant is primarily intended for use with pre-anchor channels.
30528 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
30529 * exposure across all three types per-channel.
30531 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
30533 struct LDKMaxDustHTLCExposure ChannelConfig_get_max_dust_htlc_exposure(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
30536 * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too
30537 * small to claim on-chain.
30539 * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will
30540 * not be claimable on-chain, instead being turned into additional miner fees if either
30541 * party force-closes the channel. Because the threshold is per-HTLC, our total exposure
30542 * to such payments may be sustantial if there are many dust HTLCs present when the
30543 * channel is force-closed.
30545 * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
30546 * channel negotiated throughout the channel open process, along with the fees required to have
30547 * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
30548 * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
30549 * account the HTLC transaction fee as it is zero. Because of this, you may want to set this
30550 * value to a fixed limit for channels using anchor outputs, while the fee rate multiplier
30551 * variant is primarily intended for use with pre-anchor channels.
30553 * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total
30554 * exposure across all three types per-channel.
30556 * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000.
30558 void ChannelConfig_set_max_dust_htlc_exposure(struct LDKChannelConfig *NONNULL_PTR this_ptr, struct LDKMaxDustHTLCExposure val);
30561 * The additional fee we're willing to pay to avoid waiting for the counterparty's
30562 * `to_self_delay` to reclaim funds.
30564 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
30565 * closing transaction which both sides find acceptable, ultimately paid by the channel
30566 * funder/initiator.
30568 * When we are the funder, because we have to pay the channel closing fee, we bound the
30569 * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
30570 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
30571 * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
30572 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
30575 * When we are not the funder, we require the closing transaction fee pay at least our
30576 * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
30577 * Thus, this value is ignored when we are not the funder.
30579 * Default value: 1000 satoshis.
30581 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
30582 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
30584 uint64_t ChannelConfig_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
30587 * The additional fee we're willing to pay to avoid waiting for the counterparty's
30588 * `to_self_delay` to reclaim funds.
30590 * When we close a channel cooperatively with our counterparty, we negotiate a fee for the
30591 * closing transaction which both sides find acceptable, ultimately paid by the channel
30592 * funder/initiator.
30594 * When we are the funder, because we have to pay the channel closing fee, we bound the
30595 * acceptable fee by our [`ChannelCloseMinimum`] and [`NonAnchorChannelFee`] fees, with the upper bound increased by
30596 * this value. Because the on-chain fee we'd pay to force-close the channel is kept near our
30597 * [`NonAnchorChannelFee`] feerate during normal operation, this value represents the additional fee we're
30598 * willing to pay in order to avoid waiting for our counterparty's to_self_delay to reclaim our
30601 * When we are not the funder, we require the closing transaction fee pay at least our
30602 * [`ChannelCloseMinimum`] fee estimate, but allow our counterparty to pay as much fee as they like.
30603 * Thus, this value is ignored when we are not the funder.
30605 * Default value: 1000 satoshis.
30607 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
30608 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
30610 void ChannelConfig_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint64_t val);
30613 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
30614 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
30617 * - The payee will set this option and set its invoice route hints to use [intercept scids]
30618 * generated by this channel's counterparty.
30619 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
30620 * [`forward_intercepted_htlc`] with less than the amount provided in
30621 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
30622 * actual forward amounts is their fee. See
30623 * <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
30624 * for how this feature may be used in the LSP use case.
30627 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
30628 * as-expected if this feature is activated, otherwise they may lose money!
30629 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
30633 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
30634 * Unsetting this flag between restarts may lead to payment receive failures.
30636 * Default value: false.
30638 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
30639 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
30640 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
30641 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
30642 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
30643 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
30645 bool ChannelConfig_get_accept_underpaying_htlcs(const struct LDKChannelConfig *NONNULL_PTR this_ptr);
30648 * If set, allows this channel's counterparty to skim an additional fee off this node's inbound
30649 * HTLCs. Useful for liquidity providers to offload on-chain channel costs to end users.
30652 * - The payee will set this option and set its invoice route hints to use [intercept scids]
30653 * generated by this channel's counterparty.
30654 * - The counterparty will get an [`HTLCIntercepted`] event upon payment forward, and call
30655 * [`forward_intercepted_htlc`] with less than the amount provided in
30656 * [`HTLCIntercepted::expected_outbound_amount_msat`]. The difference between the expected and
30657 * actual forward amounts is their fee. See
30658 * <https://github.com/BitcoinAndLightningLayerSpecs/lsp/tree/main/LSPS2#flow-lsp-trusts-client-model>
30659 * for how this feature may be used in the LSP use case.
30662 * It's important for payee wallet software to verify that [`PaymentClaimable::amount_msat`] is
30663 * as-expected if this feature is activated, otherwise they may lose money!
30664 * [`PaymentClaimable::counterparty_skimmed_fee_msat`] provides the fee taken by the
30668 * Switching this config flag on may break compatibility with versions of LDK prior to 0.0.116.
30669 * Unsetting this flag between restarts may lead to payment receive failures.
30671 * Default value: false.
30673 * [intercept scids]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
30674 * [`forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc
30675 * [`HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
30676 * [`HTLCIntercepted::expected_outbound_amount_msat`]: crate::events::Event::HTLCIntercepted::expected_outbound_amount_msat
30677 * [`PaymentClaimable::amount_msat`]: crate::events::Event::PaymentClaimable::amount_msat
30678 * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: crate::events::Event::PaymentClaimable::counterparty_skimmed_fee_msat
30680 void ChannelConfig_set_accept_underpaying_htlcs(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val);
30683 * Constructs a new ChannelConfig given each field
30685 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);
30688 * Creates a copy of the ChannelConfig
30690 struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
30693 * Checks if two ChannelConfigs contain equal inner contents.
30694 * This ignores pointers and is_owned flags and looks at the values in fields.
30695 * Two objects with NULL inner values will be considered "equal" here.
30697 bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
30700 * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`].
30702 void ChannelConfig_apply(struct LDKChannelConfig *NONNULL_PTR this_arg, const struct LDKChannelConfigUpdate *NONNULL_PTR update);
30705 * Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
30707 MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
30710 * Serialize the ChannelConfig object into a byte array which can be read by ChannelConfig_read
30712 struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
30715 * Read a ChannelConfig from a byte array, created by ChannelConfig_write
30717 struct LDKCResult_ChannelConfigDecodeErrorZ ChannelConfig_read(struct LDKu8slice ser);
30720 * Frees any resources used by the ChannelConfigUpdate, if is_owned is set and inner is non-NULL.
30722 void ChannelConfigUpdate_free(struct LDKChannelConfigUpdate this_obj);
30724 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
30726 void ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
30728 struct LDKCOption_u32Z ChannelConfigUpdate_get_forwarding_fee_base_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
30730 void ChannelConfigUpdate_set_forwarding_fee_base_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
30732 struct LDKCOption_u16Z ChannelConfigUpdate_get_cltv_expiry_delta(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
30734 void ChannelConfigUpdate_set_cltv_expiry_delta(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
30738 * Returns a copy of the field.
30740 struct LDKCOption_MaxDustHTLCExposureZ ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
30742 void ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_MaxDustHTLCExposureZ val);
30744 struct LDKCOption_u64Z ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(const struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr);
30746 void ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(struct LDKChannelConfigUpdate *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
30749 * Constructs a new ChannelConfigUpdate given each field
30751 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);
30754 * Creates a "default" ChannelConfigUpdate. See struct and individual field documentaiton for details on which values are used.
30756 MUST_USE_RES struct LDKChannelConfigUpdate ChannelConfigUpdate_default(void);
30759 * Frees any resources used by the UserConfig, if is_owned is set and inner is non-NULL.
30761 void UserConfig_free(struct LDKUserConfig this_obj);
30764 * Channel handshake config that we propose to our counterparty.
30766 struct LDKChannelHandshakeConfig UserConfig_get_channel_handshake_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30769 * Channel handshake config that we propose to our counterparty.
30771 void UserConfig_set_channel_handshake_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val);
30774 * Limits applied to our counterparty's proposed channel handshake config settings.
30776 struct LDKChannelHandshakeLimits UserConfig_get_channel_handshake_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30779 * Limits applied to our counterparty's proposed channel handshake config settings.
30781 void UserConfig_set_channel_handshake_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val);
30784 * Channel config which affects behavior during channel lifetime.
30786 struct LDKChannelConfig UserConfig_get_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30789 * Channel config which affects behavior during channel lifetime.
30791 void UserConfig_set_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
30794 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
30795 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
30796 * node which is not online reliably.
30798 * For nodes which are not online reliably, you should set all channels to *not* be announced
30799 * (using [`ChannelHandshakeConfig::announced_channel`] and
30800 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
30801 * ensure you are not exposed to any forwarding risk.
30803 * Note that because you cannot change a channel's announced state after creation, there is no
30804 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
30805 * from a publicly-announced forwarding node to a private non-forwarding node you must close
30806 * all your channels and open new ones. For privacy, you should also change your node_id
30807 * (swapping all private and public key material for new ones) at that time.
30809 * Default value: false.
30811 bool UserConfig_get_accept_forwards_to_priv_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30814 * If this is set to false, we will reject any HTLCs which were to be forwarded over private
30815 * channels. This prevents us from taking on HTLC-forwarding risk when we intend to run as a
30816 * node which is not online reliably.
30818 * For nodes which are not online reliably, you should set all channels to *not* be announced
30819 * (using [`ChannelHandshakeConfig::announced_channel`] and
30820 * [`ChannelHandshakeLimits::force_announced_channel_preference`]) and set this to false to
30821 * ensure you are not exposed to any forwarding risk.
30823 * Note that because you cannot change a channel's announced state after creation, there is no
30824 * way to disable forwarding on public channels retroactively. Thus, in order to change a node
30825 * from a publicly-announced forwarding node to a private non-forwarding node you must close
30826 * all your channels and open new ones. For privacy, you should also change your node_id
30827 * (swapping all private and public key material for new ones) at that time.
30829 * Default value: false.
30831 void UserConfig_set_accept_forwards_to_priv_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
30834 * If this is set to false, we do not accept inbound requests to open a new channel.
30835 * Default value: true.
30837 bool UserConfig_get_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30840 * If this is set to false, we do not accept inbound requests to open a new channel.
30841 * Default value: true.
30843 void UserConfig_set_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
30846 * If this is set to true, the user needs to manually accept inbound requests to open a new
30849 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
30850 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
30851 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
30852 * user explicitly chooses to accept the request.
30854 * Default value: false.
30856 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
30857 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
30858 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
30860 bool UserConfig_get_manually_accept_inbound_channels(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30863 * If this is set to true, the user needs to manually accept inbound requests to open a new
30866 * When set to true, [`Event::OpenChannelRequest`] will be triggered once a request to open a
30867 * new inbound channel is received through a [`msgs::OpenChannel`] message. In that case, a
30868 * [`msgs::AcceptChannel`] message will not be sent back to the counterparty node unless the
30869 * user explicitly chooses to accept the request.
30871 * Default value: false.
30873 * [`Event::OpenChannelRequest`]: crate::events::Event::OpenChannelRequest
30874 * [`msgs::OpenChannel`]: crate::ln::msgs::OpenChannel
30875 * [`msgs::AcceptChannel`]: crate::ln::msgs::AcceptChannel
30877 void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
30880 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
30881 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
30882 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
30884 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
30886 * Default value: false.
30888 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
30889 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
30891 bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30894 * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over
30895 * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC
30896 * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user.
30898 * Setting this to true may break backwards compatibility with LDK versions < 0.0.113.
30900 * Default value: false.
30902 * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid
30903 * [`Event::HTLCIntercepted`]: crate::events::Event::HTLCIntercepted
30905 void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
30908 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
30909 * parts. If this is set to true, we'll accept the payment.
30911 * Setting this to true will break backwards compatibility upon downgrading to an LDK
30912 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
30913 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
30915 * Default value: false.
30917 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
30919 bool UserConfig_get_accept_mpp_keysend(const struct LDKUserConfig *NONNULL_PTR this_ptr);
30922 * If this is set to false, when receiving a keysend payment we'll fail it if it has multiple
30923 * parts. If this is set to true, we'll accept the payment.
30925 * Setting this to true will break backwards compatibility upon downgrading to an LDK
30926 * version < 0.0.116 while receiving an MPP keysend. If we have already received an MPP
30927 * keysend, downgrading will cause us to fail to deserialize [`ChannelManager`].
30929 * Default value: false.
30931 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
30933 void UserConfig_set_accept_mpp_keysend(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val);
30936 * Constructs a new UserConfig given each field
30938 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);
30941 * Creates a copy of the UserConfig
30943 struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig);
30946 * Creates a "default" UserConfig. See struct and individual field documentaiton for details on which values are used.
30948 MUST_USE_RES struct LDKUserConfig UserConfig_default(void);
30951 * Frees any resources used by the BestBlock, if is_owned is set and inner is non-NULL.
30953 void BestBlock_free(struct LDKBestBlock this_obj);
30956 * Creates a copy of the BestBlock
30958 struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
30961 * Checks if two BestBlocks contain equal inner contents.
30962 * This ignores pointers and is_owned flags and looks at the values in fields.
30963 * Two objects with NULL inner values will be considered "equal" here.
30965 bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
30968 * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
30971 MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network);
30974 * Returns a `BestBlock` as identified by the given block hash and height.
30976 MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
30979 * Returns the best block hash.
30981 MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg);
30984 * Returns the best block height.
30986 MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg);
30989 * Calls the free function if one is set
30991 void Listen_free(struct LDKListen this_ptr);
30994 * Calls the free function if one is set
30996 void Confirm_free(struct LDKConfirm this_ptr);
30999 * Creates a copy of the ChannelMonitorUpdateStatus
31001 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
31004 * Utility method to constructs a new Completed-variant ChannelMonitorUpdateStatus
31006 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
31009 * Utility method to constructs a new InProgress-variant ChannelMonitorUpdateStatus
31011 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
31014 * Utility method to constructs a new UnrecoverableError-variant ChannelMonitorUpdateStatus
31016 enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_unrecoverable_error(void);
31019 * Checks if two ChannelMonitorUpdateStatuss contain equal inner contents.
31020 * This ignores pointers and is_owned flags and looks at the values in fields.
31022 bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
31025 * Calls the free function if one is set
31027 void Watch_free(struct LDKWatch this_ptr);
31030 * Calls the free function if one is set
31032 void Filter_free(struct LDKFilter this_ptr);
31035 * Frees any resources used by the WatchedOutput, if is_owned is set and inner is non-NULL.
31037 void WatchedOutput_free(struct LDKWatchedOutput this_obj);
31040 * First block where the transaction output may have been spent.
31042 struct LDKCOption_ThirtyTwoBytesZ WatchedOutput_get_block_hash(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
31045 * First block where the transaction output may have been spent.
31047 void WatchedOutput_set_block_hash(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
31050 * Outpoint identifying the transaction output.
31052 struct LDKOutPoint WatchedOutput_get_outpoint(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
31055 * Outpoint identifying the transaction output.
31057 void WatchedOutput_set_outpoint(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
31060 * Spending condition of the transaction output.
31062 struct LDKCVec_u8Z WatchedOutput_get_script_pubkey(const struct LDKWatchedOutput *NONNULL_PTR this_ptr);
31065 * Spending condition of the transaction output.
31067 void WatchedOutput_set_script_pubkey(struct LDKWatchedOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
31070 * Constructs a new WatchedOutput given each field
31072 MUST_USE_RES struct LDKWatchedOutput WatchedOutput_new(struct LDKCOption_ThirtyTwoBytesZ block_hash_arg, struct LDKOutPoint outpoint_arg, struct LDKCVec_u8Z script_pubkey_arg);
31075 * Creates a copy of the WatchedOutput
31077 struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
31080 * Checks if two WatchedOutputs contain equal inner contents.
31081 * This ignores pointers and is_owned flags and looks at the values in fields.
31082 * Two objects with NULL inner values will be considered "equal" here.
31084 bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
31087 * Generates a non-cryptographic 64-bit hash of the WatchedOutput.
31089 uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
31092 * Calls the free function if one is set
31094 void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
31097 * Creates a copy of the ConfirmationTarget
31099 enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
31102 * Utility method to constructs a new OnChainSweep-variant ConfirmationTarget
31104 enum LDKConfirmationTarget ConfirmationTarget_on_chain_sweep(void);
31107 * Utility method to constructs a new MinAllowedAnchorChannelRemoteFee-variant ConfirmationTarget
31109 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_anchor_channel_remote_fee(void);
31112 * Utility method to constructs a new MinAllowedNonAnchorChannelRemoteFee-variant ConfirmationTarget
31114 enum LDKConfirmationTarget ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee(void);
31117 * Utility method to constructs a new AnchorChannelFee-variant ConfirmationTarget
31119 enum LDKConfirmationTarget ConfirmationTarget_anchor_channel_fee(void);
31122 * Utility method to constructs a new NonAnchorChannelFee-variant ConfirmationTarget
31124 enum LDKConfirmationTarget ConfirmationTarget_non_anchor_channel_fee(void);
31127 * Utility method to constructs a new ChannelCloseMinimum-variant ConfirmationTarget
31129 enum LDKConfirmationTarget ConfirmationTarget_channel_close_minimum(void);
31132 * Generates a non-cryptographic 64-bit hash of the ConfirmationTarget.
31134 uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o);
31137 * Checks if two ConfirmationTargets contain equal inner contents.
31138 * This ignores pointers and is_owned flags and looks at the values in fields.
31140 bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b);
31143 * Calls the free function if one is set
31145 void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
31148 * Frees any resources used by the MonitorUpdateId, if is_owned is set and inner is non-NULL.
31150 void MonitorUpdateId_free(struct LDKMonitorUpdateId this_obj);
31153 * Creates a copy of the MonitorUpdateId
31155 struct LDKMonitorUpdateId MonitorUpdateId_clone(const struct LDKMonitorUpdateId *NONNULL_PTR orig);
31158 * Generates a non-cryptographic 64-bit hash of the MonitorUpdateId.
31160 uint64_t MonitorUpdateId_hash(const struct LDKMonitorUpdateId *NONNULL_PTR o);
31163 * Checks if two MonitorUpdateIds contain equal inner contents.
31164 * This ignores pointers and is_owned flags and looks at the values in fields.
31165 * Two objects with NULL inner values will be considered "equal" here.
31167 bool MonitorUpdateId_eq(const struct LDKMonitorUpdateId *NONNULL_PTR a, const struct LDKMonitorUpdateId *NONNULL_PTR b);
31170 * Calls the free function if one is set
31172 void Persist_free(struct LDKPersist this_ptr);
31175 * Frees any resources used by the LockedChannelMonitor, if is_owned is set and inner is non-NULL.
31177 void LockedChannelMonitor_free(struct LDKLockedChannelMonitor this_obj);
31180 * Frees any resources used by the ChainMonitor, if is_owned is set and inner is non-NULL.
31182 void ChainMonitor_free(struct LDKChainMonitor this_obj);
31185 * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
31187 * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
31188 * will call back to it indicating transactions and outputs of interest. This allows clients to
31189 * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
31190 * always need to fetch full blocks absent another means for determining which blocks contain
31191 * transactions relevant to the watched channels.
31193 MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKCOption_FilterZ chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister);
31196 * Gets the balances in the contained [`ChannelMonitor`]s which are claimable on-chain or
31197 * claims which are awaiting confirmation.
31199 * Includes the balances from each [`ChannelMonitor`] *except* those included in
31200 * `ignored_channels`, allowing you to filter out balances from channels which are still open
31201 * (and whose balance should likely be pulled from the [`ChannelDetails`]).
31203 * See [`ChannelMonitor::get_claimable_balances`] for more details on the exact criteria for
31204 * inclusion in the return value.
31206 MUST_USE_RES struct LDKCVec_BalanceZ ChainMonitor_get_claimable_balances(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKCVec_ChannelDetailsZ ignored_channels);
31209 * Gets the [`LockedChannelMonitor`] for a given funding outpoint, returning an `Err` if no
31210 * such [`ChannelMonitor`] is currently being monitored for.
31212 * Note that the result holds a mutex over our monitor set, and should not be held
31215 MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo);
31218 * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
31220 * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
31221 * monitoring for on-chain state resolutions.
31223 MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31226 * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored).
31228 MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31231 * Indicates the persistence of a [`ChannelMonitor`] has completed after
31232 * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
31234 * Thus, the anticipated use is, at a high level:
31235 * 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
31236 * update to disk and begins updating any remote (e.g. watchtower/backup) copies,
31237 * returning [`ChannelMonitorUpdateStatus::InProgress`],
31238 * 2) once all remote copies are updated, you call this function with the
31239 * `completed_update_id` that completed, and once all pending updates have completed the
31240 * channel will be re-enabled.
31242 * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently
31243 * registered [`ChannelMonitor`]s.
31245 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);
31248 * Gets a [`Future`] that completes when an event is available either via
31249 * [`chain::Watch::release_pending_monitor_events`] or
31250 * [`EventsProvider::process_pending_events`].
31252 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
31253 * [`ChainMonitor`] and should instead register actions to be taken later.
31255 * [`EventsProvider::process_pending_events`]: crate::events::EventsProvider::process_pending_events
31257 MUST_USE_RES struct LDKFuture ChainMonitor_get_update_future(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31260 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
31261 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
31262 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
31263 * invoking this every 30 seconds, or lower if running in an environment with spotty
31264 * connections, like on mobile.
31266 void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31269 * Constructs a new Listen which calls the relevant methods on this_arg.
31270 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
31272 struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31275 * Constructs a new Confirm which calls the relevant methods on this_arg.
31276 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
31278 struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31281 * Constructs a new Watch which calls the relevant methods on this_arg.
31282 * This copies the `inner` pointer in this_arg and thus the returned Watch must be freed before this_arg is
31284 struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31287 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
31288 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
31290 struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg);
31293 * Frees any resources used by the ChannelMonitorUpdate, if is_owned is set and inner is non-NULL.
31295 void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_obj);
31298 * The sequence number of this update. Updates *must* be replayed in-order according to this
31299 * sequence number (and updates may panic if they are not). The update_id values are strictly
31300 * increasing and increase by one for each new update, with two exceptions specified below.
31302 * This sequence number is also used to track up to which points updates which returned
31303 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
31304 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
31306 * The only instances we allow where update_id values are not strictly increasing have a
31307 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
31308 * will force close the channel by broadcasting the latest commitment transaction or
31309 * special post-force-close updates, like providing preimages necessary to claim outputs on the
31310 * broadcast commitment transaction. See its docs for more details.
31312 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
31314 uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr);
31317 * The sequence number of this update. Updates *must* be replayed in-order according to this
31318 * sequence number (and updates may panic if they are not). The update_id values are strictly
31319 * increasing and increase by one for each new update, with two exceptions specified below.
31321 * This sequence number is also used to track up to which points updates which returned
31322 * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
31323 * ChannelMonitor when ChannelManager::channel_monitor_updated is called.
31325 * The only instances we allow where update_id values are not strictly increasing have a
31326 * special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. This update ID is used for updates that
31327 * will force close the channel by broadcasting the latest commitment transaction or
31328 * special post-force-close updates, like providing preimages necessary to claim outputs on the
31329 * broadcast commitment transaction. See its docs for more details.
31331 * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
31333 void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val);
31336 * Creates a copy of the ChannelMonitorUpdate
31338 struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig);
31341 * Checks if two ChannelMonitorUpdates contain equal inner contents.
31342 * This ignores pointers and is_owned flags and looks at the values in fields.
31343 * Two objects with NULL inner values will be considered "equal" here.
31345 bool ChannelMonitorUpdate_eq(const struct LDKChannelMonitorUpdate *NONNULL_PTR a, const struct LDKChannelMonitorUpdate *NONNULL_PTR b);
31348 * Serialize the ChannelMonitorUpdate object into a byte array which can be read by ChannelMonitorUpdate_read
31350 struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj);
31353 * Read a ChannelMonitorUpdate from a byte array, created by ChannelMonitorUpdate_write
31355 struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser);
31358 * Frees any resources used by the MonitorEvent
31360 void MonitorEvent_free(struct LDKMonitorEvent this_ptr);
31363 * Creates a copy of the MonitorEvent
31365 struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
31368 * Utility method to constructs a new HTLCEvent-variant MonitorEvent
31370 struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
31373 * Utility method to constructs a new HolderForceClosed-variant MonitorEvent
31375 struct LDKMonitorEvent MonitorEvent_holder_force_closed(struct LDKOutPoint a);
31378 * Utility method to constructs a new Completed-variant MonitorEvent
31380 struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
31383 * Checks if two MonitorEvents contain equal inner contents.
31384 * This ignores pointers and is_owned flags and looks at the values in fields.
31386 bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
31389 * Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
31391 struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
31394 * Read a MonitorEvent from a byte array, created by MonitorEvent_write
31396 struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
31399 * Frees any resources used by the HTLCUpdate, if is_owned is set and inner is non-NULL.
31401 void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
31404 * Creates a copy of the HTLCUpdate
31406 struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
31409 * Checks if two HTLCUpdates contain equal inner contents.
31410 * This ignores pointers and is_owned flags and looks at the values in fields.
31411 * Two objects with NULL inner values will be considered "equal" here.
31413 bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
31416 * Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
31418 struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
31421 * Read a HTLCUpdate from a byte array, created by HTLCUpdate_write
31423 struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
31426 * Frees any resources used by the Balance
31428 void Balance_free(struct LDKBalance this_ptr);
31431 * Creates a copy of the Balance
31433 struct LDKBalance Balance_clone(const struct LDKBalance *NONNULL_PTR orig);
31436 * Utility method to constructs a new ClaimableOnChannelClose-variant Balance
31438 struct LDKBalance Balance_claimable_on_channel_close(uint64_t amount_satoshis);
31441 * Utility method to constructs a new ClaimableAwaitingConfirmations-variant Balance
31443 struct LDKBalance Balance_claimable_awaiting_confirmations(uint64_t amount_satoshis, uint32_t confirmation_height);
31446 * Utility method to constructs a new ContentiousClaimable-variant Balance
31448 struct LDKBalance Balance_contentious_claimable(uint64_t amount_satoshis, uint32_t timeout_height, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage);
31451 * Utility method to constructs a new MaybeTimeoutClaimableHTLC-variant Balance
31453 struct LDKBalance Balance_maybe_timeout_claimable_htlc(uint64_t amount_satoshis, uint32_t claimable_height, struct LDKThirtyTwoBytes payment_hash);
31456 * Utility method to constructs a new MaybePreimageClaimableHTLC-variant Balance
31458 struct LDKBalance Balance_maybe_preimage_claimable_htlc(uint64_t amount_satoshis, uint32_t expiry_height, struct LDKThirtyTwoBytes payment_hash);
31461 * Utility method to constructs a new CounterpartyRevokedOutputClaimable-variant Balance
31463 struct LDKBalance Balance_counterparty_revoked_output_claimable(uint64_t amount_satoshis);
31466 * Checks if two Balances contain equal inner contents.
31467 * This ignores pointers and is_owned flags and looks at the values in fields.
31469 bool Balance_eq(const struct LDKBalance *NONNULL_PTR a, const struct LDKBalance *NONNULL_PTR b);
31472 * The amount claimable, in satoshis. This excludes balances that we are unsure if we are able
31473 * to claim, this is because we are waiting for a preimage or for a timeout to expire. For more
31474 * information on these balances see [`Balance::MaybeTimeoutClaimableHTLC`] and
31475 * [`Balance::MaybePreimageClaimableHTLC`].
31477 * On-chain fees required to claim the balance are not included in this amount.
31479 MUST_USE_RES uint64_t Balance_claimable_amount_satoshis(const struct LDKBalance *NONNULL_PTR this_arg);
31482 * Frees any resources used by the ChannelMonitor, if is_owned is set and inner is non-NULL.
31484 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
31487 * Creates a copy of the ChannelMonitor
31489 struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig);
31492 * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
31494 struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj);
31497 * Updates a ChannelMonitor on the basis of some new information provided by the Channel
31500 * panics if the given update is not the next update by update_id.
31502 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelMonitor_update_monitor(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
31505 * Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
31508 MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31511 * Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
31513 MUST_USE_RES struct LDKC2Tuple_OutPointCVec_u8ZZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31516 * Gets a list of txids, with their output scripts (in the order they appear in the
31517 * transaction), which we must learn about spends of via block_connected().
31519 MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31522 * Loads the funding txo and outputs to watch into the given `chain::Filter` by repeatedly
31523 * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs
31524 * have been registered.
31526 void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter, const struct LDKLogger *NONNULL_PTR logger);
31529 * Get the list of HTLCs who's status has been updated on chain. This should be called by
31530 * ChannelManager via [`chain::Watch::release_pending_monitor_events`].
31532 MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31535 * Processes [`SpendableOutputs`] events produced from each [`ChannelMonitor`] upon maturity.
31537 * For channels featuring anchor outputs, this method will also process [`BumpTransaction`]
31538 * events produced from each [`ChannelMonitor`] while there is a balance to claim onchain
31539 * within each channel. As the confirmation of a commitment transaction may be critical to the
31540 * safety of funds, we recommend invoking this every 30 seconds, or lower if running in an
31541 * environment with spotty connections, like on mobile.
31543 * An [`EventHandler`] may safely call back to the provider, though this shouldn't be needed in
31544 * order to handle these events.
31546 * [`SpendableOutputs`]: crate::events::Event::SpendableOutputs
31547 * [`BumpTransaction`]: crate::events::Event::BumpTransaction
31549 void ChannelMonitor_process_pending_events(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKEventHandler *NONNULL_PTR handler);
31552 * Gets the counterparty's initial commitment transaction. The returned commitment
31553 * transaction is unsigned. This is intended to be called during the initial persistence of
31554 * the monitor (inside an implementation of [`Persist::persist_new_channel`]), to allow for
31555 * watchtowers in the persistence pipeline to have enough data to form justice transactions.
31557 * This is similar to [`Self::counterparty_commitment_txs_from_update`], except
31558 * that for the initial commitment transaction, we don't have a corresponding update.
31560 * This will only return `Some` for channel monitors that have been created after upgrading
31563 * [`Persist::persist_new_channel`]: crate::chain::chainmonitor::Persist::persist_new_channel
31565 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31567 MUST_USE_RES struct LDKCommitmentTransaction ChannelMonitor_initial_counterparty_commitment_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31570 * Gets all of the counterparty commitment transactions provided by the given update. This
31571 * may be empty if the update doesn't include any new counterparty commitments. Returned
31572 * commitment transactions are unsigned.
31574 * This is provided so that watchtower clients in the persistence pipeline are able to build
31575 * justice transactions for each counterparty commitment upon each update. It's intended to be
31576 * used within an implementation of [`Persist::update_persisted_channel`], which is provided
31577 * with a monitor and an update. Once revoked, signing a justice transaction can be done using
31578 * [`Self::sign_to_local_justice_tx`].
31580 * It is expected that a watchtower client may use this method to retrieve the latest counterparty
31581 * commitment transaction(s), and then hold the necessary data until a later update in which
31582 * the monitor has been updated with the corresponding revocation data, at which point the
31583 * monitor can sign the justice transaction.
31585 * This will only return a non-empty list for monitor updates that have been created after
31586 * upgrading to LDK 0.0.117+. Note that no restriction lies on the monitors themselves, which
31587 * may have been created prior to upgrading.
31589 * [`Persist::update_persisted_channel`]: crate::chain::chainmonitor::Persist::update_persisted_channel
31591 MUST_USE_RES struct LDKCVec_CommitmentTransactionZ ChannelMonitor_counterparty_commitment_txs_from_update(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR update);
31594 * Wrapper around [`EcdsaChannelSigner::sign_justice_revoked_output`] to make
31595 * signing the justice transaction easier for implementors of
31596 * [`chain::chainmonitor::Persist`]. On success this method returns the provided transaction
31597 * signing the input at `input_idx`. This method will only produce a valid signature for
31598 * a transaction spending the `to_local` output of a commitment transaction, i.e. this cannot
31599 * be used for revoked HTLC outputs.
31601 * `Value` is the value of the output being spent by the input at `input_idx`, committed
31602 * in the BIP 143 signature.
31604 * This method will only succeed if this monitor has received the revocation secret for the
31605 * provided `commitment_number`. If a commitment number is provided that does not correspond
31606 * to the commitment transaction being revoked, this will return a signed transaction, but
31607 * the signature will not be valid.
31609 * [`EcdsaChannelSigner::sign_justice_revoked_output`]: crate::sign::ecdsa::EcdsaChannelSigner::sign_justice_revoked_output
31610 * [`Persist`]: crate::chain::chainmonitor::Persist
31612 MUST_USE_RES struct LDKCResult_TransactionNoneZ ChannelMonitor_sign_to_local_justice_tx(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction justice_tx, uintptr_t input_idx, uint64_t value, uint64_t commitment_number);
31615 * Gets the `node_id` of the counterparty for this channel.
31617 * Will be `None` for channels constructed on LDK versions prior to 0.0.110 and always `Some`
31620 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
31622 MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31625 * Used by [`ChannelManager`] deserialization to broadcast the latest holder state if its copy
31626 * of the channel state was out-of-date.
31628 * You may also use this to broadcast the latest local commitment transaction, either because
31629 * a monitor update failed or because we've fallen behind (i.e. we've received proof that our
31630 * counterparty side knows a revocation secret we gave them that they shouldn't know).
31632 * Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty
31633 * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
31634 * close channel with their commitment transaction after a substantial amount of time. Best
31635 * may be to contact the other node operator out-of-band to coordinate other options available
31638 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
31640 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);
31643 * Processes transactions in a newly connected block, which may result in any of the following:
31644 * - update the monitor's state against resolved HTLCs
31645 * - punish the counterparty in the case of seeing a revoked commitment transaction
31646 * - force close the channel and claim/timeout incoming/outgoing HTLCs if near expiration
31647 * - detect settled outputs for later spending
31648 * - schedule and bump any in-flight claims
31650 * Returns any new outputs to watch from `txdata`; after called, these are also included in
31651 * [`get_outputs_to_watch`].
31653 * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
31655 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, const struct LDKLogger *NONNULL_PTR logger);
31658 * Determines if the disconnected block contained any transactions of interest and updates
31661 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, const struct LDKLogger *NONNULL_PTR logger);
31664 * Processes transactions confirmed in a block with the given header and height, returning new
31665 * outputs to watch. See [`block_connected`] for details.
31667 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
31668 * blocks. See [`chain::Confirm`] for calling expectations.
31670 * [`block_connected`]: Self::block_connected
31672 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, const struct LDKLogger *NONNULL_PTR logger);
31675 * Processes a transaction that was reorganized out of the chain.
31677 * Used instead of [`block_disconnected`] by clients that are notified of transactions rather
31678 * than blocks. See [`chain::Confirm`] for calling expectations.
31680 * [`block_disconnected`]: Self::block_disconnected
31682 void ChannelMonitor_transaction_unconfirmed(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*txid)[32], struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
31685 * Updates the monitor with the current best chain tip, returning new outputs to watch. See
31686 * [`block_connected`] for details.
31688 * Used instead of [`block_connected`] by clients that are notified of transactions rather than
31689 * blocks. See [`chain::Confirm`] for calling expectations.
31691 * [`block_connected`]: Self::block_connected
31693 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, const struct LDKLogger *NONNULL_PTR logger);
31696 * Returns the set of txids that should be monitored for re-organization out of the chain.
31698 MUST_USE_RES struct LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31701 * Gets the latest best block which was connected either via the [`chain::Listen`] or
31702 * [`chain::Confirm`] interfaces.
31704 MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31707 * Triggers rebroadcasts/fee-bumps of pending claims from a force-closed channel. This is
31708 * crucial in preventing certain classes of pinning attacks, detecting substantial mempool
31709 * feerate changes between blocks, and ensuring reliability if broadcasting fails. We recommend
31710 * invoking this every 30 seconds, or lower if running in an environment with spotty
31711 * connections, like on mobile.
31713 void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger);
31716 * Returns the descriptors for relevant outputs (i.e., those that we can spend) within the
31717 * transaction if they exist and the transaction has at least [`ANTI_REORG_DELAY`]
31718 * confirmations. For [`SpendableOutputDescriptor::DelayedPaymentOutput`] descriptors to be
31719 * returned, the transaction must have at least `max(ANTI_REORG_DELAY, to_self_delay)`
31722 * Descriptors returned by this method are primarily exposed via [`Event::SpendableOutputs`]
31723 * once they are no longer under reorg risk. This method serves as a way to retrieve these
31724 * descriptors at a later time, either for historical purposes, or to replay any
31725 * missed/unhandled descriptors. For the purpose of gathering historical records, if the
31726 * channel close has fully resolved (i.e., [`ChannelMonitor::get_claimable_balances`] returns
31727 * an empty set), you can retrieve all spendable outputs by providing all descendant spending
31728 * transactions starting from the channel's funding transaction and going down three levels.
31730 * `tx` is a transaction we'll scan the outputs of. Any transaction can be provided. If any
31731 * outputs which can be spent by us are found, at least one descriptor is returned.
31733 * `confirmation_height` must be the height of the block in which `tx` was included in.
31735 MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height);
31738 * Gets the balances in this channel which are either claimable by us if we were to
31739 * force-close the channel now or which are claimable on-chain (possibly awaiting
31742 * Any balances in the channel which are available on-chain (excluding on-chain fees) are
31743 * included here until an [`Event::SpendableOutputs`] event has been generated for the
31744 * balance, or until our counterparty has claimed the balance and accrued several
31745 * confirmations on the claim transaction.
31747 * Note that for `ChannelMonitors` which track a channel which went on-chain with versions of
31748 * LDK prior to 0.0.111, not all or excess balances may be included.
31750 * See [`Balance`] for additional details on the types of claimable balances which
31751 * may be returned here and their meanings.
31753 MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg);
31756 * Read a C2Tuple_ThirtyTwoBytesChannelMonitorZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelMonitorZ_write
31758 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b);
31761 * Frees any resources used by the OutPoint, if is_owned is set and inner is non-NULL.
31763 void OutPoint_free(struct LDKOutPoint this_obj);
31766 * The referenced transaction's txid.
31768 const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32];
31771 * The referenced transaction's txid.
31773 void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31776 * The index of the referenced output in its transaction's vout.
31778 uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr);
31781 * The index of the referenced output in its transaction's vout.
31783 void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val);
31786 * Constructs a new OutPoint given each field
31788 MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
31791 * Creates a copy of the OutPoint
31793 struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig);
31796 * Checks if two OutPoints contain equal inner contents.
31797 * This ignores pointers and is_owned flags and looks at the values in fields.
31798 * Two objects with NULL inner values will be considered "equal" here.
31800 bool OutPoint_eq(const struct LDKOutPoint *NONNULL_PTR a, const struct LDKOutPoint *NONNULL_PTR b);
31803 * Generates a non-cryptographic 64-bit hash of the OutPoint.
31805 uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o);
31808 * Convert an `OutPoint` to a lightning channel id.
31810 MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg);
31813 * Serialize the OutPoint object into a byte array which can be read by OutPoint_read
31815 struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj);
31818 * Read a OutPoint from a byte array, created by OutPoint_write
31820 struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser);
31823 * Frees any resources used by the InboundHTLCErr, if is_owned is set and inner is non-NULL.
31825 void InboundHTLCErr_free(struct LDKInboundHTLCErr this_obj);
31828 * BOLT 4 error code.
31830 uint16_t InboundHTLCErr_get_err_code(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
31833 * BOLT 4 error code.
31835 void InboundHTLCErr_set_err_code(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, uint16_t val);
31838 * Data attached to this error.
31840 * Returns a copy of the field.
31842 struct LDKCVec_u8Z InboundHTLCErr_get_err_data(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
31845 * Data attached to this error.
31847 void InboundHTLCErr_set_err_data(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
31850 * Error message text.
31852 struct LDKStr InboundHTLCErr_get_msg(const struct LDKInboundHTLCErr *NONNULL_PTR this_ptr);
31855 * Error message text.
31857 void InboundHTLCErr_set_msg(struct LDKInboundHTLCErr *NONNULL_PTR this_ptr, struct LDKStr val);
31860 * Constructs a new InboundHTLCErr given each field
31862 MUST_USE_RES struct LDKInboundHTLCErr InboundHTLCErr_new(uint16_t err_code_arg, struct LDKCVec_u8Z err_data_arg, struct LDKStr msg_arg);
31865 * Peel one layer off an incoming onion, returning a [`PendingHTLCInfo`] that contains information
31866 * about the intended next-hop for the HTLC.
31868 * This does all the relevant context-free checks that LDK requires for payment relay or
31869 * acceptance. If the payment is to be received, and the amount matches the expected amount for
31870 * a given invoice, this indicates the [`msgs::UpdateAddHTLC`], once fully committed in the
31871 * channel, will generate an [`Event::PaymentClaimable`].
31873 * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
31875 struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(const struct LDKUpdateAddHTLC *NONNULL_PTR msg, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKLogger *NONNULL_PTR logger, uint32_t cur_height, bool accept_mpp_keysend, bool allow_skimmed_fees);
31878 * Frees any resources used by the PendingHTLCRouting
31880 void PendingHTLCRouting_free(struct LDKPendingHTLCRouting this_ptr);
31883 * Creates a copy of the PendingHTLCRouting
31885 struct LDKPendingHTLCRouting PendingHTLCRouting_clone(const struct LDKPendingHTLCRouting *NONNULL_PTR orig);
31888 * Utility method to constructs a new Forward-variant PendingHTLCRouting
31890 struct LDKPendingHTLCRouting PendingHTLCRouting_forward(struct LDKOnionPacket onion_packet, uint64_t short_channel_id, struct LDKBlindedForward blinded);
31893 * Utility method to constructs a new Receive-variant PendingHTLCRouting
31895 struct LDKPendingHTLCRouting PendingHTLCRouting_receive(struct LDKFinalOnionHopData payment_data, struct LDKCOption_CVec_u8ZZ payment_metadata, uint32_t incoming_cltv_expiry, struct LDKThirtyTwoBytes phantom_shared_secret, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error);
31898 * Utility method to constructs a new ReceiveKeysend-variant PendingHTLCRouting
31900 struct LDKPendingHTLCRouting PendingHTLCRouting_receive_keysend(struct LDKFinalOnionHopData payment_data, struct LDKThirtyTwoBytes payment_preimage, struct LDKCOption_CVec_u8ZZ payment_metadata, uint32_t incoming_cltv_expiry, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
31903 * Frees any resources used by the BlindedForward, if is_owned is set and inner is non-NULL.
31905 void BlindedForward_free(struct LDKBlindedForward this_obj);
31908 * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
31909 * onion payload if we're the introduction node. Useful for calculating the next hop's
31910 * [`msgs::UpdateAddHTLC::blinding_point`].
31912 struct LDKPublicKey BlindedForward_get_inbound_blinding_point(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
31915 * The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
31916 * onion payload if we're the introduction node. Useful for calculating the next hop's
31917 * [`msgs::UpdateAddHTLC::blinding_point`].
31919 void BlindedForward_set_inbound_blinding_point(struct LDKBlindedForward *NONNULL_PTR this_ptr, struct LDKPublicKey val);
31922 * If needed, this determines how this HTLC should be failed backwards, based on whether we are
31923 * the introduction node.
31925 enum LDKBlindedFailure BlindedForward_get_failure(const struct LDKBlindedForward *NONNULL_PTR this_ptr);
31928 * If needed, this determines how this HTLC should be failed backwards, based on whether we are
31929 * the introduction node.
31931 void BlindedForward_set_failure(struct LDKBlindedForward *NONNULL_PTR this_ptr, enum LDKBlindedFailure val);
31934 * Constructs a new BlindedForward given each field
31936 MUST_USE_RES struct LDKBlindedForward BlindedForward_new(struct LDKPublicKey inbound_blinding_point_arg, enum LDKBlindedFailure failure_arg);
31939 * Creates a copy of the BlindedForward
31941 struct LDKBlindedForward BlindedForward_clone(const struct LDKBlindedForward *NONNULL_PTR orig);
31944 * Generates a non-cryptographic 64-bit hash of the BlindedForward.
31946 uint64_t BlindedForward_hash(const struct LDKBlindedForward *NONNULL_PTR o);
31949 * Checks if two BlindedForwards contain equal inner contents.
31950 * This ignores pointers and is_owned flags and looks at the values in fields.
31951 * Two objects with NULL inner values will be considered "equal" here.
31953 bool BlindedForward_eq(const struct LDKBlindedForward *NONNULL_PTR a, const struct LDKBlindedForward *NONNULL_PTR b);
31956 * Frees any resources used by the PendingHTLCInfo, if is_owned is set and inner is non-NULL.
31958 void PendingHTLCInfo_free(struct LDKPendingHTLCInfo this_obj);
31961 * Further routing details based on whether the HTLC is being forwarded or received.
31963 struct LDKPendingHTLCRouting PendingHTLCInfo_get_routing(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
31966 * Further routing details based on whether the HTLC is being forwarded or received.
31968 void PendingHTLCInfo_set_routing(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKPendingHTLCRouting val);
31971 * The onion shared secret we build with the sender used to decrypt the onion.
31973 * This is later used to encrypt failure packets in the event that the HTLC is failed.
31975 const uint8_t (*PendingHTLCInfo_get_incoming_shared_secret(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
31978 * The onion shared secret we build with the sender used to decrypt the onion.
31980 * This is later used to encrypt failure packets in the event that the HTLC is failed.
31982 void PendingHTLCInfo_set_incoming_shared_secret(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31985 * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
31987 const uint8_t (*PendingHTLCInfo_get_payment_hash(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr))[32];
31990 * Hash of the payment preimage, to lock the payment until the receiver releases the preimage.
31992 void PendingHTLCInfo_set_payment_hash(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
31995 * Amount received in the incoming HTLC.
31997 * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
32000 struct LDKCOption_u64Z PendingHTLCInfo_get_incoming_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
32003 * Amount received in the incoming HTLC.
32005 * This field was added in LDK 0.0.113 and will be `None` for objects written by prior
32008 void PendingHTLCInfo_set_incoming_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32011 * The amount the sender indicated should be forwarded on to the next hop or amount the sender
32012 * intended for us to receive for received payments.
32014 * If the received amount is less than this for received payments, an intermediary hop has
32015 * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
32016 * it along another path).
32018 * Because nodes can take less than their required fees, and because senders may wish to
32019 * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
32020 * received payments. In such cases, recipients must handle this HTLC as if it had received
32021 * [`Self::outgoing_amt_msat`].
32023 uint64_t PendingHTLCInfo_get_outgoing_amt_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
32026 * The amount the sender indicated should be forwarded on to the next hop or amount the sender
32027 * intended for us to receive for received payments.
32029 * If the received amount is less than this for received payments, an intermediary hop has
32030 * attempted to steal some of our funds and we should fail the HTLC (the sender should retry
32031 * it along another path).
32033 * Because nodes can take less than their required fees, and because senders may wish to
32034 * improve their own privacy, this amount may be less than [`Self::incoming_amt_msat`] for
32035 * received payments. In such cases, recipients must handle this HTLC as if it had received
32036 * [`Self::outgoing_amt_msat`].
32038 void PendingHTLCInfo_set_outgoing_amt_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint64_t val);
32041 * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
32042 * should have been set on the received HTLC for received payments).
32044 uint32_t PendingHTLCInfo_get_outgoing_cltv_value(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
32047 * The CLTV the sender has indicated we should set on the forwarded HTLC (or has indicated
32048 * should have been set on the received HTLC for received payments).
32050 void PendingHTLCInfo_set_outgoing_cltv_value(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, uint32_t val);
32053 * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
32055 * If this is a payment for forwarding, this is the fee we are taking before forwarding the
32058 * If this is a received payment, this is the fee that our counterparty took.
32060 * This is used to allow LSPs to take fees as a part of payments, without the sender having to
32063 struct LDKCOption_u64Z PendingHTLCInfo_get_skimmed_fee_msat(const struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr);
32066 * The fee taken for this HTLC in addition to the standard protocol HTLC fees.
32068 * If this is a payment for forwarding, this is the fee we are taking before forwarding the
32071 * If this is a received payment, this is the fee that our counterparty took.
32073 * This is used to allow LSPs to take fees as a part of payments, without the sender having to
32076 void PendingHTLCInfo_set_skimmed_fee_msat(struct LDKPendingHTLCInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32079 * Constructs a new PendingHTLCInfo given each field
32081 MUST_USE_RES struct LDKPendingHTLCInfo PendingHTLCInfo_new(struct LDKPendingHTLCRouting routing_arg, struct LDKThirtyTwoBytes incoming_shared_secret_arg, struct LDKThirtyTwoBytes payment_hash_arg, struct LDKCOption_u64Z incoming_amt_msat_arg, uint64_t outgoing_amt_msat_arg, uint32_t outgoing_cltv_value_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg);
32084 * Creates a copy of the PendingHTLCInfo
32086 struct LDKPendingHTLCInfo PendingHTLCInfo_clone(const struct LDKPendingHTLCInfo *NONNULL_PTR orig);
32089 * Creates a copy of the BlindedFailure
32091 enum LDKBlindedFailure BlindedFailure_clone(const enum LDKBlindedFailure *NONNULL_PTR orig);
32094 * Utility method to constructs a new FromIntroductionNode-variant BlindedFailure
32096 enum LDKBlindedFailure BlindedFailure_from_introduction_node(void);
32099 * Utility method to constructs a new FromBlindedNode-variant BlindedFailure
32101 enum LDKBlindedFailure BlindedFailure_from_blinded_node(void);
32104 * Generates a non-cryptographic 64-bit hash of the BlindedFailure.
32106 uint64_t BlindedFailure_hash(const enum LDKBlindedFailure *NONNULL_PTR o);
32109 * Checks if two BlindedFailures contain equal inner contents.
32110 * This ignores pointers and is_owned flags and looks at the values in fields.
32112 bool BlindedFailure_eq(const enum LDKBlindedFailure *NONNULL_PTR a, const enum LDKBlindedFailure *NONNULL_PTR b);
32115 * Frees any resources used by the FailureCode
32117 void FailureCode_free(struct LDKFailureCode this_ptr);
32120 * Creates a copy of the FailureCode
32122 struct LDKFailureCode FailureCode_clone(const struct LDKFailureCode *NONNULL_PTR orig);
32125 * Utility method to constructs a new TemporaryNodeFailure-variant FailureCode
32127 struct LDKFailureCode FailureCode_temporary_node_failure(void);
32130 * Utility method to constructs a new RequiredNodeFeatureMissing-variant FailureCode
32132 struct LDKFailureCode FailureCode_required_node_feature_missing(void);
32135 * Utility method to constructs a new IncorrectOrUnknownPaymentDetails-variant FailureCode
32137 struct LDKFailureCode FailureCode_incorrect_or_unknown_payment_details(void);
32140 * Utility method to constructs a new InvalidOnionPayload-variant FailureCode
32142 struct LDKFailureCode FailureCode_invalid_onion_payload(struct LDKCOption_C2Tuple_u64u16ZZ a);
32145 * Frees any resources used by the ChannelManager, if is_owned is set and inner is non-NULL.
32147 void ChannelManager_free(struct LDKChannelManager this_obj);
32150 * Frees any resources used by the ChainParameters, if is_owned is set and inner is non-NULL.
32152 void ChainParameters_free(struct LDKChainParameters this_obj);
32155 * The network for determining the `chain_hash` in Lightning messages.
32157 enum LDKNetwork ChainParameters_get_network(const struct LDKChainParameters *NONNULL_PTR this_ptr);
32160 * The network for determining the `chain_hash` in Lightning messages.
32162 void ChainParameters_set_network(struct LDKChainParameters *NONNULL_PTR this_ptr, enum LDKNetwork val);
32165 * The hash and height of the latest block successfully connected.
32167 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
32169 struct LDKBestBlock ChainParameters_get_best_block(const struct LDKChainParameters *NONNULL_PTR this_ptr);
32172 * The hash and height of the latest block successfully connected.
32174 * Used to track on-chain channel funding outputs and send payments with reliable timelocks.
32176 void ChainParameters_set_best_block(struct LDKChainParameters *NONNULL_PTR this_ptr, struct LDKBestBlock val);
32179 * Constructs a new ChainParameters given each field
32181 MUST_USE_RES struct LDKChainParameters ChainParameters_new(enum LDKNetwork network_arg, struct LDKBestBlock best_block_arg);
32184 * Creates a copy of the ChainParameters
32186 struct LDKChainParameters ChainParameters_clone(const struct LDKChainParameters *NONNULL_PTR orig);
32189 * Frees any resources used by the CounterpartyForwardingInfo, if is_owned is set and inner is non-NULL.
32191 void CounterpartyForwardingInfo_free(struct LDKCounterpartyForwardingInfo this_obj);
32194 * Base routing fee in millisatoshis.
32196 uint32_t CounterpartyForwardingInfo_get_fee_base_msat(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
32199 * Base routing fee in millisatoshis.
32201 void CounterpartyForwardingInfo_set_fee_base_msat(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
32204 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
32206 uint32_t CounterpartyForwardingInfo_get_fee_proportional_millionths(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
32209 * Amount in millionths of a satoshi the channel will charge per transferred satoshi.
32211 void CounterpartyForwardingInfo_set_fee_proportional_millionths(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint32_t val);
32214 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
32215 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
32216 * `cltv_expiry_delta` for more details.
32218 uint16_t CounterpartyForwardingInfo_get_cltv_expiry_delta(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr);
32221 * The minimum difference in cltv_expiry between an ingoing HTLC and its outgoing counterpart,
32222 * such that the outgoing HTLC is forwardable to this counterparty. See `msgs::ChannelUpdate`'s
32223 * `cltv_expiry_delta` for more details.
32225 void CounterpartyForwardingInfo_set_cltv_expiry_delta(struct LDKCounterpartyForwardingInfo *NONNULL_PTR this_ptr, uint16_t val);
32228 * Constructs a new CounterpartyForwardingInfo given each field
32230 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);
32233 * Creates a copy of the CounterpartyForwardingInfo
32235 struct LDKCounterpartyForwardingInfo CounterpartyForwardingInfo_clone(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR orig);
32238 * Frees any resources used by the ChannelCounterparty, if is_owned is set and inner is non-NULL.
32240 void ChannelCounterparty_free(struct LDKChannelCounterparty this_obj);
32243 * The node_id of our counterparty
32245 struct LDKPublicKey ChannelCounterparty_get_node_id(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
32248 * The node_id of our counterparty
32250 void ChannelCounterparty_set_node_id(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKPublicKey val);
32253 * The Features the channel counterparty provided upon last connection.
32254 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
32255 * many routing-relevant features are present in the init context.
32257 struct LDKInitFeatures ChannelCounterparty_get_features(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
32260 * The Features the channel counterparty provided upon last connection.
32261 * Useful for routing as it is the most up-to-date copy of the counterparty's features and
32262 * many routing-relevant features are present in the init context.
32264 void ChannelCounterparty_set_features(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
32267 * The value, in satoshis, that must always be held in the channel for our counterparty. This
32268 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
32269 * claiming at least this value on chain.
32271 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
32273 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
32275 uint64_t ChannelCounterparty_get_unspendable_punishment_reserve(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
32278 * The value, in satoshis, that must always be held in the channel for our counterparty. This
32279 * value ensures that if our counterparty broadcasts a revoked state, we can punish them by
32280 * claiming at least this value on chain.
32282 * This value is not included in [`inbound_capacity_msat`] as it can never be spent.
32284 * [`inbound_capacity_msat`]: ChannelDetails::inbound_capacity_msat
32286 void ChannelCounterparty_set_unspendable_punishment_reserve(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, uint64_t val);
32289 * Information on the fees and requirements that the counterparty requires when forwarding
32290 * payments to us through this channel.
32292 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32294 struct LDKCounterpartyForwardingInfo ChannelCounterparty_get_forwarding_info(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
32297 * Information on the fees and requirements that the counterparty requires when forwarding
32298 * payments to us through this channel.
32300 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32302 void ChannelCounterparty_set_forwarding_info(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCounterpartyForwardingInfo val);
32305 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
32306 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
32307 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
32309 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_minimum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
32312 * The smallest value HTLC (in msat) the remote peer will accept, for this channel. This field
32313 * is only `None` before we have received either the `OpenChannel` or `AcceptChannel` message
32314 * from the remote peer, or for `ChannelCounterparty` objects serialized prior to LDK 0.0.107.
32316 void ChannelCounterparty_set_outbound_htlc_minimum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32319 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
32321 struct LDKCOption_u64Z ChannelCounterparty_get_outbound_htlc_maximum_msat(const struct LDKChannelCounterparty *NONNULL_PTR this_ptr);
32324 * The largest value HTLC (in msat) the remote peer currently will accept, for this channel.
32326 void ChannelCounterparty_set_outbound_htlc_maximum_msat(struct LDKChannelCounterparty *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32329 * Constructs a new ChannelCounterparty given each field
32331 * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32333 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);
32336 * Creates a copy of the ChannelCounterparty
32338 struct LDKChannelCounterparty ChannelCounterparty_clone(const struct LDKChannelCounterparty *NONNULL_PTR orig);
32341 * Frees any resources used by the ChannelDetails, if is_owned is set and inner is non-NULL.
32343 void ChannelDetails_free(struct LDKChannelDetails this_obj);
32346 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
32347 * thereafter this is the txid of the funding transaction xor the funding transaction output).
32348 * Note that this means this value is *not* persistent - it can change once during the
32349 * lifetime of the channel.
32351 const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32];
32354 * The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
32355 * thereafter this is the txid of the funding transaction xor the funding transaction output).
32356 * Note that this means this value is *not* persistent - it can change once during the
32357 * lifetime of the channel.
32359 void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
32362 * Parameters which apply to our counterparty. See individual fields for more information.
32364 struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32367 * Parameters which apply to our counterparty. See individual fields for more information.
32369 void ChannelDetails_set_counterparty(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelCounterparty val);
32372 * The Channel's funding transaction output, if we've negotiated the funding transaction with
32373 * our counterparty already.
32375 * Note that, if this has been set, `channel_id` will be equivalent to
32376 * `funding_txo.unwrap().to_channel_id()`.
32378 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32380 struct LDKOutPoint ChannelDetails_get_funding_txo(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32383 * The Channel's funding transaction output, if we've negotiated the funding transaction with
32384 * our counterparty already.
32386 * Note that, if this has been set, `channel_id` will be equivalent to
32387 * `funding_txo.unwrap().to_channel_id()`.
32389 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32391 void ChannelDetails_set_funding_txo(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKOutPoint val);
32394 * The features which this channel operates with. See individual features for more info.
32396 * `None` until negotiation completes and the channel type is finalized.
32398 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32400 struct LDKChannelTypeFeatures ChannelDetails_get_channel_type(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32403 * The features which this channel operates with. See individual features for more info.
32405 * `None` until negotiation completes and the channel type is finalized.
32407 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32409 void ChannelDetails_set_channel_type(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
32412 * The position of the funding transaction in the chain. None if the funding transaction has
32413 * not yet been confirmed and the channel fully opened.
32415 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
32416 * payments instead of this. See [`get_inbound_payment_scid`].
32418 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
32419 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
32421 * [`inbound_scid_alias`]: Self::inbound_scid_alias
32422 * [`outbound_scid_alias`]: Self::outbound_scid_alias
32423 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
32424 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
32425 * [`confirmations_required`]: Self::confirmations_required
32427 struct LDKCOption_u64Z ChannelDetails_get_short_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32430 * The position of the funding transaction in the chain. None if the funding transaction has
32431 * not yet been confirmed and the channel fully opened.
32433 * Note that if [`inbound_scid_alias`] is set, it must be used for invoices and inbound
32434 * payments instead of this. See [`get_inbound_payment_scid`].
32436 * For channels with [`confirmations_required`] set to `Some(0)`, [`outbound_scid_alias`] may
32437 * be used in place of this in outbound routes. See [`get_outbound_payment_scid`].
32439 * [`inbound_scid_alias`]: Self::inbound_scid_alias
32440 * [`outbound_scid_alias`]: Self::outbound_scid_alias
32441 * [`get_inbound_payment_scid`]: Self::get_inbound_payment_scid
32442 * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid
32443 * [`confirmations_required`]: Self::confirmations_required
32445 void ChannelDetails_set_short_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32448 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
32449 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
32450 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
32453 * This will be `None` as long as the channel is not available for routing outbound payments.
32455 * [`short_channel_id`]: Self::short_channel_id
32456 * [`confirmations_required`]: Self::confirmations_required
32458 struct LDKCOption_u64Z ChannelDetails_get_outbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32461 * An optional [`short_channel_id`] alias for this channel, randomly generated by us and
32462 * usable in place of [`short_channel_id`] to reference the channel in outbound routes when
32463 * the channel has not yet been confirmed (as long as [`confirmations_required`] is
32466 * This will be `None` as long as the channel is not available for routing outbound payments.
32468 * [`short_channel_id`]: Self::short_channel_id
32469 * [`confirmations_required`]: Self::confirmations_required
32471 void ChannelDetails_set_outbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32474 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
32475 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
32476 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
32477 * when they see a payment to be routed to us.
32479 * Our counterparty may choose to rotate this value at any time, though will always recognize
32480 * previous values for inbound payment forwarding.
32482 * [`short_channel_id`]: Self::short_channel_id
32484 struct LDKCOption_u64Z ChannelDetails_get_inbound_scid_alias(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32487 * An optional [`short_channel_id`] alias for this channel, randomly generated by our
32488 * counterparty and usable in place of [`short_channel_id`] in invoice route hints. Our
32489 * counterparty will recognize the alias provided here in place of the [`short_channel_id`]
32490 * when they see a payment to be routed to us.
32492 * Our counterparty may choose to rotate this value at any time, though will always recognize
32493 * previous values for inbound payment forwarding.
32495 * [`short_channel_id`]: Self::short_channel_id
32497 void ChannelDetails_set_inbound_scid_alias(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32500 * The value, in satoshis, of this channel as appears in the funding output
32502 uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32505 * The value, in satoshis, of this channel as appears in the funding output
32507 void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
32510 * The value, in satoshis, that must always be held in the channel for us. This value ensures
32511 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
32512 * this value on chain.
32514 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
32516 * This value will be `None` for outbound channels until the counterparty accepts the channel.
32518 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
32520 struct LDKCOption_u64Z ChannelDetails_get_unspendable_punishment_reserve(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32523 * The value, in satoshis, that must always be held in the channel for us. This value ensures
32524 * that if we broadcast a revoked state, our counterparty can punish us by claiming at least
32525 * this value on chain.
32527 * This value is not included in [`outbound_capacity_msat`] as it can never be spent.
32529 * This value will be `None` for outbound channels until the counterparty accepts the channel.
32531 * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat
32533 void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32536 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
32537 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
32538 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
32539 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
32540 * serialized with LDK versions prior to 0.0.113.
32542 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
32543 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
32544 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
32546 struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32549 * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound
32550 * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if
32551 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
32552 * `user_channel_id` will be randomized for an inbound channel. This may be zero for objects
32553 * serialized with LDK versions prior to 0.0.113.
32555 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
32556 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
32557 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
32559 void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val);
32562 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
32563 * which is applied to commitment and HTLC transactions.
32565 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
32567 struct LDKCOption_u32Z ChannelDetails_get_feerate_sat_per_1000_weight(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32570 * The currently negotiated fee rate denominated in satoshi per 1000 weight units,
32571 * which is applied to commitment and HTLC transactions.
32573 * This value will be `None` for objects serialized with LDK versions prior to 0.0.115.
32575 void ChannelDetails_set_feerate_sat_per_1000_weight(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
32578 * Our total balance. This is the amount we would get if we close the channel.
32579 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
32580 * amount is not likely to be recoverable on close.
32582 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
32583 * balance is not available for inclusion in new outbound HTLCs). This further does not include
32584 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
32585 * This does not consider any on-chain fees.
32587 * See also [`ChannelDetails::outbound_capacity_msat`]
32589 uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32592 * Our total balance. This is the amount we would get if we close the channel.
32593 * This value is not exact. Due to various in-flight changes and feerate changes, exactly this
32594 * amount is not likely to be recoverable on close.
32596 * This does not include any pending HTLCs which are not yet fully resolved (and, thus, whose
32597 * balance is not available for inclusion in new outbound HTLCs). This further does not include
32598 * any pending outgoing HTLCs which are awaiting some other resolution to be sent.
32599 * This does not consider any on-chain fees.
32601 * See also [`ChannelDetails::outbound_capacity_msat`]
32603 void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
32606 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
32607 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
32608 * available for inclusion in new outbound HTLCs). This further does not include any pending
32609 * outgoing HTLCs which are awaiting some other resolution to be sent.
32611 * See also [`ChannelDetails::balance_msat`]
32613 * This value is not exact. Due to various in-flight changes, feerate changes, and our
32614 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
32615 * should be able to spend nearly this amount.
32617 uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32620 * The available outbound capacity for sending HTLCs to the remote peer. This does not include
32621 * any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
32622 * available for inclusion in new outbound HTLCs). This further does not include any pending
32623 * outgoing HTLCs which are awaiting some other resolution to be sent.
32625 * See also [`ChannelDetails::balance_msat`]
32627 * This value is not exact. Due to various in-flight changes, feerate changes, and our
32628 * conflict-avoidance policy, exactly this amount is not likely to be spendable. However, we
32629 * should be able to spend nearly this amount.
32631 void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
32634 * The available outbound capacity for sending a single HTLC to the remote peer. This is
32635 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
32636 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
32637 * to use a limit as close as possible to the HTLC limit we can currently send.
32639 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
32640 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
32642 uint64_t ChannelDetails_get_next_outbound_htlc_limit_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32645 * The available outbound capacity for sending a single HTLC to the remote peer. This is
32646 * similar to [`ChannelDetails::outbound_capacity_msat`] but it may be further restricted by
32647 * the current state and per-HTLC limit(s). This is intended for use when routing, allowing us
32648 * to use a limit as close as possible to the HTLC limit we can currently send.
32650 * See also [`ChannelDetails::next_outbound_htlc_minimum_msat`],
32651 * [`ChannelDetails::balance_msat`], and [`ChannelDetails::outbound_capacity_msat`].
32653 void ChannelDetails_set_next_outbound_htlc_limit_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
32656 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
32657 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
32658 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
32659 * route which is valid.
32661 uint64_t ChannelDetails_get_next_outbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32664 * The minimum value for sending a single HTLC to the remote peer. This is the equivalent of
32665 * [`ChannelDetails::next_outbound_htlc_limit_msat`] but represents a lower-bound, rather than
32666 * an upper-bound. This is intended for use when routing, allowing us to ensure we pick a
32667 * route which is valid.
32669 void ChannelDetails_set_next_outbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
32672 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
32673 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
32674 * available for inclusion in new inbound HTLCs).
32675 * Note that there are some corner cases not fully handled here, so the actual available
32676 * inbound capacity may be slightly higher than this.
32678 * This value is not exact. Due to various in-flight changes, feerate changes, and our
32679 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
32680 * However, our counterparty should be able to spend nearly this amount.
32682 uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32685 * The available inbound capacity for the remote peer to send HTLCs to us. This does not
32686 * include any pending HTLCs which are not yet fully resolved (and, thus, whose balance is not
32687 * available for inclusion in new inbound HTLCs).
32688 * Note that there are some corner cases not fully handled here, so the actual available
32689 * inbound capacity may be slightly higher than this.
32691 * This value is not exact. Due to various in-flight changes, feerate changes, and our
32692 * counterparty's conflict-avoidance policy, exactly this amount is not likely to be spendable.
32693 * However, our counterparty should be able to spend nearly this amount.
32695 void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val);
32698 * The number of required confirmations on the funding transaction before the funding will be
32699 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
32700 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
32701 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
32702 * [`ChannelHandshakeLimits::max_minimum_depth`].
32704 * This value will be `None` for outbound channels until the counterparty accepts the channel.
32706 * [`is_outbound`]: ChannelDetails::is_outbound
32707 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
32708 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
32710 struct LDKCOption_u32Z ChannelDetails_get_confirmations_required(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32713 * The number of required confirmations on the funding transaction before the funding will be
32714 * considered \"locked\". This number is selected by the channel fundee (i.e. us if
32715 * [`is_outbound`] is *not* set), and can be selected for inbound channels with
32716 * [`ChannelHandshakeConfig::minimum_depth`] or limited for outbound channels with
32717 * [`ChannelHandshakeLimits::max_minimum_depth`].
32719 * This value will be `None` for outbound channels until the counterparty accepts the channel.
32721 * [`is_outbound`]: ChannelDetails::is_outbound
32722 * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth
32723 * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth
32725 void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
32728 * The current number of confirmations on the funding transaction.
32730 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
32732 struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32735 * The current number of confirmations on the funding transaction.
32737 * This value will be `None` for objects serialized with LDK versions prior to 0.0.113.
32739 void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
32742 * The number of blocks (after our commitment transaction confirms) that we will need to wait
32743 * until we can claim our funds after we force-close the channel. During this time our
32744 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
32745 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
32746 * time to claim our non-HTLC-encumbered funds.
32748 * This value will be `None` for outbound channels until the counterparty accepts the channel.
32750 struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32753 * The number of blocks (after our commitment transaction confirms) that we will need to wait
32754 * until we can claim our funds after we force-close the channel. During this time our
32755 * counterparty is allowed to punish us if we broadcasted a stale state. If our counterparty
32756 * force-closes the channel and broadcasts a commitment transaction we do not have to wait any
32757 * time to claim our non-HTLC-encumbered funds.
32759 * This value will be `None` for outbound channels until the counterparty accepts the channel.
32761 void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val);
32764 * True if the channel was initiated (and thus funded) by us.
32766 bool ChannelDetails_get_is_outbound(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32769 * True if the channel was initiated (and thus funded) by us.
32771 void ChannelDetails_set_is_outbound(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
32774 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
32775 * channel is not currently being shut down. `channel_ready` message exchange implies the
32776 * required confirmation count has been reached (and we were connected to the peer at some
32777 * point after the funding transaction received enough confirmations). The required
32778 * confirmation count is provided in [`confirmations_required`].
32780 * [`confirmations_required`]: ChannelDetails::confirmations_required
32782 bool ChannelDetails_get_is_channel_ready(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32785 * True if the channel is confirmed, channel_ready messages have been exchanged, and the
32786 * channel is not currently being shut down. `channel_ready` message exchange implies the
32787 * required confirmation count has been reached (and we were connected to the peer at some
32788 * point after the funding transaction received enough confirmations). The required
32789 * confirmation count is provided in [`confirmations_required`].
32791 * [`confirmations_required`]: ChannelDetails::confirmations_required
32793 void ChannelDetails_set_is_channel_ready(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
32796 * The stage of the channel's shutdown.
32797 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
32799 * Returns a copy of the field.
32801 struct LDKCOption_ChannelShutdownStateZ ChannelDetails_get_channel_shutdown_state(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32804 * The stage of the channel's shutdown.
32805 * `None` for `ChannelDetails` serialized on LDK versions prior to 0.0.116.
32807 void ChannelDetails_set_channel_shutdown_state(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_ChannelShutdownStateZ val);
32810 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
32811 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
32813 * This is a strict superset of `is_channel_ready`.
32815 bool ChannelDetails_get_is_usable(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32818 * True if the channel is (a) confirmed and channel_ready messages have been exchanged, (b)
32819 * the peer is connected, and (c) the channel is not currently negotiating a shutdown.
32821 * This is a strict superset of `is_channel_ready`.
32823 void ChannelDetails_set_is_usable(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
32826 * True if this channel is (or will be) publicly-announced.
32828 bool ChannelDetails_get_is_public(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32831 * True if this channel is (or will be) publicly-announced.
32833 void ChannelDetails_set_is_public(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val);
32836 * The smallest value HTLC (in msat) we will accept, for this channel. This field
32837 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
32839 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_minimum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32842 * The smallest value HTLC (in msat) we will accept, for this channel. This field
32843 * is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.107
32845 void ChannelDetails_set_inbound_htlc_minimum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32848 * The largest value HTLC (in msat) we currently will accept, for this channel.
32850 struct LDKCOption_u64Z ChannelDetails_get_inbound_htlc_maximum_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32853 * The largest value HTLC (in msat) we currently will accept, for this channel.
32855 void ChannelDetails_set_inbound_htlc_maximum_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
32858 * Set of configurable parameters that affect channel operation.
32860 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
32862 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
32864 struct LDKChannelConfig ChannelDetails_get_config(const struct LDKChannelDetails *NONNULL_PTR this_ptr);
32867 * Set of configurable parameters that affect channel operation.
32869 * This field is only `None` for `ChannelDetails` objects serialized prior to LDK 0.0.109.
32871 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
32873 void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val);
32876 * Constructs a new ChannelDetails given each field
32878 * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32879 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32880 * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
32882 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);
32885 * Creates a copy of the ChannelDetails
32887 struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig);
32890 * Gets the current SCID which should be used to identify this channel for inbound payments.
32891 * This should be used for providing invoice hints or in any other context where our
32892 * counterparty will forward a payment to us.
32894 * This is either the [`ChannelDetails::inbound_scid_alias`], if set, or the
32895 * [`ChannelDetails::short_channel_id`]. See those for more information.
32897 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_inbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
32900 * Gets the current SCID which should be used to identify this channel for outbound payments.
32901 * This should be used in [`Route`]s to describe the first hop or in other contexts where
32902 * we're sending or forwarding a payment outbound over this channel.
32904 * This is either the [`ChannelDetails::short_channel_id`], if set, or the
32905 * [`ChannelDetails::outbound_scid_alias`]. See those for more information.
32907 MUST_USE_RES struct LDKCOption_u64Z ChannelDetails_get_outbound_payment_scid(const struct LDKChannelDetails *NONNULL_PTR this_arg);
32910 * Creates a copy of the ChannelShutdownState
32912 enum LDKChannelShutdownState ChannelShutdownState_clone(const enum LDKChannelShutdownState *NONNULL_PTR orig);
32915 * Utility method to constructs a new NotShuttingDown-variant ChannelShutdownState
32917 enum LDKChannelShutdownState ChannelShutdownState_not_shutting_down(void);
32920 * Utility method to constructs a new ShutdownInitiated-variant ChannelShutdownState
32922 enum LDKChannelShutdownState ChannelShutdownState_shutdown_initiated(void);
32925 * Utility method to constructs a new ResolvingHTLCs-variant ChannelShutdownState
32927 enum LDKChannelShutdownState ChannelShutdownState_resolving_htlcs(void);
32930 * Utility method to constructs a new NegotiatingClosingFee-variant ChannelShutdownState
32932 enum LDKChannelShutdownState ChannelShutdownState_negotiating_closing_fee(void);
32935 * Utility method to constructs a new ShutdownComplete-variant ChannelShutdownState
32937 enum LDKChannelShutdownState ChannelShutdownState_shutdown_complete(void);
32940 * Checks if two ChannelShutdownStates contain equal inner contents.
32941 * This ignores pointers and is_owned flags and looks at the values in fields.
32943 bool ChannelShutdownState_eq(const enum LDKChannelShutdownState *NONNULL_PTR a, const enum LDKChannelShutdownState *NONNULL_PTR b);
32946 * Frees any resources used by the RecentPaymentDetails
32948 void RecentPaymentDetails_free(struct LDKRecentPaymentDetails this_ptr);
32951 * Creates a copy of the RecentPaymentDetails
32953 struct LDKRecentPaymentDetails RecentPaymentDetails_clone(const struct LDKRecentPaymentDetails *NONNULL_PTR orig);
32956 * Utility method to constructs a new AwaitingInvoice-variant RecentPaymentDetails
32958 struct LDKRecentPaymentDetails RecentPaymentDetails_awaiting_invoice(struct LDKThirtyTwoBytes payment_id);
32961 * Utility method to constructs a new Pending-variant RecentPaymentDetails
32963 struct LDKRecentPaymentDetails RecentPaymentDetails_pending(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, uint64_t total_msat);
32966 * Utility method to constructs a new Fulfilled-variant RecentPaymentDetails
32968 struct LDKRecentPaymentDetails RecentPaymentDetails_fulfilled(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash);
32971 * Utility method to constructs a new Abandoned-variant RecentPaymentDetails
32973 struct LDKRecentPaymentDetails RecentPaymentDetails_abandoned(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash);
32976 * Frees any resources used by the PhantomRouteHints, if is_owned is set and inner is non-NULL.
32978 void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj);
32981 * The list of channels to be included in the invoice route hints.
32983 struct LDKCVec_ChannelDetailsZ PhantomRouteHints_get_channels(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
32986 * The list of channels to be included in the invoice route hints.
32988 void PhantomRouteHints_set_channels(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKCVec_ChannelDetailsZ val);
32991 * A fake scid used for representing the phantom node's fake channel in generating the invoice
32994 uint64_t PhantomRouteHints_get_phantom_scid(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
32997 * A fake scid used for representing the phantom node's fake channel in generating the invoice
33000 void PhantomRouteHints_set_phantom_scid(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, uint64_t val);
33003 * The pubkey of the real backing node that would ultimately receive the payment.
33005 struct LDKPublicKey PhantomRouteHints_get_real_node_pubkey(const struct LDKPhantomRouteHints *NONNULL_PTR this_ptr);
33008 * The pubkey of the real backing node that would ultimately receive the payment.
33010 void PhantomRouteHints_set_real_node_pubkey(struct LDKPhantomRouteHints *NONNULL_PTR this_ptr, struct LDKPublicKey val);
33013 * Constructs a new PhantomRouteHints given each field
33015 MUST_USE_RES struct LDKPhantomRouteHints PhantomRouteHints_new(struct LDKCVec_ChannelDetailsZ channels_arg, uint64_t phantom_scid_arg, struct LDKPublicKey real_node_pubkey_arg);
33018 * Creates a copy of the PhantomRouteHints
33020 struct LDKPhantomRouteHints PhantomRouteHints_clone(const struct LDKPhantomRouteHints *NONNULL_PTR orig);
33023 * Constructs a new `ChannelManager` to hold several channels and route between them.
33025 * The current time or latest block header time can be provided as the `current_timestamp`.
33027 * This is the main \"logic hub\" for all channel-related actions, and implements
33028 * [`ChannelMessageHandler`].
33030 * Non-proportional fees are fixed according to our risk using the provided fee estimator.
33032 * Users need to notify the new `ChannelManager` when a new block is connected or
33033 * disconnected using its [`block_connected`] and [`block_disconnected`] methods, starting
33034 * from after [`params.best_block.block_hash`]. See [`chain::Listen`] and [`chain::Confirm`] for
33037 * [`block_connected`]: chain::Listen::block_connected
33038 * [`block_disconnected`]: chain::Listen::block_disconnected
33039 * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
33041 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);
33044 * Gets the current configuration applied to all new channels.
33046 MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
33049 * Creates a new outbound channel to the given remote node and with the given value.
33051 * `user_channel_id` will be provided back as in
33052 * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events
33053 * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a
33054 * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it
33055 * is simply copied to events and otherwise ignored.
33057 * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is
33058 * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`.
33060 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be opened due to failing to
33061 * generate a shutdown scriptpubkey or destination script set by
33062 * [`SignerProvider::get_shutdown_scriptpubkey`] or [`SignerProvider::get_destination_script`].
33064 * Note that we do not check if you are currently connected to the given peer. If no
33065 * connection is available, the outbound `open_channel` message may fail to send, resulting in
33066 * the channel eventually being silently forgotten (dropped on reload).
33068 * If `temporary_channel_id` is specified, it will be used as the temporary channel ID of the
33069 * channel. Otherwise, a random one will be generated for you.
33071 * Returns the new Channel's temporary `channel_id`. This ID will appear as
33072 * [`Event::FundingGenerationReady::temporary_channel_id`] and in
33073 * [`ChannelDetails::channel_id`] until after
33074 * [`ChannelManager::funding_transaction_generated`] is called, swapping the Channel's ID for
33075 * one derived from the funding transaction's TXID. If the counterparty rejects the channel
33076 * immediately, this temporary ID will appear in [`Event::ChannelClosed::channel_id`].
33078 * [`Event::FundingGenerationReady::user_channel_id`]: events::Event::FundingGenerationReady::user_channel_id
33079 * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id
33080 * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id
33082 * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
33084 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesAPIErrorZ 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 LDKCOption_ThirtyTwoBytesZ temporary_channel_id, struct LDKUserConfig override_config);
33087 * Gets the list of open channels, in random order. See [`ChannelDetails`] field documentation for
33088 * more information.
33090 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
33093 * Gets the list of usable channels, in random order. Useful as an argument to
33094 * [`Router::find_route`] to ensure non-announced channels are used.
33096 * These are guaranteed to have their [`ChannelDetails::is_usable`] value set to true, see the
33097 * documentation for [`ChannelDetails::is_usable`] for more info on exactly what the criteria
33100 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg);
33103 * Gets the list of channels we have with a given counterparty, in random order.
33105 MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels_with_counterparty(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id);
33108 * Returns in an undefined order recent payments that -- if not fulfilled -- have yet to find a
33109 * successful path, or have unresolved HTLCs.
33111 * This can be useful for payments that may have been prepared, but ultimately not sent, as a
33112 * result of a crash. If such a payment exists, is not listed here, and an
33113 * [`Event::PaymentSent`] has not been received, you may consider resending the payment.
33115 * [`Event::PaymentSent`]: events::Event::PaymentSent
33117 MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg);
33120 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
33121 * will be accepted on the given channel, and after additional timeout/the closing of all
33122 * pending HTLCs, the channel will be closed on chain.
33124 * * If we are the channel initiator, we will pay between our [`ChannelCloseMinimum`] and
33125 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
33127 * * If our counterparty is the channel initiator, we will require a channel closing
33128 * transaction feerate of at least our [`ChannelCloseMinimum`] feerate or the feerate which
33129 * would appear on a force-closure transaction, whichever is lower. We will allow our
33130 * counterparty to pay as much fee as they'd like, however.
33132 * May generate a [`SendShutdown`] message event on success, which should be relayed.
33134 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
33135 * generate a shutdown scriptpubkey or destination script set by
33136 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
33139 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
33140 * [`ChannelCloseMinimum`]: crate::chain::chaininterface::ConfirmationTarget::ChannelCloseMinimum
33141 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
33142 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
33144 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);
33147 * Begins the process of closing a channel. After this call (plus some timeout), no new HTLCs
33148 * will be accepted on the given channel, and after additional timeout/the closing of all
33149 * pending HTLCs, the channel will be closed on chain.
33151 * `target_feerate_sat_per_1000_weight` has different meanings depending on if we initiated
33152 * the channel being closed or not:
33153 * * If we are the channel initiator, we will pay at least this feerate on the closing
33154 * transaction. The upper-bound is set by
33155 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`] plus our [`NonAnchorChannelFee`]
33156 * fee estimate (or `target_feerate_sat_per_1000_weight`, if it is greater).
33157 * * If our counterparty is the channel initiator, we will refuse to accept a channel closure
33158 * transaction feerate below `target_feerate_sat_per_1000_weight` (or the feerate which
33159 * will appear on a force-closure transaction, whichever is lower).
33161 * The `shutdown_script` provided will be used as the `scriptPubKey` for the closing transaction.
33162 * Will fail if a shutdown script has already been set for this channel by
33163 * ['ChannelHandshakeConfig::commit_upfront_shutdown_pubkey`]. The given shutdown script must
33164 * also be compatible with our and the counterparty's features.
33166 * May generate a [`SendShutdown`] message event on success, which should be relayed.
33168 * Raises [`APIError::ChannelUnavailable`] if the channel cannot be closed due to failing to
33169 * generate a shutdown scriptpubkey or destination script set by
33170 * [`SignerProvider::get_shutdown_scriptpubkey`]. A force-closure may be needed to close the
33173 * [`ChannelConfig::force_close_avoidance_max_fee_satoshis`]: crate::util::config::ChannelConfig::force_close_avoidance_max_fee_satoshis
33174 * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee
33175 * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown
33177 * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None
33179 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);
33182 * Force closes a channel, immediately broadcasting the latest local transaction(s) and
33183 * rejecting new HTLCs on the given channel. Fails if `channel_id` is unknown to
33184 * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding
33187 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);
33190 * Force closes a channel, rejecting new HTLCs on the given channel but skips broadcasting
33191 * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the
33192 * `counterparty_node_id` isn't the counterparty of the corresponding channel.
33194 * You can always get the latest local transaction(s) to broadcast from
33195 * [`ChannelMonitor::get_latest_holder_commitment_txn`].
33197 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);
33200 * Force close all channels, immediately broadcasting the latest local commitment transaction
33201 * for each to the chain and rejecting new HTLCs on each.
33203 void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
33206 * Force close all channels rejecting new HTLCs on each but without broadcasting the latest
33207 * local transaction(s).
33209 void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg);
33212 * Sends a payment along a given route.
33214 * Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
33215 * fields for more info.
33217 * May generate [`UpdateHTLCs`] message(s) event on success, which should be relayed (e.g. via
33218 * [`PeerManager::process_events`]).
33220 * # Avoiding Duplicate Payments
33222 * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this
33223 * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment
33224 * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an
33225 * [`Event::PaymentSent`] or [`Event::PaymentFailed`]) LDK will not stop you from sending a
33226 * second payment with the same [`PaymentId`].
33228 * Thus, in order to ensure duplicate payments are not sent, you should implement your own
33229 * tracking of payments, including state to indicate once a payment has completed. Because you
33230 * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should
33231 * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the
33232 * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes.
33234 * Additionally, in the scenario where we begin the process of sending a payment, but crash
33235 * before `send_payment` returns (or prior to [`ChannelMonitorUpdate`] persistence if you're
33236 * using [`ChannelMonitorUpdateStatus::InProgress`]), the payment may be lost on restart. See
33237 * [`ChannelManager::list_recent_payments`] for more information.
33239 * # Possible Error States on [`PaymentSendFailure`]
33241 * Each path may have a different return value, and [`PaymentSendFailure`] may return a `Vec` with
33242 * each entry matching the corresponding-index entry in the route paths, see
33243 * [`PaymentSendFailure`] for more info.
33245 * In general, a path may raise:
33246 * * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee,
33247 * node public key) is specified.
33248 * * [`APIError::ChannelUnavailable`] if the next-hop channel is not available as it has been
33249 * closed, doesn't exist, or the peer is currently disconnected.
33250 * * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
33251 * relevant updates.
33253 * Note that depending on the type of the [`PaymentSendFailure`] the HTLC may have been
33254 * irrevocably committed to on our end. In such a case, do NOT retry the payment with a
33255 * different route unless you intend to pay twice!
33257 * [`RouteHop`]: crate::routing::router::RouteHop
33258 * [`Event::PaymentSent`]: events::Event::PaymentSent
33259 * [`Event::PaymentFailed`]: events::Event::PaymentFailed
33260 * [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
33261 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
33262 * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
33264 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);
33267 * Similar to [`ChannelManager::send_payment_with_route`], but will automatically find a route based on
33268 * `route_params` and retry failed payment paths based on `retry_strategy`.
33270 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);
33273 * Signals that no further attempts for the given payment should occur. Useful if you have a
33274 * pending outbound payment with retries remaining, but wish to stop retrying the payment before
33275 * retries are exhausted.
33277 * # Event Generation
33279 * If no [`Event::PaymentFailed`] event had been generated before, one will be generated as soon
33280 * as there are no remaining pending HTLCs for this payment.
33282 * Note that calling this method does *not* prevent a payment from succeeding. You must still
33283 * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to
33284 * determine the ultimate status of a payment.
33286 * # Requested Invoices
33288 * In the case of paying a [`Bolt12Invoice`] via [`ChannelManager::pay_for_offer`], abandoning
33289 * the payment prior to receiving the invoice will result in an [`Event::InvoiceRequestFailed`]
33290 * and prevent any attempts at paying it once received. The other events may only be generated
33291 * once the invoice has been received.
33293 * # Restart Behavior
33295 * If an [`Event::PaymentFailed`] is generated and we restart without first persisting the
33296 * [`ChannelManager`], another [`Event::PaymentFailed`] may be generated; likewise for
33297 * [`Event::InvoiceRequestFailed`].
33299 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
33301 void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id);
33304 * Send a spontaneous payment, which is a payment that does not require the recipient to have
33305 * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
33306 * the preimage, it must be a cryptographically secure random value that no intermediate node
33307 * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
33308 * never reach the recipient.
33310 * See [`send_payment`] documentation for more details on the return value of this function
33311 * and idempotency guarantees provided by the [`PaymentId`] key.
33313 * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
33314 * [`send_payment`] for more information about the risks of duplicate preimage usage.
33316 * [`send_payment`]: Self::send_payment
33318 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id);
33321 * Similar to [`ChannelManager::send_spontaneous_payment`], but will automatically find a route
33322 * based on `route_params` and retry failed payment paths based on `retry_strategy`.
33324 * See [`PaymentParameters::for_keysend`] for help in constructing `route_params` for spontaneous
33327 * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend
33329 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesRetryableSendFailureZ ChannelManager_send_spontaneous_payment_with_retry(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKRecipientOnionFields recipient_onion, struct LDKThirtyTwoBytes payment_id, struct LDKRouteParameters route_params, struct LDKRetry retry_strategy);
33332 * Send a payment that is probing the given route for liquidity. We calculate the
33333 * [`PaymentHash`] of probes based on a static secret and a random [`PaymentId`], which allows
33334 * us to easily discern them from real payments.
33336 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPath path);
33339 * Sends payment probes over all paths of a route that would be used to pay the given
33340 * amount to the given `node_id`.
33342 * See [`ChannelManager::send_preflight_probes`] for more information.
33344 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_spontaneous_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id, uint64_t amount_msat, uint32_t final_cltv_expiry_delta, struct LDKCOption_u64Z liquidity_limit_multiplier);
33347 * Sends payment probes over all paths of a route that would be used to pay a route found
33348 * according to the given [`RouteParameters`].
33350 * This may be used to send \"pre-flight\" probes, i.e., to train our scorer before conducting
33351 * the actual payment. Note this is only useful if there likely is sufficient time for the
33352 * probe to settle before sending out the actual payment, e.g., when waiting for user
33353 * confirmation in a wallet UI.
33355 * Otherwise, there is a chance the probe could take up some liquidity needed to complete the
33356 * actual payment. Users should therefore be cautious and might avoid sending probes if
33357 * liquidity is scarce and/or they don't expect the probe to return before they send the
33358 * payment. To mitigate this issue, channels with available liquidity less than the required
33359 * amount times the given `liquidity_limit_multiplier` won't be used to send pre-flight
33360 * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`.
33362 MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKRouteParameters route_params, struct LDKCOption_u64Z liquidity_limit_multiplier);
33365 * Call this upon creation of a funding transaction for the given channel.
33367 * Returns an [`APIError::APIMisuseError`] if the funding_transaction spent non-SegWit outputs
33368 * or if no output was found which matches the parameters in [`Event::FundingGenerationReady`].
33370 * Returns [`APIError::APIMisuseError`] if the funding transaction is not final for propagation
33371 * across the p2p network.
33373 * Returns [`APIError::ChannelUnavailable`] if a funding transaction has already been provided
33374 * for the channel or if the channel has been closed as indicated by [`Event::ChannelClosed`].
33376 * May panic if the output found in the funding transaction is duplicative with some other
33377 * channel (note that this should be trivially prevented by using unique funding transaction
33378 * keys per-channel).
33380 * Do NOT broadcast the funding transaction yourself. When we have safely received our
33381 * counterparty's signature the funding transaction will automatically be broadcast via the
33382 * [`BroadcasterInterface`] provided when this `ChannelManager` was constructed.
33384 * Note that this includes RBF or similar transaction replacement strategies - lightning does
33385 * not currently support replacing a funding transaction on an existing channel. Instead,
33386 * create a new channel with a conflicting funding transaction.
33388 * Note to keep the miner incentives aligned in moving the blockchain forward, we recommend
33389 * the wallet software generating the funding transaction to apply anti-fee sniping as
33390 * implemented by Bitcoin Core wallet. See <https://bitcoinops.org/en/topics/fee-sniping/>
33391 * for more details.
33393 * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady
33394 * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed
33396 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);
33399 * Call this upon creation of a batch funding transaction for the given channels.
33401 * Return values are identical to [`Self::funding_transaction_generated`], respective to
33402 * each individual channel and transaction output.
33404 * Do NOT broadcast the funding transaction yourself. This batch funding transaction
33405 * will only be broadcast when we have safely received and persisted the counterparty's
33406 * signature for each channel.
33408 * If there is an error, all channels in the batch are to be considered closed.
33410 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_batch_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ temporary_channels, struct LDKTransaction funding_transaction);
33413 * Atomically applies partial updates to the [`ChannelConfig`] of the given channels.
33415 * Once the updates are applied, each eligible channel (advertised with a known short channel
33416 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
33417 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
33418 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
33420 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
33421 * `counterparty_node_id` is provided.
33423 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
33424 * below [`MIN_CLTV_EXPIRY_DELTA`].
33426 * If an error is returned, none of the updates should be considered applied.
33428 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
33429 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
33430 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
33431 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
33432 * [`ChannelUpdate`]: msgs::ChannelUpdate
33433 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
33434 * [`APIMisuseError`]: APIError::APIMisuseError
33436 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);
33439 * Atomically updates the [`ChannelConfig`] for the given channels.
33441 * Once the updates are applied, each eligible channel (advertised with a known short channel
33442 * ID and a change in [`forwarding_fee_proportional_millionths`], [`forwarding_fee_base_msat`],
33443 * or [`cltv_expiry_delta`]) has a [`BroadcastChannelUpdate`] event message generated
33444 * containing the new [`ChannelUpdate`] message which should be broadcast to the network.
33446 * Returns [`ChannelUnavailable`] when a channel is not found or an incorrect
33447 * `counterparty_node_id` is provided.
33449 * Returns [`APIMisuseError`] when a [`cltv_expiry_delta`] update is to be applied with a value
33450 * below [`MIN_CLTV_EXPIRY_DELTA`].
33452 * If an error is returned, none of the updates should be considered applied.
33454 * [`forwarding_fee_proportional_millionths`]: ChannelConfig::forwarding_fee_proportional_millionths
33455 * [`forwarding_fee_base_msat`]: ChannelConfig::forwarding_fee_base_msat
33456 * [`cltv_expiry_delta`]: ChannelConfig::cltv_expiry_delta
33457 * [`BroadcastChannelUpdate`]: events::MessageSendEvent::BroadcastChannelUpdate
33458 * [`ChannelUpdate`]: msgs::ChannelUpdate
33459 * [`ChannelUnavailable`]: APIError::ChannelUnavailable
33460 * [`APIMisuseError`]: APIError::APIMisuseError
33462 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);
33465 * Attempts to forward an intercepted HTLC over the provided channel id and with the provided
33466 * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event.
33468 * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time
33469 * channel to a receiving node if the node lacks sufficient inbound liquidity.
33471 * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use
33472 * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the
33473 * receiver's invoice route hints. These route hints will signal to LDK to generate an
33474 * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or
33475 * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event.
33477 * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop
33478 * you from forwarding more than you received. See
33479 * [`HTLCIntercepted::expected_outbound_amount_msat`] for more on forwarding a different amount
33482 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
33485 * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs
33486 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
33487 * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat
33489 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);
33492 * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to
33493 * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`].
33495 * Errors if the event was not handled in time, in which case the HTLC was automatically failed
33498 * [`HTLCIntercepted`]: events::Event::HTLCIntercepted
33500 MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id);
33503 * Processes HTLCs which are pending waiting on random forward delay.
33505 * Should only really ever be called in response to a PendingHTLCsForwardable event.
33506 * Will likely generate further events.
33508 void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg);
33511 * Performs actions which should happen on startup and roughly once per minute thereafter.
33513 * This currently includes:
33514 * * Increasing or decreasing the on-chain feerate estimates for our outbound channels,
33515 * * Broadcasting [`ChannelUpdate`] messages if we've been disconnected from our peer for more
33516 * than a minute, informing the network that they should no longer attempt to route over
33518 * * Expiring a channel's previous [`ChannelConfig`] if necessary to only allow forwarding HTLCs
33519 * with the current [`ChannelConfig`].
33520 * * Removing peers which have disconnected but and no longer have any channels.
33521 * * Force-closing and removing channels which have not completed establishment in a timely manner.
33522 * * Forgetting about stale outbound payments, either those that have already been fulfilled
33523 * or those awaiting an invoice that hasn't been delivered in the necessary amount of time.
33524 * The latter is determined using the system clock in `std` and the highest seen block time
33525 * minus two hours in `no-std`.
33527 * Note that this may cause reentrancy through [`chain::Watch::update_channel`] calls or feerate
33528 * estimate fetches.
33530 * [`ChannelUpdate`]: msgs::ChannelUpdate
33531 * [`ChannelConfig`]: crate::util::config::ChannelConfig
33533 void ChannelManager_timer_tick_occurred(const struct LDKChannelManager *NONNULL_PTR this_arg);
33536 * Indicates that the preimage for payment_hash is unknown or the received amount is incorrect
33537 * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources
33538 * along the path (including in our own channel on which we received it).
33540 * Note that in some cases around unclean shutdown, it is possible the payment may have
33541 * already been claimed by you via [`ChannelManager::claim_funds`] prior to you seeing (a
33542 * second copy of) the [`events::Event::PaymentClaimable`] event. Alternatively, the payment
33543 * may have already been failed automatically by LDK if it was nearing its expiration time.
33545 * While LDK will never claim a payment automatically on your behalf (i.e. without you calling
33546 * [`ChannelManager::claim_funds`]), you should still monitor for
33547 * [`events::Event::PaymentClaimed`] events even for payments you intend to fail, especially on
33548 * startup during which time claims that were in-progress at shutdown may be replayed.
33550 void ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]);
33553 * This is a variant of [`ChannelManager::fail_htlc_backwards`] that allows you to specify the
33554 * reason for the failure.
33556 * See [`FailureCode`] for valid failure codes.
33558 void ChannelManager_fail_htlc_backwards_with_reason(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKFailureCode failure_code);
33561 * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any
33562 * [`MessageSendEvent`]s needed to claim the payment.
33564 * This method is guaranteed to ensure the payment has been claimed but only if the current
33565 * height is strictly below [`Event::PaymentClaimable::claim_deadline`]. To avoid race
33566 * conditions, you should wait for an [`Event::PaymentClaimed`] before considering the payment
33567 * successful. It will generally be available in the next [`process_pending_events`] call.
33569 * Note that if you did not set an `amount_msat` when calling [`create_inbound_payment`] or
33570 * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable`
33571 * event matches your expectation. If you fail to do so and call this method, you may provide
33572 * the sender \"proof-of-payment\" when they did not fulfill the full expected payment.
33574 * This function will fail the payment if it has custom TLVs with even type numbers, as we
33575 * will assume they are unknown. If you intend to accept even custom TLVs, you should use
33576 * [`claim_funds_with_known_custom_tlvs`].
33578 * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
33579 * [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
33580 * [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
33581 * [`process_pending_events`]: EventsProvider::process_pending_events
33582 * [`create_inbound_payment`]: Self::create_inbound_payment
33583 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
33584 * [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
33586 void ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
33589 * This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
33590 * even type numbers.
33594 * You MUST check you've understood all even TLVs before using this to
33595 * claim, otherwise you may unintentionally agree to some protocol you do not understand.
33597 * [`claim_funds`]: Self::claim_funds
33599 void ChannelManager_claim_funds_with_known_custom_tlvs(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage);
33602 * Gets the node_id held by this ChannelManager
33604 MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg);
33607 * Accepts a request to open a channel after a [`Event::OpenChannelRequest`].
33609 * The `temporary_channel_id` parameter indicates which inbound channel should be accepted,
33610 * and the `counterparty_node_id` parameter is the id of the peer which has requested to open
33613 * The `user_channel_id` parameter will be provided back in
33614 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
33615 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
33617 * Note that this method will return an error and reject the channel, if it requires support
33618 * for zero confirmations. Instead, `accept_inbound_channel_from_trusted_peer_0conf` must be
33619 * used to accept such channels.
33621 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
33622 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
33624 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);
33627 * Accepts a request to open a channel after a [`events::Event::OpenChannelRequest`], treating
33628 * it as confirmed immediately.
33630 * The `user_channel_id` parameter will be provided back in
33631 * [`Event::ChannelClosed::user_channel_id`] to allow tracking of which events correspond
33632 * with which `accept_inbound_channel`/`accept_inbound_channel_from_trusted_peer_0conf` call.
33634 * Unlike [`ChannelManager::accept_inbound_channel`], this method accepts the incoming channel
33635 * and (if the counterparty agrees), enables forwarding of payments immediately.
33637 * This fully trusts that the counterparty has honestly and correctly constructed the funding
33638 * transaction and blindly assumes that it will eventually confirm.
33640 * If it does not confirm before we decide to close the channel, or if the funding transaction
33641 * does not pay to the correct script the correct amount, *you will lose funds*.
33643 * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest
33644 * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id
33646 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);
33649 * Pays for an [`Offer`] using the given parameters by creating an [`InvoiceRequest`] and
33650 * enqueuing it to be sent via an onion message. [`ChannelManager`] will pay the actual
33651 * [`Bolt12Invoice`] once it is received.
33653 * Uses [`InvoiceRequestBuilder`] such that the [`InvoiceRequest`] it builds is recognized by
33654 * the [`ChannelManager`] when handling a [`Bolt12Invoice`] message in response to the request.
33655 * The optional parameters are used in the builder, if `Some`:
33656 * - `quantity` for [`InvoiceRequest::quantity`] which must be set if
33657 * [`Offer::expects_quantity`] is `true`.
33658 * - `amount_msats` if overpaying what is required for the given `quantity` is desired, and
33659 * - `payer_note` for [`InvoiceRequest::payer_note`].
33661 * If `max_total_routing_fee_msat` is not specified, The default from
33662 * [`RouteParameters::from_payment_params_and_value`] is applied.
33666 * The provided `payment_id` is used to ensure that only one invoice is paid for the request
33667 * when received. See [Avoiding Duplicate Payments] for other requirements once the payment has
33670 * To revoke the request, use [`ChannelManager::abandon_payment`] prior to receiving the
33671 * invoice. If abandoned, or an invoice isn't received in a reasonable amount of time, the
33672 * payment will fail with an [`Event::InvoiceRequestFailed`].
33676 * Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`]
33677 * as the introduction node and a derived payer id for payer privacy. As such, currently, the
33678 * node must be announced. Otherwise, there is no way to find a path to the introduction node
33679 * in order to send the [`Bolt12Invoice`].
33683 * Requires a direct connection to an introduction node in [`Offer::paths`] or to
33684 * [`Offer::signing_pubkey`], if empty. A similar restriction applies to the responding
33685 * [`Bolt12Invoice::payment_paths`].
33690 * - a duplicate `payment_id` is provided given the caveats in the aforementioned link,
33691 * - the provided parameters are invalid for the offer,
33692 * - the parameterized [`Router`] is unable to create a blinded reply path for the invoice
33695 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
33696 * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity
33697 * [`InvoiceRequest::payer_note`]: crate::offers::invoice_request::InvoiceRequest::payer_note
33698 * [`InvoiceRequestBuilder`]: crate::offers::invoice_request::InvoiceRequestBuilder
33699 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
33700 * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
33701 * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
33703 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ ChannelManager_pay_for_offer(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOffer *NONNULL_PTR offer, struct LDKCOption_u64Z quantity, struct LDKCOption_u64Z amount_msats, struct LDKCOption_StrZ payer_note, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat);
33706 * Creates a [`Bolt12Invoice`] for a [`Refund`] and enqueues it to be sent via an onion
33709 * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a
33710 * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding
33711 * [`PaymentPreimage`].
33715 * Requires a direct connection to an introduction node in [`Refund::paths`] or to
33716 * [`Refund::payer_id`], if empty. This request is best effort; an invoice will be sent to each
33717 * node meeting the aforementioned criteria, but there's no guarantee that they will be
33718 * received and no retries will be made.
33722 * Errors if the parameterized [`Router`] is unable to create a blinded payment path or reply
33723 * path for the invoice.
33725 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
33727 MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund);
33730 * Gets a payment secret and payment hash for use in an invoice given to a third party wishing
33733 * This differs from [`create_inbound_payment_for_hash`] only in that it generates the
33734 * [`PaymentHash`] and [`PaymentPreimage`] for you.
33736 * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which
33737 * will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with
33738 * its [`PaymentPurpose::InvoicePayment::payment_preimage`] field filled in. That should then be
33739 * passed directly to [`claim_funds`].
33741 * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements.
33743 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
33744 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
33748 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
33749 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
33751 * Errors if `min_value_msat` is greater than total bitcoin supply.
33753 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
33754 * on versions of LDK prior to 0.0.114.
33756 * [`claim_funds`]: Self::claim_funds
33757 * [`PaymentClaimable`]: events::Event::PaymentClaimable
33758 * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose
33759 * [`PaymentPurpose::InvoicePayment`]: events::PaymentPurpose::InvoicePayment
33760 * [`PaymentPurpose::InvoicePayment::payment_preimage`]: events::PaymentPurpose::InvoicePayment::payment_preimage
33761 * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
33763 MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ 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);
33766 * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is
33767 * stored external to LDK.
33769 * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a
33770 * payment secret fetched via this method or [`create_inbound_payment`], and which is at least
33771 * the `min_value_msat` provided here, if one is provided.
33773 * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) should be globally unique, though
33774 * note that LDK will not stop you from registering duplicate payment hashes for inbound
33777 * `min_value_msat` should be set if the invoice being generated contains a value. Any payment
33778 * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat`
33779 * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the
33780 * sender \"proof-of-payment\" unless they have paid the required amount.
33782 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
33783 * in excess of the current time. This should roughly match the expiry time set in the invoice.
33784 * After this many seconds, we will remove the inbound payment, resulting in any attempts to
33785 * pay the invoice failing. The BOLT spec suggests 3,600 secs as a default validity time for
33786 * invoices when no timeout is set.
33788 * Note that we use block header time to time-out pending inbound payments (with some margin
33789 * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will
33790 * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry.
33791 * If you need exact expiry semantics, you should enforce them upon receipt of
33792 * [`PaymentClaimable`].
33794 * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry_delta`
33795 * set to at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
33797 * Note that a malicious eavesdropper can intuit whether an inbound payment was created by
33798 * `create_inbound_payment` or `create_inbound_payment_for_hash` based on runtime.
33802 * If you register an inbound payment with this method, then serialize the `ChannelManager`, then
33803 * deserialize it with a node running 0.0.103 and earlier, the payment will fail to be received.
33805 * Errors if `min_value_msat` is greater than total bitcoin supply.
33807 * If `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
33808 * on versions of LDK prior to 0.0.114.
33810 * [`create_inbound_payment`]: Self::create_inbound_payment
33811 * [`PaymentClaimable`]: events::Event::PaymentClaimable
33813 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ 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);
33816 * Gets an LDK-generated payment preimage from a payment hash and payment secret that were
33817 * previously returned from [`create_inbound_payment`].
33819 * [`create_inbound_payment`]: Self::create_inbound_payment
33821 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesAPIErrorZ ChannelManager_get_payment_preimage(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret);
33824 * Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
33825 * are used when constructing the phantom invoice's route hints.
33827 * [phantom node payments]: crate::sign::PhantomKeysManager
33829 MUST_USE_RES uint64_t ChannelManager_get_phantom_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
33832 * Gets route hints for use in receiving [phantom node payments].
33834 * [phantom node payments]: crate::sign::PhantomKeysManager
33836 MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg);
33839 * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are
33840 * used when constructing the route hints for HTLCs intended to be intercepted. See
33841 * [`ChannelManager::forward_intercepted_htlc`].
33843 * Note that this method is not guaranteed to return unique values, you may need to call it a few
33844 * times to get a unique scid.
33846 MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg);
33849 * Gets inflight HTLC information by processing pending outbound payments that are in
33850 * our channels. May be used during pathfinding to account for in-use channel liquidity.
33852 MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg);
33855 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
33856 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
33858 struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
33861 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
33862 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
33864 struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg);
33867 * Constructs a new Listen which calls the relevant methods on this_arg.
33868 * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is
33870 struct LDKListen ChannelManager_as_Listen(const struct LDKChannelManager *NONNULL_PTR this_arg);
33873 * Constructs a new Confirm which calls the relevant methods on this_arg.
33874 * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is
33876 struct LDKConfirm ChannelManager_as_Confirm(const struct LDKChannelManager *NONNULL_PTR this_arg);
33879 * Gets a [`Future`] that completes when this [`ChannelManager`] may need to be persisted or
33880 * may have events that need processing.
33882 * In order to check if this [`ChannelManager`] needs persisting, call
33883 * [`Self::get_and_clear_needs_persistence`].
33885 * Note that callbacks registered on the [`Future`] MUST NOT call back into this
33886 * [`ChannelManager`] and should instead register actions to be taken later.
33888 MUST_USE_RES struct LDKFuture ChannelManager_get_event_or_persistence_needed_future(const struct LDKChannelManager *NONNULL_PTR this_arg);
33891 * Returns true if this [`ChannelManager`] needs to be persisted.
33893 MUST_USE_RES bool ChannelManager_get_and_clear_needs_persistence(const struct LDKChannelManager *NONNULL_PTR this_arg);
33896 * Gets the latest best block which was connected either via the [`chain::Listen`] or
33897 * [`chain::Confirm`] interfaces.
33899 MUST_USE_RES struct LDKBestBlock ChannelManager_current_best_block(const struct LDKChannelManager *NONNULL_PTR this_arg);
33902 * Fetches the set of [`NodeFeatures`] flags that are provided by or required by
33903 * [`ChannelManager`].
33905 MUST_USE_RES struct LDKNodeFeatures ChannelManager_node_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
33908 * Fetches the set of [`ChannelFeatures`] flags that are provided by or required by
33909 * [`ChannelManager`].
33911 MUST_USE_RES struct LDKChannelFeatures ChannelManager_channel_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
33914 * Fetches the set of [`ChannelTypeFeatures`] flags that are provided by or required by
33915 * [`ChannelManager`].
33917 MUST_USE_RES struct LDKChannelTypeFeatures ChannelManager_channel_type_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
33920 * Fetches the set of [`InitFeatures`] flags that are provided by or required by
33921 * [`ChannelManager`].
33923 MUST_USE_RES struct LDKInitFeatures ChannelManager_init_features(const struct LDKChannelManager *NONNULL_PTR this_arg);
33926 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
33927 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
33929 struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
33932 * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
33933 * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
33935 struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
33938 * Fetches the set of [`InitFeatures`] flags that are provided by or required by
33939 * [`ChannelManager`].
33941 struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config);
33944 * Serialize the CounterpartyForwardingInfo object into a byte array which can be read by CounterpartyForwardingInfo_read
33946 struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
33949 * Read a CounterpartyForwardingInfo from a byte array, created by CounterpartyForwardingInfo_write
33951 struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
33954 * Serialize the ChannelCounterparty object into a byte array which can be read by ChannelCounterparty_read
33956 struct LDKCVec_u8Z ChannelCounterparty_write(const struct LDKChannelCounterparty *NONNULL_PTR obj);
33959 * Read a ChannelCounterparty from a byte array, created by ChannelCounterparty_write
33961 struct LDKCResult_ChannelCounterpartyDecodeErrorZ ChannelCounterparty_read(struct LDKu8slice ser);
33964 * Serialize the ChannelDetails object into a byte array which can be read by ChannelDetails_read
33966 struct LDKCVec_u8Z ChannelDetails_write(const struct LDKChannelDetails *NONNULL_PTR obj);
33969 * Read a ChannelDetails from a byte array, created by ChannelDetails_write
33971 struct LDKCResult_ChannelDetailsDecodeErrorZ ChannelDetails_read(struct LDKu8slice ser);
33974 * Serialize the PhantomRouteHints object into a byte array which can be read by PhantomRouteHints_read
33976 struct LDKCVec_u8Z PhantomRouteHints_write(const struct LDKPhantomRouteHints *NONNULL_PTR obj);
33979 * Read a PhantomRouteHints from a byte array, created by PhantomRouteHints_write
33981 struct LDKCResult_PhantomRouteHintsDecodeErrorZ PhantomRouteHints_read(struct LDKu8slice ser);
33984 * Serialize the BlindedForward object into a byte array which can be read by BlindedForward_read
33986 struct LDKCVec_u8Z BlindedForward_write(const struct LDKBlindedForward *NONNULL_PTR obj);
33989 * Read a BlindedForward from a byte array, created by BlindedForward_write
33991 struct LDKCResult_BlindedForwardDecodeErrorZ BlindedForward_read(struct LDKu8slice ser);
33994 * Serialize the PendingHTLCRouting object into a byte array which can be read by PendingHTLCRouting_read
33996 struct LDKCVec_u8Z PendingHTLCRouting_write(const struct LDKPendingHTLCRouting *NONNULL_PTR obj);
33999 * Read a PendingHTLCRouting from a byte array, created by PendingHTLCRouting_write
34001 struct LDKCResult_PendingHTLCRoutingDecodeErrorZ PendingHTLCRouting_read(struct LDKu8slice ser);
34004 * Serialize the PendingHTLCInfo object into a byte array which can be read by PendingHTLCInfo_read
34006 struct LDKCVec_u8Z PendingHTLCInfo_write(const struct LDKPendingHTLCInfo *NONNULL_PTR obj);
34009 * Read a PendingHTLCInfo from a byte array, created by PendingHTLCInfo_write
34011 struct LDKCResult_PendingHTLCInfoDecodeErrorZ PendingHTLCInfo_read(struct LDKu8slice ser);
34014 * Serialize the BlindedFailure object into a byte array which can be read by BlindedFailure_read
34016 struct LDKCVec_u8Z BlindedFailure_write(const enum LDKBlindedFailure *NONNULL_PTR obj);
34019 * Read a BlindedFailure from a byte array, created by BlindedFailure_write
34021 struct LDKCResult_BlindedFailureDecodeErrorZ BlindedFailure_read(struct LDKu8slice ser);
34024 * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read
34026 struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj);
34029 * Serialize the ChannelShutdownState object into a byte array which can be read by ChannelShutdownState_read
34031 struct LDKCVec_u8Z ChannelShutdownState_write(const enum LDKChannelShutdownState *NONNULL_PTR obj);
34034 * Read a ChannelShutdownState from a byte array, created by ChannelShutdownState_write
34036 struct LDKCResult_ChannelShutdownStateDecodeErrorZ ChannelShutdownState_read(struct LDKu8slice ser);
34039 * Frees any resources used by the ChannelManagerReadArgs, if is_owned is set and inner is non-NULL.
34041 void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_obj);
34044 * A cryptographically secure source of entropy.
34046 const struct LDKEntropySource *ChannelManagerReadArgs_get_entropy_source(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34049 * A cryptographically secure source of entropy.
34051 void ChannelManagerReadArgs_set_entropy_source(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKEntropySource val);
34054 * A signer that is able to perform node-scoped cryptographic operations.
34056 const struct LDKNodeSigner *ChannelManagerReadArgs_get_node_signer(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34059 * A signer that is able to perform node-scoped cryptographic operations.
34061 void ChannelManagerReadArgs_set_node_signer(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKNodeSigner val);
34064 * The keys provider which will give us relevant keys. Some keys will be loaded during
34065 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
34068 const struct LDKSignerProvider *ChannelManagerReadArgs_get_signer_provider(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34071 * The keys provider which will give us relevant keys. Some keys will be loaded during
34072 * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel
34075 void ChannelManagerReadArgs_set_signer_provider(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKSignerProvider val);
34078 * The fee_estimator for use in the ChannelManager in the future.
34080 * No calls to the FeeEstimator will be made during deserialization.
34082 const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34085 * The fee_estimator for use in the ChannelManager in the future.
34087 * No calls to the FeeEstimator will be made during deserialization.
34089 void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val);
34092 * The chain::Watch for use in the ChannelManager in the future.
34094 * No calls to the chain::Watch will be made during deserialization. It is assumed that
34095 * you have deserialized ChannelMonitors separately and will add them to your
34096 * chain::Watch after deserializing this ChannelManager.
34098 const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34101 * The chain::Watch for use in the ChannelManager in the future.
34103 * No calls to the chain::Watch will be made during deserialization. It is assumed that
34104 * you have deserialized ChannelMonitors separately and will add them to your
34105 * chain::Watch after deserializing this ChannelManager.
34107 void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val);
34110 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
34111 * used to broadcast the latest local commitment transactions of channels which must be
34112 * force-closed during deserialization.
34114 const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34117 * The BroadcasterInterface which will be used in the ChannelManager in the future and may be
34118 * used to broadcast the latest local commitment transactions of channels which must be
34119 * force-closed during deserialization.
34121 void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val);
34124 * The router which will be used in the ChannelManager in the future for finding routes
34125 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
34127 * No calls to the router will be made during deserialization.
34129 const struct LDKRouter *ChannelManagerReadArgs_get_router(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34132 * The router which will be used in the ChannelManager in the future for finding routes
34133 * on-the-fly for trampoline payments. Absent in private nodes that don't support forwarding.
34135 * No calls to the router will be made during deserialization.
34137 void ChannelManagerReadArgs_set_router(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKRouter val);
34140 * The Logger for use in the ChannelManager and which may be used to log information during
34143 const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34146 * The Logger for use in the ChannelManager and which may be used to log information during
34149 void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val);
34152 * Default settings used for new channels. Any existing channels will continue to use the
34153 * runtime settings which were stored when the ChannelManager was serialized.
34155 struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr);
34158 * Default settings used for new channels. Any existing channels will continue to use the
34159 * runtime settings which were stored when the ChannelManager was serialized.
34161 void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val);
34164 * Simple utility function to create a ChannelManagerReadArgs which creates the monitor
34165 * HashMap for you. This is primarily useful for C bindings where it is not practical to
34166 * populate a HashMap directly from C.
34168 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);
34171 * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write
34173 struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg);
34176 * Frees any resources used by the DelayedPaymentBasepoint, if is_owned is set and inner is non-NULL.
34178 void DelayedPaymentBasepoint_free(struct LDKDelayedPaymentBasepoint this_obj);
34180 struct LDKPublicKey DelayedPaymentBasepoint_get_a(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr);
34182 void DelayedPaymentBasepoint_set_a(struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34185 * Constructs a new DelayedPaymentBasepoint given each field
34187 MUST_USE_RES struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_new(struct LDKPublicKey a_arg);
34190 * Checks if two DelayedPaymentBasepoints contain equal inner contents.
34191 * This ignores pointers and is_owned flags and looks at the values in fields.
34192 * Two objects with NULL inner values will be considered "equal" here.
34194 bool DelayedPaymentBasepoint_eq(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR a, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR b);
34197 * Creates a copy of the DelayedPaymentBasepoint
34199 struct LDKDelayedPaymentBasepoint DelayedPaymentBasepoint_clone(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR orig);
34202 * Generates a non-cryptographic 64-bit hash of the DelayedPaymentBasepoint.
34204 uint64_t DelayedPaymentBasepoint_hash(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR o);
34207 * Get inner Public Key
34209 MUST_USE_RES struct LDKPublicKey DelayedPaymentBasepoint_to_public_key(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg);
34212 * Serialize the DelayedPaymentBasepoint object into a byte array which can be read by DelayedPaymentBasepoint_read
34214 struct LDKCVec_u8Z DelayedPaymentBasepoint_write(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR obj);
34217 * Read a DelayedPaymentBasepoint from a byte array, created by DelayedPaymentBasepoint_write
34219 struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ DelayedPaymentBasepoint_read(struct LDKu8slice ser);
34222 * Frees any resources used by the DelayedPaymentKey, if is_owned is set and inner is non-NULL.
34224 void DelayedPaymentKey_free(struct LDKDelayedPaymentKey this_obj);
34226 struct LDKPublicKey DelayedPaymentKey_get_a(const struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr);
34228 void DelayedPaymentKey_set_a(struct LDKDelayedPaymentKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34231 * Constructs a new DelayedPaymentKey given each field
34233 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_new(struct LDKPublicKey a_arg);
34236 * Checks if two DelayedPaymentKeys contain equal inner contents.
34237 * This ignores pointers and is_owned flags and looks at the values in fields.
34238 * Two objects with NULL inner values will be considered "equal" here.
34240 bool DelayedPaymentKey_eq(const struct LDKDelayedPaymentKey *NONNULL_PTR a, const struct LDKDelayedPaymentKey *NONNULL_PTR b);
34243 * Creates a copy of the DelayedPaymentKey
34245 struct LDKDelayedPaymentKey DelayedPaymentKey_clone(const struct LDKDelayedPaymentKey *NONNULL_PTR orig);
34248 *Derive a public delayedpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
34250 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_basepoint(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
34253 *Build a delayedpubkey directly from an already-derived private key
34255 MUST_USE_RES struct LDKDelayedPaymentKey DelayedPaymentKey_from_secret_key(const uint8_t (*sk)[32]);
34258 * Get inner Public Key
34260 MUST_USE_RES struct LDKPublicKey DelayedPaymentKey_to_public_key(const struct LDKDelayedPaymentKey *NONNULL_PTR this_arg);
34263 * Serialize the DelayedPaymentKey object into a byte array which can be read by DelayedPaymentKey_read
34265 struct LDKCVec_u8Z DelayedPaymentKey_write(const struct LDKDelayedPaymentKey *NONNULL_PTR obj);
34268 * Read a DelayedPaymentKey from a byte array, created by DelayedPaymentKey_write
34270 struct LDKCResult_DelayedPaymentKeyDecodeErrorZ DelayedPaymentKey_read(struct LDKu8slice ser);
34273 * Frees any resources used by the HtlcBasepoint, if is_owned is set and inner is non-NULL.
34275 void HtlcBasepoint_free(struct LDKHtlcBasepoint this_obj);
34277 struct LDKPublicKey HtlcBasepoint_get_a(const struct LDKHtlcBasepoint *NONNULL_PTR this_ptr);
34279 void HtlcBasepoint_set_a(struct LDKHtlcBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34282 * Constructs a new HtlcBasepoint given each field
34284 MUST_USE_RES struct LDKHtlcBasepoint HtlcBasepoint_new(struct LDKPublicKey a_arg);
34287 * Checks if two HtlcBasepoints contain equal inner contents.
34288 * This ignores pointers and is_owned flags and looks at the values in fields.
34289 * Two objects with NULL inner values will be considered "equal" here.
34291 bool HtlcBasepoint_eq(const struct LDKHtlcBasepoint *NONNULL_PTR a, const struct LDKHtlcBasepoint *NONNULL_PTR b);
34294 * Creates a copy of the HtlcBasepoint
34296 struct LDKHtlcBasepoint HtlcBasepoint_clone(const struct LDKHtlcBasepoint *NONNULL_PTR orig);
34299 * Generates a non-cryptographic 64-bit hash of the HtlcBasepoint.
34301 uint64_t HtlcBasepoint_hash(const struct LDKHtlcBasepoint *NONNULL_PTR o);
34304 * Get inner Public Key
34306 MUST_USE_RES struct LDKPublicKey HtlcBasepoint_to_public_key(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg);
34309 * Serialize the HtlcBasepoint object into a byte array which can be read by HtlcBasepoint_read
34311 struct LDKCVec_u8Z HtlcBasepoint_write(const struct LDKHtlcBasepoint *NONNULL_PTR obj);
34314 * Read a HtlcBasepoint from a byte array, created by HtlcBasepoint_write
34316 struct LDKCResult_HtlcBasepointDecodeErrorZ HtlcBasepoint_read(struct LDKu8slice ser);
34319 * Frees any resources used by the HtlcKey, if is_owned is set and inner is non-NULL.
34321 void HtlcKey_free(struct LDKHtlcKey this_obj);
34323 struct LDKPublicKey HtlcKey_get_a(const struct LDKHtlcKey *NONNULL_PTR this_ptr);
34325 void HtlcKey_set_a(struct LDKHtlcKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34328 * Constructs a new HtlcKey given each field
34330 MUST_USE_RES struct LDKHtlcKey HtlcKey_new(struct LDKPublicKey a_arg);
34333 * Checks if two HtlcKeys contain equal inner contents.
34334 * This ignores pointers and is_owned flags and looks at the values in fields.
34335 * Two objects with NULL inner values will be considered "equal" here.
34337 bool HtlcKey_eq(const struct LDKHtlcKey *NONNULL_PTR a, const struct LDKHtlcKey *NONNULL_PTR b);
34340 * Creates a copy of the HtlcKey
34342 struct LDKHtlcKey HtlcKey_clone(const struct LDKHtlcKey *NONNULL_PTR orig);
34345 *Derive a public htlcpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint`
34347 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_basepoint(const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
34350 *Build a htlcpubkey directly from an already-derived private key
34352 MUST_USE_RES struct LDKHtlcKey HtlcKey_from_secret_key(const uint8_t (*sk)[32]);
34355 * Get inner Public Key
34357 MUST_USE_RES struct LDKPublicKey HtlcKey_to_public_key(const struct LDKHtlcKey *NONNULL_PTR this_arg);
34360 * Serialize the HtlcKey object into a byte array which can be read by HtlcKey_read
34362 struct LDKCVec_u8Z HtlcKey_write(const struct LDKHtlcKey *NONNULL_PTR obj);
34365 * Read a HtlcKey from a byte array, created by HtlcKey_write
34367 struct LDKCResult_HtlcKeyDecodeErrorZ HtlcKey_read(struct LDKu8slice ser);
34370 * Frees any resources used by the RevocationBasepoint, if is_owned is set and inner is non-NULL.
34372 void RevocationBasepoint_free(struct LDKRevocationBasepoint this_obj);
34374 struct LDKPublicKey RevocationBasepoint_get_a(const struct LDKRevocationBasepoint *NONNULL_PTR this_ptr);
34376 void RevocationBasepoint_set_a(struct LDKRevocationBasepoint *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34379 * Constructs a new RevocationBasepoint given each field
34381 MUST_USE_RES struct LDKRevocationBasepoint RevocationBasepoint_new(struct LDKPublicKey a_arg);
34384 * Checks if two RevocationBasepoints contain equal inner contents.
34385 * This ignores pointers and is_owned flags and looks at the values in fields.
34386 * Two objects with NULL inner values will be considered "equal" here.
34388 bool RevocationBasepoint_eq(const struct LDKRevocationBasepoint *NONNULL_PTR a, const struct LDKRevocationBasepoint *NONNULL_PTR b);
34391 * Creates a copy of the RevocationBasepoint
34393 struct LDKRevocationBasepoint RevocationBasepoint_clone(const struct LDKRevocationBasepoint *NONNULL_PTR orig);
34396 * Generates a non-cryptographic 64-bit hash of the RevocationBasepoint.
34398 uint64_t RevocationBasepoint_hash(const struct LDKRevocationBasepoint *NONNULL_PTR o);
34401 * Get inner Public Key
34403 MUST_USE_RES struct LDKPublicKey RevocationBasepoint_to_public_key(const struct LDKRevocationBasepoint *NONNULL_PTR this_arg);
34406 * Serialize the RevocationBasepoint object into a byte array which can be read by RevocationBasepoint_read
34408 struct LDKCVec_u8Z RevocationBasepoint_write(const struct LDKRevocationBasepoint *NONNULL_PTR obj);
34411 * Read a RevocationBasepoint from a byte array, created by RevocationBasepoint_write
34413 struct LDKCResult_RevocationBasepointDecodeErrorZ RevocationBasepoint_read(struct LDKu8slice ser);
34416 * Frees any resources used by the RevocationKey, if is_owned is set and inner is non-NULL.
34418 void RevocationKey_free(struct LDKRevocationKey this_obj);
34420 struct LDKPublicKey RevocationKey_get_a(const struct LDKRevocationKey *NONNULL_PTR this_ptr);
34422 void RevocationKey_set_a(struct LDKRevocationKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34425 * Constructs a new RevocationKey given each field
34427 MUST_USE_RES struct LDKRevocationKey RevocationKey_new(struct LDKPublicKey a_arg);
34430 * Checks if two RevocationKeys contain equal inner contents.
34431 * This ignores pointers and is_owned flags and looks at the values in fields.
34432 * Two objects with NULL inner values will be considered "equal" here.
34434 bool RevocationKey_eq(const struct LDKRevocationKey *NONNULL_PTR a, const struct LDKRevocationKey *NONNULL_PTR b);
34437 * Creates a copy of the RevocationKey
34439 struct LDKRevocationKey RevocationKey_clone(const struct LDKRevocationKey *NONNULL_PTR orig);
34442 * Generates a non-cryptographic 64-bit hash of the RevocationKey.
34444 uint64_t RevocationKey_hash(const struct LDKRevocationKey *NONNULL_PTR o);
34447 * Derives a per-commitment-transaction revocation public key from one party's per-commitment
34448 * point and the other party's [`RevocationBasepoint`]. This is the public equivalent of
34449 * [`chan_utils::derive_private_revocation_key`] - using only public keys to derive a public
34450 * key instead of private keys.
34452 * Note that this is infallible iff we trust that at least one of the two input keys are randomly
34453 * generated (ie our own).
34455 * [`chan_utils::derive_private_revocation_key`]: crate::ln::chan_utils::derive_private_revocation_key
34457 MUST_USE_RES struct LDKRevocationKey RevocationKey_from_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_basepoint, struct LDKPublicKey per_commitment_point);
34460 * Get inner Public Key
34462 MUST_USE_RES struct LDKPublicKey RevocationKey_to_public_key(const struct LDKRevocationKey *NONNULL_PTR this_arg);
34465 * Serialize the RevocationKey object into a byte array which can be read by RevocationKey_read
34467 struct LDKCVec_u8Z RevocationKey_write(const struct LDKRevocationKey *NONNULL_PTR obj);
34470 * Read a RevocationKey from a byte array, created by RevocationKey_write
34472 struct LDKCResult_RevocationKeyDecodeErrorZ RevocationKey_read(struct LDKu8slice ser);
34475 * Frees any resources used by the ExpandedKey, if is_owned is set and inner is non-NULL.
34477 void ExpandedKey_free(struct LDKExpandedKey this_obj);
34480 * Create a new [`ExpandedKey`] for generating an inbound payment hash and secret.
34482 * It is recommended to cache this value and not regenerate it for each new inbound payment.
34484 MUST_USE_RES struct LDKExpandedKey ExpandedKey_new(const uint8_t (*key_material)[32]);
34487 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no
34488 * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
34489 * a `ChannelManager`.
34491 * `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
34492 * calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
34493 * regenerate it for each new inbound payment.
34495 * `current_time` is a Unix timestamp representing the current time.
34497 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
34498 * on versions of LDK prior to 0.0.114.
34500 * [phantom node payments]: crate::sign::PhantomKeysManager
34501 * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material
34503 struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ 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);
34506 * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash`],
34507 * but no `ChannelManager` is required. Useful for generating invoices for [phantom node payments]
34508 * without a `ChannelManager`.
34510 * See [`create`] for information on the `keys` and `current_time` parameters.
34512 * Note that if `min_final_cltv_expiry_delta` is set to some value, then the payment will not be receivable
34513 * on versions of LDK prior to 0.0.114.
34515 * [phantom node payments]: crate::sign::PhantomKeysManager
34517 struct LDKCResult_ThirtyTwoBytesNoneZ 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);
34520 * Frees any resources used by the DecodeError
34522 void DecodeError_free(struct LDKDecodeError this_ptr);
34525 * Creates a copy of the DecodeError
34527 struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
34530 * Utility method to constructs a new UnknownVersion-variant DecodeError
34532 struct LDKDecodeError DecodeError_unknown_version(void);
34535 * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
34537 struct LDKDecodeError DecodeError_unknown_required_feature(void);
34540 * Utility method to constructs a new InvalidValue-variant DecodeError
34542 struct LDKDecodeError DecodeError_invalid_value(void);
34545 * Utility method to constructs a new ShortRead-variant DecodeError
34547 struct LDKDecodeError DecodeError_short_read(void);
34550 * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
34552 struct LDKDecodeError DecodeError_bad_length_descriptor(void);
34555 * Utility method to constructs a new Io-variant DecodeError
34557 struct LDKDecodeError DecodeError_io(enum LDKIOError a);
34560 * Utility method to constructs a new UnsupportedCompression-variant DecodeError
34562 struct LDKDecodeError DecodeError_unsupported_compression(void);
34565 * Generates a non-cryptographic 64-bit hash of the DecodeError.
34567 uint64_t DecodeError_hash(const struct LDKDecodeError *NONNULL_PTR o);
34570 * Checks if two DecodeErrors contain equal inner contents.
34571 * This ignores pointers and is_owned flags and looks at the values in fields.
34573 bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
34576 * Frees any resources used by the Init, if is_owned is set and inner is non-NULL.
34578 void Init_free(struct LDKInit this_obj);
34581 * The relevant features which the sender supports.
34583 struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
34586 * The relevant features which the sender supports.
34588 void Init_set_features(struct LDKInit *NONNULL_PTR this_ptr, struct LDKInitFeatures val);
34591 * Indicates chains the sender is interested in.
34593 * If there are no common chains, the connection will be closed.
34595 * Returns a copy of the field.
34597 struct LDKCOption_CVec_ThirtyTwoBytesZZ Init_get_networks(const struct LDKInit *NONNULL_PTR this_ptr);
34600 * Indicates chains the sender is interested in.
34602 * If there are no common chains, the connection will be closed.
34604 void Init_set_networks(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_CVec_ThirtyTwoBytesZZ val);
34607 * The receipient's network address.
34609 * This adds the option to report a remote IP address back to a connecting peer using the init
34610 * message. A node can decide to use that information to discover a potential update to its
34611 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
34614 struct LDKCOption_SocketAddressZ Init_get_remote_network_address(const struct LDKInit *NONNULL_PTR this_ptr);
34617 * The receipient's network address.
34619 * This adds the option to report a remote IP address back to a connecting peer using the init
34620 * message. A node can decide to use that information to discover a potential update to its
34621 * public IPv4 address (NAT) and use that for a [`NodeAnnouncement`] update message containing
34624 void Init_set_remote_network_address(struct LDKInit *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val);
34627 * Constructs a new Init given each field
34629 MUST_USE_RES struct LDKInit Init_new(struct LDKInitFeatures features_arg, struct LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg, struct LDKCOption_SocketAddressZ remote_network_address_arg);
34632 * Creates a copy of the Init
34634 struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
34637 * Generates a non-cryptographic 64-bit hash of the Init.
34639 uint64_t Init_hash(const struct LDKInit *NONNULL_PTR o);
34642 * Checks if two Inits contain equal inner contents.
34643 * This ignores pointers and is_owned flags and looks at the values in fields.
34644 * Two objects with NULL inner values will be considered "equal" here.
34646 bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
34649 * Frees any resources used by the ErrorMessage, if is_owned is set and inner is non-NULL.
34651 void ErrorMessage_free(struct LDKErrorMessage this_obj);
34654 * The channel ID involved in the error.
34656 * All-0s indicates a general error unrelated to a specific channel, after which all channels
34657 * with the sending peer should be closed.
34659 const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
34662 * The channel ID involved in the error.
34664 * All-0s indicates a general error unrelated to a specific channel, after which all channels
34665 * with the sending peer should be closed.
34667 void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34670 * A possibly human-readable error description.
34672 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
34673 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
34674 * the terminal emulator or the logging subsystem.
34676 struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr);
34679 * A possibly human-readable error description.
34681 * The string should be sanitized before it is used (e.g., emitted to logs or printed to
34682 * `stdout`). Otherwise, a well crafted error message may trigger a security vulnerability in
34683 * the terminal emulator or the logging subsystem.
34685 void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val);
34688 * Constructs a new ErrorMessage given each field
34690 MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
34693 * Creates a copy of the ErrorMessage
34695 struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
34698 * Generates a non-cryptographic 64-bit hash of the ErrorMessage.
34700 uint64_t ErrorMessage_hash(const struct LDKErrorMessage *NONNULL_PTR o);
34703 * Checks if two ErrorMessages contain equal inner contents.
34704 * This ignores pointers and is_owned flags and looks at the values in fields.
34705 * Two objects with NULL inner values will be considered "equal" here.
34707 bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
34710 * Frees any resources used by the WarningMessage, if is_owned is set and inner is non-NULL.
34712 void WarningMessage_free(struct LDKWarningMessage this_obj);
34715 * The channel ID involved in the warning.
34717 * All-0s indicates a warning unrelated to a specific channel.
34719 const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
34722 * The channel ID involved in the warning.
34724 * All-0s indicates a warning unrelated to a specific channel.
34726 void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34729 * A possibly human-readable warning description.
34731 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
34732 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
34733 * the terminal emulator or the logging subsystem.
34735 struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr);
34738 * A possibly human-readable warning description.
34740 * The string should be sanitized before it is used (e.g. emitted to logs or printed to
34741 * stdout). Otherwise, a well crafted error message may trigger a security vulnerability in
34742 * the terminal emulator or the logging subsystem.
34744 void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val);
34747 * Constructs a new WarningMessage given each field
34749 MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg);
34752 * Creates a copy of the WarningMessage
34754 struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
34757 * Generates a non-cryptographic 64-bit hash of the WarningMessage.
34759 uint64_t WarningMessage_hash(const struct LDKWarningMessage *NONNULL_PTR o);
34762 * Checks if two WarningMessages contain equal inner contents.
34763 * This ignores pointers and is_owned flags and looks at the values in fields.
34764 * Two objects with NULL inner values will be considered "equal" here.
34766 bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
34769 * Frees any resources used by the Ping, if is_owned is set and inner is non-NULL.
34771 void Ping_free(struct LDKPing this_obj);
34774 * The desired response length.
34776 uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
34779 * The desired response length.
34781 void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
34784 * The ping packet size.
34786 * This field is not sent on the wire. byteslen zeros are sent.
34788 uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr);
34791 * The ping packet size.
34793 * This field is not sent on the wire. byteslen zeros are sent.
34795 void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val);
34798 * Constructs a new Ping given each field
34800 MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
34803 * Creates a copy of the Ping
34805 struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
34808 * Generates a non-cryptographic 64-bit hash of the Ping.
34810 uint64_t Ping_hash(const struct LDKPing *NONNULL_PTR o);
34813 * Checks if two Pings contain equal inner contents.
34814 * This ignores pointers and is_owned flags and looks at the values in fields.
34815 * Two objects with NULL inner values will be considered "equal" here.
34817 bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
34820 * Frees any resources used by the Pong, if is_owned is set and inner is non-NULL.
34822 void Pong_free(struct LDKPong this_obj);
34825 * The pong packet size.
34827 * This field is not sent on the wire. byteslen zeros are sent.
34829 uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
34832 * The pong packet size.
34834 * This field is not sent on the wire. byteslen zeros are sent.
34836 void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val);
34839 * Constructs a new Pong given each field
34841 MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg);
34844 * Creates a copy of the Pong
34846 struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
34849 * Generates a non-cryptographic 64-bit hash of the Pong.
34851 uint64_t Pong_hash(const struct LDKPong *NONNULL_PTR o);
34854 * Checks if two Pongs contain equal inner contents.
34855 * This ignores pointers and is_owned flags and looks at the values in fields.
34856 * Two objects with NULL inner values will be considered "equal" here.
34858 bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
34861 * Frees any resources used by the OpenChannel, if is_owned is set and inner is non-NULL.
34863 void OpenChannel_free(struct LDKOpenChannel this_obj);
34866 * The genesis hash of the blockchain where the channel is to be opened
34868 const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
34871 * The genesis hash of the blockchain where the channel is to be opened
34873 void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34876 * A temporary channel ID, until the funding outpoint is announced
34878 const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
34881 * A temporary channel ID, until the funding outpoint is announced
34883 void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
34886 * The channel value
34888 uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34891 * The channel value
34893 void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
34896 * The amount to push to the counterparty as part of the open, in milli-satoshi
34898 uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34901 * The amount to push to the counterparty as part of the open, in milli-satoshi
34903 void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
34906 * The threshold below which outputs on transactions broadcast by sender will be omitted
34908 uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34911 * The threshold below which outputs on transactions broadcast by sender will be omitted
34913 void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
34916 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
34918 uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34921 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
34923 void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
34926 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
34928 uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34931 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
34933 void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
34936 * The minimum HTLC size incoming to sender, in milli-satoshi
34938 uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34941 * The minimum HTLC size incoming to sender, in milli-satoshi
34943 void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val);
34946 * The feerate per 1000-weight of sender generated transactions, until updated by
34949 uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34952 * The feerate per 1000-weight of sender generated transactions, until updated by
34955 void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val);
34958 * The number of blocks which the counterparty will have to wait to claim on-chain funds if
34959 * they broadcast a commitment transaction
34961 uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34964 * The number of blocks which the counterparty will have to wait to claim on-chain funds if
34965 * they broadcast a commitment transaction
34967 void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
34970 * The maximum number of inbound HTLCs towards sender
34972 uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34975 * The maximum number of inbound HTLCs towards sender
34977 void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val);
34980 * The sender's key controlling the funding transaction
34982 struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34985 * The sender's key controlling the funding transaction
34987 void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
34990 * Used to derive a revocation key for transactions broadcast by counterparty
34992 struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
34995 * Used to derive a revocation key for transactions broadcast by counterparty
34997 void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35000 * A payment key to sender for transactions broadcast by counterparty
35002 struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35005 * A payment key to sender for transactions broadcast by counterparty
35007 void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35010 * Used to derive a payment key to sender for transactions broadcast by sender
35012 struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35015 * Used to derive a payment key to sender for transactions broadcast by sender
35017 void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35020 * Used to derive an HTLC payment key to sender
35022 struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35025 * Used to derive an HTLC payment key to sender
35027 void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35030 * The first to-be-broadcast-by-sender transaction's per commitment point
35032 struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35035 * The first to-be-broadcast-by-sender transaction's per commitment point
35037 void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35040 * The channel flags to be used
35042 uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35045 * The channel flags to be used
35047 void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val);
35050 * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
35052 struct LDKCOption_CVec_u8ZZ OpenChannel_get_shutdown_scriptpubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35055 * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close
35057 void OpenChannel_set_shutdown_scriptpubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
35060 * The channel type that this channel will represent
35062 * If this is `None`, we derive the channel type from the intersection of our
35063 * feature bits with our counterparty's feature bits from the [`Init`] message.
35065 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35067 struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr);
35070 * The channel type that this channel will represent
35072 * If this is `None`, we derive the channel type from the intersection of our
35073 * feature bits with our counterparty's feature bits from the [`Init`] message.
35075 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35077 void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
35080 * Constructs a new OpenChannel given each field
35082 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
35084 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_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
35087 * Creates a copy of the OpenChannel
35089 struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
35092 * Generates a non-cryptographic 64-bit hash of the OpenChannel.
35094 uint64_t OpenChannel_hash(const struct LDKOpenChannel *NONNULL_PTR o);
35097 * Checks if two OpenChannels contain equal inner contents.
35098 * This ignores pointers and is_owned flags and looks at the values in fields.
35099 * Two objects with NULL inner values will be considered "equal" here.
35101 bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
35104 * Frees any resources used by the OpenChannelV2, if is_owned is set and inner is non-NULL.
35106 void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj);
35109 * The genesis hash of the blockchain where the channel is to be opened
35111 const uint8_t (*OpenChannelV2_get_chain_hash(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
35114 * The genesis hash of the blockchain where the channel is to be opened
35116 void OpenChannelV2_set_chain_hash(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35119 * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
35121 const uint8_t (*OpenChannelV2_get_temporary_channel_id(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32];
35124 * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint
35126 void OpenChannelV2_set_temporary_channel_id(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35129 * The feerate for the funding transaction set by the channel initiator
35131 uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35134 * The feerate for the funding transaction set by the channel initiator
35136 void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
35139 * The feerate for the commitment transaction set by the channel initiator
35141 uint32_t OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35144 * The feerate for the commitment transaction set by the channel initiator
35146 void OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
35149 * Part of the channel value contributed by the channel initiator
35151 uint64_t OpenChannelV2_get_funding_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35154 * Part of the channel value contributed by the channel initiator
35156 void OpenChannelV2_set_funding_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35159 * The threshold below which outputs on transactions broadcast by the channel initiator will be
35162 uint64_t OpenChannelV2_get_dust_limit_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35165 * The threshold below which outputs on transactions broadcast by the channel initiator will be
35168 void OpenChannelV2_set_dust_limit_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35171 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
35173 uint64_t OpenChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35176 * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi
35178 void OpenChannelV2_set_max_htlc_value_in_flight_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35181 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
35183 uint64_t OpenChannelV2_get_htlc_minimum_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35186 * The minimum HTLC size incoming to channel initiator, in milli-satoshi
35188 void OpenChannelV2_set_htlc_minimum_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35191 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
35192 * broadcast a commitment transaction
35194 uint16_t OpenChannelV2_get_to_self_delay(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35197 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
35198 * broadcast a commitment transaction
35200 void OpenChannelV2_set_to_self_delay(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
35203 * The maximum number of inbound HTLCs towards channel initiator
35205 uint16_t OpenChannelV2_get_max_accepted_htlcs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35208 * The maximum number of inbound HTLCs towards channel initiator
35210 void OpenChannelV2_set_max_accepted_htlcs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
35213 * The locktime for the funding transaction
35215 uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35218 * The locktime for the funding transaction
35220 void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
35223 * The channel initiator's key controlling the funding transaction
35225 struct LDKPublicKey OpenChannelV2_get_funding_pubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35228 * The channel initiator's key controlling the funding transaction
35230 void OpenChannelV2_set_funding_pubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35233 * Used to derive a revocation key for transactions broadcast by counterparty
35235 struct LDKPublicKey OpenChannelV2_get_revocation_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35238 * Used to derive a revocation key for transactions broadcast by counterparty
35240 void OpenChannelV2_set_revocation_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35243 * A payment key to channel initiator for transactions broadcast by counterparty
35245 struct LDKPublicKey OpenChannelV2_get_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35248 * A payment key to channel initiator for transactions broadcast by counterparty
35250 void OpenChannelV2_set_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35253 * Used to derive a payment key to channel initiator for transactions broadcast by channel
35256 struct LDKPublicKey OpenChannelV2_get_delayed_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35259 * Used to derive a payment key to channel initiator for transactions broadcast by channel
35262 void OpenChannelV2_set_delayed_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35265 * Used to derive an HTLC payment key to channel initiator
35267 struct LDKPublicKey OpenChannelV2_get_htlc_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35270 * Used to derive an HTLC payment key to channel initiator
35272 void OpenChannelV2_set_htlc_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35275 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
35277 struct LDKPublicKey OpenChannelV2_get_first_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35280 * The first to-be-broadcast-by-channel-initiator transaction's per commitment point
35282 void OpenChannelV2_set_first_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35285 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
35287 struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35290 * The second to-be-broadcast-by-channel-initiator transaction's per commitment point
35292 void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35297 uint8_t OpenChannelV2_get_channel_flags(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35302 void OpenChannelV2_set_channel_flags(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint8_t val);
35305 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
35306 * collaboratively close
35308 struct LDKCOption_CVec_u8ZZ OpenChannelV2_get_shutdown_scriptpubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35311 * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we
35312 * collaboratively close
35314 void OpenChannelV2_set_shutdown_scriptpubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
35317 * The channel type that this channel will represent. If none is set, we derive the channel
35318 * type from the intersection of our feature bits with our counterparty's feature bits from
35319 * the Init message.
35321 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35323 struct LDKChannelTypeFeatures OpenChannelV2_get_channel_type(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35326 * The channel type that this channel will represent. If none is set, we derive the channel
35327 * type from the intersection of our feature bits with our counterparty's feature bits from
35328 * the Init message.
35330 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35332 void OpenChannelV2_set_channel_type(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
35335 * Optionally, a requirement that only confirmed inputs can be added
35337 enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr);
35340 * Optionally, a requirement that only confirmed inputs can be added
35342 void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
35345 * Constructs a new OpenChannelV2 given each field
35347 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
35349 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_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
35352 * Creates a copy of the OpenChannelV2
35354 struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig);
35357 * Generates a non-cryptographic 64-bit hash of the OpenChannelV2.
35359 uint64_t OpenChannelV2_hash(const struct LDKOpenChannelV2 *NONNULL_PTR o);
35362 * Checks if two OpenChannelV2s contain equal inner contents.
35363 * This ignores pointers and is_owned flags and looks at the values in fields.
35364 * Two objects with NULL inner values will be considered "equal" here.
35366 bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b);
35369 * Frees any resources used by the AcceptChannel, if is_owned is set and inner is non-NULL.
35371 void AcceptChannel_free(struct LDKAcceptChannel this_obj);
35374 * A temporary channel ID, until the funding outpoint is announced
35376 const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
35379 * A temporary channel ID, until the funding outpoint is announced
35381 void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35384 * The threshold below which outputs on transactions broadcast by sender will be omitted
35386 uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35389 * The threshold below which outputs on transactions broadcast by sender will be omitted
35391 void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
35394 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
35396 uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35399 * The maximum inbound HTLC value in flight towards sender, in milli-satoshi
35401 void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
35404 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
35406 uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35409 * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel
35411 void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
35414 * The minimum HTLC size incoming to sender, in milli-satoshi
35416 uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35419 * The minimum HTLC size incoming to sender, in milli-satoshi
35421 void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val);
35424 * Minimum depth of the funding transaction before the channel is considered open
35426 uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35429 * Minimum depth of the funding transaction before the channel is considered open
35431 void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val);
35434 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
35436 uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35439 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction
35441 void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
35444 * The maximum number of inbound HTLCs towards sender
35446 uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35449 * The maximum number of inbound HTLCs towards sender
35451 void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val);
35454 * The sender's key controlling the funding transaction
35456 struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35459 * The sender's key controlling the funding transaction
35461 void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35464 * Used to derive a revocation key for transactions broadcast by counterparty
35466 struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35469 * Used to derive a revocation key for transactions broadcast by counterparty
35471 void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35474 * A payment key to sender for transactions broadcast by counterparty
35476 struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35479 * A payment key to sender for transactions broadcast by counterparty
35481 void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35484 * Used to derive a payment key to sender for transactions broadcast by sender
35486 struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35489 * Used to derive a payment key to sender for transactions broadcast by sender
35491 void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35494 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
35496 struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35499 * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty
35501 void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35504 * The first to-be-broadcast-by-sender transaction's per commitment point
35506 struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35509 * The first to-be-broadcast-by-sender transaction's per commitment point
35511 void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35514 * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
35516 struct LDKCOption_CVec_u8ZZ AcceptChannel_get_shutdown_scriptpubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35519 * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close
35521 void AcceptChannel_set_shutdown_scriptpubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
35524 * The channel type that this channel will represent.
35526 * If this is `None`, we derive the channel type from the intersection of
35527 * our feature bits with our counterparty's feature bits from the [`Init`] message.
35528 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
35530 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35532 struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr);
35535 * The channel type that this channel will represent.
35537 * If this is `None`, we derive the channel type from the intersection of
35538 * our feature bits with our counterparty's feature bits from the [`Init`] message.
35539 * This is required to match the equivalent field in [`OpenChannel::channel_type`].
35541 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35543 void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
35546 * Constructs a new AcceptChannel given each field
35548 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
35550 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_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg);
35553 * Creates a copy of the AcceptChannel
35555 struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
35558 * Generates a non-cryptographic 64-bit hash of the AcceptChannel.
35560 uint64_t AcceptChannel_hash(const struct LDKAcceptChannel *NONNULL_PTR o);
35563 * Checks if two AcceptChannels contain equal inner contents.
35564 * This ignores pointers and is_owned flags and looks at the values in fields.
35565 * Two objects with NULL inner values will be considered "equal" here.
35567 bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
35570 * Frees any resources used by the AcceptChannelV2, if is_owned is set and inner is non-NULL.
35572 void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj);
35575 * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
35577 const uint8_t (*AcceptChannelV2_get_temporary_channel_id(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr))[32];
35580 * The same `temporary_channel_id` received from the initiator's `open_channel2` message.
35582 void AcceptChannelV2_set_temporary_channel_id(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35585 * Part of the channel value contributed by the channel acceptor
35587 uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35590 * Part of the channel value contributed by the channel acceptor
35592 void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35595 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
35598 uint64_t AcceptChannelV2_get_dust_limit_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35601 * The threshold below which outputs on transactions broadcast by the channel acceptor will be
35604 void AcceptChannelV2_set_dust_limit_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35607 * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
35609 uint64_t AcceptChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35612 * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi
35614 void AcceptChannelV2_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35617 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
35619 uint64_t AcceptChannelV2_get_htlc_minimum_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35622 * The minimum HTLC size incoming to channel acceptor, in milli-satoshi
35624 void AcceptChannelV2_set_htlc_minimum_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val);
35627 * Minimum depth of the funding transaction before the channel is considered open
35629 uint32_t AcceptChannelV2_get_minimum_depth(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35632 * Minimum depth of the funding transaction before the channel is considered open
35634 void AcceptChannelV2_set_minimum_depth(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint32_t val);
35637 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
35638 * broadcast a commitment transaction
35640 uint16_t AcceptChannelV2_get_to_self_delay(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35643 * The number of blocks which the counterparty will have to wait to claim on-chain funds if they
35644 * broadcast a commitment transaction
35646 void AcceptChannelV2_set_to_self_delay(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
35649 * The maximum number of inbound HTLCs towards channel acceptor
35651 uint16_t AcceptChannelV2_get_max_accepted_htlcs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35654 * The maximum number of inbound HTLCs towards channel acceptor
35656 void AcceptChannelV2_set_max_accepted_htlcs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val);
35659 * The channel acceptor's key controlling the funding transaction
35661 struct LDKPublicKey AcceptChannelV2_get_funding_pubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35664 * The channel acceptor's key controlling the funding transaction
35666 void AcceptChannelV2_set_funding_pubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35669 * Used to derive a revocation key for transactions broadcast by counterparty
35671 struct LDKPublicKey AcceptChannelV2_get_revocation_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35674 * Used to derive a revocation key for transactions broadcast by counterparty
35676 void AcceptChannelV2_set_revocation_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35679 * A payment key to channel acceptor for transactions broadcast by counterparty
35681 struct LDKPublicKey AcceptChannelV2_get_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35684 * A payment key to channel acceptor for transactions broadcast by counterparty
35686 void AcceptChannelV2_set_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35689 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
35692 struct LDKPublicKey AcceptChannelV2_get_delayed_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35695 * Used to derive a payment key to channel acceptor for transactions broadcast by channel
35698 void AcceptChannelV2_set_delayed_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35701 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
35703 struct LDKPublicKey AcceptChannelV2_get_htlc_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35706 * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty
35708 void AcceptChannelV2_set_htlc_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35711 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
35713 struct LDKPublicKey AcceptChannelV2_get_first_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35716 * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point
35718 void AcceptChannelV2_set_first_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35721 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
35723 struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35726 * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point
35728 void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35731 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
35732 * collaboratively close
35734 struct LDKCOption_CVec_u8ZZ AcceptChannelV2_get_shutdown_scriptpubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35737 * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we
35738 * collaboratively close
35740 void AcceptChannelV2_set_shutdown_scriptpubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
35743 * The channel type that this channel will represent. If none is set, we derive the channel
35744 * type from the intersection of our feature bits with our counterparty's feature bits from
35745 * the Init message.
35747 * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
35749 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
35751 struct LDKChannelTypeFeatures AcceptChannelV2_get_channel_type(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35754 * The channel type that this channel will represent. If none is set, we derive the channel
35755 * type from the intersection of our feature bits with our counterparty's feature bits from
35756 * the Init message.
35758 * This is required to match the equivalent field in [`OpenChannelV2::channel_type`].
35760 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
35762 void AcceptChannelV2_set_channel_type(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
35765 * Optionally, a requirement that only confirmed inputs can be added
35767 enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr);
35770 * Optionally, a requirement that only confirmed inputs can be added
35772 void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val);
35775 * Constructs a new AcceptChannelV2 given each field
35777 * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
35779 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_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg);
35782 * Creates a copy of the AcceptChannelV2
35784 struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig);
35787 * Generates a non-cryptographic 64-bit hash of the AcceptChannelV2.
35789 uint64_t AcceptChannelV2_hash(const struct LDKAcceptChannelV2 *NONNULL_PTR o);
35792 * Checks if two AcceptChannelV2s contain equal inner contents.
35793 * This ignores pointers and is_owned flags and looks at the values in fields.
35794 * Two objects with NULL inner values will be considered "equal" here.
35796 bool AcceptChannelV2_eq(const struct LDKAcceptChannelV2 *NONNULL_PTR a, const struct LDKAcceptChannelV2 *NONNULL_PTR b);
35799 * Frees any resources used by the FundingCreated, if is_owned is set and inner is non-NULL.
35801 void FundingCreated_free(struct LDKFundingCreated this_obj);
35804 * A temporary channel ID, until the funding is established
35806 const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
35809 * A temporary channel ID, until the funding is established
35811 void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35814 * The funding transaction ID
35816 const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
35819 * The funding transaction ID
35821 void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35824 * The specific output index funding this channel
35826 uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
35829 * The specific output index funding this channel
35831 void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val);
35834 * The signature of the channel initiator (funder) on the initial commitment transaction
35836 struct LDKECDSASignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr);
35839 * The signature of the channel initiator (funder) on the initial commitment transaction
35841 void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
35844 * Constructs a new FundingCreated given each field
35846 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 LDKECDSASignature signature_arg);
35849 * Creates a copy of the FundingCreated
35851 struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
35854 * Generates a non-cryptographic 64-bit hash of the FundingCreated.
35856 uint64_t FundingCreated_hash(const struct LDKFundingCreated *NONNULL_PTR o);
35859 * Checks if two FundingCreateds contain equal inner contents.
35860 * This ignores pointers and is_owned flags and looks at the values in fields.
35861 * Two objects with NULL inner values will be considered "equal" here.
35863 bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
35866 * Frees any resources used by the FundingSigned, if is_owned is set and inner is non-NULL.
35868 void FundingSigned_free(struct LDKFundingSigned this_obj);
35873 const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
35878 void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35881 * The signature of the channel acceptor (fundee) on the initial commitment transaction
35883 struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr);
35886 * The signature of the channel acceptor (fundee) on the initial commitment transaction
35888 void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
35891 * Constructs a new FundingSigned given each field
35893 MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg);
35896 * Creates a copy of the FundingSigned
35898 struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
35901 * Generates a non-cryptographic 64-bit hash of the FundingSigned.
35903 uint64_t FundingSigned_hash(const struct LDKFundingSigned *NONNULL_PTR o);
35906 * Checks if two FundingSigneds contain equal inner contents.
35907 * This ignores pointers and is_owned flags and looks at the values in fields.
35908 * Two objects with NULL inner values will be considered "equal" here.
35910 bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
35913 * Frees any resources used by the ChannelReady, if is_owned is set and inner is non-NULL.
35915 void ChannelReady_free(struct LDKChannelReady this_obj);
35920 const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
35925 void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35928 * The per-commitment point of the second commitment transaction
35930 struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr);
35933 * The per-commitment point of the second commitment transaction
35935 void ChannelReady_set_next_per_commitment_point(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKPublicKey val);
35938 * If set, provides a `short_channel_id` alias for this channel.
35940 * The sender will accept payments to be forwarded over this SCID and forward them to this
35941 * messages' recipient.
35943 struct LDKCOption_u64Z ChannelReady_get_short_channel_id_alias(const struct LDKChannelReady *NONNULL_PTR this_ptr);
35946 * If set, provides a `short_channel_id` alias for this channel.
35948 * The sender will accept payments to be forwarded over this SCID and forward them to this
35949 * messages' recipient.
35951 void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
35954 * Constructs a new ChannelReady given each field
35956 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);
35959 * Creates a copy of the ChannelReady
35961 struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
35964 * Generates a non-cryptographic 64-bit hash of the ChannelReady.
35966 uint64_t ChannelReady_hash(const struct LDKChannelReady *NONNULL_PTR o);
35969 * Checks if two ChannelReadys contain equal inner contents.
35970 * This ignores pointers and is_owned flags and looks at the values in fields.
35971 * Two objects with NULL inner values will be considered "equal" here.
35973 bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
35976 * Frees any resources used by the Stfu, if is_owned is set and inner is non-NULL.
35978 void Stfu_free(struct LDKStfu this_obj);
35981 * The channel ID where quiescence is intended
35983 const uint8_t (*Stfu_get_channel_id(const struct LDKStfu *NONNULL_PTR this_ptr))[32];
35986 * The channel ID where quiescence is intended
35988 void Stfu_set_channel_id(struct LDKStfu *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
35991 * Initiator flag, 1 if initiating, 0 if replying to an stfu.
35993 uint8_t Stfu_get_initiator(const struct LDKStfu *NONNULL_PTR this_ptr);
35996 * Initiator flag, 1 if initiating, 0 if replying to an stfu.
35998 void Stfu_set_initiator(struct LDKStfu *NONNULL_PTR this_ptr, uint8_t val);
36001 * Constructs a new Stfu given each field
36003 MUST_USE_RES struct LDKStfu Stfu_new(struct LDKThirtyTwoBytes channel_id_arg, uint8_t initiator_arg);
36006 * Creates a copy of the Stfu
36008 struct LDKStfu Stfu_clone(const struct LDKStfu *NONNULL_PTR orig);
36011 * Checks if two Stfus contain equal inner contents.
36012 * This ignores pointers and is_owned flags and looks at the values in fields.
36013 * Two objects with NULL inner values will be considered "equal" here.
36015 bool Stfu_eq(const struct LDKStfu *NONNULL_PTR a, const struct LDKStfu *NONNULL_PTR b);
36018 * Frees any resources used by the Splice, if is_owned is set and inner is non-NULL.
36020 void Splice_free(struct LDKSplice this_obj);
36023 * The channel ID where splicing is intended
36025 const uint8_t (*Splice_get_channel_id(const struct LDKSplice *NONNULL_PTR this_ptr))[32];
36028 * The channel ID where splicing is intended
36030 void Splice_set_channel_id(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36033 * The genesis hash of the blockchain where the channel is intended to be spliced
36035 const uint8_t (*Splice_get_chain_hash(const struct LDKSplice *NONNULL_PTR this_ptr))[32];
36038 * The genesis hash of the blockchain where the channel is intended to be spliced
36040 void Splice_set_chain_hash(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36043 * The intended change in channel capacity: the amount to be added (positive value)
36044 * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
36046 int64_t Splice_get_relative_satoshis(const struct LDKSplice *NONNULL_PTR this_ptr);
36049 * The intended change in channel capacity: the amount to be added (positive value)
36050 * or removed (negative value) by the sender (splice initiator) by splicing into/from the channel.
36052 void Splice_set_relative_satoshis(struct LDKSplice *NONNULL_PTR this_ptr, int64_t val);
36055 * The feerate for the new funding transaction, set by the splice initiator
36057 uint32_t Splice_get_funding_feerate_perkw(const struct LDKSplice *NONNULL_PTR this_ptr);
36060 * The feerate for the new funding transaction, set by the splice initiator
36062 void Splice_set_funding_feerate_perkw(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
36065 * The locktime for the new funding transaction
36067 uint32_t Splice_get_locktime(const struct LDKSplice *NONNULL_PTR this_ptr);
36070 * The locktime for the new funding transaction
36072 void Splice_set_locktime(struct LDKSplice *NONNULL_PTR this_ptr, uint32_t val);
36075 * The key of the sender (splice initiator) controlling the new funding transaction
36077 struct LDKPublicKey Splice_get_funding_pubkey(const struct LDKSplice *NONNULL_PTR this_ptr);
36080 * The key of the sender (splice initiator) controlling the new funding transaction
36082 void Splice_set_funding_pubkey(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36085 * Constructs a new Splice given each field
36087 MUST_USE_RES struct LDKSplice Splice_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, uint32_t funding_feerate_perkw_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg);
36090 * Creates a copy of the Splice
36092 struct LDKSplice Splice_clone(const struct LDKSplice *NONNULL_PTR orig);
36095 * Checks if two Splices contain equal inner contents.
36096 * This ignores pointers and is_owned flags and looks at the values in fields.
36097 * Two objects with NULL inner values will be considered "equal" here.
36099 bool Splice_eq(const struct LDKSplice *NONNULL_PTR a, const struct LDKSplice *NONNULL_PTR b);
36102 * Frees any resources used by the SpliceAck, if is_owned is set and inner is non-NULL.
36104 void SpliceAck_free(struct LDKSpliceAck this_obj);
36107 * The channel ID where splicing is intended
36109 const uint8_t (*SpliceAck_get_channel_id(const struct LDKSpliceAck *NONNULL_PTR this_ptr))[32];
36112 * The channel ID where splicing is intended
36114 void SpliceAck_set_channel_id(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36117 * The genesis hash of the blockchain where the channel is intended to be spliced
36119 const uint8_t (*SpliceAck_get_chain_hash(const struct LDKSpliceAck *NONNULL_PTR this_ptr))[32];
36122 * The genesis hash of the blockchain where the channel is intended to be spliced
36124 void SpliceAck_set_chain_hash(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36127 * The intended change in channel capacity: the amount to be added (positive value)
36128 * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
36130 int64_t SpliceAck_get_relative_satoshis(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
36133 * The intended change in channel capacity: the amount to be added (positive value)
36134 * or removed (negative value) by the sender (splice acceptor) by splicing into/from the channel.
36136 void SpliceAck_set_relative_satoshis(struct LDKSpliceAck *NONNULL_PTR this_ptr, int64_t val);
36139 * The key of the sender (splice acceptor) controlling the new funding transaction
36141 struct LDKPublicKey SpliceAck_get_funding_pubkey(const struct LDKSpliceAck *NONNULL_PTR this_ptr);
36144 * The key of the sender (splice acceptor) controlling the new funding transaction
36146 void SpliceAck_set_funding_pubkey(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36149 * Constructs a new SpliceAck given each field
36151 MUST_USE_RES struct LDKSpliceAck SpliceAck_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, struct LDKPublicKey funding_pubkey_arg);
36154 * Creates a copy of the SpliceAck
36156 struct LDKSpliceAck SpliceAck_clone(const struct LDKSpliceAck *NONNULL_PTR orig);
36159 * Checks if two SpliceAcks contain equal inner contents.
36160 * This ignores pointers and is_owned flags and looks at the values in fields.
36161 * Two objects with NULL inner values will be considered "equal" here.
36163 bool SpliceAck_eq(const struct LDKSpliceAck *NONNULL_PTR a, const struct LDKSpliceAck *NONNULL_PTR b);
36166 * Frees any resources used by the SpliceLocked, if is_owned is set and inner is non-NULL.
36168 void SpliceLocked_free(struct LDKSpliceLocked this_obj);
36173 const uint8_t (*SpliceLocked_get_channel_id(const struct LDKSpliceLocked *NONNULL_PTR this_ptr))[32];
36178 void SpliceLocked_set_channel_id(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36181 * Constructs a new SpliceLocked given each field
36183 MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKThirtyTwoBytes channel_id_arg);
36186 * Creates a copy of the SpliceLocked
36188 struct LDKSpliceLocked SpliceLocked_clone(const struct LDKSpliceLocked *NONNULL_PTR orig);
36191 * Checks if two SpliceLockeds contain equal inner contents.
36192 * This ignores pointers and is_owned flags and looks at the values in fields.
36193 * Two objects with NULL inner values will be considered "equal" here.
36195 bool SpliceLocked_eq(const struct LDKSpliceLocked *NONNULL_PTR a, const struct LDKSpliceLocked *NONNULL_PTR b);
36198 * Frees any resources used by the TxAddInput, if is_owned is set and inner is non-NULL.
36200 void TxAddInput_free(struct LDKTxAddInput this_obj);
36205 const uint8_t (*TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr))[32];
36210 void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36213 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
36216 uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
36219 * A randomly chosen unique identifier for this input, which is even for initiators and odd for
36222 void TxAddInput_set_serial_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint64_t val);
36225 * Serialized transaction that contains the output this input spends to verify that it is non
36228 struct LDKTransactionU16LenLimited TxAddInput_get_prevtx(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
36231 * Serialized transaction that contains the output this input spends to verify that it is non
36234 void TxAddInput_set_prevtx(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKTransactionU16LenLimited val);
36237 * The index of the output being spent
36239 uint32_t TxAddInput_get_prevtx_out(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
36242 * The index of the output being spent
36244 void TxAddInput_set_prevtx_out(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
36247 * The sequence number of this input
36249 uint32_t TxAddInput_get_sequence(const struct LDKTxAddInput *NONNULL_PTR this_ptr);
36252 * The sequence number of this input
36254 void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val);
36257 * Constructs a new TxAddInput given each field
36259 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);
36262 * Creates a copy of the TxAddInput
36264 struct LDKTxAddInput TxAddInput_clone(const struct LDKTxAddInput *NONNULL_PTR orig);
36267 * Generates a non-cryptographic 64-bit hash of the TxAddInput.
36269 uint64_t TxAddInput_hash(const struct LDKTxAddInput *NONNULL_PTR o);
36272 * Checks if two TxAddInputs contain equal inner contents.
36273 * This ignores pointers and is_owned flags and looks at the values in fields.
36274 * Two objects with NULL inner values will be considered "equal" here.
36276 bool TxAddInput_eq(const struct LDKTxAddInput *NONNULL_PTR a, const struct LDKTxAddInput *NONNULL_PTR b);
36279 * Frees any resources used by the TxAddOutput, if is_owned is set and inner is non-NULL.
36281 void TxAddOutput_free(struct LDKTxAddOutput this_obj);
36286 const uint8_t (*TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr))[32];
36291 void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36294 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
36297 uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
36300 * A randomly chosen unique identifier for this output, which is even for initiators and odd for
36303 void TxAddOutput_set_serial_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
36306 * The satoshi value of the output
36308 uint64_t TxAddOutput_get_sats(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
36311 * The satoshi value of the output
36313 void TxAddOutput_set_sats(struct LDKTxAddOutput *NONNULL_PTR this_ptr, uint64_t val);
36316 * The scriptPubKey for the output
36318 struct LDKCVec_u8Z TxAddOutput_get_script(const struct LDKTxAddOutput *NONNULL_PTR this_ptr);
36321 * The scriptPubKey for the output
36323 void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
36326 * Constructs a new TxAddOutput given each field
36328 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);
36331 * Creates a copy of the TxAddOutput
36333 struct LDKTxAddOutput TxAddOutput_clone(const struct LDKTxAddOutput *NONNULL_PTR orig);
36336 * Generates a non-cryptographic 64-bit hash of the TxAddOutput.
36338 uint64_t TxAddOutput_hash(const struct LDKTxAddOutput *NONNULL_PTR o);
36341 * Checks if two TxAddOutputs contain equal inner contents.
36342 * This ignores pointers and is_owned flags and looks at the values in fields.
36343 * Two objects with NULL inner values will be considered "equal" here.
36345 bool TxAddOutput_eq(const struct LDKTxAddOutput *NONNULL_PTR a, const struct LDKTxAddOutput *NONNULL_PTR b);
36348 * Frees any resources used by the TxRemoveInput, if is_owned is set and inner is non-NULL.
36350 void TxRemoveInput_free(struct LDKTxRemoveInput this_obj);
36355 const uint8_t (*TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr))[32];
36360 void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36363 * The serial ID of the input to be removed
36365 uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr);
36368 * The serial ID of the input to be removed
36370 void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val);
36373 * Constructs a new TxRemoveInput given each field
36375 MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
36378 * Creates a copy of the TxRemoveInput
36380 struct LDKTxRemoveInput TxRemoveInput_clone(const struct LDKTxRemoveInput *NONNULL_PTR orig);
36383 * Generates a non-cryptographic 64-bit hash of the TxRemoveInput.
36385 uint64_t TxRemoveInput_hash(const struct LDKTxRemoveInput *NONNULL_PTR o);
36388 * Checks if two TxRemoveInputs contain equal inner contents.
36389 * This ignores pointers and is_owned flags and looks at the values in fields.
36390 * Two objects with NULL inner values will be considered "equal" here.
36392 bool TxRemoveInput_eq(const struct LDKTxRemoveInput *NONNULL_PTR a, const struct LDKTxRemoveInput *NONNULL_PTR b);
36395 * Frees any resources used by the TxRemoveOutput, if is_owned is set and inner is non-NULL.
36397 void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj);
36402 const uint8_t (*TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr))[32];
36407 void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36410 * The serial ID of the output to be removed
36412 uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr);
36415 * The serial ID of the output to be removed
36417 void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val);
36420 * Constructs a new TxRemoveOutput given each field
36422 MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg);
36425 * Creates a copy of the TxRemoveOutput
36427 struct LDKTxRemoveOutput TxRemoveOutput_clone(const struct LDKTxRemoveOutput *NONNULL_PTR orig);
36430 * Generates a non-cryptographic 64-bit hash of the TxRemoveOutput.
36432 uint64_t TxRemoveOutput_hash(const struct LDKTxRemoveOutput *NONNULL_PTR o);
36435 * Checks if two TxRemoveOutputs contain equal inner contents.
36436 * This ignores pointers and is_owned flags and looks at the values in fields.
36437 * Two objects with NULL inner values will be considered "equal" here.
36439 bool TxRemoveOutput_eq(const struct LDKTxRemoveOutput *NONNULL_PTR a, const struct LDKTxRemoveOutput *NONNULL_PTR b);
36442 * Frees any resources used by the TxComplete, if is_owned is set and inner is non-NULL.
36444 void TxComplete_free(struct LDKTxComplete this_obj);
36449 const uint8_t (*TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr))[32];
36454 void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36457 * Constructs a new TxComplete given each field
36459 MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKThirtyTwoBytes channel_id_arg);
36462 * Creates a copy of the TxComplete
36464 struct LDKTxComplete TxComplete_clone(const struct LDKTxComplete *NONNULL_PTR orig);
36467 * Generates a non-cryptographic 64-bit hash of the TxComplete.
36469 uint64_t TxComplete_hash(const struct LDKTxComplete *NONNULL_PTR o);
36472 * Checks if two TxCompletes contain equal inner contents.
36473 * This ignores pointers and is_owned flags and looks at the values in fields.
36474 * Two objects with NULL inner values will be considered "equal" here.
36476 bool TxComplete_eq(const struct LDKTxComplete *NONNULL_PTR a, const struct LDKTxComplete *NONNULL_PTR b);
36479 * Frees any resources used by the TxSignatures, if is_owned is set and inner is non-NULL.
36481 void TxSignatures_free(struct LDKTxSignatures this_obj);
36486 const uint8_t (*TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
36491 void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36496 const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32];
36501 void TxSignatures_set_tx_hash(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36504 * The list of witnesses
36506 * Returns a copy of the field.
36508 struct LDKCVec_WitnessZ TxSignatures_get_witnesses(const struct LDKTxSignatures *NONNULL_PTR this_ptr);
36511 * The list of witnesses
36513 void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val);
36516 * Constructs a new TxSignatures given each field
36518 MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg);
36521 * Creates a copy of the TxSignatures
36523 struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig);
36526 * Generates a non-cryptographic 64-bit hash of the TxSignatures.
36528 uint64_t TxSignatures_hash(const struct LDKTxSignatures *NONNULL_PTR o);
36531 * Checks if two TxSignaturess contain equal inner contents.
36532 * This ignores pointers and is_owned flags and looks at the values in fields.
36533 * Two objects with NULL inner values will be considered "equal" here.
36535 bool TxSignatures_eq(const struct LDKTxSignatures *NONNULL_PTR a, const struct LDKTxSignatures *NONNULL_PTR b);
36538 * Frees any resources used by the TxInitRbf, if is_owned is set and inner is non-NULL.
36540 void TxInitRbf_free(struct LDKTxInitRbf this_obj);
36545 const uint8_t (*TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr))[32];
36550 void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36553 * The locktime of the transaction
36555 uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
36558 * The locktime of the transaction
36560 void TxInitRbf_set_locktime(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
36563 * The feerate of the transaction
36565 uint32_t TxInitRbf_get_feerate_sat_per_1000_weight(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
36568 * The feerate of the transaction
36570 void TxInitRbf_set_feerate_sat_per_1000_weight(struct LDKTxInitRbf *NONNULL_PTR this_ptr, uint32_t val);
36573 * The number of satoshis the sender will contribute to or, if negative, remove from
36574 * (e.g. splice-out) the funding output of the transaction
36576 struct LDKCOption_i64Z TxInitRbf_get_funding_output_contribution(const struct LDKTxInitRbf *NONNULL_PTR this_ptr);
36579 * The number of satoshis the sender will contribute to or, if negative, remove from
36580 * (e.g. splice-out) the funding output of the transaction
36582 void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
36585 * Constructs a new TxInitRbf given each field
36587 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);
36590 * Creates a copy of the TxInitRbf
36592 struct LDKTxInitRbf TxInitRbf_clone(const struct LDKTxInitRbf *NONNULL_PTR orig);
36595 * Generates a non-cryptographic 64-bit hash of the TxInitRbf.
36597 uint64_t TxInitRbf_hash(const struct LDKTxInitRbf *NONNULL_PTR o);
36600 * Checks if two TxInitRbfs contain equal inner contents.
36601 * This ignores pointers and is_owned flags and looks at the values in fields.
36602 * Two objects with NULL inner values will be considered "equal" here.
36604 bool TxInitRbf_eq(const struct LDKTxInitRbf *NONNULL_PTR a, const struct LDKTxInitRbf *NONNULL_PTR b);
36607 * Frees any resources used by the TxAckRbf, if is_owned is set and inner is non-NULL.
36609 void TxAckRbf_free(struct LDKTxAckRbf this_obj);
36614 const uint8_t (*TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr))[32];
36619 void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36622 * The number of satoshis the sender will contribute to or, if negative, remove from
36623 * (e.g. splice-out) the funding output of the transaction
36625 struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr);
36628 * The number of satoshis the sender will contribute to or, if negative, remove from
36629 * (e.g. splice-out) the funding output of the transaction
36631 void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val);
36634 * Constructs a new TxAckRbf given each field
36636 MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg);
36639 * Creates a copy of the TxAckRbf
36641 struct LDKTxAckRbf TxAckRbf_clone(const struct LDKTxAckRbf *NONNULL_PTR orig);
36644 * Generates a non-cryptographic 64-bit hash of the TxAckRbf.
36646 uint64_t TxAckRbf_hash(const struct LDKTxAckRbf *NONNULL_PTR o);
36649 * Checks if two TxAckRbfs contain equal inner contents.
36650 * This ignores pointers and is_owned flags and looks at the values in fields.
36651 * Two objects with NULL inner values will be considered "equal" here.
36653 bool TxAckRbf_eq(const struct LDKTxAckRbf *NONNULL_PTR a, const struct LDKTxAckRbf *NONNULL_PTR b);
36656 * Frees any resources used by the TxAbort, if is_owned is set and inner is non-NULL.
36658 void TxAbort_free(struct LDKTxAbort this_obj);
36663 const uint8_t (*TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr))[32];
36668 void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36673 * Returns a copy of the field.
36675 struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr);
36680 void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
36683 * Constructs a new TxAbort given each field
36685 MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg);
36688 * Creates a copy of the TxAbort
36690 struct LDKTxAbort TxAbort_clone(const struct LDKTxAbort *NONNULL_PTR orig);
36693 * Generates a non-cryptographic 64-bit hash of the TxAbort.
36695 uint64_t TxAbort_hash(const struct LDKTxAbort *NONNULL_PTR o);
36698 * Checks if two TxAborts contain equal inner contents.
36699 * This ignores pointers and is_owned flags and looks at the values in fields.
36700 * Two objects with NULL inner values will be considered "equal" here.
36702 bool TxAbort_eq(const struct LDKTxAbort *NONNULL_PTR a, const struct LDKTxAbort *NONNULL_PTR b);
36705 * Frees any resources used by the Shutdown, if is_owned is set and inner is non-NULL.
36707 void Shutdown_free(struct LDKShutdown this_obj);
36712 const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
36717 void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36720 * The destination of this peer's funds on closing.
36722 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
36724 struct LDKCVec_u8Z Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr);
36727 * The destination of this peer's funds on closing.
36729 * Must be in one of these forms: P2PKH, P2SH, P2WPKH, P2WSH, P2TR.
36731 void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
36734 * Constructs a new Shutdown given each field
36736 MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg);
36739 * Creates a copy of the Shutdown
36741 struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
36744 * Generates a non-cryptographic 64-bit hash of the Shutdown.
36746 uint64_t Shutdown_hash(const struct LDKShutdown *NONNULL_PTR o);
36749 * Checks if two Shutdowns contain equal inner contents.
36750 * This ignores pointers and is_owned flags and looks at the values in fields.
36751 * Two objects with NULL inner values will be considered "equal" here.
36753 bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
36756 * Frees any resources used by the ClosingSignedFeeRange, if is_owned is set and inner is non-NULL.
36758 void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
36761 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
36764 uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
36767 * The minimum absolute fee, in satoshis, which the sender is willing to place on the closing
36770 void ClosingSignedFeeRange_set_min_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
36773 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
36776 uint64_t ClosingSignedFeeRange_get_max_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
36779 * The maximum absolute fee, in satoshis, which the sender is willing to place on the closing
36782 void ClosingSignedFeeRange_set_max_fee_satoshis(struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr, uint64_t val);
36785 * Constructs a new ClosingSignedFeeRange given each field
36787 MUST_USE_RES struct LDKClosingSignedFeeRange ClosingSignedFeeRange_new(uint64_t min_fee_satoshis_arg, uint64_t max_fee_satoshis_arg);
36790 * Creates a copy of the ClosingSignedFeeRange
36792 struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
36795 * Generates a non-cryptographic 64-bit hash of the ClosingSignedFeeRange.
36797 uint64_t ClosingSignedFeeRange_hash(const struct LDKClosingSignedFeeRange *NONNULL_PTR o);
36800 * Checks if two ClosingSignedFeeRanges contain equal inner contents.
36801 * This ignores pointers and is_owned flags and looks at the values in fields.
36802 * Two objects with NULL inner values will be considered "equal" here.
36804 bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
36807 * Frees any resources used by the ClosingSigned, if is_owned is set and inner is non-NULL.
36809 void ClosingSigned_free(struct LDKClosingSigned this_obj);
36814 const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
36819 void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36822 * The proposed total fee for the closing transaction
36824 uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
36827 * The proposed total fee for the closing transaction
36829 void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val);
36832 * A signature on the closing transaction
36834 struct LDKECDSASignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
36837 * A signature on the closing transaction
36839 void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
36842 * The minimum and maximum fees which the sender is willing to accept, provided only by new
36845 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36847 struct LDKClosingSignedFeeRange ClosingSigned_get_fee_range(const struct LDKClosingSigned *NONNULL_PTR this_ptr);
36850 * The minimum and maximum fees which the sender is willing to accept, provided only by new
36853 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36855 void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val);
36858 * Constructs a new ClosingSigned given each field
36860 * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36862 MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKECDSASignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg);
36865 * Creates a copy of the ClosingSigned
36867 struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
36870 * Generates a non-cryptographic 64-bit hash of the ClosingSigned.
36872 uint64_t ClosingSigned_hash(const struct LDKClosingSigned *NONNULL_PTR o);
36875 * Checks if two ClosingSigneds contain equal inner contents.
36876 * This ignores pointers and is_owned flags and looks at the values in fields.
36877 * Two objects with NULL inner values will be considered "equal" here.
36879 bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
36882 * Frees any resources used by the UpdateAddHTLC, if is_owned is set and inner is non-NULL.
36884 void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
36889 const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
36894 void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36899 uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
36904 void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
36907 * The HTLC value in milli-satoshi
36909 uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
36912 * The HTLC value in milli-satoshi
36914 void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val);
36917 * The payment hash, the pre-image of which controls HTLC redemption
36919 const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
36922 * The payment hash, the pre-image of which controls HTLC redemption
36924 void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
36927 * The expiry height of the HTLC
36929 uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
36932 * The expiry height of the HTLC
36934 void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val);
36937 * The extra fee skimmed by the sender of this message. See
36938 * [`ChannelConfig::accept_underpaying_htlcs`].
36940 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
36942 struct LDKCOption_u64Z UpdateAddHTLC_get_skimmed_fee_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
36945 * The extra fee skimmed by the sender of this message. See
36946 * [`ChannelConfig::accept_underpaying_htlcs`].
36948 * [`ChannelConfig::accept_underpaying_htlcs`]: crate::util::config::ChannelConfig::accept_underpaying_htlcs
36950 void UpdateAddHTLC_set_skimmed_fee_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
36953 * The onion routing packet with encrypted data for the next hop.
36955 struct LDKOnionPacket UpdateAddHTLC_get_onion_routing_packet(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
36958 * The onion routing packet with encrypted data for the next hop.
36960 void UpdateAddHTLC_set_onion_routing_packet(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKOnionPacket val);
36963 * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
36964 * routing packet and the recipient-provided encrypted payload within.
36966 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
36968 struct LDKPublicKey UpdateAddHTLC_get_blinding_point(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr);
36971 * Provided if we are relaying or receiving a payment within a blinded path, to decrypt the onion
36972 * routing packet and the recipient-provided encrypted payload within.
36974 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
36976 void UpdateAddHTLC_set_blinding_point(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKPublicKey val);
36979 * Constructs a new UpdateAddHTLC given each field
36981 * Note that blinding_point_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
36983 MUST_USE_RES struct LDKUpdateAddHTLC UpdateAddHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, uint64_t amount_msat_arg, struct LDKThirtyTwoBytes payment_hash_arg, uint32_t cltv_expiry_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, struct LDKOnionPacket onion_routing_packet_arg, struct LDKPublicKey blinding_point_arg);
36986 * Creates a copy of the UpdateAddHTLC
36988 struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
36991 * Generates a non-cryptographic 64-bit hash of the UpdateAddHTLC.
36993 uint64_t UpdateAddHTLC_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR o);
36996 * Checks if two UpdateAddHTLCs contain equal inner contents.
36997 * This ignores pointers and is_owned flags and looks at the values in fields.
36998 * Two objects with NULL inner values will be considered "equal" here.
37000 bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
37003 * Frees any resources used by the OnionMessage, if is_owned is set and inner is non-NULL.
37005 void OnionMessage_free(struct LDKOnionMessage this_obj);
37008 * Used in decrypting the onion packet's payload.
37010 struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
37013 * Used in decrypting the onion packet's payload.
37015 void OnionMessage_set_blinding_point(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPublicKey val);
37018 * The full onion packet including hop data, pubkey, and hmac
37020 struct LDKPacket OnionMessage_get_onion_routing_packet(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
37023 * The full onion packet including hop data, pubkey, and hmac
37025 void OnionMessage_set_onion_routing_packet(struct LDKOnionMessage *NONNULL_PTR this_ptr, struct LDKPacket val);
37028 * Constructs a new OnionMessage given each field
37030 MUST_USE_RES struct LDKOnionMessage OnionMessage_new(struct LDKPublicKey blinding_point_arg, struct LDKPacket onion_routing_packet_arg);
37033 * Creates a copy of the OnionMessage
37035 struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
37038 * Generates a non-cryptographic 64-bit hash of the OnionMessage.
37040 uint64_t OnionMessage_hash(const struct LDKOnionMessage *NONNULL_PTR o);
37043 * Checks if two OnionMessages contain equal inner contents.
37044 * This ignores pointers and is_owned flags and looks at the values in fields.
37045 * Two objects with NULL inner values will be considered "equal" here.
37047 bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
37050 * Frees any resources used by the UpdateFulfillHTLC, if is_owned is set and inner is non-NULL.
37052 void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
37057 const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
37062 void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37067 uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr);
37072 void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val);
37075 * The pre-image of the payment hash, allowing HTLC redemption
37077 const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
37080 * The pre-image of the payment hash, allowing HTLC redemption
37082 void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37085 * Constructs a new UpdateFulfillHTLC given each field
37087 MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg);
37090 * Creates a copy of the UpdateFulfillHTLC
37092 struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
37095 * Generates a non-cryptographic 64-bit hash of the UpdateFulfillHTLC.
37097 uint64_t UpdateFulfillHTLC_hash(const struct LDKUpdateFulfillHTLC *NONNULL_PTR o);
37100 * Checks if two UpdateFulfillHTLCs contain equal inner contents.
37101 * This ignores pointers and is_owned flags and looks at the values in fields.
37102 * Two objects with NULL inner values will be considered "equal" here.
37104 bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
37107 * Frees any resources used by the UpdateFailHTLC, if is_owned is set and inner is non-NULL.
37109 void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
37114 const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
37119 void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37124 uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr);
37129 void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val);
37132 * Creates a copy of the UpdateFailHTLC
37134 struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
37137 * Generates a non-cryptographic 64-bit hash of the UpdateFailHTLC.
37139 uint64_t UpdateFailHTLC_hash(const struct LDKUpdateFailHTLC *NONNULL_PTR o);
37142 * Checks if two UpdateFailHTLCs contain equal inner contents.
37143 * This ignores pointers and is_owned flags and looks at the values in fields.
37144 * Two objects with NULL inner values will be considered "equal" here.
37146 bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
37149 * Frees any resources used by the UpdateFailMalformedHTLC, if is_owned is set and inner is non-NULL.
37151 void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
37156 const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
37161 void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37166 uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
37171 void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val);
37176 uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr);
37181 void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val);
37184 * Creates a copy of the UpdateFailMalformedHTLC
37186 struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
37189 * Generates a non-cryptographic 64-bit hash of the UpdateFailMalformedHTLC.
37191 uint64_t UpdateFailMalformedHTLC_hash(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR o);
37194 * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
37195 * This ignores pointers and is_owned flags and looks at the values in fields.
37196 * Two objects with NULL inner values will be considered "equal" here.
37198 bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
37201 * Frees any resources used by the CommitmentSigned, if is_owned is set and inner is non-NULL.
37203 void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
37208 const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
37213 void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37216 * A signature on the commitment transaction
37218 struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
37221 * A signature on the commitment transaction
37223 void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37226 * Signatures on the HTLC transactions
37228 * Returns a copy of the field.
37230 struct LDKCVec_ECDSASignatureZ CommitmentSigned_get_htlc_signatures(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr);
37233 * Signatures on the HTLC transactions
37235 void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
37238 * Constructs a new CommitmentSigned given each field
37240 MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg);
37243 * Creates a copy of the CommitmentSigned
37245 struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
37248 * Generates a non-cryptographic 64-bit hash of the CommitmentSigned.
37250 uint64_t CommitmentSigned_hash(const struct LDKCommitmentSigned *NONNULL_PTR o);
37253 * Checks if two CommitmentSigneds contain equal inner contents.
37254 * This ignores pointers and is_owned flags and looks at the values in fields.
37255 * Two objects with NULL inner values will be considered "equal" here.
37257 bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
37260 * Frees any resources used by the RevokeAndACK, if is_owned is set and inner is non-NULL.
37262 void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
37267 const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
37272 void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37275 * The secret corresponding to the per-commitment point
37277 const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
37280 * The secret corresponding to the per-commitment point
37282 void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37285 * The next sender-broadcast commitment transaction's per-commitment point
37287 struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr);
37290 * The next sender-broadcast commitment transaction's per-commitment point
37292 void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val);
37295 * Constructs a new RevokeAndACK given each field
37297 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);
37300 * Creates a copy of the RevokeAndACK
37302 struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
37305 * Generates a non-cryptographic 64-bit hash of the RevokeAndACK.
37307 uint64_t RevokeAndACK_hash(const struct LDKRevokeAndACK *NONNULL_PTR o);
37310 * Checks if two RevokeAndACKs contain equal inner contents.
37311 * This ignores pointers and is_owned flags and looks at the values in fields.
37312 * Two objects with NULL inner values will be considered "equal" here.
37314 bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
37317 * Frees any resources used by the UpdateFee, if is_owned is set and inner is non-NULL.
37319 void UpdateFee_free(struct LDKUpdateFee this_obj);
37324 const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
37329 void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37332 * Fee rate per 1000-weight of the transaction
37334 uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr);
37337 * Fee rate per 1000-weight of the transaction
37339 void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val);
37342 * Constructs a new UpdateFee given each field
37344 MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg);
37347 * Creates a copy of the UpdateFee
37349 struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
37352 * Generates a non-cryptographic 64-bit hash of the UpdateFee.
37354 uint64_t UpdateFee_hash(const struct LDKUpdateFee *NONNULL_PTR o);
37357 * Checks if two UpdateFees contain equal inner contents.
37358 * This ignores pointers and is_owned flags and looks at the values in fields.
37359 * Two objects with NULL inner values will be considered "equal" here.
37361 bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
37364 * Frees any resources used by the ChannelReestablish, if is_owned is set and inner is non-NULL.
37366 void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
37371 const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
37376 void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37379 * The next commitment number for the sender
37381 uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
37384 * The next commitment number for the sender
37386 void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
37389 * The next commitment number for the recipient
37391 uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
37394 * The next commitment number for the recipient
37396 void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val);
37399 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
37400 * belonging to the recipient
37402 const uint8_t (*ChannelReestablish_get_your_last_per_commitment_secret(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
37405 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
37406 * belonging to the recipient
37408 void ChannelReestablish_set_your_last_per_commitment_secret(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37411 * The sender's per-commitment point for their current commitment transaction
37413 struct LDKPublicKey ChannelReestablish_get_my_current_per_commitment_point(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
37416 * The sender's per-commitment point for their current commitment transaction
37418 void ChannelReestablish_set_my_current_per_commitment_point(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKPublicKey val);
37421 * The next funding transaction ID
37423 struct LDKCOption_ThirtyTwoBytesZ ChannelReestablish_get_next_funding_txid(const struct LDKChannelReestablish *NONNULL_PTR this_ptr);
37426 * The next funding transaction ID
37428 void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
37431 * Constructs a new ChannelReestablish given each field
37433 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_ThirtyTwoBytesZ next_funding_txid_arg);
37436 * Creates a copy of the ChannelReestablish
37438 struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
37441 * Generates a non-cryptographic 64-bit hash of the ChannelReestablish.
37443 uint64_t ChannelReestablish_hash(const struct LDKChannelReestablish *NONNULL_PTR o);
37446 * Checks if two ChannelReestablishs contain equal inner contents.
37447 * This ignores pointers and is_owned flags and looks at the values in fields.
37448 * Two objects with NULL inner values will be considered "equal" here.
37450 bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
37453 * Frees any resources used by the AnnouncementSignatures, if is_owned is set and inner is non-NULL.
37455 void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
37460 const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
37465 void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37468 * The short channel ID
37470 uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
37473 * The short channel ID
37475 void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val);
37478 * A signature by the node key
37480 struct LDKECDSASignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
37483 * A signature by the node key
37485 void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37488 * A signature by the funding key
37490 struct LDKECDSASignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr);
37493 * A signature by the funding key
37495 void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37498 * Constructs a new AnnouncementSignatures given each field
37500 MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKECDSASignature node_signature_arg, struct LDKECDSASignature bitcoin_signature_arg);
37503 * Creates a copy of the AnnouncementSignatures
37505 struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
37508 * Generates a non-cryptographic 64-bit hash of the AnnouncementSignatures.
37510 uint64_t AnnouncementSignatures_hash(const struct LDKAnnouncementSignatures *NONNULL_PTR o);
37513 * Checks if two AnnouncementSignaturess contain equal inner contents.
37514 * This ignores pointers and is_owned flags and looks at the values in fields.
37515 * Two objects with NULL inner values will be considered "equal" here.
37517 bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
37520 * Frees any resources used by the SocketAddress
37522 void SocketAddress_free(struct LDKSocketAddress this_ptr);
37525 * Creates a copy of the SocketAddress
37527 struct LDKSocketAddress SocketAddress_clone(const struct LDKSocketAddress *NONNULL_PTR orig);
37530 * Utility method to constructs a new TcpIpV4-variant SocketAddress
37532 struct LDKSocketAddress SocketAddress_tcp_ip_v4(struct LDKFourBytes addr, uint16_t port);
37535 * Utility method to constructs a new TcpIpV6-variant SocketAddress
37537 struct LDKSocketAddress SocketAddress_tcp_ip_v6(struct LDKSixteenBytes addr, uint16_t port);
37540 * Utility method to constructs a new OnionV2-variant SocketAddress
37542 struct LDKSocketAddress SocketAddress_onion_v2(struct LDKTwelveBytes a);
37545 * Utility method to constructs a new OnionV3-variant SocketAddress
37547 struct LDKSocketAddress SocketAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
37550 * Utility method to constructs a new Hostname-variant SocketAddress
37552 struct LDKSocketAddress SocketAddress_hostname(struct LDKHostname hostname, uint16_t port);
37555 * Generates a non-cryptographic 64-bit hash of the SocketAddress.
37557 uint64_t SocketAddress_hash(const struct LDKSocketAddress *NONNULL_PTR o);
37560 * Checks if two SocketAddresss contain equal inner contents.
37561 * This ignores pointers and is_owned flags and looks at the values in fields.
37563 bool SocketAddress_eq(const struct LDKSocketAddress *NONNULL_PTR a, const struct LDKSocketAddress *NONNULL_PTR b);
37566 * Serialize the SocketAddress object into a byte array which can be read by SocketAddress_read
37568 struct LDKCVec_u8Z SocketAddress_write(const struct LDKSocketAddress *NONNULL_PTR obj);
37571 * Read a SocketAddress from a byte array, created by SocketAddress_write
37573 struct LDKCResult_SocketAddressDecodeErrorZ SocketAddress_read(struct LDKu8slice ser);
37576 * Creates a copy of the SocketAddressParseError
37578 enum LDKSocketAddressParseError SocketAddressParseError_clone(const enum LDKSocketAddressParseError *NONNULL_PTR orig);
37581 * Utility method to constructs a new SocketAddrParse-variant SocketAddressParseError
37583 enum LDKSocketAddressParseError SocketAddressParseError_socket_addr_parse(void);
37586 * Utility method to constructs a new InvalidInput-variant SocketAddressParseError
37588 enum LDKSocketAddressParseError SocketAddressParseError_invalid_input(void);
37591 * Utility method to constructs a new InvalidPort-variant SocketAddressParseError
37593 enum LDKSocketAddressParseError SocketAddressParseError_invalid_port(void);
37596 * Utility method to constructs a new InvalidOnionV3-variant SocketAddressParseError
37598 enum LDKSocketAddressParseError SocketAddressParseError_invalid_onion_v3(void);
37601 * Generates a non-cryptographic 64-bit hash of the SocketAddressParseError.
37603 uint64_t SocketAddressParseError_hash(const enum LDKSocketAddressParseError *NONNULL_PTR o);
37606 * Checks if two SocketAddressParseErrors contain equal inner contents.
37607 * This ignores pointers and is_owned flags and looks at the values in fields.
37609 bool SocketAddressParseError_eq(const enum LDKSocketAddressParseError *NONNULL_PTR a, const enum LDKSocketAddressParseError *NONNULL_PTR b);
37612 * Parses an OnionV3 host and port into a [`SocketAddress::OnionV3`].
37614 * The host part must end with \".onion\".
37616 struct LDKCResult_SocketAddressSocketAddressParseErrorZ parse_onion_address(struct LDKStr host, uint16_t port);
37619 * Get the string representation of a SocketAddress object
37621 struct LDKStr SocketAddress_to_str(const struct LDKSocketAddress *NONNULL_PTR o);
37624 * Read a SocketAddress object from a string
37626 struct LDKCResult_SocketAddressSocketAddressParseErrorZ SocketAddress_from_str(struct LDKStr s);
37629 * Frees any resources used by the UnsignedGossipMessage
37631 void UnsignedGossipMessage_free(struct LDKUnsignedGossipMessage this_ptr);
37634 * Creates a copy of the UnsignedGossipMessage
37636 struct LDKUnsignedGossipMessage UnsignedGossipMessage_clone(const struct LDKUnsignedGossipMessage *NONNULL_PTR orig);
37639 * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage
37641 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_announcement(struct LDKUnsignedChannelAnnouncement a);
37644 * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage
37646 struct LDKUnsignedGossipMessage UnsignedGossipMessage_channel_update(struct LDKUnsignedChannelUpdate a);
37649 * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage
37651 struct LDKUnsignedGossipMessage UnsignedGossipMessage_node_announcement(struct LDKUnsignedNodeAnnouncement a);
37654 * Serialize the UnsignedGossipMessage object into a byte array which can be read by UnsignedGossipMessage_read
37656 struct LDKCVec_u8Z UnsignedGossipMessage_write(const struct LDKUnsignedGossipMessage *NONNULL_PTR obj);
37659 * Frees any resources used by the UnsignedNodeAnnouncement, if is_owned is set and inner is non-NULL.
37661 void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_obj);
37664 * The advertised features
37666 struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
37669 * The advertised features
37671 void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
37674 * A strictly monotonic announcement counter, with gaps allowed
37676 uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
37679 * A strictly monotonic announcement counter, with gaps allowed
37681 void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val);
37684 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
37687 struct LDKNodeId UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
37690 * The `node_id` this announcement originated from (don't rebroadcast the `node_announcement` back
37693 void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
37696 * An RGB color for UI purposes
37698 const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3];
37701 * An RGB color for UI purposes
37703 void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
37706 * An alias, for UI purposes.
37708 * This should be sanitized before use. There is no guarantee of uniqueness.
37710 struct LDKNodeAlias UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
37713 * An alias, for UI purposes.
37715 * This should be sanitized before use. There is no guarantee of uniqueness.
37717 void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
37720 * List of addresses on which this node is reachable
37722 * Returns a copy of the field.
37724 struct LDKCVec_SocketAddressZ UnsignedNodeAnnouncement_get_addresses(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr);
37727 * List of addresses on which this node is reachable
37729 void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val);
37732 * Creates a copy of the UnsignedNodeAnnouncement
37734 struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
37737 * Generates a non-cryptographic 64-bit hash of the UnsignedNodeAnnouncement.
37739 uint64_t UnsignedNodeAnnouncement_hash(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR o);
37742 * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
37743 * This ignores pointers and is_owned flags and looks at the values in fields.
37744 * Two objects with NULL inner values will be considered "equal" here.
37746 bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
37749 * Frees any resources used by the NodeAnnouncement, if is_owned is set and inner is non-NULL.
37751 void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
37754 * The signature by the node key
37756 struct LDKECDSASignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
37759 * The signature by the node key
37761 void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37764 * The actual content of the announcement
37766 struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
37769 * The actual content of the announcement
37771 void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val);
37774 * Constructs a new NodeAnnouncement given each field
37776 MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg);
37779 * Creates a copy of the NodeAnnouncement
37781 struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
37784 * Generates a non-cryptographic 64-bit hash of the NodeAnnouncement.
37786 uint64_t NodeAnnouncement_hash(const struct LDKNodeAnnouncement *NONNULL_PTR o);
37789 * Checks if two NodeAnnouncements contain equal inner contents.
37790 * This ignores pointers and is_owned flags and looks at the values in fields.
37791 * Two objects with NULL inner values will be considered "equal" here.
37793 bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
37796 * Frees any resources used by the UnsignedChannelAnnouncement, if is_owned is set and inner is non-NULL.
37798 void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
37801 * The advertised channel features
37803 struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37806 * The advertised channel features
37808 void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
37811 * The genesis hash of the blockchain where the channel is to be opened
37813 const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32];
37816 * The genesis hash of the blockchain where the channel is to be opened
37818 void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
37821 * The short channel ID
37823 uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37826 * The short channel ID
37828 void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val);
37831 * One of the two `node_id`s which are endpoints of this channel
37833 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37836 * One of the two `node_id`s which are endpoints of this channel
37838 void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
37841 * The other of the two `node_id`s which are endpoints of this channel
37843 struct LDKNodeId UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37846 * The other of the two `node_id`s which are endpoints of this channel
37848 void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
37851 * The funding key for the first node
37853 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37856 * The funding key for the first node
37858 void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
37861 * The funding key for the second node
37863 struct LDKNodeId UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37866 * The funding key for the second node
37868 void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeId val);
37871 * Excess data which was signed as a part of the message which we do not (yet) understand how
37874 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
37876 * Returns a copy of the field.
37878 struct LDKCVec_u8Z UnsignedChannelAnnouncement_get_excess_data(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
37881 * Excess data which was signed as a part of the message which we do not (yet) understand how
37884 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
37886 void UnsignedChannelAnnouncement_set_excess_data(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
37889 * Constructs a new UnsignedChannelAnnouncement given each field
37891 MUST_USE_RES struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_new(struct LDKChannelFeatures features_arg, struct LDKThirtyTwoBytes chain_hash_arg, uint64_t short_channel_id_arg, struct LDKNodeId node_id_1_arg, struct LDKNodeId node_id_2_arg, struct LDKNodeId bitcoin_key_1_arg, struct LDKNodeId bitcoin_key_2_arg, struct LDKCVec_u8Z excess_data_arg);
37894 * Creates a copy of the UnsignedChannelAnnouncement
37896 struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
37899 * Generates a non-cryptographic 64-bit hash of the UnsignedChannelAnnouncement.
37901 uint64_t UnsignedChannelAnnouncement_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR o);
37904 * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
37905 * This ignores pointers and is_owned flags and looks at the values in fields.
37906 * Two objects with NULL inner values will be considered "equal" here.
37908 bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
37911 * Frees any resources used by the ChannelAnnouncement, if is_owned is set and inner is non-NULL.
37913 void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
37916 * Authentication of the announcement by the first public node
37918 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
37921 * Authentication of the announcement by the first public node
37923 void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37926 * Authentication of the announcement by the second public node
37928 struct LDKECDSASignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
37931 * Authentication of the announcement by the second public node
37933 void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37936 * Proof of funding UTXO ownership by the first public node
37938 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
37941 * Proof of funding UTXO ownership by the first public node
37943 void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37946 * Proof of funding UTXO ownership by the second public node
37948 struct LDKECDSASignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
37951 * Proof of funding UTXO ownership by the second public node
37953 void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
37956 * The actual announcement
37958 struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
37961 * The actual announcement
37963 void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val);
37966 * Constructs a new ChannelAnnouncement given each field
37968 MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKECDSASignature node_signature_1_arg, struct LDKECDSASignature node_signature_2_arg, struct LDKECDSASignature bitcoin_signature_1_arg, struct LDKECDSASignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg);
37971 * Creates a copy of the ChannelAnnouncement
37973 struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
37976 * Generates a non-cryptographic 64-bit hash of the ChannelAnnouncement.
37978 uint64_t ChannelAnnouncement_hash(const struct LDKChannelAnnouncement *NONNULL_PTR o);
37981 * Checks if two ChannelAnnouncements contain equal inner contents.
37982 * This ignores pointers and is_owned flags and looks at the values in fields.
37983 * Two objects with NULL inner values will be considered "equal" here.
37985 bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
37988 * Frees any resources used by the UnsignedChannelUpdate, if is_owned is set and inner is non-NULL.
37990 void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
37993 * The genesis hash of the blockchain where the channel is to be opened
37995 const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
37998 * The genesis hash of the blockchain where the channel is to be opened
38000 void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38003 * The short channel ID
38005 uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38008 * The short channel ID
38010 void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
38013 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
38015 uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38018 * A strictly monotonic announcement counter, with gaps allowed, specific to this channel
38020 void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
38025 uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38030 void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val);
38033 * The number of blocks such that if:
38034 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
38035 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
38036 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
38037 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
38038 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
38039 * forwarding. Note that the HTLC sender is the one who originally sets this value when
38040 * constructing the route.
38042 uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38045 * The number of blocks such that if:
38046 * `incoming_htlc.cltv_expiry < outgoing_htlc.cltv_expiry + cltv_expiry_delta`
38047 * then we need to fail the HTLC backwards. When forwarding an HTLC, `cltv_expiry_delta` determines
38048 * the outgoing HTLC's minimum `cltv_expiry` value -- so, if an incoming HTLC comes in with a
38049 * `cltv_expiry` of 100000, and the node we're forwarding to has a `cltv_expiry_delta` value of 10,
38050 * then we'll check that the outgoing HTLC's `cltv_expiry` value is at least 100010 before
38051 * forwarding. Note that the HTLC sender is the one who originally sets this value when
38052 * constructing the route.
38054 void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val);
38057 * The minimum HTLC size incoming to sender, in milli-satoshi
38059 uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38062 * The minimum HTLC size incoming to sender, in milli-satoshi
38064 void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
38067 * The maximum HTLC value incoming to sender, in milli-satoshi.
38069 * This used to be optional.
38071 uint64_t UnsignedChannelUpdate_get_htlc_maximum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38074 * The maximum HTLC value incoming to sender, in milli-satoshi.
38076 * This used to be optional.
38078 void UnsignedChannelUpdate_set_htlc_maximum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val);
38081 * The base HTLC fee charged by sender, in milli-satoshi
38083 uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38086 * The base HTLC fee charged by sender, in milli-satoshi
38088 void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
38091 * The amount to fee multiplier, in micro-satoshi
38093 uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38096 * The amount to fee multiplier, in micro-satoshi
38098 void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val);
38101 * Excess data which was signed as a part of the message which we do not (yet) understand how
38104 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
38106 * Returns a copy of the field.
38108 struct LDKCVec_u8Z UnsignedChannelUpdate_get_excess_data(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr);
38111 * Excess data which was signed as a part of the message which we do not (yet) understand how
38114 * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
38116 void UnsignedChannelUpdate_set_excess_data(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
38119 * Constructs a new UnsignedChannelUpdate given each field
38121 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);
38124 * Creates a copy of the UnsignedChannelUpdate
38126 struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
38129 * Generates a non-cryptographic 64-bit hash of the UnsignedChannelUpdate.
38131 uint64_t UnsignedChannelUpdate_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR o);
38134 * Checks if two UnsignedChannelUpdates contain equal inner contents.
38135 * This ignores pointers and is_owned flags and looks at the values in fields.
38136 * Two objects with NULL inner values will be considered "equal" here.
38138 bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
38141 * Frees any resources used by the ChannelUpdate, if is_owned is set and inner is non-NULL.
38143 void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
38146 * A signature of the channel update
38148 struct LDKECDSASignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
38151 * A signature of the channel update
38153 void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
38156 * The actual channel update
38158 struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
38161 * The actual channel update
38163 void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val);
38166 * Constructs a new ChannelUpdate given each field
38168 MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKECDSASignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg);
38171 * Creates a copy of the ChannelUpdate
38173 struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
38176 * Generates a non-cryptographic 64-bit hash of the ChannelUpdate.
38178 uint64_t ChannelUpdate_hash(const struct LDKChannelUpdate *NONNULL_PTR o);
38181 * Checks if two ChannelUpdates contain equal inner contents.
38182 * This ignores pointers and is_owned flags and looks at the values in fields.
38183 * Two objects with NULL inner values will be considered "equal" here.
38185 bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
38188 * Frees any resources used by the QueryChannelRange, if is_owned is set and inner is non-NULL.
38190 void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
38193 * The genesis hash of the blockchain being queried
38195 const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
38198 * The genesis hash of the blockchain being queried
38200 void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38203 * The height of the first block for the channel UTXOs being queried
38205 uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
38208 * The height of the first block for the channel UTXOs being queried
38210 void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
38213 * The number of blocks to include in the query results
38215 uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr);
38218 * The number of blocks to include in the query results
38220 void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val);
38223 * Constructs a new QueryChannelRange given each field
38225 MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg);
38228 * Creates a copy of the QueryChannelRange
38230 struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
38233 * Generates a non-cryptographic 64-bit hash of the QueryChannelRange.
38235 uint64_t QueryChannelRange_hash(const struct LDKQueryChannelRange *NONNULL_PTR o);
38238 * Checks if two QueryChannelRanges contain equal inner contents.
38239 * This ignores pointers and is_owned flags and looks at the values in fields.
38240 * Two objects with NULL inner values will be considered "equal" here.
38242 bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
38245 * Frees any resources used by the ReplyChannelRange, if is_owned is set and inner is non-NULL.
38247 void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
38250 * The genesis hash of the blockchain being queried
38252 const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
38255 * The genesis hash of the blockchain being queried
38257 void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38260 * The height of the first block in the range of the reply
38262 uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
38265 * The height of the first block in the range of the reply
38267 void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
38270 * The number of blocks included in the range of the reply
38272 uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
38275 * The number of blocks included in the range of the reply
38277 void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val);
38280 * True when this is the final reply for a query
38282 bool ReplyChannelRange_get_sync_complete(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
38285 * True when this is the final reply for a query
38287 void ReplyChannelRange_set_sync_complete(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val);
38290 * The `short_channel_id`s in the channel range
38292 * Returns a copy of the field.
38294 struct LDKCVec_u64Z ReplyChannelRange_get_short_channel_ids(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr);
38297 * The `short_channel_id`s in the channel range
38299 void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
38302 * Constructs a new ReplyChannelRange given each field
38304 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);
38307 * Creates a copy of the ReplyChannelRange
38309 struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
38312 * Generates a non-cryptographic 64-bit hash of the ReplyChannelRange.
38314 uint64_t ReplyChannelRange_hash(const struct LDKReplyChannelRange *NONNULL_PTR o);
38317 * Checks if two ReplyChannelRanges contain equal inner contents.
38318 * This ignores pointers and is_owned flags and looks at the values in fields.
38319 * Two objects with NULL inner values will be considered "equal" here.
38321 bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
38324 * Frees any resources used by the QueryShortChannelIds, if is_owned is set and inner is non-NULL.
38326 void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
38329 * The genesis hash of the blockchain being queried
38331 const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
38334 * The genesis hash of the blockchain being queried
38336 void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38339 * The short_channel_ids that are being queried
38341 * Returns a copy of the field.
38343 struct LDKCVec_u64Z QueryShortChannelIds_get_short_channel_ids(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr);
38346 * The short_channel_ids that are being queried
38348 void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
38351 * Constructs a new QueryShortChannelIds given each field
38353 MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg);
38356 * Creates a copy of the QueryShortChannelIds
38358 struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
38361 * Generates a non-cryptographic 64-bit hash of the QueryShortChannelIds.
38363 uint64_t QueryShortChannelIds_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR o);
38366 * Checks if two QueryShortChannelIdss contain equal inner contents.
38367 * This ignores pointers and is_owned flags and looks at the values in fields.
38368 * Two objects with NULL inner values will be considered "equal" here.
38370 bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
38373 * Frees any resources used by the ReplyShortChannelIdsEnd, if is_owned is set and inner is non-NULL.
38375 void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
38378 * The genesis hash of the blockchain that was queried
38380 const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
38383 * The genesis hash of the blockchain that was queried
38385 void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38388 * Indicates if the query recipient maintains up-to-date channel
38389 * information for the `chain_hash`
38391 bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr);
38394 * Indicates if the query recipient maintains up-to-date channel
38395 * information for the `chain_hash`
38397 void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val);
38400 * Constructs a new ReplyShortChannelIdsEnd given each field
38402 MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg);
38405 * Creates a copy of the ReplyShortChannelIdsEnd
38407 struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
38410 * Generates a non-cryptographic 64-bit hash of the ReplyShortChannelIdsEnd.
38412 uint64_t ReplyShortChannelIdsEnd_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR o);
38415 * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
38416 * This ignores pointers and is_owned flags and looks at the values in fields.
38417 * Two objects with NULL inner values will be considered "equal" here.
38419 bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
38422 * Frees any resources used by the GossipTimestampFilter, if is_owned is set and inner is non-NULL.
38424 void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
38427 * The genesis hash of the blockchain for channel and node information
38429 const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
38432 * The genesis hash of the blockchain for channel and node information
38434 void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38437 * The starting unix timestamp
38439 uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
38442 * The starting unix timestamp
38444 void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
38447 * The range of information in seconds
38449 uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr);
38452 * The range of information in seconds
38454 void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val);
38457 * Constructs a new GossipTimestampFilter given each field
38459 MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg);
38462 * Creates a copy of the GossipTimestampFilter
38464 struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
38467 * Generates a non-cryptographic 64-bit hash of the GossipTimestampFilter.
38469 uint64_t GossipTimestampFilter_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR o);
38472 * Checks if two GossipTimestampFilters contain equal inner contents.
38473 * This ignores pointers and is_owned flags and looks at the values in fields.
38474 * Two objects with NULL inner values will be considered "equal" here.
38476 bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
38479 * Frees any resources used by the ErrorAction
38481 void ErrorAction_free(struct LDKErrorAction this_ptr);
38484 * Creates a copy of the ErrorAction
38486 struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
38489 * Utility method to constructs a new DisconnectPeer-variant ErrorAction
38491 struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
38494 * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction
38496 struct LDKErrorAction ErrorAction_disconnect_peer_with_warning(struct LDKWarningMessage msg);
38499 * Utility method to constructs a new IgnoreError-variant ErrorAction
38501 struct LDKErrorAction ErrorAction_ignore_error(void);
38504 * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
38506 struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
38509 * Utility method to constructs a new IgnoreDuplicateGossip-variant ErrorAction
38511 struct LDKErrorAction ErrorAction_ignore_duplicate_gossip(void);
38514 * Utility method to constructs a new SendErrorMessage-variant ErrorAction
38516 struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
38519 * Utility method to constructs a new SendWarningMessage-variant ErrorAction
38521 struct LDKErrorAction ErrorAction_send_warning_message(struct LDKWarningMessage msg, enum LDKLevel log_level);
38524 * Generates a non-cryptographic 64-bit hash of the ErrorAction.
38526 uint64_t ErrorAction_hash(const struct LDKErrorAction *NONNULL_PTR o);
38529 * Frees any resources used by the LightningError, if is_owned is set and inner is non-NULL.
38531 void LightningError_free(struct LDKLightningError this_obj);
38534 * A human-readable message describing the error
38536 struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
38539 * A human-readable message describing the error
38541 void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKStr val);
38544 * The action which should be taken against the offending peer.
38546 struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr);
38549 * The action which should be taken against the offending peer.
38551 void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val);
38554 * Constructs a new LightningError given each field
38556 MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKStr err_arg, struct LDKErrorAction action_arg);
38559 * Creates a copy of the LightningError
38561 struct LDKLightningError LightningError_clone(const struct LDKLightningError *NONNULL_PTR orig);
38564 * Frees any resources used by the CommitmentUpdate, if is_owned is set and inner is non-NULL.
38566 void CommitmentUpdate_free(struct LDKCommitmentUpdate this_obj);
38569 * `update_add_htlc` messages which should be sent
38571 struct LDKCVec_UpdateAddHTLCZ CommitmentUpdate_get_update_add_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
38574 * `update_add_htlc` messages which should be sent
38576 void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val);
38579 * `update_fulfill_htlc` messages which should be sent
38581 struct LDKCVec_UpdateFulfillHTLCZ CommitmentUpdate_get_update_fulfill_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
38584 * `update_fulfill_htlc` messages which should be sent
38586 void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val);
38589 * `update_fail_htlc` messages which should be sent
38591 struct LDKCVec_UpdateFailHTLCZ CommitmentUpdate_get_update_fail_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
38594 * `update_fail_htlc` messages which should be sent
38596 void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val);
38599 * `update_fail_malformed_htlc` messages which should be sent
38601 struct LDKCVec_UpdateFailMalformedHTLCZ CommitmentUpdate_get_update_fail_malformed_htlcs(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
38604 * `update_fail_malformed_htlc` messages which should be sent
38606 void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val);
38609 * An `update_fee` message which should be sent
38611 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
38613 struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
38616 * An `update_fee` message which should be sent
38618 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
38620 void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val);
38623 * A `commitment_signed` message which should be sent
38625 struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr);
38628 * A `commitment_signed` message which should be sent
38630 void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val);
38633 * Constructs a new CommitmentUpdate given each field
38635 * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
38637 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);
38640 * Creates a copy of the CommitmentUpdate
38642 struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
38645 * Generates a non-cryptographic 64-bit hash of the CommitmentUpdate.
38647 uint64_t CommitmentUpdate_hash(const struct LDKCommitmentUpdate *NONNULL_PTR o);
38650 * Checks if two CommitmentUpdates 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 CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
38657 * Calls the free function if one is set
38659 void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
38662 * Calls the free function if one is set
38664 void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
38667 * Calls the free function if one is set
38669 void OnionMessageHandler_free(struct LDKOnionMessageHandler this_ptr);
38672 * Frees any resources used by the FinalOnionHopData, if is_owned is set and inner is non-NULL.
38674 void FinalOnionHopData_free(struct LDKFinalOnionHopData this_obj);
38677 * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
38678 * Because it is generated by the recipient and included in the invoice, it also provides
38679 * proof to the recipient that the payment was sent by someone with the generated invoice.
38681 const uint8_t (*FinalOnionHopData_get_payment_secret(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr))[32];
38684 * When sending a multi-part payment, this secret is used to identify a payment across HTLCs.
38685 * Because it is generated by the recipient and included in the invoice, it also provides
38686 * proof to the recipient that the payment was sent by someone with the generated invoice.
38688 void FinalOnionHopData_set_payment_secret(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38691 * The intended total amount that this payment is for.
38693 * Message serialization may panic if this value is more than 21 million Bitcoin.
38695 uint64_t FinalOnionHopData_get_total_msat(const struct LDKFinalOnionHopData *NONNULL_PTR this_ptr);
38698 * The intended total amount that this payment is for.
38700 * Message serialization may panic if this value is more than 21 million Bitcoin.
38702 void FinalOnionHopData_set_total_msat(struct LDKFinalOnionHopData *NONNULL_PTR this_ptr, uint64_t val);
38705 * Constructs a new FinalOnionHopData given each field
38707 MUST_USE_RES struct LDKFinalOnionHopData FinalOnionHopData_new(struct LDKThirtyTwoBytes payment_secret_arg, uint64_t total_msat_arg);
38710 * Creates a copy of the FinalOnionHopData
38712 struct LDKFinalOnionHopData FinalOnionHopData_clone(const struct LDKFinalOnionHopData *NONNULL_PTR orig);
38715 * Frees any resources used by the OnionPacket, if is_owned is set and inner is non-NULL.
38717 void OnionPacket_free(struct LDKOnionPacket this_obj);
38720 * BOLT 4 version number.
38722 uint8_t OnionPacket_get_version(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
38725 * BOLT 4 version number.
38727 void OnionPacket_set_version(struct LDKOnionPacket *NONNULL_PTR this_ptr, uint8_t val);
38730 * In order to ensure we always return an error on onion decode in compliance with [BOLT
38731 * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
38732 * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
38733 * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
38736 * Returns a copy of the field.
38738 struct LDKCResult_PublicKeySecp256k1ErrorZ OnionPacket_get_public_key(const struct LDKOnionPacket *NONNULL_PTR this_ptr);
38741 * In order to ensure we always return an error on onion decode in compliance with [BOLT
38742 * #4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md), we have to
38743 * deserialize `OnionPacket`s contained in [`UpdateAddHTLC`] messages even if the ephemeral
38744 * public key (here) is bogus, so we hold a [`Result`] instead of a [`PublicKey`] as we'd
38747 void OnionPacket_set_public_key(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKCResult_PublicKeySecp256k1ErrorZ val);
38750 * HMAC to verify the integrity of hop_data.
38752 const uint8_t (*OnionPacket_get_hmac(const struct LDKOnionPacket *NONNULL_PTR this_ptr))[32];
38755 * HMAC to verify the integrity of hop_data.
38757 void OnionPacket_set_hmac(struct LDKOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
38760 * Creates a copy of the OnionPacket
38762 struct LDKOnionPacket OnionPacket_clone(const struct LDKOnionPacket *NONNULL_PTR orig);
38765 * Generates a non-cryptographic 64-bit hash of the OnionPacket.
38767 uint64_t OnionPacket_hash(const struct LDKOnionPacket *NONNULL_PTR o);
38770 * Checks if two OnionPackets contain equal inner contents.
38771 * This ignores pointers and is_owned flags and looks at the values in fields.
38772 * Two objects with NULL inner values will be considered "equal" here.
38774 bool OnionPacket_eq(const struct LDKOnionPacket *NONNULL_PTR a, const struct LDKOnionPacket *NONNULL_PTR b);
38777 * Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
38779 struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj);
38782 * Read a AcceptChannel from a byte array, created by AcceptChannel_write
38784 struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser);
38787 * Serialize the AcceptChannelV2 object into a byte array which can be read by AcceptChannelV2_read
38789 struct LDKCVec_u8Z AcceptChannelV2_write(const struct LDKAcceptChannelV2 *NONNULL_PTR obj);
38792 * Read a AcceptChannelV2 from a byte array, created by AcceptChannelV2_write
38794 struct LDKCResult_AcceptChannelV2DecodeErrorZ AcceptChannelV2_read(struct LDKu8slice ser);
38797 * Serialize the Stfu object into a byte array which can be read by Stfu_read
38799 struct LDKCVec_u8Z Stfu_write(const struct LDKStfu *NONNULL_PTR obj);
38802 * Read a Stfu from a byte array, created by Stfu_write
38804 struct LDKCResult_StfuDecodeErrorZ Stfu_read(struct LDKu8slice ser);
38807 * Serialize the Splice object into a byte array which can be read by Splice_read
38809 struct LDKCVec_u8Z Splice_write(const struct LDKSplice *NONNULL_PTR obj);
38812 * Read a Splice from a byte array, created by Splice_write
38814 struct LDKCResult_SpliceDecodeErrorZ Splice_read(struct LDKu8slice ser);
38817 * Serialize the SpliceAck object into a byte array which can be read by SpliceAck_read
38819 struct LDKCVec_u8Z SpliceAck_write(const struct LDKSpliceAck *NONNULL_PTR obj);
38822 * Read a SpliceAck from a byte array, created by SpliceAck_write
38824 struct LDKCResult_SpliceAckDecodeErrorZ SpliceAck_read(struct LDKu8slice ser);
38827 * Serialize the SpliceLocked object into a byte array which can be read by SpliceLocked_read
38829 struct LDKCVec_u8Z SpliceLocked_write(const struct LDKSpliceLocked *NONNULL_PTR obj);
38832 * Read a SpliceLocked from a byte array, created by SpliceLocked_write
38834 struct LDKCResult_SpliceLockedDecodeErrorZ SpliceLocked_read(struct LDKu8slice ser);
38837 * Serialize the TxAddInput object into a byte array which can be read by TxAddInput_read
38839 struct LDKCVec_u8Z TxAddInput_write(const struct LDKTxAddInput *NONNULL_PTR obj);
38842 * Read a TxAddInput from a byte array, created by TxAddInput_write
38844 struct LDKCResult_TxAddInputDecodeErrorZ TxAddInput_read(struct LDKu8slice ser);
38847 * Serialize the TxAddOutput object into a byte array which can be read by TxAddOutput_read
38849 struct LDKCVec_u8Z TxAddOutput_write(const struct LDKTxAddOutput *NONNULL_PTR obj);
38852 * Read a TxAddOutput from a byte array, created by TxAddOutput_write
38854 struct LDKCResult_TxAddOutputDecodeErrorZ TxAddOutput_read(struct LDKu8slice ser);
38857 * Serialize the TxRemoveInput object into a byte array which can be read by TxRemoveInput_read
38859 struct LDKCVec_u8Z TxRemoveInput_write(const struct LDKTxRemoveInput *NONNULL_PTR obj);
38862 * Read a TxRemoveInput from a byte array, created by TxRemoveInput_write
38864 struct LDKCResult_TxRemoveInputDecodeErrorZ TxRemoveInput_read(struct LDKu8slice ser);
38867 * Serialize the TxRemoveOutput object into a byte array which can be read by TxRemoveOutput_read
38869 struct LDKCVec_u8Z TxRemoveOutput_write(const struct LDKTxRemoveOutput *NONNULL_PTR obj);
38872 * Read a TxRemoveOutput from a byte array, created by TxRemoveOutput_write
38874 struct LDKCResult_TxRemoveOutputDecodeErrorZ TxRemoveOutput_read(struct LDKu8slice ser);
38877 * Serialize the TxComplete object into a byte array which can be read by TxComplete_read
38879 struct LDKCVec_u8Z TxComplete_write(const struct LDKTxComplete *NONNULL_PTR obj);
38882 * Read a TxComplete from a byte array, created by TxComplete_write
38884 struct LDKCResult_TxCompleteDecodeErrorZ TxComplete_read(struct LDKu8slice ser);
38887 * Serialize the TxSignatures object into a byte array which can be read by TxSignatures_read
38889 struct LDKCVec_u8Z TxSignatures_write(const struct LDKTxSignatures *NONNULL_PTR obj);
38892 * Read a TxSignatures from a byte array, created by TxSignatures_write
38894 struct LDKCResult_TxSignaturesDecodeErrorZ TxSignatures_read(struct LDKu8slice ser);
38897 * Serialize the TxInitRbf object into a byte array which can be read by TxInitRbf_read
38899 struct LDKCVec_u8Z TxInitRbf_write(const struct LDKTxInitRbf *NONNULL_PTR obj);
38902 * Read a TxInitRbf from a byte array, created by TxInitRbf_write
38904 struct LDKCResult_TxInitRbfDecodeErrorZ TxInitRbf_read(struct LDKu8slice ser);
38907 * Serialize the TxAckRbf object into a byte array which can be read by TxAckRbf_read
38909 struct LDKCVec_u8Z TxAckRbf_write(const struct LDKTxAckRbf *NONNULL_PTR obj);
38912 * Read a TxAckRbf from a byte array, created by TxAckRbf_write
38914 struct LDKCResult_TxAckRbfDecodeErrorZ TxAckRbf_read(struct LDKu8slice ser);
38917 * Serialize the TxAbort object into a byte array which can be read by TxAbort_read
38919 struct LDKCVec_u8Z TxAbort_write(const struct LDKTxAbort *NONNULL_PTR obj);
38922 * Read a TxAbort from a byte array, created by TxAbort_write
38924 struct LDKCResult_TxAbortDecodeErrorZ TxAbort_read(struct LDKu8slice ser);
38927 * Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
38929 struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj);
38932 * Read a AnnouncementSignatures from a byte array, created by AnnouncementSignatures_write
38934 struct LDKCResult_AnnouncementSignaturesDecodeErrorZ AnnouncementSignatures_read(struct LDKu8slice ser);
38937 * Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
38939 struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj);
38942 * Read a ChannelReestablish from a byte array, created by ChannelReestablish_write
38944 struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser);
38947 * Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
38949 struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj);
38952 * Read a ClosingSigned from a byte array, created by ClosingSigned_write
38954 struct LDKCResult_ClosingSignedDecodeErrorZ ClosingSigned_read(struct LDKu8slice ser);
38957 * Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
38959 struct LDKCVec_u8Z ClosingSignedFeeRange_write(const struct LDKClosingSignedFeeRange *NONNULL_PTR obj);
38962 * Read a ClosingSignedFeeRange from a byte array, created by ClosingSignedFeeRange_write
38964 struct LDKCResult_ClosingSignedFeeRangeDecodeErrorZ ClosingSignedFeeRange_read(struct LDKu8slice ser);
38967 * Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
38969 struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj);
38972 * Read a CommitmentSigned from a byte array, created by CommitmentSigned_write
38974 struct LDKCResult_CommitmentSignedDecodeErrorZ CommitmentSigned_read(struct LDKu8slice ser);
38977 * Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
38979 struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj);
38982 * Read a FundingCreated from a byte array, created by FundingCreated_write
38984 struct LDKCResult_FundingCreatedDecodeErrorZ FundingCreated_read(struct LDKu8slice ser);
38987 * Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
38989 struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj);
38992 * Read a FundingSigned from a byte array, created by FundingSigned_write
38994 struct LDKCResult_FundingSignedDecodeErrorZ FundingSigned_read(struct LDKu8slice ser);
38997 * Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
38999 struct LDKCVec_u8Z ChannelReady_write(const struct LDKChannelReady *NONNULL_PTR obj);
39002 * Read a ChannelReady from a byte array, created by ChannelReady_write
39004 struct LDKCResult_ChannelReadyDecodeErrorZ ChannelReady_read(struct LDKu8slice ser);
39007 * Serialize the Init object into a byte array which can be read by Init_read
39009 struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj);
39012 * Read a Init from a byte array, created by Init_write
39014 struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser);
39017 * Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
39019 struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj);
39022 * Read a OpenChannel from a byte array, created by OpenChannel_write
39024 struct LDKCResult_OpenChannelDecodeErrorZ OpenChannel_read(struct LDKu8slice ser);
39027 * Serialize the OpenChannelV2 object into a byte array which can be read by OpenChannelV2_read
39029 struct LDKCVec_u8Z OpenChannelV2_write(const struct LDKOpenChannelV2 *NONNULL_PTR obj);
39032 * Read a OpenChannelV2 from a byte array, created by OpenChannelV2_write
39034 struct LDKCResult_OpenChannelV2DecodeErrorZ OpenChannelV2_read(struct LDKu8slice ser);
39037 * Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
39039 struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj);
39042 * Read a RevokeAndACK from a byte array, created by RevokeAndACK_write
39044 struct LDKCResult_RevokeAndACKDecodeErrorZ RevokeAndACK_read(struct LDKu8slice ser);
39047 * Serialize the Shutdown object into a byte array which can be read by Shutdown_read
39049 struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj);
39052 * Read a Shutdown from a byte array, created by Shutdown_write
39054 struct LDKCResult_ShutdownDecodeErrorZ Shutdown_read(struct LDKu8slice ser);
39057 * Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
39059 struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj);
39062 * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write
39064 struct LDKCResult_UpdateFailHTLCDecodeErrorZ UpdateFailHTLC_read(struct LDKu8slice ser);
39067 * Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
39069 struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj);
39072 * Read a UpdateFailMalformedHTLC from a byte array, created by UpdateFailMalformedHTLC_write
39074 struct LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ UpdateFailMalformedHTLC_read(struct LDKu8slice ser);
39077 * Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
39079 struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj);
39082 * Read a UpdateFee from a byte array, created by UpdateFee_write
39084 struct LDKCResult_UpdateFeeDecodeErrorZ UpdateFee_read(struct LDKu8slice ser);
39087 * Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
39089 struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj);
39092 * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write
39094 struct LDKCResult_UpdateFulfillHTLCDecodeErrorZ UpdateFulfillHTLC_read(struct LDKu8slice ser);
39097 * Serialize the OnionPacket object into a byte array which can be read by OnionPacket_read
39099 struct LDKCVec_u8Z OnionPacket_write(const struct LDKOnionPacket *NONNULL_PTR obj);
39102 * Read a OnionPacket from a byte array, created by OnionPacket_write
39104 struct LDKCResult_OnionPacketDecodeErrorZ OnionPacket_read(struct LDKu8slice ser);
39107 * Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
39109 struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj);
39112 * Read a UpdateAddHTLC from a byte array, created by UpdateAddHTLC_write
39114 struct LDKCResult_UpdateAddHTLCDecodeErrorZ UpdateAddHTLC_read(struct LDKu8slice ser);
39117 * Read a OnionMessage from a byte array, created by OnionMessage_write
39119 struct LDKCResult_OnionMessageDecodeErrorZ OnionMessage_read(struct LDKu8slice ser);
39122 * Serialize the OnionMessage object into a byte array which can be read by OnionMessage_read
39124 struct LDKCVec_u8Z OnionMessage_write(const struct LDKOnionMessage *NONNULL_PTR obj);
39127 * Serialize the FinalOnionHopData object into a byte array which can be read by FinalOnionHopData_read
39129 struct LDKCVec_u8Z FinalOnionHopData_write(const struct LDKFinalOnionHopData *NONNULL_PTR obj);
39132 * Read a FinalOnionHopData from a byte array, created by FinalOnionHopData_write
39134 struct LDKCResult_FinalOnionHopDataDecodeErrorZ FinalOnionHopData_read(struct LDKu8slice ser);
39137 * Serialize the Ping object into a byte array which can be read by Ping_read
39139 struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj);
39142 * Read a Ping from a byte array, created by Ping_write
39144 struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser);
39147 * Serialize the Pong object into a byte array which can be read by Pong_read
39149 struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj);
39152 * Read a Pong from a byte array, created by Pong_write
39154 struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser);
39157 * Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
39159 struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj);
39162 * Read a UnsignedChannelAnnouncement from a byte array, created by UnsignedChannelAnnouncement_write
39164 struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser);
39167 * Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
39169 struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj);
39172 * Read a ChannelAnnouncement from a byte array, created by ChannelAnnouncement_write
39174 struct LDKCResult_ChannelAnnouncementDecodeErrorZ ChannelAnnouncement_read(struct LDKu8slice ser);
39177 * Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
39179 struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj);
39182 * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write
39184 struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser);
39187 * Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
39189 struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj);
39192 * Read a ChannelUpdate from a byte array, created by ChannelUpdate_write
39194 struct LDKCResult_ChannelUpdateDecodeErrorZ ChannelUpdate_read(struct LDKu8slice ser);
39197 * Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
39199 struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj);
39202 * Read a ErrorMessage from a byte array, created by ErrorMessage_write
39204 struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser);
39207 * Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
39209 struct LDKCVec_u8Z WarningMessage_write(const struct LDKWarningMessage *NONNULL_PTR obj);
39212 * Read a WarningMessage from a byte array, created by WarningMessage_write
39214 struct LDKCResult_WarningMessageDecodeErrorZ WarningMessage_read(struct LDKu8slice ser);
39217 * Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
39219 struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj);
39222 * Read a UnsignedNodeAnnouncement from a byte array, created by UnsignedNodeAnnouncement_write
39224 struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser);
39227 * Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
39229 struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj);
39232 * Read a NodeAnnouncement from a byte array, created by NodeAnnouncement_write
39234 struct LDKCResult_NodeAnnouncementDecodeErrorZ NodeAnnouncement_read(struct LDKu8slice ser);
39237 * Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
39239 struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser);
39242 * Serialize the QueryShortChannelIds object into a byte array which can be read by QueryShortChannelIds_read
39244 struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj);
39247 * Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
39249 struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj);
39252 * Read a ReplyShortChannelIdsEnd from a byte array, created by ReplyShortChannelIdsEnd_write
39254 struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser);
39257 * Calculates the overflow safe ending block height for the query.
39259 * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`.
39261 MUST_USE_RES uint32_t QueryChannelRange_end_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_arg);
39264 * Serialize the QueryChannelRange object into a byte array which can be read by QueryChannelRange_read
39266 struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj);
39269 * Read a QueryChannelRange from a byte array, created by QueryChannelRange_write
39271 struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser);
39274 * Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
39276 struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser);
39279 * Serialize the ReplyChannelRange object into a byte array which can be read by ReplyChannelRange_read
39281 struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj);
39284 * Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
39286 struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj);
39289 * Read a GossipTimestampFilter from a byte array, created by GossipTimestampFilter_write
39291 struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser);
39294 * Calls the free function if one is set
39296 void CustomMessageHandler_free(struct LDKCustomMessageHandler this_ptr);
39299 * Frees any resources used by the IgnoringMessageHandler, if is_owned is set and inner is non-NULL.
39301 void IgnoringMessageHandler_free(struct LDKIgnoringMessageHandler this_obj);
39304 * Constructs a new IgnoringMessageHandler given each field
39306 MUST_USE_RES struct LDKIgnoringMessageHandler IgnoringMessageHandler_new(void);
39309 * Constructs a new EventsProvider which calls the relevant methods on this_arg.
39310 * This copies the `inner` pointer in this_arg and thus the returned EventsProvider must be freed before this_arg is
39312 struct LDKEventsProvider IgnoringMessageHandler_as_EventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39315 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
39316 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
39318 struct LDKMessageSendEventsProvider IgnoringMessageHandler_as_MessageSendEventsProvider(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39321 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
39322 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
39324 struct LDKRoutingMessageHandler IgnoringMessageHandler_as_RoutingMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39327 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
39328 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
39330 struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39333 * Constructs a new OffersMessageHandler which calls the relevant methods on this_arg.
39334 * This copies the `inner` pointer in this_arg and thus the returned OffersMessageHandler must be freed before this_arg is
39336 struct LDKOffersMessageHandler IgnoringMessageHandler_as_OffersMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39339 * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
39340 * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
39342 struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39345 * Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
39346 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
39348 struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39351 * Constructs a new CustomMessageHandler which calls the relevant methods on this_arg.
39352 * This copies the `inner` pointer in this_arg and thus the returned CustomMessageHandler must be freed before this_arg is
39354 struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
39357 * Frees any resources used by the ErroringMessageHandler, if is_owned is set and inner is non-NULL.
39359 void ErroringMessageHandler_free(struct LDKErroringMessageHandler this_obj);
39362 * Constructs a new ErroringMessageHandler
39364 MUST_USE_RES struct LDKErroringMessageHandler ErroringMessageHandler_new(void);
39367 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
39368 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
39370 struct LDKMessageSendEventsProvider ErroringMessageHandler_as_MessageSendEventsProvider(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
39373 * Constructs a new ChannelMessageHandler which calls the relevant methods on this_arg.
39374 * This copies the `inner` pointer in this_arg and thus the returned ChannelMessageHandler must be freed before this_arg is
39376 struct LDKChannelMessageHandler ErroringMessageHandler_as_ChannelMessageHandler(const struct LDKErroringMessageHandler *NONNULL_PTR this_arg);
39379 * Frees any resources used by the MessageHandler, if is_owned is set and inner is non-NULL.
39381 void MessageHandler_free(struct LDKMessageHandler this_obj);
39384 * A message handler which handles messages specific to channels. Usually this is just a
39385 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
39387 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
39389 const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
39392 * A message handler which handles messages specific to channels. Usually this is just a
39393 * [`ChannelManager`] object or an [`ErroringMessageHandler`].
39395 * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
39397 void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val);
39400 * A message handler which handles messages updating our knowledge of the network channel
39401 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
39403 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
39405 const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
39408 * A message handler which handles messages updating our knowledge of the network channel
39409 * graph. Usually this is just a [`P2PGossipSync`] object or an [`IgnoringMessageHandler`].
39411 * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
39413 void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val);
39416 * A message handler which handles onion messages. This should generally be an
39417 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
39419 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
39421 const struct LDKOnionMessageHandler *MessageHandler_get_onion_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
39424 * A message handler which handles onion messages. This should generally be an
39425 * [`OnionMessenger`], but can also be an [`IgnoringMessageHandler`].
39427 * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger
39429 void MessageHandler_set_onion_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKOnionMessageHandler val);
39432 * A message handler which handles custom messages. The only LDK-provided implementation is
39433 * [`IgnoringMessageHandler`].
39435 const struct LDKCustomMessageHandler *MessageHandler_get_custom_message_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr);
39438 * A message handler which handles custom messages. The only LDK-provided implementation is
39439 * [`IgnoringMessageHandler`].
39441 void MessageHandler_set_custom_message_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKCustomMessageHandler val);
39444 * Constructs a new MessageHandler given each field
39446 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);
39449 * Creates a copy of a SocketDescriptor
39451 struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig);
39454 * Calls the free function if one is set
39456 void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr);
39459 * Frees any resources used by the PeerHandleError, if is_owned is set and inner is non-NULL.
39461 void PeerHandleError_free(struct LDKPeerHandleError this_obj);
39464 * Constructs a new PeerHandleError given each field
39466 MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void);
39469 * Creates a copy of the PeerHandleError
39471 struct LDKPeerHandleError PeerHandleError_clone(const struct LDKPeerHandleError *NONNULL_PTR orig);
39474 * Frees any resources used by the PeerManager, if is_owned is set and inner is non-NULL.
39476 void PeerManager_free(struct LDKPeerManager this_obj);
39479 * Constructs a new `PeerManager` with the given message handlers.
39481 * `ephemeral_random_data` is used to derive per-connection ephemeral keys and must be
39482 * cryptographically secure random bytes.
39484 * `current_time` is used as an always-increasing counter that survives across restarts and is
39485 * incremented irregularly internally. In general it is best to simply use the current UNIX
39486 * timestamp, however if it is not available a persistent counter that increases once per
39487 * minute should suffice.
39489 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);
39492 * Get a list of tuples mapping from node id to network addresses for peers which have
39493 * completed the initial handshake.
39495 * For outbound connections, the [`PublicKey`] will be the same as the `their_node_id` parameter
39496 * passed in to [`Self::new_outbound_connection`], however entries will only appear once the initial
39497 * handshake has completed and we are sure the remote peer has the private key for the given
39500 * The returned `Option`s will only be `Some` if an address had been previously given via
39501 * [`Self::new_outbound_connection`] or [`Self::new_inbound_connection`].
39503 MUST_USE_RES struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
39506 * Indicates a new outbound connection has been established to a node with the given `node_id`
39507 * and an optional remote network address.
39509 * The remote network address adds the option to report a remote IP address back to a connecting
39510 * peer using the init message.
39511 * The user should pass the remote network address of the host they are connected to.
39513 * If an `Err` is returned here you must disconnect the connection immediately.
39515 * Returns a small number of bytes to send to the remote node (currently always 50).
39517 * Panics if descriptor is duplicative with some other descriptor which has not yet been
39518 * [`socket_disconnected`].
39520 * [`socket_disconnected`]: PeerManager::socket_disconnected
39522 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_SocketAddressZ remote_network_address);
39525 * Indicates a new inbound connection has been established to a node with an optional remote
39528 * The remote network address adds the option to report a remote IP address back to a connecting
39529 * peer using the init message.
39530 * The user should pass the remote network address of the host they are connected to.
39532 * May refuse the connection by returning an Err, but will never write bytes to the remote end
39533 * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
39534 * the connection immediately.
39536 * Panics if descriptor is duplicative with some other descriptor which has not yet been
39537 * [`socket_disconnected`].
39539 * [`socket_disconnected`]: PeerManager::socket_disconnected
39541 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor, struct LDKCOption_SocketAddressZ remote_network_address);
39544 * Indicates that there is room to write data to the given socket descriptor.
39546 * May return an Err to indicate that the connection should be closed.
39548 * May call [`send_data`] on the descriptor passed in (or an equal descriptor) before
39549 * returning. Thus, be very careful with reentrancy issues! The invariants around calling
39550 * [`write_buffer_space_avail`] in case a write did not fully complete must still hold - be
39551 * ready to call [`write_buffer_space_avail`] again if a write call generated here isn't
39554 * [`send_data`]: SocketDescriptor::send_data
39555 * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
39557 MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor);
39560 * Indicates that data was read from the given socket descriptor.
39562 * May return an Err to indicate that the connection should be closed.
39564 * Will *not* call back into [`send_data`] on any descriptors to avoid reentrancy complexity.
39565 * Thus, however, you should call [`process_events`] after any `read_event` to generate
39566 * [`send_data`] calls to handle responses.
39568 * If `Ok(true)` is returned, further read_events should not be triggered until a
39569 * [`send_data`] call on this descriptor has `resume_read` set (preventing DoS issues in the
39572 * In order to avoid processing too many messages at once per peer, `data` should be on the
39575 * [`send_data`]: SocketDescriptor::send_data
39576 * [`process_events`]: PeerManager::process_events
39578 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);
39581 * Checks for any events generated by our handlers and processes them. Includes sending most
39582 * response messages as well as messages generated by calls to handler functions directly (eg
39583 * functions like [`ChannelManager::process_pending_htlc_forwards`] or [`send_payment`]).
39585 * May call [`send_data`] on [`SocketDescriptor`]s. Thus, be very careful with reentrancy
39588 * You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
39589 * or one of the other clients provided in our language bindings.
39591 * Note that if there are any other calls to this function waiting on lock(s) this may return
39592 * without doing any work. All available events that need handling will be handled before the
39593 * other calls return.
39595 * [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
39596 * [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
39597 * [`send_data`]: SocketDescriptor::send_data
39599 void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg);
39602 * Indicates that the given socket descriptor's connection is now closed.
39604 void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor);
39607 * Disconnect a peer given its node id.
39609 * If a peer is connected, this will call [`disconnect_socket`] on the descriptor for the
39610 * peer. Thus, be very careful about reentrancy issues.
39612 * [`disconnect_socket`]: SocketDescriptor::disconnect_socket
39614 void PeerManager_disconnect_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
39617 * Disconnects all currently-connected peers. This is useful on platforms where there may be
39618 * an indication that TCP sockets have stalled even if we weren't around to time them out
39619 * using regular ping/pongs.
39621 void PeerManager_disconnect_all_peers(const struct LDKPeerManager *NONNULL_PTR this_arg);
39624 * Send pings to each peer and disconnect those which did not respond to the last round of
39627 * This may be called on any timescale you want, however, roughly once every ten seconds is
39628 * preferred. The call rate determines both how often we send a ping to our peers and how much
39629 * time they have to respond before we disconnect them.
39631 * May call [`send_data`] on all [`SocketDescriptor`]s. Thus, be very careful with reentrancy
39634 * [`send_data`]: SocketDescriptor::send_data
39636 void PeerManager_timer_tick_occurred(const struct LDKPeerManager *NONNULL_PTR this_arg);
39639 * Generates a signed node_announcement from the given arguments, sending it to all connected
39640 * peers. Note that peers will likely ignore this message unless we have at least one public
39641 * channel which has at least six confirmations on-chain.
39643 * `rgb` is a node \"color\" and `alias` is a printable human-readable string to describe this
39644 * node to humans. They carry no in-protocol meaning.
39646 * `addresses` represent the set (possibly empty) of socket addresses on which this node
39647 * accepts incoming connections. These will be included in the node_announcement, publicly
39648 * tying these addresses together and to this node. If you wish to preserve user privacy,
39649 * addresses should likely contain only Tor Onion addresses.
39651 * Panics if `addresses` is absurdly large (more than 100).
39653 * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
39655 void PeerManager_broadcast_node_announcement(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_SocketAddressZ addresses);
39658 * Gets the weight for an HTLC-Success transaction.
39660 uint64_t htlc_success_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
39663 * Gets the weight for an HTLC-Timeout transaction.
39665 uint64_t htlc_timeout_tx_weight(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
39668 * Creates a copy of the HTLCClaim
39670 enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig);
39673 * Utility method to constructs a new OfferedTimeout-variant HTLCClaim
39675 enum LDKHTLCClaim HTLCClaim_offered_timeout(void);
39678 * Utility method to constructs a new OfferedPreimage-variant HTLCClaim
39680 enum LDKHTLCClaim HTLCClaim_offered_preimage(void);
39683 * Utility method to constructs a new AcceptedTimeout-variant HTLCClaim
39685 enum LDKHTLCClaim HTLCClaim_accepted_timeout(void);
39688 * Utility method to constructs a new AcceptedPreimage-variant HTLCClaim
39690 enum LDKHTLCClaim HTLCClaim_accepted_preimage(void);
39693 * Utility method to constructs a new Revocation-variant HTLCClaim
39695 enum LDKHTLCClaim HTLCClaim_revocation(void);
39698 * Checks if two HTLCClaims contain equal inner contents.
39699 * This ignores pointers and is_owned flags and looks at the values in fields.
39701 bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b);
39704 * Check if a given input witness attempts to claim a HTLC.
39706 MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness);
39709 * Build the commitment secret from the seed and the commitment number
39711 struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx);
39714 * Build a closing transaction
39716 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);
39719 * Frees any resources used by the CounterpartyCommitmentSecrets, if is_owned is set and inner is non-NULL.
39721 void CounterpartyCommitmentSecrets_free(struct LDKCounterpartyCommitmentSecrets this_obj);
39724 * Creates a copy of the CounterpartyCommitmentSecrets
39726 struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_clone(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR orig);
39729 * Creates a new empty `CounterpartyCommitmentSecrets` structure.
39731 MUST_USE_RES struct LDKCounterpartyCommitmentSecrets CounterpartyCommitmentSecrets_new(void);
39734 * Returns the minimum index of all stored secrets. Note that indexes start
39735 * at 1 << 48 and get decremented by one for each new secret.
39737 MUST_USE_RES uint64_t CounterpartyCommitmentSecrets_get_min_seen_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg);
39740 * Inserts the `secret` at `idx`. Returns `Ok(())` if the secret
39741 * was generated in accordance with BOLT 3 and is consistent with previous secrets.
39743 MUST_USE_RES struct LDKCResult_NoneNoneZ CounterpartyCommitmentSecrets_provide_secret(struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx, struct LDKThirtyTwoBytes secret);
39746 * Returns the secret at `idx`.
39747 * Returns `None` if `idx` is < [`CounterpartyCommitmentSecrets::get_min_seen_secret`].
39749 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
39751 MUST_USE_RES struct LDKThirtyTwoBytes CounterpartyCommitmentSecrets_get_secret(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR this_arg, uint64_t idx);
39754 * Serialize the CounterpartyCommitmentSecrets object into a byte array which can be read by CounterpartyCommitmentSecrets_read
39756 struct LDKCVec_u8Z CounterpartyCommitmentSecrets_write(const struct LDKCounterpartyCommitmentSecrets *NONNULL_PTR obj);
39759 * Read a CounterpartyCommitmentSecrets from a byte array, created by CounterpartyCommitmentSecrets_write
39761 struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser);
39764 * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key)
39765 * from the base secret and the per_commitment_point.
39767 struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]);
39770 * Derives a per-commitment-transaction revocation key from its constituent parts.
39772 * Only the cheating participant owns a valid witness to propagate a revoked
39773 * commitment transaction, thus per_commitment_secret always come from cheater
39774 * and revocation_base_secret always come from punisher, which is the broadcaster
39775 * of the transaction spending with this key knowledge.
39777 struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]);
39780 * Frees any resources used by the TxCreationKeys, if is_owned is set and inner is non-NULL.
39782 void TxCreationKeys_free(struct LDKTxCreationKeys this_obj);
39785 * The broadcaster's per-commitment public key which was used to derive the other keys.
39787 struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
39790 * The broadcaster's per-commitment public key which was used to derive the other keys.
39792 void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39795 * The revocation key which is used to allow the broadcaster of the commitment
39796 * transaction to provide their counterparty the ability to punish them if they broadcast
39799 struct LDKRevocationKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
39802 * The revocation key which is used to allow the broadcaster of the commitment
39803 * transaction to provide their counterparty the ability to punish them if they broadcast
39806 void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
39809 * Broadcaster's HTLC Key
39811 struct LDKHtlcKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
39814 * Broadcaster's HTLC Key
39816 void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
39819 * Countersignatory's HTLC Key
39821 struct LDKHtlcKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
39824 * Countersignatory's HTLC Key
39826 void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKHtlcKey val);
39829 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
39831 struct LDKDelayedPaymentKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr);
39834 * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay)
39836 void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentKey val);
39839 * Constructs a new TxCreationKeys given each field
39841 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKRevocationKey revocation_key_arg, struct LDKHtlcKey broadcaster_htlc_key_arg, struct LDKHtlcKey countersignatory_htlc_key_arg, struct LDKDelayedPaymentKey broadcaster_delayed_payment_key_arg);
39844 * Checks if two TxCreationKeyss contain equal inner contents.
39845 * This ignores pointers and is_owned flags and looks at the values in fields.
39846 * Two objects with NULL inner values will be considered "equal" here.
39848 bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
39851 * Creates a copy of the TxCreationKeys
39853 struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
39856 * Serialize the TxCreationKeys object into a byte array which can be read by TxCreationKeys_read
39858 struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj);
39861 * Read a TxCreationKeys from a byte array, created by TxCreationKeys_write
39863 struct LDKCResult_TxCreationKeysDecodeErrorZ TxCreationKeys_read(struct LDKu8slice ser);
39866 * Frees any resources used by the ChannelPublicKeys, if is_owned is set and inner is non-NULL.
39868 void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_obj);
39871 * The public key which is used to sign all commitment transactions, as it appears in the
39872 * on-chain channel lock-in 2-of-2 multisig output.
39874 struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
39877 * The public key which is used to sign all commitment transactions, as it appears in the
39878 * on-chain channel lock-in 2-of-2 multisig output.
39880 void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39883 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
39884 * revocation keys. This is combined with the per-commitment-secret generated by the
39885 * counterparty to create a secret which the counterparty can reveal to revoke previous
39888 struct LDKRevocationBasepoint ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
39891 * The base point which is used (with derive_public_revocation_key) to derive per-commitment
39892 * revocation keys. This is combined with the per-commitment-secret generated by the
39893 * counterparty to create a secret which the counterparty can reveal to revoke previous
39896 void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKRevocationBasepoint val);
39899 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
39900 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
39901 * static across every commitment transaction.
39903 struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
39906 * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately
39907 * spendable primary channel balance on the broadcaster's commitment transaction. This key is
39908 * static across every commitment transaction.
39910 void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val);
39913 * The base point which is used (with derive_public_key) to derive a per-commitment payment
39914 * public key which receives non-HTLC-encumbered funds which are only available for spending
39915 * after some delay (or can be claimed via the revocation path).
39917 struct LDKDelayedPaymentBasepoint ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
39920 * The base point which is used (with derive_public_key) to derive a per-commitment payment
39921 * public key which receives non-HTLC-encumbered funds which are only available for spending
39922 * after some delay (or can be claimed via the revocation path).
39924 void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKDelayedPaymentBasepoint val);
39927 * The base point which is used (with derive_public_key) to derive a per-commitment public key
39928 * which is used to encumber HTLC-in-flight outputs.
39930 struct LDKHtlcBasepoint ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr);
39933 * The base point which is used (with derive_public_key) to derive a per-commitment public key
39934 * which is used to encumber HTLC-in-flight outputs.
39936 void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKHtlcBasepoint val);
39939 * Constructs a new ChannelPublicKeys given each field
39941 MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKRevocationBasepoint revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKDelayedPaymentBasepoint delayed_payment_basepoint_arg, struct LDKHtlcBasepoint htlc_basepoint_arg);
39944 * Creates a copy of the ChannelPublicKeys
39946 struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
39949 * Generates a non-cryptographic 64-bit hash of the ChannelPublicKeys.
39951 uint64_t ChannelPublicKeys_hash(const struct LDKChannelPublicKeys *NONNULL_PTR o);
39954 * Checks if two ChannelPublicKeyss contain equal inner contents.
39955 * This ignores pointers and is_owned flags and looks at the values in fields.
39956 * Two objects with NULL inner values will be considered "equal" here.
39958 bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
39961 * Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
39963 struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
39966 * Read a ChannelPublicKeys from a byte array, created by ChannelPublicKeys_write
39968 struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
39971 * Create per-state keys from channel base points and the per-commitment point.
39972 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
39974 MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, const struct LDKDelayedPaymentBasepoint *NONNULL_PTR broadcaster_delayed_payment_base, const struct LDKHtlcBasepoint *NONNULL_PTR broadcaster_htlc_base, const struct LDKRevocationBasepoint *NONNULL_PTR countersignatory_revocation_base, const struct LDKHtlcBasepoint *NONNULL_PTR countersignatory_htlc_base);
39977 * Generate per-state keys from channel static keys.
39978 * Key set is asymmetric and can't be used as part of counter-signatory set of transactions.
39980 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);
39983 * A script either spendable by the revocation
39984 * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain.
39985 * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions.
39987 struct LDKCVec_u8Z get_revokeable_redeemscript(const struct LDKRevocationKey *NONNULL_PTR revocation_key, uint16_t contest_delay, const struct LDKDelayedPaymentKey *NONNULL_PTR broadcaster_delayed_payment_key);
39990 * Returns the script for the counterparty's output on a holder's commitment transaction based on
39991 * the channel type.
39993 struct LDKCVec_u8Z get_counterparty_payment_script(const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features, struct LDKPublicKey payment_key);
39996 * Frees any resources used by the HTLCOutputInCommitment, if is_owned is set and inner is non-NULL.
39998 void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_obj);
40001 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
40002 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
40003 * need to compare this value to whether the commitment transaction in question is that of
40004 * the counterparty or our own.
40006 bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
40009 * Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
40010 * Note that this is not the same as whether it is ountbound *from us*. To determine that you
40011 * need to compare this value to whether the commitment transaction in question is that of
40012 * the counterparty or our own.
40014 void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val);
40017 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
40018 * this divided by 1000.
40020 uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
40023 * The value, in msat, of the HTLC. The value as it appears in the commitment transaction is
40024 * this divided by 1000.
40026 void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val);
40029 * The CLTV lock-time at which this HTLC expires.
40031 uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
40034 * The CLTV lock-time at which this HTLC expires.
40036 void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val);
40039 * The hash of the preimage which unlocks this HTLC.
40041 const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32];
40044 * The hash of the preimage which unlocks this HTLC.
40046 void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40049 * The position within the commitment transactions' outputs. This may be None if the value is
40050 * below the dust limit (in which case no output appears in the commitment transaction and the
40051 * value is spent to additional transaction fees).
40053 struct LDKCOption_u32Z HTLCOutputInCommitment_get_transaction_output_index(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr);
40056 * The position within the commitment transactions' outputs. This may be None if the value is
40057 * below the dust limit (in which case no output appears in the commitment transaction and the
40058 * value is spent to additional transaction fees).
40060 void HTLCOutputInCommitment_set_transaction_output_index(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val);
40063 * Constructs a new HTLCOutputInCommitment given each field
40065 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);
40068 * Creates a copy of the HTLCOutputInCommitment
40070 struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
40073 * Checks if two HTLCOutputInCommitments contain equal inner contents.
40074 * This ignores pointers and is_owned flags and looks at the values in fields.
40075 * Two objects with NULL inner values will be considered "equal" here.
40077 bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
40080 * Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
40082 struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
40085 * Read a HTLCOutputInCommitment from a byte array, created by HTLCOutputInCommitment_write
40087 struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
40090 * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc
40091 * does not need to have its previous_output_index filled.
40093 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);
40096 * Gets the redeemscript for a funding output from the two funding public keys.
40097 * Note that the order of funding public keys does not matter.
40099 struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory);
40102 * Builds an unsigned HTLC-Success or HTLC-Timeout transaction from the given channel and HTLC
40103 * parameters. This is used by [`TrustedCommitmentTransaction::get_htlc_sigs`] to fetch the
40104 * transaction which needs signing, and can be used to construct an HTLC transaction which is
40105 * broadcastable given a counterparty HTLC signature.
40107 * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the
40108 * commitment transaction).
40110 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, const struct LDKDelayedPaymentKey *NONNULL_PTR broadcaster_delayed_payment_key, const struct LDKRevocationKey *NONNULL_PTR revocation_key);
40113 * Returns the witness required to satisfy and spend a HTLC input.
40115 struct LDKWitness build_htlc_input_witness(struct LDKECDSASignature local_sig, struct LDKECDSASignature remote_sig, struct LDKCOption_ThirtyTwoBytesZ preimage, struct LDKu8slice redeem_script, const struct LDKChannelTypeFeatures *NONNULL_PTR channel_type_features);
40118 * Gets the witnessScript for the to_remote output when anchors are enabled.
40120 struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point);
40123 * Gets the witnessScript for an anchor output from the funding public key.
40124 * The witness in the spending input must be:
40125 * <BIP 143 funding_signature>
40126 * After 16 blocks of confirmation, an alternative satisfying witness could be:
40128 * (empty vector required to satisfy compliance with MINIMALIF-standard rule)
40130 struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey);
40133 * Returns the witness required to satisfy and spend an anchor input.
40135 struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKECDSASignature funding_sig);
40138 * Frees any resources used by the ChannelTransactionParameters, if is_owned is set and inner is non-NULL.
40140 void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj);
40143 * Holder public keys
40145 struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
40148 * Holder public keys
40150 void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
40153 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
40155 uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
40158 * The contest delay selected by the holder, which applies to counterparty-broadcast transactions
40160 void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
40163 * Whether the holder is the initiator of this channel.
40164 * This is an input to the commitment number obscure factor computation.
40166 bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
40169 * Whether the holder is the initiator of this channel.
40170 * This is an input to the commitment number obscure factor computation.
40172 void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val);
40175 * The late-bound counterparty channel transaction parameters.
40176 * These parameters are populated at the point in the protocol where the counterparty provides them.
40178 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40180 struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
40183 * The late-bound counterparty channel transaction parameters.
40184 * These parameters are populated at the point in the protocol where the counterparty provides them.
40186 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40188 void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val);
40191 * The late-bound funding outpoint
40193 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
40195 struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
40198 * The late-bound funding outpoint
40200 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
40202 void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val);
40205 * This channel's type, as negotiated during channel open. For old objects where this field
40206 * wasn't serialized, it will default to static_remote_key at deserialization.
40208 struct LDKChannelTypeFeatures ChannelTransactionParameters_get_channel_type_features(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr);
40211 * This channel's type, as negotiated during channel open. For old objects where this field
40212 * wasn't serialized, it will default to static_remote_key at deserialization.
40214 void ChannelTransactionParameters_set_channel_type_features(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val);
40217 * Constructs a new ChannelTransactionParameters given each field
40219 * Note that counterparty_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40220 * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
40222 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);
40225 * Creates a copy of the ChannelTransactionParameters
40227 struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig);
40230 * Generates a non-cryptographic 64-bit hash of the ChannelTransactionParameters.
40232 uint64_t ChannelTransactionParameters_hash(const struct LDKChannelTransactionParameters *NONNULL_PTR o);
40235 * Checks if two ChannelTransactionParameterss contain equal inner contents.
40236 * This ignores pointers and is_owned flags and looks at the values in fields.
40237 * Two objects with NULL inner values will be considered "equal" here.
40239 bool ChannelTransactionParameters_eq(const struct LDKChannelTransactionParameters *NONNULL_PTR a, const struct LDKChannelTransactionParameters *NONNULL_PTR b);
40242 * Frees any resources used by the CounterpartyChannelTransactionParameters, if is_owned is set and inner is non-NULL.
40244 void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_obj);
40247 * Counter-party public keys
40249 struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
40252 * Counter-party public keys
40254 void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val);
40257 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
40259 uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr);
40262 * The contest delay selected by the counterparty, which applies to holder-broadcast transactions
40264 void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val);
40267 * Constructs a new CounterpartyChannelTransactionParameters given each field
40269 MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg);
40272 * Creates a copy of the CounterpartyChannelTransactionParameters
40274 struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig);
40277 * Generates a non-cryptographic 64-bit hash of the CounterpartyChannelTransactionParameters.
40279 uint64_t CounterpartyChannelTransactionParameters_hash(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR o);
40282 * Checks if two CounterpartyChannelTransactionParameterss contain equal inner contents.
40283 * This ignores pointers and is_owned flags and looks at the values in fields.
40284 * Two objects with NULL inner values will be considered "equal" here.
40286 bool CounterpartyChannelTransactionParameters_eq(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR a, const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR b);
40289 * Whether the late bound parameters are populated.
40291 MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
40294 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
40295 * given that the holder is the broadcaster.
40297 * self.is_populated() must be true before calling this function.
40299 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
40302 * Convert the holder/counterparty parameters to broadcaster/countersignatory-organized parameters,
40303 * given that the counterparty is the broadcaster.
40305 * self.is_populated() must be true before calling this function.
40307 MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg);
40310 * Serialize the CounterpartyChannelTransactionParameters object into a byte array which can be read by CounterpartyChannelTransactionParameters_read
40312 struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj);
40315 * Read a CounterpartyChannelTransactionParameters from a byte array, created by CounterpartyChannelTransactionParameters_write
40317 struct LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser);
40320 * Serialize the ChannelTransactionParameters object into a byte array which can be read by ChannelTransactionParameters_read
40322 struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj);
40325 * Read a ChannelTransactionParameters from a byte array, created by ChannelTransactionParameters_write
40327 struct LDKCResult_ChannelTransactionParametersDecodeErrorZ ChannelTransactionParameters_read(struct LDKu8slice ser);
40330 * Frees any resources used by the DirectedChannelTransactionParameters, if is_owned is set and inner is non-NULL.
40332 void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_obj);
40335 * Get the channel pubkeys for the broadcaster
40337 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
40340 * Get the channel pubkeys for the countersignatory
40342 MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
40345 * Get the contest delay applicable to the transactions.
40346 * Note that the contest delay was selected by the countersignatory.
40348 MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
40351 * Whether the channel is outbound from the broadcaster.
40353 * The boolean representing the side that initiated the channel is
40354 * an input to the commitment number obscure factor computation.
40356 MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
40359 * The funding outpoint
40361 MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
40364 * Whether to use anchors for this channel
40366 MUST_USE_RES struct LDKChannelTypeFeatures DirectedChannelTransactionParameters_channel_type_features(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg);
40369 * Frees any resources used by the HolderCommitmentTransaction, if is_owned is set and inner is non-NULL.
40371 void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_obj);
40374 * Our counterparty's signature for the transaction
40376 struct LDKECDSASignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
40379 * Our counterparty's signature for the transaction
40381 void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
40384 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
40386 * Returns a copy of the field.
40388 struct LDKCVec_ECDSASignatureZ HolderCommitmentTransaction_get_counterparty_htlc_sigs(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr);
40391 * All non-dust counterparty HTLC signatures, in the order they appear in the transaction
40393 void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val);
40396 * Creates a copy of the HolderCommitmentTransaction
40398 struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig);
40401 * Serialize the HolderCommitmentTransaction object into a byte array which can be read by HolderCommitmentTransaction_read
40403 struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj);
40406 * Read a HolderCommitmentTransaction from a byte array, created by HolderCommitmentTransaction_write
40408 struct LDKCResult_HolderCommitmentTransactionDecodeErrorZ HolderCommitmentTransaction_read(struct LDKu8slice ser);
40411 * Create a new holder transaction with the given counterparty signatures.
40412 * The funding keys are used to figure out which signature should go first when building the transaction for broadcast.
40414 MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKECDSASignature counterparty_sig, struct LDKCVec_ECDSASignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key);
40417 * Frees any resources used by the BuiltCommitmentTransaction, if is_owned is set and inner is non-NULL.
40419 void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_obj);
40422 * The commitment transaction
40424 struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr);
40427 * The commitment transaction
40429 void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val);
40432 * The txid for the commitment transaction.
40434 * This is provided as a performance optimization, instead of calling transaction.txid()
40437 const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32];
40440 * The txid for the commitment transaction.
40442 * This is provided as a performance optimization, instead of calling transaction.txid()
40445 void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
40448 * Constructs a new BuiltCommitmentTransaction given each field
40450 MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg);
40453 * Creates a copy of the BuiltCommitmentTransaction
40455 struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig);
40458 * Serialize the BuiltCommitmentTransaction object into a byte array which can be read by BuiltCommitmentTransaction_read
40460 struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj);
40463 * Read a BuiltCommitmentTransaction from a byte array, created by BuiltCommitmentTransaction_write
40465 struct LDKCResult_BuiltCommitmentTransactionDecodeErrorZ BuiltCommitmentTransaction_read(struct LDKu8slice ser);
40468 * Get the SIGHASH_ALL sighash value of the transaction.
40470 * This can be used to verify a signature.
40472 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);
40475 * Signs the counterparty's commitment transaction.
40477 MUST_USE_RES struct LDKECDSASignature 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);
40480 * Signs the holder commitment transaction because we are about to broadcast it.
40482 MUST_USE_RES struct LDKECDSASignature 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);
40485 * Frees any resources used by the ClosingTransaction, if is_owned is set and inner is non-NULL.
40487 void ClosingTransaction_free(struct LDKClosingTransaction this_obj);
40490 * Creates a copy of the ClosingTransaction
40492 struct LDKClosingTransaction ClosingTransaction_clone(const struct LDKClosingTransaction *NONNULL_PTR orig);
40495 * Generates a non-cryptographic 64-bit hash of the ClosingTransaction.
40497 uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
40500 * Checks if two ClosingTransactions contain equal inner contents.
40501 * This ignores pointers and is_owned flags and looks at the values in fields.
40502 * Two objects with NULL inner values will be considered "equal" here.
40504 bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
40507 * Construct an object of the class
40509 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);
40512 * Trust our pre-built transaction.
40514 * Applies a wrapper which allows access to the transaction.
40516 * This should only be used if you fully trust the builder of this object. It should not
40517 * be used by an external signer - instead use the verify function.
40519 MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
40522 * Verify our pre-built transaction.
40524 * Applies a wrapper which allows access to the transaction.
40526 * An external validating signer must call this method before signing
40527 * or using the built transaction.
40529 MUST_USE_RES struct LDKCResult_TrustedClosingTransactionNoneZ ClosingTransaction_verify(const struct LDKClosingTransaction *NONNULL_PTR this_arg, struct LDKOutPoint funding_outpoint);
40532 * The value to be sent to the holder, or zero if the output will be omitted
40534 MUST_USE_RES uint64_t ClosingTransaction_to_holder_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
40537 * The value to be sent to the counterparty, or zero if the output will be omitted
40539 MUST_USE_RES uint64_t ClosingTransaction_to_counterparty_value_sat(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
40542 * The destination of the holder's output
40544 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_holder_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
40547 * The destination of the counterparty's output
40549 MUST_USE_RES struct LDKu8slice ClosingTransaction_to_counterparty_script(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
40552 * Frees any resources used by the TrustedClosingTransaction, if is_owned is set and inner is non-NULL.
40554 void TrustedClosingTransaction_free(struct LDKTrustedClosingTransaction this_obj);
40557 * The pre-built Bitcoin commitment transaction
40559 MUST_USE_RES struct LDKTransaction TrustedClosingTransaction_built_transaction(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg);
40562 * Get the SIGHASH_ALL sighash value of the transaction.
40564 * This can be used to verify a signature.
40566 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);
40569 * Sign a transaction, either because we are counter-signing the counterparty's transaction or
40570 * because we are about to broadcast a holder transaction.
40572 MUST_USE_RES struct LDKECDSASignature TrustedClosingTransaction_sign(const struct LDKTrustedClosingTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
40575 * Frees any resources used by the CommitmentTransaction, if is_owned is set and inner is non-NULL.
40577 void CommitmentTransaction_free(struct LDKCommitmentTransaction this_obj);
40580 * Creates a copy of the CommitmentTransaction
40582 struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig);
40585 * Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
40587 struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj);
40590 * Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
40592 struct LDKCResult_CommitmentTransactionDecodeErrorZ CommitmentTransaction_read(struct LDKu8slice ser);
40595 * The backwards-counting commitment number
40597 MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
40600 * The per commitment point used by the broadcaster.
40602 MUST_USE_RES struct LDKPublicKey CommitmentTransaction_per_commitment_point(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
40605 * The value to be sent to the broadcaster
40607 MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
40610 * The value to be sent to the counterparty
40612 MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
40615 * The feerate paid per 1000-weight-unit in this commitment transaction.
40617 MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
40620 * Trust our pre-built transaction and derived transaction creation public keys.
40622 * Applies a wrapper which allows access to these fields.
40624 * This should only be used if you fully trust the builder of this object. It should not
40625 * be used by an external signer - instead use the verify function.
40627 MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg);
40630 * Verify our pre-built transaction and derived transaction creation public keys.
40632 * Applies a wrapper which allows access to these fields.
40634 * An external validating signer must call this method before signing
40635 * or using the built transaction.
40637 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);
40640 * Frees any resources used by the TrustedCommitmentTransaction, if is_owned is set and inner is non-NULL.
40642 void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_obj);
40645 * The transaction ID of the built Bitcoin transaction
40647 MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
40650 * The pre-built Bitcoin commitment transaction
40652 MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
40655 * The pre-calculated transaction creation public keys.
40657 MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
40660 * Should anchors be used.
40662 MUST_USE_RES struct LDKChannelTypeFeatures TrustedCommitmentTransaction_channel_type_features(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
40665 * Get a signature for each HTLC which was included in the commitment transaction (ie for
40666 * which HTLCOutputInCommitment::transaction_output_index.is_some()).
40668 * The returned Vec has one entry for each HTLC, and in the same order.
40670 * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
40672 MUST_USE_RES struct LDKCResult_CVec_ECDSASignatureZNoneZ 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);
40675 * Returns the index of the revokeable output, i.e. the `to_local` output sending funds to
40676 * the broadcaster, in the built transaction, if any exists.
40678 * There are two cases where this may return `None`:
40679 * - The balance of the revokeable output is below the dust limit (only found on commitments
40680 * early in the channel's lifetime, i.e. before the channel reserve is met).
40681 * - This commitment was created before LDK 0.0.117. In this case, the
40682 * commitment transaction previously didn't contain enough information to locate the
40683 * revokeable output.
40685 MUST_USE_RES struct LDKCOption_usizeZ TrustedCommitmentTransaction_revokeable_output_index(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg);
40688 * Helper method to build an unsigned justice transaction spending the revokeable
40689 * `to_local` output to a destination script. Fee estimation accounts for the expected
40690 * revocation witness data that will be added when signed.
40692 * This method will error if the given fee rate results in a fee greater than the value
40693 * of the output being spent, or if there exists no revokeable `to_local` output on this
40694 * commitment transaction. See [`Self::revokeable_output_index`] for more details.
40696 * The built transaction will allow fee bumping with RBF, and this method takes
40697 * `feerate_per_kw` as an input such that multiple copies of a justice transaction at different
40698 * fee rates may be built.
40700 MUST_USE_RES struct LDKCResult_TransactionNoneZ TrustedCommitmentTransaction_build_to_local_justice_tx(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, uint64_t feerate_per_kw, struct LDKCVec_u8Z destination_script);
40703 * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a
40704 * shared secret first. This prevents on-chain observers from discovering how many commitment
40705 * transactions occurred in a channel before it was closed.
40707 * This function gets the shared secret from relevant channel public keys and can be used to
40708 * \"decrypt\" the commitment transaction number given a commitment transaction on-chain.
40710 uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster);
40713 * Checks if two InitFeaturess contain equal inner contents.
40714 * This ignores pointers and is_owned flags and looks at the values in fields.
40715 * Two objects with NULL inner values will be considered "equal" here.
40717 bool InitFeatures_eq(const struct LDKInitFeatures *NONNULL_PTR a, const struct LDKInitFeatures *NONNULL_PTR b);
40720 * Checks if two NodeFeaturess contain equal inner contents.
40721 * This ignores pointers and is_owned flags and looks at the values in fields.
40722 * Two objects with NULL inner values will be considered "equal" here.
40724 bool NodeFeatures_eq(const struct LDKNodeFeatures *NONNULL_PTR a, const struct LDKNodeFeatures *NONNULL_PTR b);
40727 * Checks if two ChannelFeaturess contain equal inner contents.
40728 * This ignores pointers and is_owned flags and looks at the values in fields.
40729 * Two objects with NULL inner values will be considered "equal" here.
40731 bool ChannelFeatures_eq(const struct LDKChannelFeatures *NONNULL_PTR a, const struct LDKChannelFeatures *NONNULL_PTR b);
40734 * Checks if two Bolt11InvoiceFeaturess contain equal inner contents.
40735 * This ignores pointers and is_owned flags and looks at the values in fields.
40736 * Two objects with NULL inner values will be considered "equal" here.
40738 bool Bolt11InvoiceFeatures_eq(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR b);
40741 * Checks if two OfferFeaturess contain equal inner contents.
40742 * This ignores pointers and is_owned flags and looks at the values in fields.
40743 * Two objects with NULL inner values will be considered "equal" here.
40745 bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b);
40748 * Checks if two InvoiceRequestFeaturess contain equal inner contents.
40749 * This ignores pointers and is_owned flags and looks at the values in fields.
40750 * Two objects with NULL inner values will be considered "equal" here.
40752 bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b);
40755 * Checks if two Bolt12InvoiceFeaturess contain equal inner contents.
40756 * This ignores pointers and is_owned flags and looks at the values in fields.
40757 * Two objects with NULL inner values will be considered "equal" here.
40759 bool Bolt12InvoiceFeatures_eq(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR a, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR b);
40762 * Checks if two BlindedHopFeaturess contain equal inner contents.
40763 * This ignores pointers and is_owned flags and looks at the values in fields.
40764 * Two objects with NULL inner values will be considered "equal" here.
40766 bool BlindedHopFeatures_eq(const struct LDKBlindedHopFeatures *NONNULL_PTR a, const struct LDKBlindedHopFeatures *NONNULL_PTR b);
40769 * Checks if two ChannelTypeFeaturess contain equal inner contents.
40770 * This ignores pointers and is_owned flags and looks at the values in fields.
40771 * Two objects with NULL inner values will be considered "equal" here.
40773 bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b);
40776 * Creates a copy of the InitFeatures
40778 struct LDKInitFeatures InitFeatures_clone(const struct LDKInitFeatures *NONNULL_PTR orig);
40781 * Creates a copy of the NodeFeatures
40783 struct LDKNodeFeatures NodeFeatures_clone(const struct LDKNodeFeatures *NONNULL_PTR orig);
40786 * Creates a copy of the ChannelFeatures
40788 struct LDKChannelFeatures ChannelFeatures_clone(const struct LDKChannelFeatures *NONNULL_PTR orig);
40791 * Creates a copy of the Bolt11InvoiceFeatures
40793 struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_clone(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR orig);
40796 * Creates a copy of the OfferFeatures
40798 struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig);
40801 * Creates a copy of the InvoiceRequestFeatures
40803 struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig);
40806 * Creates a copy of the Bolt12InvoiceFeatures
40808 struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_clone(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR orig);
40811 * Creates a copy of the BlindedHopFeatures
40813 struct LDKBlindedHopFeatures BlindedHopFeatures_clone(const struct LDKBlindedHopFeatures *NONNULL_PTR orig);
40816 * Creates a copy of the ChannelTypeFeatures
40818 struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig);
40821 * Generates a non-cryptographic 64-bit hash of the InitFeatures.
40823 uint64_t InitFeatures_hash(const struct LDKInitFeatures *NONNULL_PTR o);
40826 * Generates a non-cryptographic 64-bit hash of the NodeFeatures.
40828 uint64_t NodeFeatures_hash(const struct LDKNodeFeatures *NONNULL_PTR o);
40831 * Generates a non-cryptographic 64-bit hash of the ChannelFeatures.
40833 uint64_t ChannelFeatures_hash(const struct LDKChannelFeatures *NONNULL_PTR o);
40836 * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceFeatures.
40838 uint64_t Bolt11InvoiceFeatures_hash(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR o);
40841 * Generates a non-cryptographic 64-bit hash of the OfferFeatures.
40843 uint64_t OfferFeatures_hash(const struct LDKOfferFeatures *NONNULL_PTR o);
40846 * Generates a non-cryptographic 64-bit hash of the InvoiceRequestFeatures.
40848 uint64_t InvoiceRequestFeatures_hash(const struct LDKInvoiceRequestFeatures *NONNULL_PTR o);
40851 * Generates a non-cryptographic 64-bit hash of the Bolt12InvoiceFeatures.
40853 uint64_t Bolt12InvoiceFeatures_hash(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR o);
40856 * Generates a non-cryptographic 64-bit hash of the BlindedHopFeatures.
40858 uint64_t BlindedHopFeatures_hash(const struct LDKBlindedHopFeatures *NONNULL_PTR o);
40861 * Generates a non-cryptographic 64-bit hash of the ChannelTypeFeatures.
40863 uint64_t ChannelTypeFeatures_hash(const struct LDKChannelTypeFeatures *NONNULL_PTR o);
40866 * Frees any resources used by the InitFeatures, if is_owned is set and inner is non-NULL.
40868 void InitFeatures_free(struct LDKInitFeatures this_obj);
40871 * Frees any resources used by the NodeFeatures, if is_owned is set and inner is non-NULL.
40873 void NodeFeatures_free(struct LDKNodeFeatures this_obj);
40876 * Frees any resources used by the ChannelFeatures, if is_owned is set and inner is non-NULL.
40878 void ChannelFeatures_free(struct LDKChannelFeatures this_obj);
40881 * Frees any resources used by the Bolt11InvoiceFeatures, if is_owned is set and inner is non-NULL.
40883 void Bolt11InvoiceFeatures_free(struct LDKBolt11InvoiceFeatures this_obj);
40886 * Frees any resources used by the OfferFeatures, if is_owned is set and inner is non-NULL.
40888 void OfferFeatures_free(struct LDKOfferFeatures this_obj);
40891 * Frees any resources used by the InvoiceRequestFeatures, if is_owned is set and inner is non-NULL.
40893 void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj);
40896 * Frees any resources used by the Bolt12InvoiceFeatures, if is_owned is set and inner is non-NULL.
40898 void Bolt12InvoiceFeatures_free(struct LDKBolt12InvoiceFeatures this_obj);
40901 * Frees any resources used by the BlindedHopFeatures, if is_owned is set and inner is non-NULL.
40903 void BlindedHopFeatures_free(struct LDKBlindedHopFeatures this_obj);
40906 * Frees any resources used by the ChannelTypeFeatures, if is_owned is set and inner is non-NULL.
40908 void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
40911 * Create a blank Features with no features set
40913 MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
40916 * Returns true if this `Features` object contains required features unknown by `other`.
40918 MUST_USE_RES bool InitFeatures_requires_unknown_bits_from(const struct LDKInitFeatures *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR other);
40921 * Returns true if this `Features` object contains unknown feature flags which are set as
40924 MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
40927 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
40930 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
40931 * be set instead (i.e., `bit - 1`).
40933 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
40935 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
40938 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
40941 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
40942 * set instead (i.e., `bit + 1`).
40944 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
40946 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_feature_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
40949 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
40950 * by [bLIP 2] or if it is a known `T` feature.
40952 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
40953 * be set instead (i.e., `bit - 1`).
40955 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
40957 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_required_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
40960 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
40961 * by [bLIP 2] or if it is a known `T` feature.
40963 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
40964 * set instead (i.e., `bit + 1`).
40966 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
40968 MUST_USE_RES struct LDKCResult_NoneNoneZ InitFeatures_set_optional_custom_bit(struct LDKInitFeatures *NONNULL_PTR this_arg, uintptr_t bit);
40971 * Create a blank Features with no features set
40973 MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
40976 * Returns true if this `Features` object contains required features unknown by `other`.
40978 MUST_USE_RES bool NodeFeatures_requires_unknown_bits_from(const struct LDKNodeFeatures *NONNULL_PTR this_arg, const struct LDKNodeFeatures *NONNULL_PTR other);
40981 * Returns true if this `Features` object contains unknown feature flags which are set as
40984 MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
40987 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
40990 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
40991 * be set instead (i.e., `bit - 1`).
40993 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
40995 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
40998 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41001 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41002 * set instead (i.e., `bit + 1`).
41004 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41006 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_feature_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41009 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41010 * by [bLIP 2] or if it is a known `T` feature.
41012 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41013 * be set instead (i.e., `bit - 1`).
41015 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41017 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_required_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41020 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41021 * by [bLIP 2] or if it is a known `T` feature.
41023 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41024 * set instead (i.e., `bit + 1`).
41026 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41028 MUST_USE_RES struct LDKCResult_NoneNoneZ NodeFeatures_set_optional_custom_bit(struct LDKNodeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41031 * Create a blank Features with no features set
41033 MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
41036 * Returns true if this `Features` object contains required features unknown by `other`.
41038 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits_from(const struct LDKChannelFeatures *NONNULL_PTR this_arg, const struct LDKChannelFeatures *NONNULL_PTR other);
41041 * Returns true if this `Features` object contains unknown feature flags which are set as
41044 MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
41047 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41050 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41051 * be set instead (i.e., `bit - 1`).
41053 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41055 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41058 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41061 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41062 * set instead (i.e., `bit + 1`).
41064 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41066 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_feature_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41069 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41070 * by [bLIP 2] or if it is a known `T` feature.
41072 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41073 * be set instead (i.e., `bit - 1`).
41075 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41077 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_required_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41080 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41081 * by [bLIP 2] or if it is a known `T` feature.
41083 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41084 * set instead (i.e., `bit + 1`).
41086 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41088 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelFeatures_set_optional_custom_bit(struct LDKChannelFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41091 * Create a blank Features with no features set
41093 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11InvoiceFeatures_empty(void);
41096 * Returns true if this `Features` object contains required features unknown by `other`.
41098 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt11InvoiceFeatures *NONNULL_PTR other);
41101 * Returns true if this `Features` object contains unknown feature flags which are set as
41104 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_unknown_bits(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41107 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41110 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41111 * be set instead (i.e., `bit - 1`).
41113 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41115 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41118 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41121 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41122 * set instead (i.e., `bit + 1`).
41124 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41126 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_feature_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41129 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41130 * by [bLIP 2] or if it is a known `T` feature.
41132 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41133 * be set instead (i.e., `bit - 1`).
41135 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41137 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_required_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41140 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41141 * by [bLIP 2] or if it is a known `T` feature.
41143 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41144 * set instead (i.e., `bit + 1`).
41146 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41148 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt11InvoiceFeatures_set_optional_custom_bit(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41151 * Create a blank Features with no features set
41153 MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void);
41156 * Returns true if this `Features` object contains required features unknown by `other`.
41158 MUST_USE_RES bool OfferFeatures_requires_unknown_bits_from(const struct LDKOfferFeatures *NONNULL_PTR this_arg, const struct LDKOfferFeatures *NONNULL_PTR other);
41161 * Returns true if this `Features` object contains unknown feature flags which are set as
41164 MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg);
41167 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41170 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41171 * be set instead (i.e., `bit - 1`).
41173 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41175 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41178 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41181 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41182 * set instead (i.e., `bit + 1`).
41184 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41186 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_feature_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41189 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41190 * by [bLIP 2] or if it is a known `T` feature.
41192 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41193 * be set instead (i.e., `bit - 1`).
41195 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41197 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_required_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41200 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41201 * by [bLIP 2] or if it is a known `T` feature.
41203 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41204 * set instead (i.e., `bit + 1`).
41206 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41208 MUST_USE_RES struct LDKCResult_NoneNoneZ OfferFeatures_set_optional_custom_bit(struct LDKOfferFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41211 * Create a blank Features with no features set
41213 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void);
41216 * Returns true if this `Features` object contains required features unknown by `other`.
41218 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits_from(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, const struct LDKInvoiceRequestFeatures *NONNULL_PTR other);
41221 * Returns true if this `Features` object contains unknown feature flags which are set as
41224 MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg);
41227 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41230 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41231 * be set instead (i.e., `bit - 1`).
41233 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41235 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41238 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41241 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41242 * set instead (i.e., `bit + 1`).
41244 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41246 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_feature_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41249 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41250 * by [bLIP 2] or if it is a known `T` feature.
41252 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41253 * be set instead (i.e., `bit - 1`).
41255 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41257 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_required_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41260 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41261 * by [bLIP 2] or if it is a known `T` feature.
41263 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41264 * set instead (i.e., `bit + 1`).
41266 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41268 MUST_USE_RES struct LDKCResult_NoneNoneZ InvoiceRequestFeatures_set_optional_custom_bit(struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41271 * Create a blank Features with no features set
41273 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12InvoiceFeatures_empty(void);
41276 * Returns true if this `Features` object contains required features unknown by `other`.
41278 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits_from(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, const struct LDKBolt12InvoiceFeatures *NONNULL_PTR other);
41281 * Returns true if this `Features` object contains unknown feature flags which are set as
41284 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_unknown_bits(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
41287 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41290 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41291 * be set instead (i.e., `bit - 1`).
41293 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41295 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41298 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41301 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41302 * set instead (i.e., `bit + 1`).
41304 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41306 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_feature_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41309 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41310 * by [bLIP 2] or if it is a known `T` feature.
41312 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41313 * be set instead (i.e., `bit - 1`).
41315 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41317 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_required_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41320 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41321 * by [bLIP 2] or if it is a known `T` feature.
41323 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41324 * set instead (i.e., `bit + 1`).
41326 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41328 MUST_USE_RES struct LDKCResult_NoneNoneZ Bolt12InvoiceFeatures_set_optional_custom_bit(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41331 * Create a blank Features with no features set
41333 MUST_USE_RES struct LDKBlindedHopFeatures BlindedHopFeatures_empty(void);
41336 * Returns true if this `Features` object contains required features unknown by `other`.
41338 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits_from(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, const struct LDKBlindedHopFeatures *NONNULL_PTR other);
41341 * Returns true if this `Features` object contains unknown feature flags which are set as
41344 MUST_USE_RES bool BlindedHopFeatures_requires_unknown_bits(const struct LDKBlindedHopFeatures *NONNULL_PTR this_arg);
41347 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41350 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41351 * be set instead (i.e., `bit - 1`).
41353 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41355 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41358 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41361 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41362 * set instead (i.e., `bit + 1`).
41364 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41366 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_feature_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41369 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41370 * by [bLIP 2] or if it is a known `T` feature.
41372 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41373 * be set instead (i.e., `bit - 1`).
41375 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41377 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_required_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41380 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41381 * by [bLIP 2] or if it is a known `T` feature.
41383 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41384 * set instead (i.e., `bit + 1`).
41386 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41388 MUST_USE_RES struct LDKCResult_NoneNoneZ BlindedHopFeatures_set_optional_custom_bit(struct LDKBlindedHopFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41391 * Create a blank Features with no features set
41393 MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
41396 * Returns true if this `Features` object contains required features unknown by `other`.
41398 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits_from(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, const struct LDKChannelTypeFeatures *NONNULL_PTR other);
41401 * Returns true if this `Features` object contains unknown feature flags which are set as
41404 MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41407 * Sets a required feature bit. Errors if `bit` is outside the feature range as defined
41410 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41411 * be set instead (i.e., `bit - 1`).
41413 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41415 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41418 * Sets an optional feature bit. Errors if `bit` is outside the feature range as defined
41421 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41422 * set instead (i.e., `bit + 1`).
41424 * [BOLT 9]: https://github.com/lightning/bolts/blob/master/09-features.md
41426 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_feature_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41429 * Sets a required custom feature bit. Errors if `bit` is outside the custom range as defined
41430 * by [bLIP 2] or if it is a known `T` feature.
41432 * Note: Required bits are even. If an odd bit is given, then the corresponding even bit will
41433 * be set instead (i.e., `bit - 1`).
41435 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41437 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_required_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41440 * Sets an optional custom feature bit. Errors if `bit` is outside the custom range as defined
41441 * by [bLIP 2] or if it is a known `T` feature.
41443 * Note: Optional bits are odd. If an even bit is given, then the corresponding odd bit will be
41444 * set instead (i.e., `bit + 1`).
41446 * [bLIP 2]: https://github.com/lightning/blips/blob/master/blip-0002.md#feature-bits
41448 MUST_USE_RES struct LDKCResult_NoneNoneZ ChannelTypeFeatures_set_optional_custom_bit(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg, uintptr_t bit);
41451 * Serialize the InitFeatures object into a byte array which can be read by InitFeatures_read
41453 struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
41456 * Read a InitFeatures from a byte array, created by InitFeatures_write
41458 struct LDKCResult_InitFeaturesDecodeErrorZ InitFeatures_read(struct LDKu8slice ser);
41461 * Serialize the ChannelFeatures object into a byte array which can be read by ChannelFeatures_read
41463 struct LDKCVec_u8Z ChannelFeatures_write(const struct LDKChannelFeatures *NONNULL_PTR obj);
41466 * Read a ChannelFeatures from a byte array, created by ChannelFeatures_write
41468 struct LDKCResult_ChannelFeaturesDecodeErrorZ ChannelFeatures_read(struct LDKu8slice ser);
41471 * Serialize the NodeFeatures object into a byte array which can be read by NodeFeatures_read
41473 struct LDKCVec_u8Z NodeFeatures_write(const struct LDKNodeFeatures *NONNULL_PTR obj);
41476 * Read a NodeFeatures from a byte array, created by NodeFeatures_write
41478 struct LDKCResult_NodeFeaturesDecodeErrorZ NodeFeatures_read(struct LDKu8slice ser);
41481 * Serialize the Bolt11InvoiceFeatures object into a byte array which can be read by Bolt11InvoiceFeatures_read
41483 struct LDKCVec_u8Z Bolt11InvoiceFeatures_write(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR obj);
41486 * Read a Bolt11InvoiceFeatures from a byte array, created by Bolt11InvoiceFeatures_write
41488 struct LDKCResult_Bolt11InvoiceFeaturesDecodeErrorZ Bolt11InvoiceFeatures_read(struct LDKu8slice ser);
41491 * Serialize the Bolt12InvoiceFeatures object into a byte array which can be read by Bolt12InvoiceFeatures_read
41493 struct LDKCVec_u8Z Bolt12InvoiceFeatures_write(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR obj);
41496 * Read a Bolt12InvoiceFeatures from a byte array, created by Bolt12InvoiceFeatures_write
41498 struct LDKCResult_Bolt12InvoiceFeaturesDecodeErrorZ Bolt12InvoiceFeatures_read(struct LDKu8slice ser);
41501 * Serialize the BlindedHopFeatures object into a byte array which can be read by BlindedHopFeatures_read
41503 struct LDKCVec_u8Z BlindedHopFeatures_write(const struct LDKBlindedHopFeatures *NONNULL_PTR obj);
41506 * Read a BlindedHopFeatures from a byte array, created by BlindedHopFeatures_write
41508 struct LDKCResult_BlindedHopFeaturesDecodeErrorZ BlindedHopFeatures_read(struct LDKu8slice ser);
41511 * Serialize the ChannelTypeFeatures object into a byte array which can be read by ChannelTypeFeatures_read
41513 struct LDKCVec_u8Z ChannelTypeFeatures_write(const struct LDKChannelTypeFeatures *NONNULL_PTR obj);
41516 * Read a ChannelTypeFeatures from a byte array, created by ChannelTypeFeatures_write
41518 struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ ChannelTypeFeatures_read(struct LDKu8slice ser);
41521 * Set this feature as optional.
41523 void InitFeatures_set_data_loss_protect_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41526 * Set this feature as required.
41528 void InitFeatures_set_data_loss_protect_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41531 * Checks if this feature is supported.
41533 MUST_USE_RES bool InitFeatures_supports_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41536 * Set this feature as optional.
41538 void NodeFeatures_set_data_loss_protect_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41541 * Set this feature as required.
41543 void NodeFeatures_set_data_loss_protect_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41546 * Checks if this feature is supported.
41548 MUST_USE_RES bool NodeFeatures_supports_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41551 * Checks if this feature is required.
41553 MUST_USE_RES bool InitFeatures_requires_data_loss_protect(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41556 * Checks if this feature is required.
41558 MUST_USE_RES bool NodeFeatures_requires_data_loss_protect(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41561 * Set this feature as optional.
41563 void InitFeatures_set_initial_routing_sync_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41566 * Set this feature as required.
41568 void InitFeatures_set_initial_routing_sync_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41571 * Checks if this feature is supported.
41573 MUST_USE_RES bool InitFeatures_initial_routing_sync(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41576 * Set this feature as optional.
41578 void InitFeatures_set_upfront_shutdown_script_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41581 * Set this feature as required.
41583 void InitFeatures_set_upfront_shutdown_script_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41586 * Checks if this feature is supported.
41588 MUST_USE_RES bool InitFeatures_supports_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41591 * Set this feature as optional.
41593 void NodeFeatures_set_upfront_shutdown_script_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41596 * Set this feature as required.
41598 void NodeFeatures_set_upfront_shutdown_script_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41601 * Checks if this feature is supported.
41603 MUST_USE_RES bool NodeFeatures_supports_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41606 * Checks if this feature is required.
41608 MUST_USE_RES bool InitFeatures_requires_upfront_shutdown_script(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41611 * Checks if this feature is required.
41613 MUST_USE_RES bool NodeFeatures_requires_upfront_shutdown_script(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41616 * Set this feature as optional.
41618 void InitFeatures_set_gossip_queries_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41621 * Set this feature as required.
41623 void InitFeatures_set_gossip_queries_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41626 * Checks if this feature is supported.
41628 MUST_USE_RES bool InitFeatures_supports_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41631 * Set this feature as optional.
41633 void NodeFeatures_set_gossip_queries_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41636 * Set this feature as required.
41638 void NodeFeatures_set_gossip_queries_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41641 * Checks if this feature is supported.
41643 MUST_USE_RES bool NodeFeatures_supports_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41646 * Checks if this feature is required.
41648 MUST_USE_RES bool InitFeatures_requires_gossip_queries(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41651 * Checks if this feature is required.
41653 MUST_USE_RES bool NodeFeatures_requires_gossip_queries(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41656 * Set this feature as optional.
41658 void InitFeatures_set_variable_length_onion_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41661 * Set this feature as required.
41663 void InitFeatures_set_variable_length_onion_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41666 * Checks if this feature is supported.
41668 MUST_USE_RES bool InitFeatures_supports_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41671 * Set this feature as optional.
41673 void NodeFeatures_set_variable_length_onion_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41676 * Set this feature as required.
41678 void NodeFeatures_set_variable_length_onion_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41681 * Checks if this feature is supported.
41683 MUST_USE_RES bool NodeFeatures_supports_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41686 * Set this feature as optional.
41688 void Bolt11InvoiceFeatures_set_variable_length_onion_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41691 * Set this feature as required.
41693 void Bolt11InvoiceFeatures_set_variable_length_onion_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41696 * Checks if this feature is supported.
41698 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41701 * Checks if this feature is required.
41703 MUST_USE_RES bool InitFeatures_requires_variable_length_onion(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41706 * Checks if this feature is required.
41708 MUST_USE_RES bool NodeFeatures_requires_variable_length_onion(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41711 * Checks if this feature is required.
41713 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_variable_length_onion(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41716 * Set this feature as optional.
41718 void InitFeatures_set_static_remote_key_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41721 * Set this feature as required.
41723 void InitFeatures_set_static_remote_key_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41726 * Checks if this feature is supported.
41728 MUST_USE_RES bool InitFeatures_supports_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41731 * Set this feature as optional.
41733 void NodeFeatures_set_static_remote_key_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41736 * Set this feature as required.
41738 void NodeFeatures_set_static_remote_key_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41741 * Checks if this feature is supported.
41743 MUST_USE_RES bool NodeFeatures_supports_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41746 * Set this feature as optional.
41748 void ChannelTypeFeatures_set_static_remote_key_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41751 * Set this feature as required.
41753 void ChannelTypeFeatures_set_static_remote_key_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41756 * Checks if this feature is supported.
41758 MUST_USE_RES bool ChannelTypeFeatures_supports_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41761 * Checks if this feature is required.
41763 MUST_USE_RES bool InitFeatures_requires_static_remote_key(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41766 * Checks if this feature is required.
41768 MUST_USE_RES bool NodeFeatures_requires_static_remote_key(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41771 * Checks if this feature is required.
41773 MUST_USE_RES bool ChannelTypeFeatures_requires_static_remote_key(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41776 * Set this feature as optional.
41778 void InitFeatures_set_payment_secret_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41781 * Set this feature as required.
41783 void InitFeatures_set_payment_secret_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41786 * Checks if this feature is supported.
41788 MUST_USE_RES bool InitFeatures_supports_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41791 * Set this feature as optional.
41793 void NodeFeatures_set_payment_secret_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41796 * Set this feature as required.
41798 void NodeFeatures_set_payment_secret_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41801 * Checks if this feature is supported.
41803 MUST_USE_RES bool NodeFeatures_supports_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41806 * Set this feature as optional.
41808 void Bolt11InvoiceFeatures_set_payment_secret_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41811 * Set this feature as required.
41813 void Bolt11InvoiceFeatures_set_payment_secret_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41816 * Checks if this feature is supported.
41818 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41821 * Checks if this feature is required.
41823 MUST_USE_RES bool InitFeatures_requires_payment_secret(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41826 * Checks if this feature is required.
41828 MUST_USE_RES bool NodeFeatures_requires_payment_secret(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41831 * Checks if this feature is required.
41833 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_secret(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41836 * Set this feature as optional.
41838 void InitFeatures_set_basic_mpp_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41841 * Set this feature as required.
41843 void InitFeatures_set_basic_mpp_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41846 * Checks if this feature is supported.
41848 MUST_USE_RES bool InitFeatures_supports_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41851 * Set this feature as optional.
41853 void NodeFeatures_set_basic_mpp_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41856 * Set this feature as required.
41858 void NodeFeatures_set_basic_mpp_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41861 * Checks if this feature is supported.
41863 MUST_USE_RES bool NodeFeatures_supports_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41866 * Set this feature as optional.
41868 void Bolt11InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41871 * Set this feature as required.
41873 void Bolt11InvoiceFeatures_set_basic_mpp_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41876 * Checks if this feature is supported.
41878 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41881 * Set this feature as optional.
41883 void Bolt12InvoiceFeatures_set_basic_mpp_optional(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
41886 * Set this feature as required.
41888 void Bolt12InvoiceFeatures_set_basic_mpp_required(struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
41891 * Checks if this feature is supported.
41893 MUST_USE_RES bool Bolt12InvoiceFeatures_supports_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
41896 * Checks if this feature is required.
41898 MUST_USE_RES bool InitFeatures_requires_basic_mpp(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41901 * Checks if this feature is required.
41903 MUST_USE_RES bool NodeFeatures_requires_basic_mpp(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41906 * Checks if this feature is required.
41908 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_basic_mpp(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
41911 * Checks if this feature is required.
41913 MUST_USE_RES bool Bolt12InvoiceFeatures_requires_basic_mpp(const struct LDKBolt12InvoiceFeatures *NONNULL_PTR this_arg);
41916 * Set this feature as optional.
41918 void InitFeatures_set_wumbo_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41921 * Set this feature as required.
41923 void InitFeatures_set_wumbo_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41926 * Checks if this feature is supported.
41928 MUST_USE_RES bool InitFeatures_supports_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41931 * Set this feature as optional.
41933 void NodeFeatures_set_wumbo_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41936 * Set this feature as required.
41938 void NodeFeatures_set_wumbo_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41941 * Checks if this feature is supported.
41943 MUST_USE_RES bool NodeFeatures_supports_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41946 * Checks if this feature is required.
41948 MUST_USE_RES bool InitFeatures_requires_wumbo(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41951 * Checks if this feature is required.
41953 MUST_USE_RES bool NodeFeatures_requires_wumbo(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41956 * Set this feature as optional.
41958 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
41961 * Set this feature as required.
41963 void InitFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
41966 * Checks if this feature is supported.
41968 MUST_USE_RES bool InitFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
41971 * Set this feature as optional.
41973 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41976 * Set this feature as required.
41978 void NodeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
41981 * Checks if this feature is supported.
41983 MUST_USE_RES bool NodeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
41986 * Set this feature as optional.
41988 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41991 * Set this feature as required.
41993 void ChannelTypeFeatures_set_anchors_nonzero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
41996 * Checks if this feature is supported.
41998 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42001 * Checks if this feature is required.
42003 MUST_USE_RES bool InitFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42006 * Checks if this feature is required.
42008 MUST_USE_RES bool NodeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42011 * Checks if this feature is required.
42013 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_nonzero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42016 * Set this feature as optional.
42018 void InitFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42021 * Set this feature as required.
42023 void InitFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42026 * Checks if this feature is supported.
42028 MUST_USE_RES bool InitFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42031 * Set this feature as optional.
42033 void NodeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42036 * Set this feature as required.
42038 void NodeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42041 * Checks if this feature is supported.
42043 MUST_USE_RES bool NodeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42046 * Set this feature as optional.
42048 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42051 * Set this feature as required.
42053 void ChannelTypeFeatures_set_anchors_zero_fee_htlc_tx_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42056 * Checks if this feature is supported.
42058 MUST_USE_RES bool ChannelTypeFeatures_supports_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42061 * Checks if this feature is required.
42063 MUST_USE_RES bool InitFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42066 * Checks if this feature is required.
42068 MUST_USE_RES bool NodeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42071 * Checks if this feature is required.
42073 MUST_USE_RES bool ChannelTypeFeatures_requires_anchors_zero_fee_htlc_tx(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42076 * Set this feature as optional.
42078 void InitFeatures_set_route_blinding_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42081 * Set this feature as required.
42083 void InitFeatures_set_route_blinding_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42086 * Checks if this feature is supported.
42088 MUST_USE_RES bool InitFeatures_supports_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42091 * Set this feature as optional.
42093 void NodeFeatures_set_route_blinding_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42096 * Set this feature as required.
42098 void NodeFeatures_set_route_blinding_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42101 * Checks if this feature is supported.
42103 MUST_USE_RES bool NodeFeatures_supports_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42106 * Checks if this feature is required.
42108 MUST_USE_RES bool InitFeatures_requires_route_blinding(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42111 * Checks if this feature is required.
42113 MUST_USE_RES bool NodeFeatures_requires_route_blinding(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42116 * Set this feature as optional.
42118 void InitFeatures_set_shutdown_any_segwit_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42121 * Set this feature as required.
42123 void InitFeatures_set_shutdown_any_segwit_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42126 * Checks if this feature is supported.
42128 MUST_USE_RES bool InitFeatures_supports_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42131 * Set this feature as optional.
42133 void NodeFeatures_set_shutdown_any_segwit_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42136 * Set this feature as required.
42138 void NodeFeatures_set_shutdown_any_segwit_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42141 * Checks if this feature is supported.
42143 MUST_USE_RES bool NodeFeatures_supports_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42146 * Checks if this feature is required.
42148 MUST_USE_RES bool InitFeatures_requires_shutdown_anysegwit(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42151 * Checks if this feature is required.
42153 MUST_USE_RES bool NodeFeatures_requires_shutdown_anysegwit(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42156 * Set this feature as optional.
42158 void InitFeatures_set_taproot_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42161 * Set this feature as required.
42163 void InitFeatures_set_taproot_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42166 * Checks if this feature is supported.
42168 MUST_USE_RES bool InitFeatures_supports_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42171 * Set this feature as optional.
42173 void NodeFeatures_set_taproot_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42176 * Set this feature as required.
42178 void NodeFeatures_set_taproot_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42181 * Checks if this feature is supported.
42183 MUST_USE_RES bool NodeFeatures_supports_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42186 * Set this feature as optional.
42188 void ChannelTypeFeatures_set_taproot_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42191 * Set this feature as required.
42193 void ChannelTypeFeatures_set_taproot_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42196 * Checks if this feature is supported.
42198 MUST_USE_RES bool ChannelTypeFeatures_supports_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42201 * Checks if this feature is required.
42203 MUST_USE_RES bool InitFeatures_requires_taproot(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42206 * Checks if this feature is required.
42208 MUST_USE_RES bool NodeFeatures_requires_taproot(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42211 * Checks if this feature is required.
42213 MUST_USE_RES bool ChannelTypeFeatures_requires_taproot(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42216 * Set this feature as optional.
42218 void InitFeatures_set_onion_messages_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42221 * Set this feature as required.
42223 void InitFeatures_set_onion_messages_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42226 * Checks if this feature is supported.
42228 MUST_USE_RES bool InitFeatures_supports_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42231 * Set this feature as optional.
42233 void NodeFeatures_set_onion_messages_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42236 * Set this feature as required.
42238 void NodeFeatures_set_onion_messages_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42241 * Checks if this feature is supported.
42243 MUST_USE_RES bool NodeFeatures_supports_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42246 * Checks if this feature is required.
42248 MUST_USE_RES bool InitFeatures_requires_onion_messages(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42251 * Checks if this feature is required.
42253 MUST_USE_RES bool NodeFeatures_requires_onion_messages(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42256 * Set this feature as optional.
42258 void InitFeatures_set_channel_type_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42261 * Set this feature as required.
42263 void InitFeatures_set_channel_type_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42266 * Checks if this feature is supported.
42268 MUST_USE_RES bool InitFeatures_supports_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42271 * Set this feature as optional.
42273 void NodeFeatures_set_channel_type_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42276 * Set this feature as required.
42278 void NodeFeatures_set_channel_type_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42281 * Checks if this feature is supported.
42283 MUST_USE_RES bool NodeFeatures_supports_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42286 * Checks if this feature is required.
42288 MUST_USE_RES bool InitFeatures_requires_channel_type(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42291 * Checks if this feature is required.
42293 MUST_USE_RES bool NodeFeatures_requires_channel_type(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42296 * Set this feature as optional.
42298 void InitFeatures_set_scid_privacy_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42301 * Set this feature as required.
42303 void InitFeatures_set_scid_privacy_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42306 * Checks if this feature is supported.
42308 MUST_USE_RES bool InitFeatures_supports_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42311 * Set this feature as optional.
42313 void NodeFeatures_set_scid_privacy_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42316 * Set this feature as required.
42318 void NodeFeatures_set_scid_privacy_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42321 * Checks if this feature is supported.
42323 MUST_USE_RES bool NodeFeatures_supports_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42326 * Set this feature as optional.
42328 void ChannelTypeFeatures_set_scid_privacy_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42331 * Set this feature as required.
42333 void ChannelTypeFeatures_set_scid_privacy_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42336 * Checks if this feature is supported.
42338 MUST_USE_RES bool ChannelTypeFeatures_supports_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42341 * Checks if this feature is required.
42343 MUST_USE_RES bool InitFeatures_requires_scid_privacy(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42346 * Checks if this feature is required.
42348 MUST_USE_RES bool NodeFeatures_requires_scid_privacy(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42351 * Checks if this feature is required.
42353 MUST_USE_RES bool ChannelTypeFeatures_requires_scid_privacy(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42356 * Set this feature as optional.
42358 void Bolt11InvoiceFeatures_set_payment_metadata_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
42361 * Set this feature as required.
42363 void Bolt11InvoiceFeatures_set_payment_metadata_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
42366 * Checks if this feature is supported.
42368 MUST_USE_RES bool Bolt11InvoiceFeatures_supports_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
42371 * Checks if this feature is required.
42373 MUST_USE_RES bool Bolt11InvoiceFeatures_requires_payment_metadata(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg);
42376 * Set this feature as optional.
42378 void InitFeatures_set_zero_conf_optional(struct LDKInitFeatures *NONNULL_PTR this_arg);
42381 * Set this feature as required.
42383 void InitFeatures_set_zero_conf_required(struct LDKInitFeatures *NONNULL_PTR this_arg);
42386 * Checks if this feature is supported.
42388 MUST_USE_RES bool InitFeatures_supports_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42391 * Set this feature as optional.
42393 void NodeFeatures_set_zero_conf_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42396 * Set this feature as required.
42398 void NodeFeatures_set_zero_conf_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42401 * Checks if this feature is supported.
42403 MUST_USE_RES bool NodeFeatures_supports_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42406 * Set this feature as optional.
42408 void ChannelTypeFeatures_set_zero_conf_optional(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42411 * Set this feature as required.
42413 void ChannelTypeFeatures_set_zero_conf_required(struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42416 * Checks if this feature is supported.
42418 MUST_USE_RES bool ChannelTypeFeatures_supports_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42421 * Checks if this feature is required.
42423 MUST_USE_RES bool InitFeatures_requires_zero_conf(const struct LDKInitFeatures *NONNULL_PTR this_arg);
42426 * Checks if this feature is required.
42428 MUST_USE_RES bool NodeFeatures_requires_zero_conf(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42431 * Checks if this feature is required.
42433 MUST_USE_RES bool ChannelTypeFeatures_requires_zero_conf(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
42436 * Set this feature as optional.
42438 void NodeFeatures_set_keysend_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42441 * Set this feature as required.
42443 void NodeFeatures_set_keysend_required(struct LDKNodeFeatures *NONNULL_PTR this_arg);
42446 * Checks if this feature is supported.
42448 MUST_USE_RES bool NodeFeatures_supports_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42451 * Checks if this feature is required.
42453 MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
42456 * Frees any resources used by the ShutdownScript, if is_owned is set and inner is non-NULL.
42458 void ShutdownScript_free(struct LDKShutdownScript this_obj);
42461 * Creates a copy of the ShutdownScript
42463 struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
42466 * Checks if two ShutdownScripts contain equal inner contents.
42467 * This ignores pointers and is_owned flags and looks at the values in fields.
42468 * Two objects with NULL inner values will be considered "equal" here.
42470 bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
42473 * Frees any resources used by the InvalidShutdownScript, if is_owned is set and inner is non-NULL.
42475 void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
42478 * The script that did not meet the requirements from [BOLT #2].
42480 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
42482 struct LDKCVec_u8Z InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
42485 * The script that did not meet the requirements from [BOLT #2].
42487 * [BOLT #2]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md
42489 void InvalidShutdownScript_set_script(struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
42492 * Constructs a new InvalidShutdownScript given each field
42494 MUST_USE_RES struct LDKInvalidShutdownScript InvalidShutdownScript_new(struct LDKCVec_u8Z script_arg);
42497 * Creates a copy of the InvalidShutdownScript
42499 struct LDKInvalidShutdownScript InvalidShutdownScript_clone(const struct LDKInvalidShutdownScript *NONNULL_PTR orig);
42502 * Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
42504 struct LDKCVec_u8Z ShutdownScript_write(const struct LDKShutdownScript *NONNULL_PTR obj);
42507 * Read a ShutdownScript from a byte array, created by ShutdownScript_write
42509 struct LDKCResult_ShutdownScriptDecodeErrorZ ShutdownScript_read(struct LDKu8slice ser);
42512 * Generates a P2WPKH script pubkey from the given [`WPubkeyHash`].
42514 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wpkh(const uint8_t (*pubkey_hash)[20]);
42517 * Generates a P2WSH script pubkey from the given [`WScriptHash`].
42519 MUST_USE_RES struct LDKShutdownScript ShutdownScript_new_p2wsh(const uint8_t (*script_hash)[32]);
42522 * Generates a witness script pubkey from the given segwit version and program.
42524 * Note for version-zero witness scripts you must use [`ShutdownScript::new_p2wpkh`] or
42525 * [`ShutdownScript::new_p2wsh`] instead.
42529 * This function may return an error if `program` is invalid for the segwit `version`.
42531 MUST_USE_RES struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ ShutdownScript_new_witness_program(struct LDKWitnessProgram witness_program);
42534 * Converts the shutdown script into the underlying [`ScriptBuf`].
42536 MUST_USE_RES struct LDKCVec_u8Z ShutdownScript_into_inner(struct LDKShutdownScript this_arg);
42539 * Returns the [`PublicKey`] used for a P2WPKH shutdown script if constructed directly from it.
42541 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42543 MUST_USE_RES struct LDKPublicKey ShutdownScript_as_legacy_pubkey(const struct LDKShutdownScript *NONNULL_PTR this_arg);
42546 * Returns whether the shutdown script is compatible with the features as defined by BOLT #2.
42548 * Specifically, checks for compliance with feature `option_shutdown_anysegwit`.
42550 MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features);
42553 * Frees any resources used by the Retry
42555 void Retry_free(struct LDKRetry this_ptr);
42558 * Creates a copy of the Retry
42560 struct LDKRetry Retry_clone(const struct LDKRetry *NONNULL_PTR orig);
42563 * Utility method to constructs a new Attempts-variant Retry
42565 struct LDKRetry Retry_attempts(uint32_t a);
42568 * Utility method to constructs a new Timeout-variant Retry
42570 struct LDKRetry Retry_timeout(uint64_t a);
42573 * Checks if two Retrys contain equal inner contents.
42574 * This ignores pointers and is_owned flags and looks at the values in fields.
42576 bool Retry_eq(const struct LDKRetry *NONNULL_PTR a, const struct LDKRetry *NONNULL_PTR b);
42579 * Generates a non-cryptographic 64-bit hash of the Retry.
42581 uint64_t Retry_hash(const struct LDKRetry *NONNULL_PTR o);
42584 * Serialize the Retry object into a byte array which can be read by Retry_read
42586 struct LDKCVec_u8Z Retry_write(const struct LDKRetry *NONNULL_PTR obj);
42589 * Read a Retry from a byte array, created by Retry_write
42591 struct LDKCResult_RetryDecodeErrorZ Retry_read(struct LDKu8slice ser);
42594 * Creates a copy of the RetryableSendFailure
42596 enum LDKRetryableSendFailure RetryableSendFailure_clone(const enum LDKRetryableSendFailure *NONNULL_PTR orig);
42599 * Utility method to constructs a new PaymentExpired-variant RetryableSendFailure
42601 enum LDKRetryableSendFailure RetryableSendFailure_payment_expired(void);
42604 * Utility method to constructs a new RouteNotFound-variant RetryableSendFailure
42606 enum LDKRetryableSendFailure RetryableSendFailure_route_not_found(void);
42609 * Utility method to constructs a new DuplicatePayment-variant RetryableSendFailure
42611 enum LDKRetryableSendFailure RetryableSendFailure_duplicate_payment(void);
42614 * Checks if two RetryableSendFailures contain equal inner contents.
42615 * This ignores pointers and is_owned flags and looks at the values in fields.
42617 bool RetryableSendFailure_eq(const enum LDKRetryableSendFailure *NONNULL_PTR a, const enum LDKRetryableSendFailure *NONNULL_PTR b);
42620 * Frees any resources used by the PaymentSendFailure
42622 void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr);
42625 * Creates a copy of the PaymentSendFailure
42627 struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
42630 * Utility method to constructs a new ParameterError-variant PaymentSendFailure
42632 struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
42635 * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
42637 struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
42640 * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure
42642 struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a);
42645 * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure
42647 struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void);
42650 * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
42652 struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id);
42655 * Checks if two PaymentSendFailures contain equal inner contents.
42656 * This ignores pointers and is_owned flags and looks at the values in fields.
42658 bool PaymentSendFailure_eq(const struct LDKPaymentSendFailure *NONNULL_PTR a, const struct LDKPaymentSendFailure *NONNULL_PTR b);
42661 * Frees any resources used by the ProbeSendFailure
42663 void ProbeSendFailure_free(struct LDKProbeSendFailure this_ptr);
42666 * Creates a copy of the ProbeSendFailure
42668 struct LDKProbeSendFailure ProbeSendFailure_clone(const struct LDKProbeSendFailure *NONNULL_PTR orig);
42671 * Utility method to constructs a new RouteNotFound-variant ProbeSendFailure
42673 struct LDKProbeSendFailure ProbeSendFailure_route_not_found(void);
42676 * Utility method to constructs a new SendingFailed-variant ProbeSendFailure
42678 struct LDKProbeSendFailure ProbeSendFailure_sending_failed(struct LDKPaymentSendFailure a);
42681 * Checks if two ProbeSendFailures contain equal inner contents.
42682 * This ignores pointers and is_owned flags and looks at the values in fields.
42684 bool ProbeSendFailure_eq(const struct LDKProbeSendFailure *NONNULL_PTR a, const struct LDKProbeSendFailure *NONNULL_PTR b);
42687 * Frees any resources used by the RecipientOnionFields, if is_owned is set and inner is non-NULL.
42689 void RecipientOnionFields_free(struct LDKRecipientOnionFields this_obj);
42692 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
42693 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
42694 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
42697 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
42698 * multi-path payments require a recipient-provided secret.
42700 * Some implementations may reject spontaneous payments with payment secrets, so you may only
42701 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
42702 * recipient will not reject it.
42704 struct LDKCOption_ThirtyTwoBytesZ RecipientOnionFields_get_payment_secret(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
42707 * The [`PaymentSecret`] is an arbitrary 32 bytes provided by the recipient for us to repeat
42708 * in the onion. It is unrelated to `payment_hash` (or [`PaymentPreimage`]) and exists to
42709 * authenticate the sender to the recipient and prevent payment-probing (deanonymization)
42712 * If you do not have one, the [`Route`] you pay over must not contain multiple paths as
42713 * multi-path payments require a recipient-provided secret.
42715 * Some implementations may reject spontaneous payments with payment secrets, so you may only
42716 * want to provide a secret for a spontaneous payment if MPP is needed and you know your
42717 * recipient will not reject it.
42719 void RecipientOnionFields_set_payment_secret(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
42722 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
42723 * arbitrary length. This gives recipients substantially more flexibility to receive
42726 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
42727 * scheme to authenticate received payments against expected payments and invoices, this field
42728 * is not used in LDK for received payments, and can be used to store arbitrary data in
42729 * invoices which will be received with the payment.
42731 * Note that this field was added to the lightning specification more recently than
42732 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
42733 * may not be supported as universally.
42735 * Returns a copy of the field.
42737 struct LDKCOption_CVec_u8ZZ RecipientOnionFields_get_payment_metadata(const struct LDKRecipientOnionFields *NONNULL_PTR this_ptr);
42740 * The payment metadata serves a similar purpose as [`Self::payment_secret`] but is of
42741 * arbitrary length. This gives recipients substantially more flexibility to receive
42744 * In LDK, while the [`Self::payment_secret`] is fixed based on an internal authentication
42745 * scheme to authenticate received payments against expected payments and invoices, this field
42746 * is not used in LDK for received payments, and can be used to store arbitrary data in
42747 * invoices which will be received with the payment.
42749 * Note that this field was added to the lightning specification more recently than
42750 * [`Self::payment_secret`] and while nearly all lightning senders support secrets, metadata
42751 * may not be supported as universally.
42753 void RecipientOnionFields_set_payment_metadata(struct LDKRecipientOnionFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
42756 * Creates a copy of the RecipientOnionFields
42758 struct LDKRecipientOnionFields RecipientOnionFields_clone(const struct LDKRecipientOnionFields *NONNULL_PTR orig);
42761 * Checks if two RecipientOnionFieldss contain equal inner contents.
42762 * This ignores pointers and is_owned flags and looks at the values in fields.
42763 * Two objects with NULL inner values will be considered "equal" here.
42765 bool RecipientOnionFields_eq(const struct LDKRecipientOnionFields *NONNULL_PTR a, const struct LDKRecipientOnionFields *NONNULL_PTR b);
42768 * Serialize the RecipientOnionFields object into a byte array which can be read by RecipientOnionFields_read
42770 struct LDKCVec_u8Z RecipientOnionFields_write(const struct LDKRecipientOnionFields *NONNULL_PTR obj);
42773 * Read a RecipientOnionFields from a byte array, created by RecipientOnionFields_write
42775 struct LDKCResult_RecipientOnionFieldsDecodeErrorZ RecipientOnionFields_read(struct LDKu8slice ser);
42778 * Creates a [`RecipientOnionFields`] from only a [`PaymentSecret`]. This is the most common
42779 * set of onion fields for today's BOLT11 invoices - most nodes require a [`PaymentSecret`]
42780 * but do not require or provide any further data.
42782 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_secret_only(struct LDKThirtyTwoBytes payment_secret);
42785 * Creates a new [`RecipientOnionFields`] with no fields. This generally does not create
42786 * payable HTLCs except for single-path spontaneous payments, i.e. this should generally
42787 * only be used for calls to [`ChannelManager::send_spontaneous_payment`]. If you are sending
42788 * a spontaneous MPP this will not work as all MPP require payment secrets; you may
42789 * instead want to use [`RecipientOnionFields::secret_only`].
42791 * [`ChannelManager::send_spontaneous_payment`]: super::channelmanager::ChannelManager::send_spontaneous_payment
42792 * [`RecipientOnionFields::secret_only`]: RecipientOnionFields::secret_only
42794 MUST_USE_RES struct LDKRecipientOnionFields RecipientOnionFields_spontaneous_empty(void);
42797 * Creates a new [`RecipientOnionFields`] from an existing one, adding custom TLVs. Each
42798 * TLV is provided as a `(u64, Vec<u8>)` for the type number and serialized value
42799 * respectively. TLV type numbers must be unique and within the range
42800 * reserved for custom types, i.e. >= 2^16, otherwise this method will return `Err(())`.
42802 * This method will also error for types in the experimental range which have been
42803 * standardized within the protocol, which only includes 5482373484 (keysend) for now.
42805 * See [`Self::custom_tlvs`] for more info.
42807 MUST_USE_RES struct LDKCResult_RecipientOnionFieldsNoneZ RecipientOnionFields_with_custom_tlvs(struct LDKRecipientOnionFields this_arg, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs);
42810 * Gets the custom TLVs that will be sent or have been received.
42812 * Custom TLVs allow sending extra application-specific data with a payment. They provide
42813 * additional flexibility on top of payment metadata, as while other implementations may
42814 * require `payment_metadata` to reflect metadata provided in an invoice, custom TLVs
42815 * do not have this restriction.
42817 * Note that if this field is non-empty, it will contain strictly increasing TLVs, each
42818 * represented by a `(u64, Vec<u8>)` for its type number and serialized value respectively.
42819 * This is validated when setting this field using [`Self::with_custom_tlvs`].
42821 MUST_USE_RES struct LDKCVec_C2Tuple_u64CVec_u8ZZZ RecipientOnionFields_custom_tlvs(const struct LDKRecipientOnionFields *NONNULL_PTR this_arg);
42824 * Calls the free function if one is set
42826 void CustomMessageReader_free(struct LDKCustomMessageReader this_ptr);
42829 * Creates a copy of a Type
42831 struct LDKType Type_clone(const struct LDKType *NONNULL_PTR orig);
42834 * Calls the free function if one is set
42836 void Type_free(struct LDKType this_ptr);
42839 * Frees any resources used by the Offer, if is_owned is set and inner is non-NULL.
42841 void Offer_free(struct LDKOffer this_obj);
42844 * Creates a copy of the Offer
42846 struct LDKOffer Offer_clone(const struct LDKOffer *NONNULL_PTR orig);
42849 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
42850 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
42851 * for the selected chain.
42853 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ Offer_chains(const struct LDKOffer *NONNULL_PTR this_arg);
42856 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
42857 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
42859 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg);
42862 * The minimum amount required for a successful payment of a single item.
42864 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42866 MUST_USE_RES struct LDKAmount Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg);
42869 * A complete description of the purpose of the payment. Intended to be displayed to the user
42870 * but with the caveat that it has not been verified in any way.
42872 MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg);
42875 * Features pertaining to the offer.
42877 MUST_USE_RES struct LDKOfferFeatures Offer_offer_features(const struct LDKOffer *NONNULL_PTR this_arg);
42880 * Duration since the Unix epoch when an invoice should no longer be requested.
42882 * If `None`, the offer does not expire.
42884 MUST_USE_RES struct LDKCOption_u64Z Offer_absolute_expiry(const struct LDKOffer *NONNULL_PTR this_arg);
42887 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
42888 * displayed to the user but with the caveat that it has not been verified in any way.
42890 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
42892 MUST_USE_RES struct LDKPrintableString Offer_issuer(const struct LDKOffer *NONNULL_PTR this_arg);
42895 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
42896 * recipient privacy by obfuscating its node id.
42898 MUST_USE_RES struct LDKCVec_BlindedPathZ Offer_paths(const struct LDKOffer *NONNULL_PTR this_arg);
42901 * The quantity of items supported.
42903 MUST_USE_RES struct LDKQuantity Offer_supported_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
42906 * The public key used by the recipient to sign invoices.
42908 MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg);
42911 * Returns whether the given chain is supported by the offer.
42913 MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain);
42916 * Whether the offer has expired.
42918 MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg);
42921 * Whether the offer has expired given the duration since the Unix epoch.
42923 MUST_USE_RES bool Offer_is_expired_no_std(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
42926 * Returns whether the given quantity is valid for the offer.
42928 MUST_USE_RES bool Offer_is_valid_quantity(const struct LDKOffer *NONNULL_PTR this_arg, uint64_t quantity);
42931 * Returns whether a quantity is expected in an [`InvoiceRequest`] for the offer.
42933 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
42935 MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg);
42938 * Serialize the Offer object into a byte array which can be read by Offer_read
42940 struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj);
42943 * Frees any resources used by the Amount, if is_owned is set and inner is non-NULL.
42945 void Amount_free(struct LDKAmount this_obj);
42948 * Creates a copy of the Amount
42950 struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig);
42953 * Frees any resources used by the Quantity, if is_owned is set and inner is non-NULL.
42955 void Quantity_free(struct LDKQuantity this_obj);
42958 * Creates a copy of the Quantity
42960 struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig);
42963 * Read a Offer object from a string
42965 struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s);
42968 * Frees any resources used by the UnsignedBolt12Invoice, if is_owned is set and inner is non-NULL.
42970 void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj);
42973 * Returns the [`TaggedHash`] of the invoice to sign.
42975 MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
42978 * Frees any resources used by the Bolt12Invoice, if is_owned is set and inner is non-NULL.
42980 void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj);
42983 * Creates a copy of the Bolt12Invoice
42985 struct LDKBolt12Invoice Bolt12Invoice_clone(const struct LDKBolt12Invoice *NONNULL_PTR orig);
42988 * The chains that may be used when paying a requested invoice.
42990 * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
42992 * [`Offer::chains`]: crate::offers::offer::Offer::chains
42994 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ UnsignedBolt12Invoice_offer_chains(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
42997 * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
42998 * invoice originated from an offer.
43000 * From [`InvoiceRequest::chain`] or [`Refund::chain`].
43002 * [`offer_chains`]: Self::offer_chains
43003 * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
43005 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_chain(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43008 * Opaque bytes set by the originating [`Offer`].
43010 * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
43011 * if the [`Offer`] did not set it.
43013 * [`Offer`]: crate::offers::offer::Offer
43014 * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
43016 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43019 * The minimum amount required for a successful payment of a single item.
43021 * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
43022 * the [`Offer`] did not set it.
43024 * [`Offer`]: crate::offers::offer::Offer
43025 * [`Offer::amount`]: crate::offers::offer::Offer::amount
43027 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43029 MUST_USE_RES struct LDKAmount UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43032 * Features pertaining to the originating [`Offer`].
43034 * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
43037 * [`Offer`]: crate::offers::offer::Offer
43038 * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
43040 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43042 MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43045 * A complete description of the purpose of the originating offer or refund.
43047 * From [`Offer::description`] or [`Refund::description`].
43049 * [`Offer::description`]: crate::offers::offer::Offer::description
43051 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_description(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43054 * Duration since the Unix epoch when an invoice should no longer be requested.
43056 * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
43058 * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
43060 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_absolute_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43063 * The issuer of the offer or refund.
43065 * From [`Offer::issuer`] or [`Refund::issuer`].
43067 * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
43069 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43071 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_issuer(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43074 * Paths to the recipient originating from publicly reachable nodes.
43076 * From [`Offer::paths`] or [`Refund::paths`].
43078 * [`Offer::paths`]: crate::offers::offer::Offer::paths
43080 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43083 * The quantity of items supported.
43085 * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
43088 * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
43090 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43092 MUST_USE_RES struct LDKQuantity UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43095 * An unpredictable series of bytes from the payer.
43097 * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
43099 MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43102 * Features pertaining to requesting an invoice.
43104 * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
43106 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedBolt12Invoice_invoice_request_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43109 * The quantity of items requested or refunded for.
43111 * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
43113 MUST_USE_RES struct LDKCOption_u64Z UnsignedBolt12Invoice_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43116 * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
43117 * refund in case there are no [`message_paths`].
43119 * [`message_paths`]: Self::message_paths
43121 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_payer_id(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43124 * A payer-provided note reflected back in the invoice.
43126 * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
43128 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43130 MUST_USE_RES struct LDKPrintableString UnsignedBolt12Invoice_payer_note(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43133 * Duration since the Unix epoch when the invoice was created.
43135 MUST_USE_RES uint64_t UnsignedBolt12Invoice_created_at(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43138 * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
43139 * should no longer be paid.
43141 MUST_USE_RES uint64_t UnsignedBolt12Invoice_relative_expiry(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43144 * Whether the invoice has expired.
43146 MUST_USE_RES bool UnsignedBolt12Invoice_is_expired(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43149 * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
43151 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedBolt12Invoice_payment_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43154 * The minimum amount required for a successful payment of the invoice.
43156 MUST_USE_RES uint64_t UnsignedBolt12Invoice_amount_msats(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43159 * Features pertaining to paying an invoice.
43161 MUST_USE_RES struct LDKBolt12InvoiceFeatures UnsignedBolt12Invoice_invoice_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43164 * The public key corresponding to the key used to sign the invoice.
43166 MUST_USE_RES struct LDKPublicKey UnsignedBolt12Invoice_signing_pubkey(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg);
43169 * The chains that may be used when paying a requested invoice.
43171 * From [`Offer::chains`]; `None` if the invoice was created in response to a [`Refund`].
43173 * [`Offer::chains`]: crate::offers::offer::Offer::chains
43175 MUST_USE_RES struct LDKCOption_CVec_ThirtyTwoBytesZZ Bolt12Invoice_offer_chains(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43178 * The chain that must be used when paying the invoice; selected from [`offer_chains`] if the
43179 * invoice originated from an offer.
43181 * From [`InvoiceRequest::chain`] or [`Refund::chain`].
43183 * [`offer_chains`]: Self::offer_chains
43184 * [`InvoiceRequest::chain`]: crate::offers::invoice_request::InvoiceRequest::chain
43186 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_chain(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43189 * Opaque bytes set by the originating [`Offer`].
43191 * From [`Offer::metadata`]; `None` if the invoice was created in response to a [`Refund`] or
43192 * if the [`Offer`] did not set it.
43194 * [`Offer`]: crate::offers::offer::Offer
43195 * [`Offer::metadata`]: crate::offers::offer::Offer::metadata
43197 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43200 * The minimum amount required for a successful payment of a single item.
43202 * From [`Offer::amount`]; `None` if the invoice was created in response to a [`Refund`] or if
43203 * the [`Offer`] did not set it.
43205 * [`Offer`]: crate::offers::offer::Offer
43206 * [`Offer::amount`]: crate::offers::offer::Offer::amount
43208 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43210 MUST_USE_RES struct LDKAmount Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43213 * Features pertaining to the originating [`Offer`].
43215 * From [`Offer::offer_features`]; `None` if the invoice was created in response to a
43218 * [`Offer`]: crate::offers::offer::Offer
43219 * [`Offer::offer_features`]: crate::offers::offer::Offer::offer_features
43221 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43223 MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43226 * A complete description of the purpose of the originating offer or refund.
43228 * From [`Offer::description`] or [`Refund::description`].
43230 * [`Offer::description`]: crate::offers::offer::Offer::description
43232 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_description(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43235 * Duration since the Unix epoch when an invoice should no longer be requested.
43237 * From [`Offer::absolute_expiry`] or [`Refund::absolute_expiry`].
43239 * [`Offer::absolute_expiry`]: crate::offers::offer::Offer::absolute_expiry
43241 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_absolute_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43244 * The issuer of the offer or refund.
43246 * From [`Offer::issuer`] or [`Refund::issuer`].
43248 * [`Offer::issuer`]: crate::offers::offer::Offer::issuer
43250 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43252 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_issuer(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43255 * Paths to the recipient originating from publicly reachable nodes.
43257 * From [`Offer::paths`] or [`Refund::paths`].
43259 * [`Offer::paths`]: crate::offers::offer::Offer::paths
43261 MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43264 * The quantity of items supported.
43266 * From [`Offer::supported_quantity`]; `None` if the invoice was created in response to a
43269 * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity
43271 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43273 MUST_USE_RES struct LDKQuantity Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43276 * An unpredictable series of bytes from the payer.
43278 * From [`InvoiceRequest::payer_metadata`] or [`Refund::payer_metadata`].
43280 MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43283 * Features pertaining to requesting an invoice.
43285 * From [`InvoiceRequest::invoice_request_features`] or [`Refund::features`].
43287 MUST_USE_RES struct LDKInvoiceRequestFeatures Bolt12Invoice_invoice_request_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43290 * The quantity of items requested or refunded for.
43292 * From [`InvoiceRequest::quantity`] or [`Refund::quantity`].
43294 MUST_USE_RES struct LDKCOption_u64Z Bolt12Invoice_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43297 * A possibly transient pubkey used to sign the invoice request or to send an invoice for a
43298 * refund in case there are no [`message_paths`].
43300 * [`message_paths`]: Self::message_paths
43302 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_payer_id(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43305 * A payer-provided note reflected back in the invoice.
43307 * From [`InvoiceRequest::payer_note`] or [`Refund::payer_note`].
43309 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43311 MUST_USE_RES struct LDKPrintableString Bolt12Invoice_payer_note(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43314 * Duration since the Unix epoch when the invoice was created.
43316 MUST_USE_RES uint64_t Bolt12Invoice_created_at(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43319 * Duration since [`Bolt12Invoice::created_at`] when the invoice has expired and therefore
43320 * should no longer be paid.
43322 MUST_USE_RES uint64_t Bolt12Invoice_relative_expiry(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43325 * Whether the invoice has expired.
43327 MUST_USE_RES bool Bolt12Invoice_is_expired(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43330 * SHA256 hash of the payment preimage that will be given in return for paying the invoice.
43332 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_payment_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43335 * The minimum amount required for a successful payment of the invoice.
43337 MUST_USE_RES uint64_t Bolt12Invoice_amount_msats(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43340 * Features pertaining to paying an invoice.
43342 MUST_USE_RES struct LDKBolt12InvoiceFeatures Bolt12Invoice_invoice_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43345 * The public key corresponding to the key used to sign the invoice.
43347 MUST_USE_RES struct LDKPublicKey Bolt12Invoice_signing_pubkey(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43350 * Signature of the invoice verified using [`Bolt12Invoice::signing_pubkey`].
43352 MUST_USE_RES struct LDKSchnorrSignature Bolt12Invoice_signature(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43355 * Hash that was used for signing the invoice.
43357 MUST_USE_RES struct LDKThirtyTwoBytes Bolt12Invoice_signable_hash(const struct LDKBolt12Invoice *NONNULL_PTR this_arg);
43360 * Verifies that the invoice was for a request or refund created using the given key. Returns
43361 * the associated [`PaymentId`] to use when sending the payment.
43363 MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
43366 * Serialize the UnsignedBolt12Invoice object into a byte array which can be read by UnsignedBolt12Invoice_read
43368 struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj);
43371 * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read
43373 struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj);
43376 * Frees any resources used by the BlindedPayInfo, if is_owned is set and inner is non-NULL.
43378 void BlindedPayInfo_free(struct LDKBlindedPayInfo this_obj);
43381 * Base fee charged (in millisatoshi) for the entire blinded path.
43383 uint32_t BlindedPayInfo_get_fee_base_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
43386 * Base fee charged (in millisatoshi) for the entire blinded path.
43388 void BlindedPayInfo_set_fee_base_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
43391 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
43392 * (i.e., 10,000 is 1%).
43394 uint32_t BlindedPayInfo_get_fee_proportional_millionths(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
43397 * Liquidity fee charged (in millionths of the amount transferred) for the entire blinded path
43398 * (i.e., 10,000 is 1%).
43400 void BlindedPayInfo_set_fee_proportional_millionths(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint32_t val);
43403 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
43406 uint16_t BlindedPayInfo_get_cltv_expiry_delta(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
43409 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for the entire blinded
43412 void BlindedPayInfo_set_cltv_expiry_delta(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint16_t val);
43415 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
43416 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
43417 * seen by the recipient.
43419 uint64_t BlindedPayInfo_get_htlc_minimum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
43422 * The minimum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
43423 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
43424 * seen by the recipient.
43426 void BlindedPayInfo_set_htlc_minimum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
43429 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
43430 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
43431 * seen by the recipient.
43433 uint64_t BlindedPayInfo_get_htlc_maximum_msat(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
43436 * The maximum HTLC value (in millisatoshi) that is acceptable to all channel peers on the
43437 * blinded path from the introduction node to the recipient, accounting for any fees, i.e., as
43438 * seen by the recipient.
43440 void BlindedPayInfo_set_htlc_maximum_msat(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, uint64_t val);
43443 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
43446 struct LDKBlindedHopFeatures BlindedPayInfo_get_features(const struct LDKBlindedPayInfo *NONNULL_PTR this_ptr);
43449 * Features set in `encrypted_data_tlv` for the `encrypted_recipient_data` TLV record in an
43452 void BlindedPayInfo_set_features(struct LDKBlindedPayInfo *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
43455 * Constructs a new BlindedPayInfo given each field
43457 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);
43460 * Creates a copy of the BlindedPayInfo
43462 struct LDKBlindedPayInfo BlindedPayInfo_clone(const struct LDKBlindedPayInfo *NONNULL_PTR orig);
43465 * Generates a non-cryptographic 64-bit hash of the BlindedPayInfo.
43467 uint64_t BlindedPayInfo_hash(const struct LDKBlindedPayInfo *NONNULL_PTR o);
43470 * Checks if two BlindedPayInfos contain equal inner contents.
43471 * This ignores pointers and is_owned flags and looks at the values in fields.
43472 * Two objects with NULL inner values will be considered "equal" here.
43474 bool BlindedPayInfo_eq(const struct LDKBlindedPayInfo *NONNULL_PTR a, const struct LDKBlindedPayInfo *NONNULL_PTR b);
43477 * Serialize the BlindedPayInfo object into a byte array which can be read by BlindedPayInfo_read
43479 struct LDKCVec_u8Z BlindedPayInfo_write(const struct LDKBlindedPayInfo *NONNULL_PTR obj);
43482 * Read a BlindedPayInfo from a byte array, created by BlindedPayInfo_write
43484 struct LDKCResult_BlindedPayInfoDecodeErrorZ BlindedPayInfo_read(struct LDKu8slice ser);
43487 * Frees any resources used by the InvoiceError, if is_owned is set and inner is non-NULL.
43489 void InvoiceError_free(struct LDKInvoiceError this_obj);
43492 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
43494 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
43495 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
43497 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43499 struct LDKErroneousField InvoiceError_get_erroneous_field(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
43502 * The field in the [`InvoiceRequest`] or the [`Bolt12Invoice`] that contained an error.
43504 * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
43505 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
43507 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
43509 void InvoiceError_set_erroneous_field(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKErroneousField val);
43512 * An explanation of the error.
43514 struct LDKUntrustedString InvoiceError_get_message(const struct LDKInvoiceError *NONNULL_PTR this_ptr);
43517 * An explanation of the error.
43519 void InvoiceError_set_message(struct LDKInvoiceError *NONNULL_PTR this_ptr, struct LDKUntrustedString val);
43522 * Constructs a new InvoiceError given each field
43524 * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
43526 MUST_USE_RES struct LDKInvoiceError InvoiceError_new(struct LDKErroneousField erroneous_field_arg, struct LDKUntrustedString message_arg);
43529 * Creates a copy of the InvoiceError
43531 struct LDKInvoiceError InvoiceError_clone(const struct LDKInvoiceError *NONNULL_PTR orig);
43534 * Frees any resources used by the ErroneousField, if is_owned is set and inner is non-NULL.
43536 void ErroneousField_free(struct LDKErroneousField this_obj);
43539 * The type number of the TLV field containing the error.
43541 uint64_t ErroneousField_get_tlv_fieldnum(const struct LDKErroneousField *NONNULL_PTR this_ptr);
43544 * The type number of the TLV field containing the error.
43546 void ErroneousField_set_tlv_fieldnum(struct LDKErroneousField *NONNULL_PTR this_ptr, uint64_t val);
43549 * A value to use for the TLV field to avoid the error.
43551 * Returns a copy of the field.
43553 struct LDKCOption_CVec_u8ZZ ErroneousField_get_suggested_value(const struct LDKErroneousField *NONNULL_PTR this_ptr);
43556 * A value to use for the TLV field to avoid the error.
43558 void ErroneousField_set_suggested_value(struct LDKErroneousField *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val);
43561 * Constructs a new ErroneousField given each field
43563 MUST_USE_RES struct LDKErroneousField ErroneousField_new(uint64_t tlv_fieldnum_arg, struct LDKCOption_CVec_u8ZZ suggested_value_arg);
43566 * Creates a copy of the ErroneousField
43568 struct LDKErroneousField ErroneousField_clone(const struct LDKErroneousField *NONNULL_PTR orig);
43571 * Creates an [`InvoiceError`] with the given message.
43573 MUST_USE_RES struct LDKInvoiceError InvoiceError_from_string(struct LDKStr s);
43576 * Serialize the InvoiceError object into a byte array which can be read by InvoiceError_read
43578 struct LDKCVec_u8Z InvoiceError_write(const struct LDKInvoiceError *NONNULL_PTR obj);
43581 * Read a InvoiceError from a byte array, created by InvoiceError_write
43583 struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser);
43586 * Frees any resources used by the UnsignedInvoiceRequest, if is_owned is set and inner is non-NULL.
43588 void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj);
43591 * Returns the [`TaggedHash`] of the invoice to sign.
43593 MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43596 * Frees any resources used by the InvoiceRequest, if is_owned is set and inner is non-NULL.
43598 void InvoiceRequest_free(struct LDKInvoiceRequest this_obj);
43601 * Creates a copy of the InvoiceRequest
43603 struct LDKInvoiceRequest InvoiceRequest_clone(const struct LDKInvoiceRequest *NONNULL_PTR orig);
43606 * Frees any resources used by the VerifiedInvoiceRequest, if is_owned is set and inner is non-NULL.
43608 void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj);
43611 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
43613 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
43614 * [`respond_with`].
43616 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
43617 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
43618 * [`respond_with`]: Self::respond_with
43620 struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr);
43623 * Keys used for signing a [`Bolt12Invoice`] if they can be derived.
43625 * If `Some`, must call [`respond_using_derived_keys`] when responding. Otherwise, call
43626 * [`respond_with`].
43628 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
43629 * [`respond_using_derived_keys`]: Self::respond_using_derived_keys
43630 * [`respond_with`]: Self::respond_with
43632 void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val);
43635 * Creates a copy of the VerifiedInvoiceRequest
43637 struct LDKVerifiedInvoiceRequest VerifiedInvoiceRequest_clone(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR orig);
43640 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
43641 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
43642 * for the selected chain.
43644 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ UnsignedInvoiceRequest_chains(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43647 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
43648 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
43650 MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43653 * The minimum amount required for a successful payment of a single item.
43655 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43657 MUST_USE_RES struct LDKAmount UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43660 * A complete description of the purpose of the payment. Intended to be displayed to the user
43661 * but with the caveat that it has not been verified in any way.
43663 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43666 * Features pertaining to the offer.
43668 MUST_USE_RES struct LDKOfferFeatures UnsignedInvoiceRequest_offer_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43671 * Duration since the Unix epoch when an invoice should no longer be requested.
43673 * If `None`, the offer does not expire.
43675 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_absolute_expiry(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43678 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
43679 * displayed to the user but with the caveat that it has not been verified in any way.
43681 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43683 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_issuer(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43686 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
43687 * recipient privacy by obfuscating its node id.
43689 MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedInvoiceRequest_paths(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43692 * The quantity of items supported.
43694 MUST_USE_RES struct LDKQuantity UnsignedInvoiceRequest_supported_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43697 * The public key used by the recipient to sign invoices.
43699 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_signing_pubkey(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43702 * An unpredictable series of bytes, typically containing information about the derivation of
43705 * [`payer_id`]: Self::payer_id
43707 MUST_USE_RES struct LDKu8slice UnsignedInvoiceRequest_payer_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43710 * A chain from [`Offer::chains`] that the offer is valid for.
43712 MUST_USE_RES struct LDKThirtyTwoBytes UnsignedInvoiceRequest_chain(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43715 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
43716 * must be greater than or equal to [`Offer::amount`], converted if necessary.
43718 * [`chain`]: Self::chain
43720 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_amount_msats(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43723 * Features pertaining to requesting an invoice.
43725 MUST_USE_RES struct LDKInvoiceRequestFeatures UnsignedInvoiceRequest_invoice_request_features(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43728 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
43730 MUST_USE_RES struct LDKCOption_u64Z UnsignedInvoiceRequest_quantity(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43733 * A possibly transient pubkey used to sign the invoice request.
43735 MUST_USE_RES struct LDKPublicKey UnsignedInvoiceRequest_payer_id(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43738 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
43741 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43743 MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_payer_note(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg);
43746 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
43747 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
43748 * for the selected chain.
43750 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ InvoiceRequest_chains(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43753 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
43754 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
43756 MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43759 * The minimum amount required for a successful payment of a single item.
43761 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43763 MUST_USE_RES struct LDKAmount InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43766 * A complete description of the purpose of the payment. Intended to be displayed to the user
43767 * but with the caveat that it has not been verified in any way.
43769 MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43772 * Features pertaining to the offer.
43774 MUST_USE_RES struct LDKOfferFeatures InvoiceRequest_offer_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43777 * Duration since the Unix epoch when an invoice should no longer be requested.
43779 * If `None`, the offer does not expire.
43781 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_absolute_expiry(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43784 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
43785 * displayed to the user but with the caveat that it has not been verified in any way.
43787 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43789 MUST_USE_RES struct LDKPrintableString InvoiceRequest_issuer(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43792 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
43793 * recipient privacy by obfuscating its node id.
43795 MUST_USE_RES struct LDKCVec_BlindedPathZ InvoiceRequest_paths(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43798 * The quantity of items supported.
43800 MUST_USE_RES struct LDKQuantity InvoiceRequest_supported_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43803 * The public key used by the recipient to sign invoices.
43805 MUST_USE_RES struct LDKPublicKey InvoiceRequest_signing_pubkey(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43808 * An unpredictable series of bytes, typically containing information about the derivation of
43811 * [`payer_id`]: Self::payer_id
43813 MUST_USE_RES struct LDKu8slice InvoiceRequest_payer_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43816 * A chain from [`Offer::chains`] that the offer is valid for.
43818 MUST_USE_RES struct LDKThirtyTwoBytes InvoiceRequest_chain(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43821 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
43822 * must be greater than or equal to [`Offer::amount`], converted if necessary.
43824 * [`chain`]: Self::chain
43826 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_amount_msats(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43829 * Features pertaining to requesting an invoice.
43831 MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequest_invoice_request_features(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43834 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
43836 MUST_USE_RES struct LDKCOption_u64Z InvoiceRequest_quantity(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43839 * A possibly transient pubkey used to sign the invoice request.
43841 MUST_USE_RES struct LDKPublicKey InvoiceRequest_payer_id(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43844 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
43847 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43849 MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43852 * Signature of the invoice request using [`payer_id`].
43854 * [`payer_id`]: Self::payer_id
43856 MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg);
43859 * Verifies that the request was for an offer created using the given key. Returns the verified
43860 * request which contains the derived keys needed to sign a [`Bolt12Invoice`] for the request
43861 * if they could be extracted from the metadata.
43863 * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
43865 MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key);
43868 * The chains that may be used when paying a requested invoice (e.g., bitcoin mainnet).
43869 * Payments must be denominated in units of the minimal lightning-payable unit (e.g., msats)
43870 * for the selected chain.
43872 MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43875 * Opaque bytes set by the originator. Useful for authentication and validating fields since it
43876 * is reflected in `invoice_request` messages along with all the other fields from the `offer`.
43878 MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43881 * The minimum amount required for a successful payment of a single item.
43883 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43885 MUST_USE_RES struct LDKAmount VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43888 * A complete description of the purpose of the payment. Intended to be displayed to the user
43889 * but with the caveat that it has not been verified in any way.
43891 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43894 * Features pertaining to the offer.
43896 MUST_USE_RES struct LDKOfferFeatures VerifiedInvoiceRequest_offer_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43899 * Duration since the Unix epoch when an invoice should no longer be requested.
43901 * If `None`, the offer does not expire.
43903 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_absolute_expiry(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43906 * The issuer of the offer, possibly beginning with `user@domain` or `domain`. Intended to be
43907 * displayed to the user but with the caveat that it has not been verified in any way.
43909 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43911 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_issuer(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43914 * Paths to the recipient originating from publicly reachable nodes. Blinded paths provide
43915 * recipient privacy by obfuscating its node id.
43917 MUST_USE_RES struct LDKCVec_BlindedPathZ VerifiedInvoiceRequest_paths(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43920 * The quantity of items supported.
43922 MUST_USE_RES struct LDKQuantity VerifiedInvoiceRequest_supported_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43925 * The public key used by the recipient to sign invoices.
43927 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_signing_pubkey(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43930 * An unpredictable series of bytes, typically containing information about the derivation of
43933 * [`payer_id`]: Self::payer_id
43935 MUST_USE_RES struct LDKu8slice VerifiedInvoiceRequest_payer_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43938 * A chain from [`Offer::chains`] that the offer is valid for.
43940 MUST_USE_RES struct LDKThirtyTwoBytes VerifiedInvoiceRequest_chain(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43943 * The amount to pay in msats (i.e., the minimum lightning-payable unit for [`chain`]), which
43944 * must be greater than or equal to [`Offer::amount`], converted if necessary.
43946 * [`chain`]: Self::chain
43948 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_amount_msats(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43951 * Features pertaining to requesting an invoice.
43953 MUST_USE_RES struct LDKInvoiceRequestFeatures VerifiedInvoiceRequest_invoice_request_features(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43956 * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`].
43958 MUST_USE_RES struct LDKCOption_u64Z VerifiedInvoiceRequest_quantity(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43961 * A possibly transient pubkey used to sign the invoice request.
43963 MUST_USE_RES struct LDKPublicKey VerifiedInvoiceRequest_payer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43966 * A payer-provided note which will be seen by the recipient and reflected back in the invoice
43969 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
43971 MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg);
43974 * Serialize the UnsignedInvoiceRequest object into a byte array which can be read by UnsignedInvoiceRequest_read
43976 struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj);
43979 * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read
43981 struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj);
43984 * Frees any resources used by the TaggedHash, if is_owned is set and inner is non-NULL.
43986 void TaggedHash_free(struct LDKTaggedHash this_obj);
43989 * Creates a copy of the TaggedHash
43991 struct LDKTaggedHash TaggedHash_clone(const struct LDKTaggedHash *NONNULL_PTR orig);
43994 * Returns the digest to sign.
43996 MUST_USE_RES const uint8_t (*TaggedHash_as_digest(const struct LDKTaggedHash *NONNULL_PTR this_arg))[32];
43999 * Returns the tag used in the tagged hash.
44001 MUST_USE_RES struct LDKStr TaggedHash_tag(const struct LDKTaggedHash *NONNULL_PTR this_arg);
44004 * Returns the merkle root used in the tagged hash.
44006 MUST_USE_RES struct LDKThirtyTwoBytes TaggedHash_merkle_root(const struct LDKTaggedHash *NONNULL_PTR this_arg);
44009 * Frees any resources used by the Bolt12ParseError, if is_owned is set and inner is non-NULL.
44011 void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj);
44014 * Creates a copy of the Bolt12ParseError
44016 struct LDKBolt12ParseError Bolt12ParseError_clone(const struct LDKBolt12ParseError *NONNULL_PTR orig);
44019 * Creates a copy of the Bolt12SemanticError
44021 enum LDKBolt12SemanticError Bolt12SemanticError_clone(const enum LDKBolt12SemanticError *NONNULL_PTR orig);
44024 * Utility method to constructs a new AlreadyExpired-variant Bolt12SemanticError
44026 enum LDKBolt12SemanticError Bolt12SemanticError_already_expired(void);
44029 * Utility method to constructs a new UnsupportedChain-variant Bolt12SemanticError
44031 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_chain(void);
44034 * Utility method to constructs a new UnexpectedChain-variant Bolt12SemanticError
44036 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_chain(void);
44039 * Utility method to constructs a new MissingAmount-variant Bolt12SemanticError
44041 enum LDKBolt12SemanticError Bolt12SemanticError_missing_amount(void);
44044 * Utility method to constructs a new InvalidAmount-variant Bolt12SemanticError
44046 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_amount(void);
44049 * Utility method to constructs a new InsufficientAmount-variant Bolt12SemanticError
44051 enum LDKBolt12SemanticError Bolt12SemanticError_insufficient_amount(void);
44054 * Utility method to constructs a new UnexpectedAmount-variant Bolt12SemanticError
44056 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_amount(void);
44059 * Utility method to constructs a new UnsupportedCurrency-variant Bolt12SemanticError
44061 enum LDKBolt12SemanticError Bolt12SemanticError_unsupported_currency(void);
44064 * Utility method to constructs a new UnknownRequiredFeatures-variant Bolt12SemanticError
44066 enum LDKBolt12SemanticError Bolt12SemanticError_unknown_required_features(void);
44069 * Utility method to constructs a new UnexpectedFeatures-variant Bolt12SemanticError
44071 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_features(void);
44074 * Utility method to constructs a new MissingDescription-variant Bolt12SemanticError
44076 enum LDKBolt12SemanticError Bolt12SemanticError_missing_description(void);
44079 * Utility method to constructs a new MissingSigningPubkey-variant Bolt12SemanticError
44081 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signing_pubkey(void);
44084 * Utility method to constructs a new InvalidSigningPubkey-variant Bolt12SemanticError
44086 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_signing_pubkey(void);
44089 * Utility method to constructs a new UnexpectedSigningPubkey-variant Bolt12SemanticError
44091 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_signing_pubkey(void);
44094 * Utility method to constructs a new MissingQuantity-variant Bolt12SemanticError
44096 enum LDKBolt12SemanticError Bolt12SemanticError_missing_quantity(void);
44099 * Utility method to constructs a new InvalidQuantity-variant Bolt12SemanticError
44101 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_quantity(void);
44104 * Utility method to constructs a new UnexpectedQuantity-variant Bolt12SemanticError
44106 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_quantity(void);
44109 * Utility method to constructs a new InvalidMetadata-variant Bolt12SemanticError
44111 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_metadata(void);
44114 * Utility method to constructs a new UnexpectedMetadata-variant Bolt12SemanticError
44116 enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_metadata(void);
44119 * Utility method to constructs a new MissingPayerMetadata-variant Bolt12SemanticError
44121 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_metadata(void);
44124 * Utility method to constructs a new MissingPayerId-variant Bolt12SemanticError
44126 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payer_id(void);
44129 * Utility method to constructs a new DuplicatePaymentId-variant Bolt12SemanticError
44131 enum LDKBolt12SemanticError Bolt12SemanticError_duplicate_payment_id(void);
44134 * Utility method to constructs a new MissingPaths-variant Bolt12SemanticError
44136 enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void);
44139 * Utility method to constructs a new InvalidPayInfo-variant Bolt12SemanticError
44141 enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void);
44144 * Utility method to constructs a new MissingCreationTime-variant Bolt12SemanticError
44146 enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void);
44149 * Utility method to constructs a new MissingPaymentHash-variant Bolt12SemanticError
44151 enum LDKBolt12SemanticError Bolt12SemanticError_missing_payment_hash(void);
44154 * Utility method to constructs a new MissingSignature-variant Bolt12SemanticError
44156 enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void);
44159 * Frees any resources used by the Refund, if is_owned is set and inner is non-NULL.
44161 void Refund_free(struct LDKRefund this_obj);
44164 * Creates a copy of the Refund
44166 struct LDKRefund Refund_clone(const struct LDKRefund *NONNULL_PTR orig);
44169 * A complete description of the purpose of the refund. Intended to be displayed to the user
44170 * but with the caveat that it has not been verified in any way.
44172 MUST_USE_RES struct LDKPrintableString Refund_description(const struct LDKRefund *NONNULL_PTR this_arg);
44175 * Duration since the Unix epoch when an invoice should no longer be sent.
44177 * If `None`, the refund does not expire.
44179 MUST_USE_RES struct LDKCOption_u64Z Refund_absolute_expiry(const struct LDKRefund *NONNULL_PTR this_arg);
44182 * Whether the refund has expired.
44184 MUST_USE_RES bool Refund_is_expired(const struct LDKRefund *NONNULL_PTR this_arg);
44187 * Whether the refund has expired given the duration since the Unix epoch.
44189 MUST_USE_RES bool Refund_is_expired_no_std(const struct LDKRefund *NONNULL_PTR this_arg, uint64_t duration_since_epoch);
44192 * The issuer of the refund, possibly beginning with `user@domain` or `domain`. Intended to be
44193 * displayed to the user but with the caveat that it has not been verified in any way.
44195 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44197 MUST_USE_RES struct LDKPrintableString Refund_issuer(const struct LDKRefund *NONNULL_PTR this_arg);
44200 * Paths to the sender originating from publicly reachable nodes. Blinded paths provide sender
44201 * privacy by obfuscating its node id.
44203 MUST_USE_RES struct LDKCVec_BlindedPathZ Refund_paths(const struct LDKRefund *NONNULL_PTR this_arg);
44206 * An unpredictable series of bytes, typically containing information about the derivation of
44209 * [`payer_id`]: Self::payer_id
44211 MUST_USE_RES struct LDKu8slice Refund_payer_metadata(const struct LDKRefund *NONNULL_PTR this_arg);
44214 * A chain that the refund is valid for.
44216 MUST_USE_RES struct LDKThirtyTwoBytes Refund_chain(const struct LDKRefund *NONNULL_PTR this_arg);
44219 * The amount to refund in msats (i.e., the minimum lightning-payable unit for [`chain`]).
44221 * [`chain`]: Self::chain
44223 MUST_USE_RES uint64_t Refund_amount_msats(const struct LDKRefund *NONNULL_PTR this_arg);
44226 * Features pertaining to requesting an invoice.
44228 MUST_USE_RES struct LDKInvoiceRequestFeatures Refund_features(const struct LDKRefund *NONNULL_PTR this_arg);
44231 * The quantity of an item that refund is for.
44233 MUST_USE_RES struct LDKCOption_u64Z Refund_quantity(const struct LDKRefund *NONNULL_PTR this_arg);
44236 * A public node id to send to in the case where there are no [`paths`]. Otherwise, a possibly
44237 * transient pubkey.
44239 * [`paths`]: Self::paths
44241 MUST_USE_RES struct LDKPublicKey Refund_payer_id(const struct LDKRefund *NONNULL_PTR this_arg);
44244 * Payer provided note to include in the invoice.
44246 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44248 MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg);
44251 * Serialize the Refund object into a byte array which can be read by Refund_read
44253 struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj);
44256 * Read a Refund object from a string
44258 struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s);
44261 * Creates a copy of the UtxoLookupError
44263 enum LDKUtxoLookupError UtxoLookupError_clone(const enum LDKUtxoLookupError *NONNULL_PTR orig);
44266 * Utility method to constructs a new UnknownChain-variant UtxoLookupError
44268 enum LDKUtxoLookupError UtxoLookupError_unknown_chain(void);
44271 * Utility method to constructs a new UnknownTx-variant UtxoLookupError
44273 enum LDKUtxoLookupError UtxoLookupError_unknown_tx(void);
44276 * Frees any resources used by the UtxoResult
44278 void UtxoResult_free(struct LDKUtxoResult this_ptr);
44281 * Creates a copy of the UtxoResult
44283 struct LDKUtxoResult UtxoResult_clone(const struct LDKUtxoResult *NONNULL_PTR orig);
44286 * Utility method to constructs a new Sync-variant UtxoResult
44288 struct LDKUtxoResult UtxoResult_sync(struct LDKCResult_TxOutUtxoLookupErrorZ a);
44291 * Utility method to constructs a new Async-variant UtxoResult
44293 struct LDKUtxoResult UtxoResult_async(struct LDKUtxoFuture a);
44296 * Calls the free function if one is set
44298 void UtxoLookup_free(struct LDKUtxoLookup this_ptr);
44301 * Frees any resources used by the UtxoFuture, if is_owned is set and inner is non-NULL.
44303 void UtxoFuture_free(struct LDKUtxoFuture this_obj);
44306 * Creates a copy of the UtxoFuture
44308 struct LDKUtxoFuture UtxoFuture_clone(const struct LDKUtxoFuture *NONNULL_PTR orig);
44311 * Builds a new future for later resolution.
44313 MUST_USE_RES struct LDKUtxoFuture UtxoFuture_new(void);
44316 * Resolves this future against the given `graph` and with the given `result`.
44318 * This is identical to calling [`UtxoFuture::resolve`] with a dummy `gossip`, disabling
44319 * forwarding the validated gossip message onwards to peers.
44321 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
44322 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
44325 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
44326 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
44328 void UtxoFuture_resolve_without_forwarding(const struct LDKUtxoFuture *NONNULL_PTR this_arg, const struct LDKNetworkGraph *NONNULL_PTR graph, struct LDKCResult_TxOutUtxoLookupErrorZ result);
44331 * Resolves this future against the given `graph` and with the given `result`.
44333 * The given `gossip` is used to broadcast any validated messages onwards to all peers which
44334 * have available buffer space.
44336 * Because this may cause the [`NetworkGraph`]'s [`processing_queue_high`] to flip, in order
44337 * to allow us to interact with peers again, you should call [`PeerManager::process_events`]
44340 * [`processing_queue_high`]: crate::ln::msgs::RoutingMessageHandler::processing_queue_high
44341 * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
44343 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);
44346 * Frees any resources used by the NodeId, if is_owned is set and inner is non-NULL.
44348 void NodeId_free(struct LDKNodeId this_obj);
44351 * Creates a copy of the NodeId
44353 struct LDKNodeId NodeId_clone(const struct LDKNodeId *NONNULL_PTR orig);
44356 * Create a new NodeId from a public key
44358 MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey);
44361 * Get the public key slice from this NodeId
44363 MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg);
44366 * Get the public key as an array from this NodeId
44368 MUST_USE_RES const uint8_t (*NodeId_as_array(const struct LDKNodeId *NONNULL_PTR this_arg))[33];
44371 * Get the public key from this NodeId
44373 MUST_USE_RES struct LDKCResult_PublicKeySecp256k1ErrorZ NodeId_as_pubkey(const struct LDKNodeId *NONNULL_PTR this_arg);
44376 * Generates a non-cryptographic 64-bit hash of the NodeId.
44378 uint64_t NodeId_hash(const struct LDKNodeId *NONNULL_PTR o);
44381 * Serialize the NodeId object into a byte array which can be read by NodeId_read
44383 struct LDKCVec_u8Z NodeId_write(const struct LDKNodeId *NONNULL_PTR obj);
44386 * Read a NodeId from a byte array, created by NodeId_write
44388 struct LDKCResult_NodeIdDecodeErrorZ NodeId_read(struct LDKu8slice ser);
44391 * Frees any resources used by the NetworkGraph, if is_owned is set and inner is non-NULL.
44393 void NetworkGraph_free(struct LDKNetworkGraph this_obj);
44396 * Frees any resources used by the ReadOnlyNetworkGraph, if is_owned is set and inner is non-NULL.
44398 void ReadOnlyNetworkGraph_free(struct LDKReadOnlyNetworkGraph this_obj);
44401 * Frees any resources used by the NetworkUpdate
44403 void NetworkUpdate_free(struct LDKNetworkUpdate this_ptr);
44406 * Creates a copy of the NetworkUpdate
44408 struct LDKNetworkUpdate NetworkUpdate_clone(const struct LDKNetworkUpdate *NONNULL_PTR orig);
44411 * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate
44413 struct LDKNetworkUpdate NetworkUpdate_channel_update_message(struct LDKChannelUpdate msg);
44416 * Utility method to constructs a new ChannelFailure-variant NetworkUpdate
44418 struct LDKNetworkUpdate NetworkUpdate_channel_failure(uint64_t short_channel_id, bool is_permanent);
44421 * Utility method to constructs a new NodeFailure-variant NetworkUpdate
44423 struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
44426 * Checks if two NetworkUpdates contain equal inner contents.
44427 * This ignores pointers and is_owned flags and looks at the values in fields.
44429 bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
44432 * Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
44434 struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
44437 * Read a NetworkUpdate from a byte array, created by NetworkUpdate_write
44439 struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
44442 * Frees any resources used by the P2PGossipSync, if is_owned is set and inner is non-NULL.
44444 void P2PGossipSync_free(struct LDKP2PGossipSync this_obj);
44447 * Creates a new tracker of the actual state of the network of channels and nodes,
44448 * assuming an existing [`NetworkGraph`].
44449 * UTXO lookup is used to make sure announced channels exist on-chain, channel data is
44450 * correct, and the announcement is signed with channel owners' keys.
44452 MUST_USE_RES struct LDKP2PGossipSync P2PGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKCOption_UtxoLookupZ utxo_lookup, struct LDKLogger logger);
44455 * Adds a provider used to check new announcements. Does not affect
44456 * existing announcements unless they are updated.
44457 * Add, update or remove the provider would replace the current one.
44459 void P2PGossipSync_add_utxo_lookup(const struct LDKP2PGossipSync *NONNULL_PTR this_arg, struct LDKCOption_UtxoLookupZ utxo_lookup);
44462 * Handles any network updates originating from [`Event`]s.
44463 * Note that this will skip applying any [`NetworkUpdate::ChannelUpdateMessage`] to avoid
44464 * leaking possibly identifying information of the sender to the public network.
44466 * [`Event`]: crate::events::Event
44468 void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update);
44471 * Gets the chain hash for this network graph.
44473 MUST_USE_RES struct LDKThirtyTwoBytes NetworkGraph_get_chain_hash(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
44476 * Verifies the signature of a [`NodeAnnouncement`].
44478 * Returns an error if it is invalid.
44480 struct LDKCResult_NoneLightningErrorZ verify_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
44483 * Verifies all signatures included in a [`ChannelAnnouncement`].
44485 * Returns an error if one of the signatures is invalid.
44487 struct LDKCResult_NoneLightningErrorZ verify_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
44490 * Constructs a new RoutingMessageHandler which calls the relevant methods on this_arg.
44491 * This copies the `inner` pointer in this_arg and thus the returned RoutingMessageHandler must be freed before this_arg is
44493 struct LDKRoutingMessageHandler P2PGossipSync_as_RoutingMessageHandler(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
44496 * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg.
44497 * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is
44499 struct LDKMessageSendEventsProvider P2PGossipSync_as_MessageSendEventsProvider(const struct LDKP2PGossipSync *NONNULL_PTR this_arg);
44502 * Frees any resources used by the ChannelUpdateInfo, if is_owned is set and inner is non-NULL.
44504 void ChannelUpdateInfo_free(struct LDKChannelUpdateInfo this_obj);
44507 * When the last update to the channel direction was issued.
44508 * Value is opaque, as set in the announcement.
44510 uint32_t ChannelUpdateInfo_get_last_update(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44513 * When the last update to the channel direction was issued.
44514 * Value is opaque, as set in the announcement.
44516 void ChannelUpdateInfo_set_last_update(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint32_t val);
44519 * Whether the channel can be currently used for payments (in this one direction).
44521 bool ChannelUpdateInfo_get_enabled(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44524 * Whether the channel can be currently used for payments (in this one direction).
44526 void ChannelUpdateInfo_set_enabled(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, bool val);
44529 * The difference in CLTV values that you must have when routing through this channel.
44531 uint16_t ChannelUpdateInfo_get_cltv_expiry_delta(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44534 * The difference in CLTV values that you must have when routing through this channel.
44536 void ChannelUpdateInfo_set_cltv_expiry_delta(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint16_t val);
44539 * The minimum value, which must be relayed to the next hop via the channel
44541 uint64_t ChannelUpdateInfo_get_htlc_minimum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44544 * The minimum value, which must be relayed to the next hop via the channel
44546 void ChannelUpdateInfo_set_htlc_minimum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
44549 * The maximum value which may be relayed to the next hop via the channel.
44551 uint64_t ChannelUpdateInfo_get_htlc_maximum_msat(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44554 * The maximum value which may be relayed to the next hop via the channel.
44556 void ChannelUpdateInfo_set_htlc_maximum_msat(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, uint64_t val);
44559 * Fees charged when the channel is used for routing
44561 struct LDKRoutingFees ChannelUpdateInfo_get_fees(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44564 * Fees charged when the channel is used for routing
44566 void ChannelUpdateInfo_set_fees(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
44569 * Most recent update for the channel received from the network
44570 * Mostly redundant with the data we store in fields explicitly.
44571 * Everything else is useful only for sending out for initial routing sync.
44572 * Not stored if contains excess data to prevent DoS.
44574 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44576 struct LDKChannelUpdate ChannelUpdateInfo_get_last_update_message(const struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr);
44579 * Most recent update for the channel received from the network
44580 * Mostly redundant with the data we store in fields explicitly.
44581 * Everything else is useful only for sending out for initial routing sync.
44582 * Not stored if contains excess data to prevent DoS.
44584 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44586 void ChannelUpdateInfo_set_last_update_message(struct LDKChannelUpdateInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val);
44589 * Constructs a new ChannelUpdateInfo given each field
44591 * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
44593 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);
44596 * Creates a copy of the ChannelUpdateInfo
44598 struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
44601 * Checks if two ChannelUpdateInfos contain equal inner contents.
44602 * This ignores pointers and is_owned flags and looks at the values in fields.
44603 * Two objects with NULL inner values will be considered "equal" here.
44605 bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
44608 * Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
44610 struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
44613 * Read a ChannelUpdateInfo from a byte array, created by ChannelUpdateInfo_write
44615 struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
44618 * Frees any resources used by the ChannelInfo, if is_owned is set and inner is non-NULL.
44620 void ChannelInfo_free(struct LDKChannelInfo this_obj);
44623 * Protocol features of a channel communicated during its announcement
44625 struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44628 * Protocol features of a channel communicated during its announcement
44630 void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
44633 * Source node of the first direction of a channel
44635 struct LDKNodeId ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44638 * Source node of the first direction of a channel
44640 void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
44643 * Details about the first direction of a channel
44645 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44647 struct LDKChannelUpdateInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44650 * Details about the first direction of a channel
44652 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44654 void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
44657 * Source node of the second direction of a channel
44659 struct LDKNodeId ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44662 * Source node of the second direction of a channel
44664 void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKNodeId val);
44667 * Details about the second direction of a channel
44669 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44671 struct LDKChannelUpdateInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44674 * Details about the second direction of a channel
44676 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44678 void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdateInfo val);
44681 * The channel capacity as seen on-chain, if chain lookup is available.
44683 struct LDKCOption_u64Z ChannelInfo_get_capacity_sats(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44686 * The channel capacity as seen on-chain, if chain lookup is available.
44688 void ChannelInfo_set_capacity_sats(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
44691 * An initial announcement of the channel
44692 * Mostly redundant with the data we store in fields explicitly.
44693 * Everything else is useful only for sending out for initial routing sync.
44694 * Not stored if contains excess data to prevent DoS.
44696 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44698 struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr);
44701 * An initial announcement of the channel
44702 * Mostly redundant with the data we store in fields explicitly.
44703 * Everything else is useful only for sending out for initial routing sync.
44704 * Not stored if contains excess data to prevent DoS.
44706 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44708 void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val);
44711 * Creates a copy of the ChannelInfo
44713 struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
44716 * Checks if two ChannelInfos contain equal inner contents.
44717 * This ignores pointers and is_owned flags and looks at the values in fields.
44718 * Two objects with NULL inner values will be considered "equal" here.
44720 bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
44723 * Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
44725 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44727 MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
44730 * Serialize the ChannelInfo object into a byte array which can be read by ChannelInfo_read
44732 struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
44735 * Read a ChannelInfo from a byte array, created by ChannelInfo_write
44737 struct LDKCResult_ChannelInfoDecodeErrorZ ChannelInfo_read(struct LDKu8slice ser);
44740 * Frees any resources used by the DirectedChannelInfo, if is_owned is set and inner is non-NULL.
44742 void DirectedChannelInfo_free(struct LDKDirectedChannelInfo this_obj);
44745 * Creates a copy of the DirectedChannelInfo
44747 struct LDKDirectedChannelInfo DirectedChannelInfo_clone(const struct LDKDirectedChannelInfo *NONNULL_PTR orig);
44750 * Returns information for the channel.
44752 MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
44755 * Returns the [`EffectiveCapacity`] of the channel in the direction.
44757 * This is either the total capacity from the funding transaction, if known, or the
44758 * `htlc_maximum_msat` for the direction as advertised by the gossip network, if known,
44761 MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg);
44764 * Frees any resources used by the EffectiveCapacity
44766 void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr);
44769 * Creates a copy of the EffectiveCapacity
44771 struct LDKEffectiveCapacity EffectiveCapacity_clone(const struct LDKEffectiveCapacity *NONNULL_PTR orig);
44774 * Utility method to constructs a new ExactLiquidity-variant EffectiveCapacity
44776 struct LDKEffectiveCapacity EffectiveCapacity_exact_liquidity(uint64_t liquidity_msat);
44779 * Utility method to constructs a new AdvertisedMaxHTLC-variant EffectiveCapacity
44781 struct LDKEffectiveCapacity EffectiveCapacity_advertised_max_htlc(uint64_t amount_msat);
44784 * Utility method to constructs a new Total-variant EffectiveCapacity
44786 struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat);
44789 * Utility method to constructs a new Infinite-variant EffectiveCapacity
44791 struct LDKEffectiveCapacity EffectiveCapacity_infinite(void);
44794 * Utility method to constructs a new HintMaxHTLC-variant EffectiveCapacity
44796 struct LDKEffectiveCapacity EffectiveCapacity_hint_max_htlc(uint64_t amount_msat);
44799 * Utility method to constructs a new Unknown-variant EffectiveCapacity
44801 struct LDKEffectiveCapacity EffectiveCapacity_unknown(void);
44804 * Returns the effective capacity denominated in millisatoshi.
44806 MUST_USE_RES uint64_t EffectiveCapacity_as_msat(const struct LDKEffectiveCapacity *NONNULL_PTR this_arg);
44809 * Frees any resources used by the RoutingFees, if is_owned is set and inner is non-NULL.
44811 void RoutingFees_free(struct LDKRoutingFees this_obj);
44814 * Flat routing fee in millisatoshis.
44816 uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
44819 * Flat routing fee in millisatoshis.
44821 void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
44824 * Liquidity-based routing fee in millionths of a routed amount.
44825 * In other words, 10000 is 1%.
44827 uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr);
44830 * Liquidity-based routing fee in millionths of a routed amount.
44831 * In other words, 10000 is 1%.
44833 void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val);
44836 * Constructs a new RoutingFees given each field
44838 MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg);
44841 * Checks if two RoutingFeess contain equal inner contents.
44842 * This ignores pointers and is_owned flags and looks at the values in fields.
44843 * Two objects with NULL inner values will be considered "equal" here.
44845 bool RoutingFees_eq(const struct LDKRoutingFees *NONNULL_PTR a, const struct LDKRoutingFees *NONNULL_PTR b);
44848 * Creates a copy of the RoutingFees
44850 struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig);
44853 * Generates a non-cryptographic 64-bit hash of the RoutingFees.
44855 uint64_t RoutingFees_hash(const struct LDKRoutingFees *NONNULL_PTR o);
44858 * Serialize the RoutingFees object into a byte array which can be read by RoutingFees_read
44860 struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj);
44863 * Read a RoutingFees from a byte array, created by RoutingFees_write
44865 struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser);
44868 * Frees any resources used by the NodeAnnouncementInfo, if is_owned is set and inner is non-NULL.
44870 void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_obj);
44873 * Protocol features the node announced support for
44875 struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
44878 * Protocol features the node announced support for
44880 void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
44883 * When the last known update to the node state was issued.
44884 * Value is opaque, as set in the announcement.
44886 uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
44889 * When the last known update to the node state was issued.
44890 * Value is opaque, as set in the announcement.
44892 void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val);
44895 * Color assigned to the node
44897 const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3];
44900 * Color assigned to the node
44902 void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val);
44905 * Moniker assigned to the node.
44906 * May be invalid or malicious (eg control chars),
44907 * should not be exposed to the user.
44909 struct LDKNodeAlias NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
44912 * Moniker assigned to the node.
44913 * May be invalid or malicious (eg control chars),
44914 * should not be exposed to the user.
44916 void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAlias val);
44919 * An initial announcement of the node
44920 * Mostly redundant with the data we store in fields explicitly.
44921 * Everything else is useful only for sending out for initial routing sync.
44922 * Not stored if contains excess data to prevent DoS.
44924 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
44926 struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr);
44929 * An initial announcement of the node
44930 * Mostly redundant with the data we store in fields explicitly.
44931 * Everything else is useful only for sending out for initial routing sync.
44932 * Not stored if contains excess data to prevent DoS.
44934 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
44936 void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val);
44939 * Constructs a new NodeAnnouncementInfo given each field
44941 * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
44943 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);
44946 * Creates a copy of the NodeAnnouncementInfo
44948 struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
44951 * Checks if two NodeAnnouncementInfos contain equal inner contents.
44952 * This ignores pointers and is_owned flags and looks at the values in fields.
44953 * Two objects with NULL inner values will be considered "equal" here.
44955 bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
44958 * Internet-level addresses via which one can connect to the node
44960 MUST_USE_RES struct LDKCVec_SocketAddressZ NodeAnnouncementInfo_addresses(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_arg);
44963 * Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
44965 struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
44968 * Read a NodeAnnouncementInfo from a byte array, created by NodeAnnouncementInfo_write
44970 struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
44973 * Frees any resources used by the NodeAlias, if is_owned is set and inner is non-NULL.
44975 void NodeAlias_free(struct LDKNodeAlias this_obj);
44977 const uint8_t (*NodeAlias_get_a(const struct LDKNodeAlias *NONNULL_PTR this_ptr))[32];
44979 void NodeAlias_set_a(struct LDKNodeAlias *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
44982 * Constructs a new NodeAlias given each field
44984 MUST_USE_RES struct LDKNodeAlias NodeAlias_new(struct LDKThirtyTwoBytes a_arg);
44987 * Creates a copy of the NodeAlias
44989 struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
44992 * Generates a non-cryptographic 64-bit hash of the NodeAlias.
44994 uint64_t NodeAlias_hash(const struct LDKNodeAlias *NONNULL_PTR o);
44997 * Checks if two NodeAliass contain equal inner contents.
44998 * This ignores pointers and is_owned flags and looks at the values in fields.
44999 * Two objects with NULL inner values will be considered "equal" here.
45001 bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
45004 * Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
45006 struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
45009 * Read a NodeAlias from a byte array, created by NodeAlias_write
45011 struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
45014 * Frees any resources used by the NodeInfo, if is_owned is set and inner is non-NULL.
45016 void NodeInfo_free(struct LDKNodeInfo this_obj);
45019 * All valid channels a node has announced
45021 * Returns a copy of the field.
45023 struct LDKCVec_u64Z NodeInfo_get_channels(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
45026 * All valid channels a node has announced
45028 void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
45031 * More information about a node from node_announcement.
45032 * Optional because we store a Node entry after learning about it from
45033 * a channel announcement, but before receiving a node announcement.
45035 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45037 struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr);
45040 * More information about a node from node_announcement.
45041 * Optional because we store a Node entry after learning about it from
45042 * a channel announcement, but before receiving a node announcement.
45044 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
45046 void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val);
45049 * Constructs a new NodeInfo given each field
45051 * Note that announcement_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
45053 MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKNodeAnnouncementInfo announcement_info_arg);
45056 * Creates a copy of the NodeInfo
45058 struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
45061 * Checks if two NodeInfos contain equal inner contents.
45062 * This ignores pointers and is_owned flags and looks at the values in fields.
45063 * Two objects with NULL inner values will be considered "equal" here.
45065 bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
45068 * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
45070 struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
45073 * Read a NodeInfo from a byte array, created by NodeInfo_write
45075 struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
45078 * Serialize the NetworkGraph object into a byte array which can be read by NetworkGraph_read
45080 struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj);
45083 * Read a NetworkGraph from a byte array, created by NetworkGraph_write
45085 struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser, struct LDKLogger arg);
45088 * Creates a new, empty, network graph.
45090 MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(enum LDKNetwork network, struct LDKLogger logger);
45093 * Returns a read-only view of the network graph.
45095 MUST_USE_RES struct LDKReadOnlyNetworkGraph NetworkGraph_read_only(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
45098 * The unix timestamp provided by the most recent rapid gossip sync.
45099 * It will be set by the rapid sync process after every sync completion.
45101 MUST_USE_RES struct LDKCOption_u32Z NetworkGraph_get_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
45104 * Update the unix timestamp provided by the most recent rapid gossip sync.
45105 * This should be done automatically by the rapid sync process after every sync completion.
45107 void NetworkGraph_set_last_rapid_gossip_sync_timestamp(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint32_t last_rapid_gossip_sync_timestamp);
45110 * For an already known node (from channel announcements), update its stored properties from a
45111 * given node announcement.
45113 * You probably don't want to call this directly, instead relying on a P2PGossipSync's
45114 * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
45115 * routing messages from a source using a protocol other than the lightning P2P protocol.
45117 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg);
45120 * For an already known node (from channel announcements), update its stored properties from a
45121 * given node announcement without verifying the associated signatures. Because we aren't
45122 * given the associated signatures here we cannot relay the node announcement to any of our
45125 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);
45128 * Store or update channel info from a channel announcement.
45130 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
45131 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
45132 * routing messages from a source using a protocol other than the lightning P2P protocol.
45134 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
45135 * the corresponding UTXO exists on chain and is correctly-formatted.
45137 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);
45140 * Store or update channel info from a channel announcement.
45142 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
45143 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
45144 * routing messages from a source using a protocol other than the lightning P2P protocol.
45146 * This will skip verification of if the channel is actually on-chain.
45148 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);
45151 * Store or update channel info from a channel announcement without verifying the associated
45152 * signatures. Because we aren't given the associated signatures here we cannot relay the
45153 * channel announcement to any of our peers.
45155 * If a [`UtxoLookup`] object is provided via `utxo_lookup`, it will be called to verify
45156 * the corresponding UTXO exists on chain and is correctly-formatted.
45158 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);
45161 * Update channel from partial announcement data received via rapid gossip sync
45163 * `timestamp: u64`: Timestamp emulating the backdated original announcement receipt (by the
45164 * rapid gossip sync server)
45166 * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields.
45168 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);
45171 * Marks a channel in the graph as failed permanently.
45173 * The channel and any node for which this was their last channel are removed from the graph.
45175 void NetworkGraph_channel_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
45178 * Marks a node in the graph as permanently failed, effectively removing it and its channels
45179 * from local storage.
45181 void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
45184 * Removes information about channels that we haven't heard any updates about in some time.
45185 * This can be used regularly to prune the network graph of channels that likely no longer
45188 * While there is no formal requirement that nodes regularly re-broadcast their channel
45189 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
45190 * pruning occur for updates which are at least two weeks old, which we implement here.
45192 * Note that for users of the `lightning-background-processor` crate this method may be
45193 * automatically called regularly for you.
45195 * This method will also cause us to stop tracking removed nodes and channels if they have been
45196 * in the map for a while so that these can be resynced from gossip in the future.
45198 * This method is only available with the `std` feature. See
45199 * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
45201 void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
45204 * Removes information about channels that we haven't heard any updates about in some time.
45205 * This can be used regularly to prune the network graph of channels that likely no longer
45208 * While there is no formal requirement that nodes regularly re-broadcast their channel
45209 * updates every two weeks, the non-normative section of BOLT 7 currently suggests that
45210 * pruning occur for updates which are at least two weeks old, which we implement here.
45212 * This method will also cause us to stop tracking removed nodes and channels if they have been
45213 * in the map for a while so that these can be resynced from gossip in the future.
45215 * This function takes the current unix time as an argument. For users with the `std` feature
45216 * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
45218 void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
45221 * For an already known (from announcement) channel, update info about one of the directions
45224 * You probably don't want to call this directly, instead relying on a [`P2PGossipSync`]'s
45225 * [`RoutingMessageHandler`] implementation to call it indirectly. This may be useful to accept
45226 * routing messages from a source using a protocol other than the lightning P2P protocol.
45228 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
45229 * materially in the future will be rejected.
45231 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
45234 * For an already known (from announcement) channel, update info about one of the directions
45235 * of the channel without verifying the associated signatures. Because we aren't given the
45236 * associated signatures here we cannot relay the channel update to any of our peers.
45238 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
45239 * materially in the future will be rejected.
45241 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
45244 * For an already known (from announcement) channel, verify the given [`ChannelUpdate`].
45246 * This checks whether the update currently is applicable by [`Self::update_channel`].
45248 * If built with `no-std`, any updates with a timestamp more than two weeks in the past or
45249 * materially in the future will be rejected.
45251 MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_verify_channel_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
45254 * Returns information on a channel with the given id.
45256 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45258 MUST_USE_RES struct LDKChannelInfo ReadOnlyNetworkGraph_channel(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id);
45261 * Returns the list of channels in the graph
45263 MUST_USE_RES struct LDKCVec_u64Z ReadOnlyNetworkGraph_list_channels(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
45266 * Returns information on a node with the given id.
45268 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45270 MUST_USE_RES struct LDKNodeInfo ReadOnlyNetworkGraph_node(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
45273 * Returns the list of nodes in the graph
45275 MUST_USE_RES struct LDKCVec_NodeIdZ ReadOnlyNetworkGraph_list_nodes(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg);
45278 * Get network addresses by node id.
45279 * Returns None if the requested node is completely unknown,
45280 * or if node announcement for the node was never received.
45282 MUST_USE_RES struct LDKCOption_CVec_SocketAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey);
45285 * Frees any resources used by the DefaultRouter, if is_owned is set and inner is non-NULL.
45287 void DefaultRouter_free(struct LDKDefaultRouter this_obj);
45290 * Creates a new router.
45292 MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKEntropySource entropy_source, struct LDKLockableScore scorer, struct LDKProbabilisticScoringFeeParameters score_params);
45295 * Constructs a new Router which calls the relevant methods on this_arg.
45296 * This copies the `inner` pointer in this_arg and thus the returned Router must be freed before this_arg is
45298 struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
45301 * Constructs a new MessageRouter which calls the relevant methods on this_arg.
45302 * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
45304 struct LDKMessageRouter DefaultRouter_as_MessageRouter(const struct LDKDefaultRouter *NONNULL_PTR this_arg);
45307 * Calls the free function if one is set
45309 void Router_free(struct LDKRouter this_ptr);
45312 * Frees any resources used by the ScorerAccountingForInFlightHtlcs, if is_owned is set and inner is non-NULL.
45314 void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj);
45317 * Initialize a new `ScorerAccountingForInFlightHtlcs`.
45319 MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScoreLookUp scorer, const struct LDKInFlightHtlcs *NONNULL_PTR inflight_htlcs);
45322 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
45323 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
45325 struct LDKScoreLookUp ScorerAccountingForInFlightHtlcs_as_ScoreLookUp(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg);
45328 * Frees any resources used by the InFlightHtlcs, if is_owned is set and inner is non-NULL.
45330 void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj);
45333 * Creates a copy of the InFlightHtlcs
45335 struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig);
45338 * Constructs an empty `InFlightHtlcs`.
45340 MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void);
45343 * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`.
45345 void InFlightHtlcs_process_path(struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKPath *NONNULL_PTR path, struct LDKPublicKey payer_node_id);
45348 * Adds a known HTLC given the public key of the HTLC source, target, and short channel
45351 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);
45354 * Returns liquidity in msat given the public key of the HTLC source, target, and short channel
45357 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);
45360 * Serialize the InFlightHtlcs object into a byte array which can be read by InFlightHtlcs_read
45362 struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj);
45365 * Read a InFlightHtlcs from a byte array, created by InFlightHtlcs_write
45367 struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
45370 * Frees any resources used by the RouteHop, if is_owned is set and inner is non-NULL.
45372 void RouteHop_free(struct LDKRouteHop this_obj);
45375 * The node_id of the node at this hop.
45377 struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45380 * The node_id of the node at this hop.
45382 void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
45385 * The node_announcement features of the node at this hop. For the last hop, these may be
45386 * amended to match the features present in the invoice this node generated.
45388 struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45391 * The node_announcement features of the node at this hop. For the last hop, these may be
45392 * amended to match the features present in the invoice this node generated.
45394 void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val);
45397 * The channel that should be used from the previous hop to reach this node.
45399 uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45402 * The channel that should be used from the previous hop to reach this node.
45404 void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
45407 * The channel_announcement features of the channel that should be used from the previous hop
45408 * to reach this node.
45410 struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45413 * The channel_announcement features of the channel that should be used from the previous hop
45414 * to reach this node.
45416 void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val);
45419 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
45420 * If this is the last hop in [`Path::hops`]:
45421 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
45422 * * otherwise, this is the full value of this [`Path`]'s part of the payment
45424 * [`BlindedPath`]: crate::blinded_path::BlindedPath
45426 uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45429 * The fee taken on this hop (for paying for the use of the *next* channel in the path).
45430 * If this is the last hop in [`Path::hops`]:
45431 * * if we're sending to a [`BlindedPath`], this is the fee paid for use of the entire blinded path
45432 * * otherwise, this is the full value of this [`Path`]'s part of the payment
45434 * [`BlindedPath`]: crate::blinded_path::BlindedPath
45436 void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val);
45439 * The CLTV delta added for this hop.
45440 * If this is the last hop in [`Path::hops`]:
45441 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
45442 * * otherwise, this is the CLTV delta expected at the destination
45444 * [`BlindedPath`]: crate::blinded_path::BlindedPath
45446 uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45449 * The CLTV delta added for this hop.
45450 * If this is the last hop in [`Path::hops`]:
45451 * * if we're sending to a [`BlindedPath`], this is the CLTV delta for the entire blinded path
45452 * * otherwise, this is the CLTV delta expected at the destination
45454 * [`BlindedPath`]: crate::blinded_path::BlindedPath
45456 void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val);
45459 * Indicates whether this hop is possibly announced in the public network graph.
45461 * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
45462 * either know for sure it's announced in the public graph, or if any public channels exist
45463 * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
45464 * the channel to be unannounced.
45466 * Will be `true` for objects serialized with LDK version 0.0.116 and before.
45468 bool RouteHop_get_maybe_announced_channel(const struct LDKRouteHop *NONNULL_PTR this_ptr);
45471 * Indicates whether this hop is possibly announced in the public network graph.
45473 * Will be `true` if there is a possibility that the channel is publicly known, i.e., if we
45474 * either know for sure it's announced in the public graph, or if any public channels exist
45475 * for which the given `short_channel_id` could be an alias for. Will be `false` if we believe
45476 * the channel to be unannounced.
45478 * Will be `true` for objects serialized with LDK version 0.0.116 and before.
45480 void RouteHop_set_maybe_announced_channel(struct LDKRouteHop *NONNULL_PTR this_ptr, bool val);
45483 * Constructs a new RouteHop given each field
45485 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, bool maybe_announced_channel_arg);
45488 * Creates a copy of the RouteHop
45490 struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig);
45493 * Generates a non-cryptographic 64-bit hash of the RouteHop.
45495 uint64_t RouteHop_hash(const struct LDKRouteHop *NONNULL_PTR o);
45498 * Checks if two RouteHops contain equal inner contents.
45499 * This ignores pointers and is_owned flags and looks at the values in fields.
45500 * Two objects with NULL inner values will be considered "equal" here.
45502 bool RouteHop_eq(const struct LDKRouteHop *NONNULL_PTR a, const struct LDKRouteHop *NONNULL_PTR b);
45505 * Serialize the RouteHop object into a byte array which can be read by RouteHop_read
45507 struct LDKCVec_u8Z RouteHop_write(const struct LDKRouteHop *NONNULL_PTR obj);
45510 * Read a RouteHop from a byte array, created by RouteHop_write
45512 struct LDKCResult_RouteHopDecodeErrorZ RouteHop_read(struct LDKu8slice ser);
45515 * Frees any resources used by the BlindedTail, if is_owned is set and inner is non-NULL.
45517 void BlindedTail_free(struct LDKBlindedTail this_obj);
45520 * The hops of the [`BlindedPath`] provided by the recipient.
45522 * [`BlindedPath`]: crate::blinded_path::BlindedPath
45524 struct LDKCVec_BlindedHopZ BlindedTail_get_hops(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
45527 * The hops of the [`BlindedPath`] provided by the recipient.
45529 * [`BlindedPath`]: crate::blinded_path::BlindedPath
45531 void BlindedTail_set_hops(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
45534 * The blinding point of the [`BlindedPath`] provided by the recipient.
45536 * [`BlindedPath`]: crate::blinded_path::BlindedPath
45538 struct LDKPublicKey BlindedTail_get_blinding_point(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
45541 * The blinding point of the [`BlindedPath`] provided by the recipient.
45543 * [`BlindedPath`]: crate::blinded_path::BlindedPath
45545 void BlindedTail_set_blinding_point(struct LDKBlindedTail *NONNULL_PTR this_ptr, struct LDKPublicKey val);
45548 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
45549 * inferring the destination. May be 0.
45551 uint32_t BlindedTail_get_excess_final_cltv_expiry_delta(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
45554 * Excess CLTV delta added to the recipient's CLTV expiry to deter intermediate nodes from
45555 * inferring the destination. May be 0.
45557 void BlindedTail_set_excess_final_cltv_expiry_delta(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint32_t val);
45560 * The total amount paid on this [`Path`], excluding the fees.
45562 uint64_t BlindedTail_get_final_value_msat(const struct LDKBlindedTail *NONNULL_PTR this_ptr);
45565 * The total amount paid on this [`Path`], excluding the fees.
45567 void BlindedTail_set_final_value_msat(struct LDKBlindedTail *NONNULL_PTR this_ptr, uint64_t val);
45570 * Constructs a new BlindedTail given each field
45572 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);
45575 * Creates a copy of the BlindedTail
45577 struct LDKBlindedTail BlindedTail_clone(const struct LDKBlindedTail *NONNULL_PTR orig);
45580 * Generates a non-cryptographic 64-bit hash of the BlindedTail.
45582 uint64_t BlindedTail_hash(const struct LDKBlindedTail *NONNULL_PTR o);
45585 * Checks if two BlindedTails contain equal inner contents.
45586 * This ignores pointers and is_owned flags and looks at the values in fields.
45587 * Two objects with NULL inner values will be considered "equal" here.
45589 bool BlindedTail_eq(const struct LDKBlindedTail *NONNULL_PTR a, const struct LDKBlindedTail *NONNULL_PTR b);
45592 * Serialize the BlindedTail object into a byte array which can be read by BlindedTail_read
45594 struct LDKCVec_u8Z BlindedTail_write(const struct LDKBlindedTail *NONNULL_PTR obj);
45597 * Read a BlindedTail from a byte array, created by BlindedTail_write
45599 struct LDKCResult_BlindedTailDecodeErrorZ BlindedTail_read(struct LDKu8slice ser);
45602 * Frees any resources used by the Path, if is_owned is set and inner is non-NULL.
45604 void Path_free(struct LDKPath this_obj);
45607 * The list of unblinded hops in this [`Path`]. Must be at least length one.
45609 struct LDKCVec_RouteHopZ Path_get_hops(const struct LDKPath *NONNULL_PTR this_ptr);
45612 * The list of unblinded hops in this [`Path`]. Must be at least length one.
45614 void Path_set_hops(struct LDKPath *NONNULL_PTR this_ptr, struct LDKCVec_RouteHopZ val);
45617 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
45619 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45621 struct LDKBlindedTail Path_get_blinded_tail(const struct LDKPath *NONNULL_PTR this_ptr);
45624 * The blinded path at which this path terminates, if we're sending to one, and its metadata.
45626 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
45628 void Path_set_blinded_tail(struct LDKPath *NONNULL_PTR this_ptr, struct LDKBlindedTail val);
45631 * Constructs a new Path given each field
45633 * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
45635 MUST_USE_RES struct LDKPath Path_new(struct LDKCVec_RouteHopZ hops_arg, struct LDKBlindedTail blinded_tail_arg);
45638 * Creates a copy of the Path
45640 struct LDKPath Path_clone(const struct LDKPath *NONNULL_PTR orig);
45643 * Generates a non-cryptographic 64-bit hash of the Path.
45645 uint64_t Path_hash(const struct LDKPath *NONNULL_PTR o);
45648 * Checks if two Paths contain equal inner contents.
45649 * This ignores pointers and is_owned flags and looks at the values in fields.
45650 * Two objects with NULL inner values will be considered "equal" here.
45652 bool Path_eq(const struct LDKPath *NONNULL_PTR a, const struct LDKPath *NONNULL_PTR b);
45655 * Gets the fees for a given path, excluding any excess paid to the recipient.
45657 MUST_USE_RES uint64_t Path_fee_msat(const struct LDKPath *NONNULL_PTR this_arg);
45660 * Gets the total amount paid on this [`Path`], excluding the fees.
45662 MUST_USE_RES uint64_t Path_final_value_msat(const struct LDKPath *NONNULL_PTR this_arg);
45665 * Gets the final hop's CLTV expiry delta.
45667 MUST_USE_RES struct LDKCOption_u32Z Path_final_cltv_expiry_delta(const struct LDKPath *NONNULL_PTR this_arg);
45670 * Frees any resources used by the Route, if is_owned is set and inner is non-NULL.
45672 void Route_free(struct LDKRoute this_obj);
45675 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
45676 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
45679 struct LDKCVec_PathZ Route_get_paths(const struct LDKRoute *NONNULL_PTR this_ptr);
45682 * The list of [`Path`]s taken for a single (potentially-)multi-part payment. If no
45683 * [`BlindedTail`]s are present, then the pubkey of the last [`RouteHop`] in each path must be
45686 void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_PathZ val);
45689 * The `route_params` parameter passed to [`find_route`].
45691 * This is used by `ChannelManager` to track information which may be required for retries.
45693 * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
45695 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
45697 struct LDKRouteParameters Route_get_route_params(const struct LDKRoute *NONNULL_PTR this_ptr);
45700 * The `route_params` parameter passed to [`find_route`].
45702 * This is used by `ChannelManager` to track information which may be required for retries.
45704 * Will be `None` for objects serialized with LDK versions prior to 0.0.117.
45706 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
45708 void Route_set_route_params(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKRouteParameters val);
45711 * Constructs a new Route given each field
45713 * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
45715 MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_PathZ paths_arg, struct LDKRouteParameters route_params_arg);
45718 * Creates a copy of the Route
45720 struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig);
45723 * Generates a non-cryptographic 64-bit hash of the Route.
45725 uint64_t Route_hash(const struct LDKRoute *NONNULL_PTR o);
45728 * Checks if two Routes contain equal inner contents.
45729 * This ignores pointers and is_owned flags and looks at the values in fields.
45730 * Two objects with NULL inner values will be considered "equal" here.
45732 bool Route_eq(const struct LDKRoute *NONNULL_PTR a, const struct LDKRoute *NONNULL_PTR b);
45735 * Returns the total amount of fees paid on this [`Route`].
45737 * For objects serialized with LDK 0.0.117 and after, this includes any extra payment made to
45738 * the recipient, which can happen in excess of the amount passed to [`find_route`] via
45739 * [`RouteParameters::final_value_msat`], if we had to reach the [`htlc_minimum_msat`] limits.
45741 * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
45743 MUST_USE_RES uint64_t Route_get_total_fees(const struct LDKRoute *NONNULL_PTR this_arg);
45746 * Returns the total amount paid on this [`Route`], excluding the fees.
45748 * Might be more than requested as part of the given [`RouteParameters::final_value_msat`] if
45749 * we had to reach the [`htlc_minimum_msat`] limits.
45751 * [`htlc_minimum_msat`]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_update-message
45753 MUST_USE_RES uint64_t Route_get_total_amount(const struct LDKRoute *NONNULL_PTR this_arg);
45756 * Serialize the Route object into a byte array which can be read by Route_read
45758 struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj);
45761 * Read a Route from a byte array, created by Route_write
45763 struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser);
45766 * Frees any resources used by the RouteParameters, if is_owned is set and inner is non-NULL.
45768 void RouteParameters_free(struct LDKRouteParameters this_obj);
45771 * The parameters of the failed payment path.
45773 struct LDKPaymentParameters RouteParameters_get_payment_params(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
45776 * The parameters of the failed payment path.
45778 void RouteParameters_set_payment_params(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKPaymentParameters val);
45781 * The amount in msats sent on the failed payment path.
45783 uint64_t RouteParameters_get_final_value_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
45786 * The amount in msats sent on the failed payment path.
45788 void RouteParameters_set_final_value_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, uint64_t val);
45791 * The maximum total fees, in millisatoshi, that may accrue during route finding.
45793 * This limit also applies to the total fees that may arise while retrying failed payment
45796 * Note that values below a few sats may result in some paths being spuriously ignored.
45798 struct LDKCOption_u64Z RouteParameters_get_max_total_routing_fee_msat(const struct LDKRouteParameters *NONNULL_PTR this_ptr);
45801 * The maximum total fees, in millisatoshi, that may accrue during route finding.
45803 * This limit also applies to the total fees that may arise while retrying failed payment
45806 * Note that values below a few sats may result in some paths being spuriously ignored.
45808 void RouteParameters_set_max_total_routing_fee_msat(struct LDKRouteParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
45811 * Constructs a new RouteParameters given each field
45813 MUST_USE_RES struct LDKRouteParameters RouteParameters_new(struct LDKPaymentParameters payment_params_arg, uint64_t final_value_msat_arg, struct LDKCOption_u64Z max_total_routing_fee_msat_arg);
45816 * Creates a copy of the RouteParameters
45818 struct LDKRouteParameters RouteParameters_clone(const struct LDKRouteParameters *NONNULL_PTR orig);
45821 * Generates a non-cryptographic 64-bit hash of the RouteParameters.
45823 uint64_t RouteParameters_hash(const struct LDKRouteParameters *NONNULL_PTR o);
45826 * Checks if two RouteParameterss contain equal inner contents.
45827 * This ignores pointers and is_owned flags and looks at the values in fields.
45828 * Two objects with NULL inner values will be considered "equal" here.
45830 bool RouteParameters_eq(const struct LDKRouteParameters *NONNULL_PTR a, const struct LDKRouteParameters *NONNULL_PTR b);
45833 * Constructs [`RouteParameters`] from the given [`PaymentParameters`] and a payment amount.
45835 * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
45837 MUST_USE_RES struct LDKRouteParameters RouteParameters_from_payment_params_and_value(struct LDKPaymentParameters payment_params, uint64_t final_value_msat);
45840 * Serialize the RouteParameters object into a byte array which can be read by RouteParameters_read
45842 struct LDKCVec_u8Z RouteParameters_write(const struct LDKRouteParameters *NONNULL_PTR obj);
45845 * Read a RouteParameters from a byte array, created by RouteParameters_write
45847 struct LDKCResult_RouteParametersDecodeErrorZ RouteParameters_read(struct LDKu8slice ser);
45850 * Frees any resources used by the PaymentParameters, if is_owned is set and inner is non-NULL.
45852 void PaymentParameters_free(struct LDKPaymentParameters this_obj);
45855 * Information about the payee, such as their features and route hints for their channels.
45857 struct LDKPayee PaymentParameters_get_payee(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45860 * Information about the payee, such as their features and route hints for their channels.
45862 void PaymentParameters_set_payee(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKPayee val);
45865 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
45867 struct LDKCOption_u64Z PaymentParameters_get_expiry_time(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45870 * Expiration of a payment to the payee, in seconds relative to the UNIX epoch.
45872 void PaymentParameters_set_expiry_time(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
45875 * The maximum total CLTV delta we accept for the route.
45876 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
45878 uint32_t PaymentParameters_get_max_total_cltv_expiry_delta(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45881 * The maximum total CLTV delta we accept for the route.
45882 * Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
45884 void PaymentParameters_set_max_total_cltv_expiry_delta(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint32_t val);
45887 * The maximum number of paths that may be used by (MPP) payments.
45888 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
45890 uint8_t PaymentParameters_get_max_path_count(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45893 * The maximum number of paths that may be used by (MPP) payments.
45894 * Defaults to [`DEFAULT_MAX_PATH_COUNT`].
45896 void PaymentParameters_set_max_path_count(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
45899 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
45900 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
45901 * a lower value prefers to send larger MPP parts, potentially saturating channels and
45902 * increasing failure probability for those paths.
45904 * Note that this restriction will be relaxed during pathfinding after paths which meet this
45905 * restriction have been found. While paths which meet this criteria will be searched for, it
45906 * is ultimately up to the scorer to select them over other paths.
45908 * A value of 0 will allow payments up to and including a channel's total announced usable
45909 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
45913 uint8_t PaymentParameters_get_max_channel_saturation_power_of_half(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45916 * Selects the maximum share of a channel's total capacity which will be sent over a channel,
45917 * as a power of 1/2. A higher value prefers to send the payment using more MPP parts whereas
45918 * a lower value prefers to send larger MPP parts, potentially saturating channels and
45919 * increasing failure probability for those paths.
45921 * Note that this restriction will be relaxed during pathfinding after paths which meet this
45922 * restriction have been found. While paths which meet this criteria will be searched for, it
45923 * is ultimately up to the scorer to select them over other paths.
45925 * A value of 0 will allow payments up to and including a channel's total announced usable
45926 * capacity, a value of one will only use up to half its capacity, two 1/4, etc.
45930 void PaymentParameters_set_max_channel_saturation_power_of_half(struct LDKPaymentParameters *NONNULL_PTR this_ptr, uint8_t val);
45933 * A list of SCIDs which this payment was previously attempted over and which caused the
45934 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
45937 * Returns a copy of the field.
45939 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_channels(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45942 * A list of SCIDs which this payment was previously attempted over and which caused the
45943 * payment to fail. Future attempts for the same payment shouldn't be relayed through any of
45946 void PaymentParameters_set_previously_failed_channels(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
45949 * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
45950 * payment was previously attempted over and which caused the payment to fail. Future attempts
45951 * for the same payment shouldn't be relayed through any of these blinded paths.
45953 * Returns a copy of the field.
45955 struct LDKCVec_u64Z PaymentParameters_get_previously_failed_blinded_path_idxs(const struct LDKPaymentParameters *NONNULL_PTR this_ptr);
45958 * A list of indices corresponding to blinded paths in [`Payee::Blinded::route_hints`] which this
45959 * payment was previously attempted over and which caused the payment to fail. Future attempts
45960 * for the same payment shouldn't be relayed through any of these blinded paths.
45962 void PaymentParameters_set_previously_failed_blinded_path_idxs(struct LDKPaymentParameters *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val);
45965 * Constructs a new PaymentParameters given each field
45967 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, struct LDKCVec_u64Z previously_failed_blinded_path_idxs_arg);
45970 * Creates a copy of the PaymentParameters
45972 struct LDKPaymentParameters PaymentParameters_clone(const struct LDKPaymentParameters *NONNULL_PTR orig);
45975 * Generates a non-cryptographic 64-bit hash of the PaymentParameters.
45977 uint64_t PaymentParameters_hash(const struct LDKPaymentParameters *NONNULL_PTR o);
45980 * Checks if two PaymentParameterss contain equal inner contents.
45981 * This ignores pointers and is_owned flags and looks at the values in fields.
45982 * Two objects with NULL inner values will be considered "equal" here.
45984 bool PaymentParameters_eq(const struct LDKPaymentParameters *NONNULL_PTR a, const struct LDKPaymentParameters *NONNULL_PTR b);
45987 * Serialize the PaymentParameters object into a byte array which can be read by PaymentParameters_read
45989 struct LDKCVec_u8Z PaymentParameters_write(const struct LDKPaymentParameters *NONNULL_PTR obj);
45992 * Read a PaymentParameters from a byte array, created by PaymentParameters_write
45994 struct LDKCResult_PaymentParametersDecodeErrorZ PaymentParameters_read(struct LDKu8slice ser, uint32_t arg);
45997 * Creates a payee with the node id of the given `pubkey`.
45999 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
46002 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_node_id(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta);
46005 * Creates a payee with the node id of the given `pubkey` to use for keysend payments.
46007 * The `final_cltv_expiry_delta` should match the expected final CLTV delta the recipient has
46010 * Note that MPP keysend is not widely supported yet. The `allow_mpp` lets you choose
46011 * whether your router will be allowed to find a multi-part route for this payment. If you
46012 * set `allow_mpp` to true, you should ensure a payment secret is set on send, likely via
46013 * [`RecipientOnionFields::secret_only`].
46015 * [`RecipientOnionFields::secret_only`]: crate::ln::channelmanager::RecipientOnionFields::secret_only
46017 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_for_keysend(struct LDKPublicKey payee_pubkey, uint32_t final_cltv_expiry_delta, bool allow_mpp);
46020 * Creates parameters for paying to a blinded payee from the provided invoice. Sets
46021 * [`Payee::Blinded::route_hints`], [`Payee::Blinded::features`], and
46022 * [`PaymentParameters::expiry_time`].
46024 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_from_bolt12_invoice(const struct LDKBolt12Invoice *NONNULL_PTR invoice);
46027 * Creates parameters for paying to a blinded payee from the provided blinded route hints.
46029 MUST_USE_RES struct LDKPaymentParameters PaymentParameters_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ blinded_route_hints);
46032 * Frees any resources used by the Payee
46034 void Payee_free(struct LDKPayee this_ptr);
46037 * Creates a copy of the Payee
46039 struct LDKPayee Payee_clone(const struct LDKPayee *NONNULL_PTR orig);
46042 * Utility method to constructs a new Blinded-variant Payee
46044 struct LDKPayee Payee_blinded(struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ route_hints, struct LDKBolt12InvoiceFeatures features);
46047 * Utility method to constructs a new Clear-variant Payee
46049 struct LDKPayee Payee_clear(struct LDKPublicKey node_id, struct LDKCVec_RouteHintZ route_hints, struct LDKBolt11InvoiceFeatures features, uint32_t final_cltv_expiry_delta);
46052 * Generates a non-cryptographic 64-bit hash of the Payee.
46054 uint64_t Payee_hash(const struct LDKPayee *NONNULL_PTR o);
46057 * Checks if two Payees contain equal inner contents.
46058 * This ignores pointers and is_owned flags and looks at the values in fields.
46060 bool Payee_eq(const struct LDKPayee *NONNULL_PTR a, const struct LDKPayee *NONNULL_PTR b);
46063 * Frees any resources used by the RouteHint, if is_owned is set and inner is non-NULL.
46065 void RouteHint_free(struct LDKRouteHint this_obj);
46067 struct LDKCVec_RouteHintHopZ RouteHint_get_a(const struct LDKRouteHint *NONNULL_PTR this_ptr);
46069 void RouteHint_set_a(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKCVec_RouteHintHopZ val);
46072 * Constructs a new RouteHint given each field
46074 MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKCVec_RouteHintHopZ a_arg);
46077 * Creates a copy of the RouteHint
46079 struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig);
46082 * Generates a non-cryptographic 64-bit hash of the RouteHint.
46084 uint64_t RouteHint_hash(const struct LDKRouteHint *NONNULL_PTR o);
46087 * Checks if two RouteHints contain equal inner contents.
46088 * This ignores pointers and is_owned flags and looks at the values in fields.
46089 * Two objects with NULL inner values will be considered "equal" here.
46091 bool RouteHint_eq(const struct LDKRouteHint *NONNULL_PTR a, const struct LDKRouteHint *NONNULL_PTR b);
46094 * Serialize the RouteHint object into a byte array which can be read by RouteHint_read
46096 struct LDKCVec_u8Z RouteHint_write(const struct LDKRouteHint *NONNULL_PTR obj);
46099 * Read a RouteHint from a byte array, created by RouteHint_write
46101 struct LDKCResult_RouteHintDecodeErrorZ RouteHint_read(struct LDKu8slice ser);
46104 * Frees any resources used by the RouteHintHop, if is_owned is set and inner is non-NULL.
46106 void RouteHintHop_free(struct LDKRouteHintHop this_obj);
46109 * The node_id of the non-target end of the route
46111 struct LDKPublicKey RouteHintHop_get_src_node_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
46114 * The node_id of the non-target end of the route
46116 void RouteHintHop_set_src_node_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
46119 * The short_channel_id of this channel
46121 uint64_t RouteHintHop_get_short_channel_id(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
46124 * The short_channel_id of this channel
46126 void RouteHintHop_set_short_channel_id(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint64_t val);
46129 * The fees which must be paid to use this channel
46131 struct LDKRoutingFees RouteHintHop_get_fees(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
46134 * The fees which must be paid to use this channel
46136 void RouteHintHop_set_fees(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKRoutingFees val);
46139 * The difference in CLTV values between this node and the next node.
46141 uint16_t RouteHintHop_get_cltv_expiry_delta(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
46144 * The difference in CLTV values between this node and the next node.
46146 void RouteHintHop_set_cltv_expiry_delta(struct LDKRouteHintHop *NONNULL_PTR this_ptr, uint16_t val);
46149 * The minimum value, in msat, which must be relayed to the next hop.
46151 struct LDKCOption_u64Z RouteHintHop_get_htlc_minimum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
46154 * The minimum value, in msat, which must be relayed to the next hop.
46156 void RouteHintHop_set_htlc_minimum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
46159 * The maximum value in msat available for routing with a single HTLC.
46161 struct LDKCOption_u64Z RouteHintHop_get_htlc_maximum_msat(const struct LDKRouteHintHop *NONNULL_PTR this_ptr);
46164 * The maximum value in msat available for routing with a single HTLC.
46166 void RouteHintHop_set_htlc_maximum_msat(struct LDKRouteHintHop *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val);
46169 * Constructs a new RouteHintHop given each field
46171 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);
46174 * Creates a copy of the RouteHintHop
46176 struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
46179 * Generates a non-cryptographic 64-bit hash of the RouteHintHop.
46181 uint64_t RouteHintHop_hash(const struct LDKRouteHintHop *NONNULL_PTR o);
46184 * Checks if two RouteHintHops contain equal inner contents.
46185 * This ignores pointers and is_owned flags and looks at the values in fields.
46186 * Two objects with NULL inner values will be considered "equal" here.
46188 bool RouteHintHop_eq(const struct LDKRouteHintHop *NONNULL_PTR a, const struct LDKRouteHintHop *NONNULL_PTR b);
46191 * Serialize the RouteHintHop object into a byte array which can be read by RouteHintHop_read
46193 struct LDKCVec_u8Z RouteHintHop_write(const struct LDKRouteHintHop *NONNULL_PTR obj);
46196 * Read a RouteHintHop from a byte array, created by RouteHintHop_write
46198 struct LDKCResult_RouteHintHopDecodeErrorZ RouteHintHop_read(struct LDKu8slice ser);
46201 * Frees any resources used by the FirstHopCandidate, if is_owned is set and inner is non-NULL.
46203 void FirstHopCandidate_free(struct LDKFirstHopCandidate this_obj);
46206 * Creates a copy of the FirstHopCandidate
46208 struct LDKFirstHopCandidate FirstHopCandidate_clone(const struct LDKFirstHopCandidate *NONNULL_PTR orig);
46211 * Frees any resources used by the PublicHopCandidate, if is_owned is set and inner is non-NULL.
46213 void PublicHopCandidate_free(struct LDKPublicHopCandidate this_obj);
46216 * The short channel ID of the channel, i.e. the identifier by which we refer to this
46219 uint64_t PublicHopCandidate_get_short_channel_id(const struct LDKPublicHopCandidate *NONNULL_PTR this_ptr);
46222 * The short channel ID of the channel, i.e. the identifier by which we refer to this
46225 void PublicHopCandidate_set_short_channel_id(struct LDKPublicHopCandidate *NONNULL_PTR this_ptr, uint64_t val);
46228 * Creates a copy of the PublicHopCandidate
46230 struct LDKPublicHopCandidate PublicHopCandidate_clone(const struct LDKPublicHopCandidate *NONNULL_PTR orig);
46233 * Frees any resources used by the PrivateHopCandidate, if is_owned is set and inner is non-NULL.
46235 void PrivateHopCandidate_free(struct LDKPrivateHopCandidate this_obj);
46238 * Creates a copy of the PrivateHopCandidate
46240 struct LDKPrivateHopCandidate PrivateHopCandidate_clone(const struct LDKPrivateHopCandidate *NONNULL_PTR orig);
46243 * Frees any resources used by the BlindedPathCandidate, if is_owned is set and inner is non-NULL.
46245 void BlindedPathCandidate_free(struct LDKBlindedPathCandidate this_obj);
46248 * Creates a copy of the BlindedPathCandidate
46250 struct LDKBlindedPathCandidate BlindedPathCandidate_clone(const struct LDKBlindedPathCandidate *NONNULL_PTR orig);
46253 * Frees any resources used by the OneHopBlindedPathCandidate, if is_owned is set and inner is non-NULL.
46255 void OneHopBlindedPathCandidate_free(struct LDKOneHopBlindedPathCandidate this_obj);
46258 * Creates a copy of the OneHopBlindedPathCandidate
46260 struct LDKOneHopBlindedPathCandidate OneHopBlindedPathCandidate_clone(const struct LDKOneHopBlindedPathCandidate *NONNULL_PTR orig);
46263 * Frees any resources used by the CandidateRouteHop
46265 void CandidateRouteHop_free(struct LDKCandidateRouteHop this_ptr);
46268 * Creates a copy of the CandidateRouteHop
46270 struct LDKCandidateRouteHop CandidateRouteHop_clone(const struct LDKCandidateRouteHop *NONNULL_PTR orig);
46273 * Utility method to constructs a new FirstHop-variant CandidateRouteHop
46275 struct LDKCandidateRouteHop CandidateRouteHop_first_hop(struct LDKFirstHopCandidate a);
46278 * Utility method to constructs a new PublicHop-variant CandidateRouteHop
46280 struct LDKCandidateRouteHop CandidateRouteHop_public_hop(struct LDKPublicHopCandidate a);
46283 * Utility method to constructs a new PrivateHop-variant CandidateRouteHop
46285 struct LDKCandidateRouteHop CandidateRouteHop_private_hop(struct LDKPrivateHopCandidate a);
46288 * Utility method to constructs a new Blinded-variant CandidateRouteHop
46290 struct LDKCandidateRouteHop CandidateRouteHop_blinded(struct LDKBlindedPathCandidate a);
46293 * Utility method to constructs a new OneHopBlinded-variant CandidateRouteHop
46295 struct LDKCandidateRouteHop CandidateRouteHop_one_hop_blinded(struct LDKOneHopBlindedPathCandidate a);
46298 * Returns the globally unique short channel ID for this hop, if one is known.
46300 * This only returns `Some` if the channel is public (either our own, or one we've learned
46301 * from the public network graph), and thus the short channel ID we have for this channel is
46302 * globally unique and identifies this channel in a global namespace.
46304 MUST_USE_RES struct LDKCOption_u64Z CandidateRouteHop_globally_unique_short_channel_id(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
46307 * Returns the required difference in HTLC CLTV expiry between the [`Self::source`] and the
46308 * next-hop for an HTLC taking this hop.
46310 * This is the time that the node(s) in this hop have to claim the HTLC on-chain if the
46311 * next-hop goes on chain with a payment preimage.
46313 MUST_USE_RES uint32_t CandidateRouteHop_cltv_expiry_delta(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
46316 * Returns the minimum amount that can be sent over this hop, in millisatoshis.
46318 MUST_USE_RES uint64_t CandidateRouteHop_htlc_minimum_msat(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
46321 * Returns the fees that must be paid to route an HTLC over this channel.
46323 MUST_USE_RES struct LDKRoutingFees CandidateRouteHop_fees(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
46326 * Returns the source node id of current hop.
46328 * Source node id refers to the node forwarding the HTLC through this hop.
46330 * For [`Self::FirstHop`] we return payer's node id.
46332 MUST_USE_RES struct LDKNodeId CandidateRouteHop_source(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
46335 * Returns the target node id of this hop, if known.
46337 * Target node id refers to the node receiving the HTLC after this hop.
46339 * For [`Self::Blinded`] we return `None` because the ultimate destination after the blinded
46342 * For [`Self::OneHopBlinded`] we return `None` because the target is the same as the source,
46343 * and such a return value would be somewhat nonsensical.
46345 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
46347 MUST_USE_RES struct LDKNodeId CandidateRouteHop_target(const struct LDKCandidateRouteHop *NONNULL_PTR this_arg);
46350 * Finds a route from us (payer) to the given target node (payee).
46352 * If the payee provided features in their invoice, they should be provided via the `payee` field
46353 * in the given [`RouteParameters::payment_params`].
46354 * Without this, MPP will only be used if the payee's features are available in the network graph.
46356 * Private routing paths between a public node and the target may be included in the `payee` field
46357 * of [`RouteParameters::payment_params`].
46359 * If some channels aren't announced, it may be useful to fill in `first_hops` with the results
46360 * from [`ChannelManager::list_usable_channels`]. If it is filled in, the view of these channels
46361 * from `network_graph` will be ignored, and only those in `first_hops` will be used.
46363 * The fees on channels from us to the next hop are ignored as they are assumed to all be equal.
46364 * However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` /
46365 * `htlc_maximum_msat` *are* checked as they may change based on the receiving node.
46369 * Panics if first_hops contains channels without `short_channel_id`s;
46370 * [`ChannelManager::list_usable_channels`] will never include such channels.
46372 * [`ChannelManager::list_usable_channels`]: crate::ln::channelmanager::ChannelManager::list_usable_channels
46373 * [`Event::PaymentPathFailed`]: crate::events::Event::PaymentPathFailed
46374 * [`NetworkGraph`]: crate::routing::gossip::NetworkGraph
46376 * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
46378 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 LDKScoreLookUp *NONNULL_PTR scorer, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR score_params, const uint8_t (*random_seed_bytes)[32]);
46381 * Construct a route from us (payer) to the target node (payee) via the given hops (which should
46382 * exclude the payer, but include the payee). This may be useful, e.g., for probing the chosen path.
46384 * Re-uses logic from `find_route`, so the restrictions described there also apply here.
46386 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]);
46389 * Calls the free function if one is set
46391 void ScoreLookUp_free(struct LDKScoreLookUp this_ptr);
46394 * Calls the free function if one is set
46396 void ScoreUpdate_free(struct LDKScoreUpdate this_ptr);
46399 * Calls the free function if one is set
46401 void Score_free(struct LDKScore this_ptr);
46404 * Calls the free function if one is set
46406 void LockableScore_free(struct LDKLockableScore this_ptr);
46409 * Calls the free function if one is set
46411 void WriteableScore_free(struct LDKWriteableScore this_ptr);
46414 * Frees any resources used by the MultiThreadedLockableScore, if is_owned is set and inner is non-NULL.
46416 void MultiThreadedLockableScore_free(struct LDKMultiThreadedLockableScore this_obj);
46419 * Constructs a new LockableScore which calls the relevant methods on this_arg.
46420 * This copies the `inner` pointer in this_arg and thus the returned LockableScore must be freed before this_arg is
46422 struct LDKLockableScore MultiThreadedLockableScore_as_LockableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
46425 * Serialize the MultiThreadedLockableScore object into a byte array which can be read by MultiThreadedLockableScore_read
46427 struct LDKCVec_u8Z MultiThreadedLockableScore_write(const struct LDKMultiThreadedLockableScore *NONNULL_PTR obj);
46430 * Constructs a new WriteableScore which calls the relevant methods on this_arg.
46431 * This copies the `inner` pointer in this_arg and thus the returned WriteableScore must be freed before this_arg is
46433 struct LDKWriteableScore MultiThreadedLockableScore_as_WriteableScore(const struct LDKMultiThreadedLockableScore *NONNULL_PTR this_arg);
46436 * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
46438 MUST_USE_RES struct LDKMultiThreadedLockableScore MultiThreadedLockableScore_new(struct LDKScore score);
46441 * Frees any resources used by the MultiThreadedScoreLockRead, if is_owned is set and inner is non-NULL.
46443 void MultiThreadedScoreLockRead_free(struct LDKMultiThreadedScoreLockRead this_obj);
46446 * Frees any resources used by the MultiThreadedScoreLockWrite, if is_owned is set and inner is non-NULL.
46448 void MultiThreadedScoreLockWrite_free(struct LDKMultiThreadedScoreLockWrite this_obj);
46451 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
46452 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
46454 struct LDKScoreLookUp MultiThreadedScoreLockRead_as_ScoreLookUp(const struct LDKMultiThreadedScoreLockRead *NONNULL_PTR this_arg);
46457 * Serialize the MultiThreadedScoreLockWrite object into a byte array which can be read by MultiThreadedScoreLockWrite_read
46459 struct LDKCVec_u8Z MultiThreadedScoreLockWrite_write(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR obj);
46462 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
46463 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
46465 struct LDKScoreUpdate MultiThreadedScoreLockWrite_as_ScoreUpdate(const struct LDKMultiThreadedScoreLockWrite *NONNULL_PTR this_arg);
46468 * Frees any resources used by the ChannelUsage, if is_owned is set and inner is non-NULL.
46470 void ChannelUsage_free(struct LDKChannelUsage this_obj);
46473 * The amount to send through the channel, denominated in millisatoshis.
46475 uint64_t ChannelUsage_get_amount_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
46478 * The amount to send through the channel, denominated in millisatoshis.
46480 void ChannelUsage_set_amount_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
46483 * Total amount, denominated in millisatoshis, already allocated to send through the channel
46484 * as part of a multi-path payment.
46486 uint64_t ChannelUsage_get_inflight_htlc_msat(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
46489 * Total amount, denominated in millisatoshis, already allocated to send through the channel
46490 * as part of a multi-path payment.
46492 void ChannelUsage_set_inflight_htlc_msat(struct LDKChannelUsage *NONNULL_PTR this_ptr, uint64_t val);
46495 * The effective capacity of the channel.
46497 struct LDKEffectiveCapacity ChannelUsage_get_effective_capacity(const struct LDKChannelUsage *NONNULL_PTR this_ptr);
46500 * The effective capacity of the channel.
46502 void ChannelUsage_set_effective_capacity(struct LDKChannelUsage *NONNULL_PTR this_ptr, struct LDKEffectiveCapacity val);
46505 * Constructs a new ChannelUsage given each field
46507 MUST_USE_RES struct LDKChannelUsage ChannelUsage_new(uint64_t amount_msat_arg, uint64_t inflight_htlc_msat_arg, struct LDKEffectiveCapacity effective_capacity_arg);
46510 * Creates a copy of the ChannelUsage
46512 struct LDKChannelUsage ChannelUsage_clone(const struct LDKChannelUsage *NONNULL_PTR orig);
46515 * Frees any resources used by the FixedPenaltyScorer, if is_owned is set and inner is non-NULL.
46517 void FixedPenaltyScorer_free(struct LDKFixedPenaltyScorer this_obj);
46520 * Creates a copy of the FixedPenaltyScorer
46522 struct LDKFixedPenaltyScorer FixedPenaltyScorer_clone(const struct LDKFixedPenaltyScorer *NONNULL_PTR orig);
46525 * Creates a new scorer using `penalty_msat`.
46527 MUST_USE_RES struct LDKFixedPenaltyScorer FixedPenaltyScorer_with_penalty(uint64_t penalty_msat);
46530 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
46531 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
46533 struct LDKScoreLookUp FixedPenaltyScorer_as_ScoreLookUp(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
46536 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
46537 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
46539 struct LDKScoreUpdate FixedPenaltyScorer_as_ScoreUpdate(const struct LDKFixedPenaltyScorer *NONNULL_PTR this_arg);
46542 * Serialize the FixedPenaltyScorer object into a byte array which can be read by FixedPenaltyScorer_read
46544 struct LDKCVec_u8Z FixedPenaltyScorer_write(const struct LDKFixedPenaltyScorer *NONNULL_PTR obj);
46547 * Read a FixedPenaltyScorer from a byte array, created by FixedPenaltyScorer_write
46549 struct LDKCResult_FixedPenaltyScorerDecodeErrorZ FixedPenaltyScorer_read(struct LDKu8slice ser, uint64_t arg);
46552 * Frees any resources used by the ProbabilisticScorer, if is_owned is set and inner is non-NULL.
46554 void ProbabilisticScorer_free(struct LDKProbabilisticScorer this_obj);
46557 * Frees any resources used by the ProbabilisticScoringFeeParameters, if is_owned is set and inner is non-NULL.
46559 void ProbabilisticScoringFeeParameters_free(struct LDKProbabilisticScoringFeeParameters this_obj);
46562 * A fixed penalty in msats to apply to each channel.
46564 * Default value: 500 msat
46566 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46569 * A fixed penalty in msats to apply to each channel.
46571 * Default value: 500 msat
46573 void ProbabilisticScoringFeeParameters_set_base_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46576 * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
46577 * applied to each channel, in excess of the [`base_penalty_msat`].
46579 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
46580 * fees plus penalty) for large payments. The penalty is computed as the product of this
46581 * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
46582 * amount plus the amount of any other HTLCs flowing we sent over the same channel).
46584 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
46586 * Default value: 8,192 msat
46588 * [`base_penalty_msat`]: Self::base_penalty_msat
46590 uint64_t ProbabilisticScoringFeeParameters_get_base_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46593 * A multiplier used with the total amount flowing over a channel to calculate a fixed penalty
46594 * applied to each channel, in excess of the [`base_penalty_msat`].
46596 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
46597 * fees plus penalty) for large payments. The penalty is computed as the product of this
46598 * multiplier and `2^30`ths of the total amount flowing over a channel (i.e. the payment
46599 * amount plus the amount of any other HTLCs flowing we sent over the same channel).
46601 * ie `base_penalty_amount_multiplier_msat * amount_msat / 2^30`
46603 * Default value: 8,192 msat
46605 * [`base_penalty_msat`]: Self::base_penalty_msat
46607 void ProbabilisticScoringFeeParameters_set_base_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46610 * A multiplier used in conjunction with the negative `log10` of the channel's success
46611 * probability for a payment, as determined by our latest estimates of the channel's
46612 * liquidity, to determine the liquidity penalty.
46614 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
46615 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
46616 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
46617 * lower bounding the success probability to `0.01`) when the amount falls within the
46618 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
46619 * result in a `u64::max_value` penalty, however.
46621 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
46623 * Default value: 30,000 msat
46625 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
46627 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46630 * A multiplier used in conjunction with the negative `log10` of the channel's success
46631 * probability for a payment, as determined by our latest estimates of the channel's
46632 * liquidity, to determine the liquidity penalty.
46634 * The penalty is based in part on the knowledge learned from prior successful and unsuccessful
46635 * payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
46636 * penalty is effectively limited to `2 * liquidity_penalty_multiplier_msat` (corresponding to
46637 * lower bounding the success probability to `0.01`) when the amount falls within the
46638 * uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
46639 * result in a `u64::max_value` penalty, however.
46641 * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
46643 * Default value: 30,000 msat
46645 * [`liquidity_offset_half_life`]: ProbabilisticScoringDecayParameters::liquidity_offset_half_life
46647 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46650 * A multiplier used in conjunction with the total amount flowing over a channel and the
46651 * negative `log10` of the channel's success probability for the payment, as determined by our
46652 * latest estimates of the channel's liquidity, to determine the amount penalty.
46654 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
46655 * fees plus penalty) for large payments. The penalty is computed as the product of this
46656 * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
46657 * `log10` of the success probability.
46659 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
46661 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
46662 * the amount will result in a penalty of the multiplier. And, as the success probability
46663 * decreases, the negative `log10` weighting will increase dramatically. For higher success
46664 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
46667 * Default value: 192 msat
46669 uint64_t ProbabilisticScoringFeeParameters_get_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46672 * A multiplier used in conjunction with the total amount flowing over a channel and the
46673 * negative `log10` of the channel's success probability for the payment, as determined by our
46674 * latest estimates of the channel's liquidity, to determine the amount penalty.
46676 * The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
46677 * fees plus penalty) for large payments. The penalty is computed as the product of this
46678 * multiplier and `2^20`ths of the amount flowing over this channel, weighted by the negative
46679 * `log10` of the success probability.
46681 * `-log10(success_probability) * liquidity_penalty_amount_multiplier_msat * amount_msat / 2^20`
46683 * In practice, this means for 0.1 success probability (`-log10(0.1) == 1`) each `2^20`th of
46684 * the amount will result in a penalty of the multiplier. And, as the success probability
46685 * decreases, the negative `log10` weighting will increase dramatically. For higher success
46686 * probabilities, the multiplier will have a decreasing effect as the negative `log10` will
46689 * Default value: 192 msat
46691 void ProbabilisticScoringFeeParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46694 * A multiplier used in conjunction with the negative `log10` of the channel's success
46695 * probability for the payment, as determined based on the history of our estimates of the
46696 * channel's available liquidity, to determine a penalty.
46698 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
46699 * only our latest estimate for the current liquidity available in the channel, it estimates
46700 * success probability based on the estimated liquidity available in the channel through
46701 * history. Specifically, every time we update our liquidity bounds on a given channel, we
46702 * track which of several buckets those bounds fall into, exponentially decaying the
46703 * probability of each bucket as new samples are added.
46705 * Default value: 10,000 msat
46707 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
46709 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46712 * A multiplier used in conjunction with the negative `log10` of the channel's success
46713 * probability for the payment, as determined based on the history of our estimates of the
46714 * channel's available liquidity, to determine a penalty.
46716 * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
46717 * only our latest estimate for the current liquidity available in the channel, it estimates
46718 * success probability based on the estimated liquidity available in the channel through
46719 * history. Specifically, every time we update our liquidity bounds on a given channel, we
46720 * track which of several buckets those bounds fall into, exponentially decaying the
46721 * probability of each bucket as new samples are added.
46723 * Default value: 10,000 msat
46725 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
46727 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46730 * A multiplier used in conjunction with the total amount flowing over a channel and the
46731 * negative `log10` of the channel's success probability for the payment, as determined based
46732 * on the history of our estimates of the channel's available liquidity, to determine a
46735 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
46736 * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
46737 * of the amount flowing over this channel, weighted by the negative `log10` of the success
46740 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
46741 * of using only our latest estimate for the current liquidity available in the channel, it
46742 * estimates success probability based on the estimated liquidity available in the channel
46743 * through history. Specifically, every time we update our liquidity bounds on a given
46744 * channel, we track which of several buckets those bounds fall into, exponentially decaying
46745 * the probability of each bucket as new samples are added.
46747 * Default value: 64 msat
46749 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
46751 uint64_t ProbabilisticScoringFeeParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46754 * A multiplier used in conjunction with the total amount flowing over a channel and the
46755 * negative `log10` of the channel's success probability for the payment, as determined based
46756 * on the history of our estimates of the channel's available liquidity, to determine a
46759 * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
46760 * large payments. The penalty is computed as the product of this multiplier and `2^20`ths
46761 * of the amount flowing over this channel, weighted by the negative `log10` of the success
46764 * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
46765 * of using only our latest estimate for the current liquidity available in the channel, it
46766 * estimates success probability based on the estimated liquidity available in the channel
46767 * through history. Specifically, every time we update our liquidity bounds on a given
46768 * channel, we track which of several buckets those bounds fall into, exponentially decaying
46769 * the probability of each bucket as new samples are added.
46771 * Default value: 64 msat
46773 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
46775 void ProbabilisticScoringFeeParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46778 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
46779 * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
46780 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
46781 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
46782 * to restrict `htlc_maximum_msat` and improve privacy.
46784 * Default value: 250 msat
46786 uint64_t ProbabilisticScoringFeeParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46789 * This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
46790 * channel's capacity, (ie. htlc_maximum_msat >= 0.5 * channel_capacity) which makes us
46791 * prefer nodes with a smaller `htlc_maximum_msat`. We treat such nodes preferentially
46792 * as this makes balance discovery attacks harder to execute, thereby creating an incentive
46793 * to restrict `htlc_maximum_msat` and improve privacy.
46795 * Default value: 250 msat
46797 void ProbabilisticScoringFeeParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46800 * This penalty is applied when the total amount flowing over a channel exceeds our current
46801 * estimate of the channel's available liquidity. The total amount is the amount of the
46802 * current HTLC plus any HTLCs which we've sent over the same channel.
46804 * Note that in this case all other penalties, including the
46805 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
46806 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
46807 * applicable, are still included in the overall penalty.
46809 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
46810 * `u64::max_value()` will guarantee that.
46812 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
46814 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
46815 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
46816 * [`base_penalty_msat`]: Self::base_penalty_msat
46817 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
46819 uint64_t ProbabilisticScoringFeeParameters_get_considered_impossible_penalty_msat(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46822 * This penalty is applied when the total amount flowing over a channel exceeds our current
46823 * estimate of the channel's available liquidity. The total amount is the amount of the
46824 * current HTLC plus any HTLCs which we've sent over the same channel.
46826 * Note that in this case all other penalties, including the
46827 * [`liquidity_penalty_multiplier_msat`] and [`liquidity_penalty_amount_multiplier_msat`]-based
46828 * penalties, as well as the [`base_penalty_msat`] and the [`anti_probing_penalty_msat`], if
46829 * applicable, are still included in the overall penalty.
46831 * If you wish to avoid creating paths with such channels entirely, setting this to a value of
46832 * `u64::max_value()` will guarantee that.
46834 * Default value: 1_0000_0000_000 msat (1 Bitcoin)
46836 * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
46837 * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
46838 * [`base_penalty_msat`]: Self::base_penalty_msat
46839 * [`anti_probing_penalty_msat`]: Self::anti_probing_penalty_msat
46841 void ProbabilisticScoringFeeParameters_set_considered_impossible_penalty_msat(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, uint64_t val);
46844 * In order to calculate most of the scores above, we must first convert a lower and upper
46845 * bound on the available liquidity in a channel into the probability that we think a payment
46846 * will succeed. That probability is derived from a Probability Density Function for where we
46847 * think the liquidity in a channel likely lies, given such bounds.
46849 * If this flag is set, that PDF is simply a constant - we assume that the actual available
46850 * liquidity in a channel is just as likely to be at any point between our lower and upper
46853 * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
46854 * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
46855 * matches experimental results - most routing nodes do not aggressively rebalance their
46856 * channels and flows in the network are often unbalanced, leaving liquidity usually
46859 * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
46860 * of floating-point multiplications in the hottest routing code, which may lead to routing
46861 * performance degradation on some machines.
46863 * Default value: false
46865 bool ProbabilisticScoringFeeParameters_get_linear_success_probability(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr);
46868 * In order to calculate most of the scores above, we must first convert a lower and upper
46869 * bound on the available liquidity in a channel into the probability that we think a payment
46870 * will succeed. That probability is derived from a Probability Density Function for where we
46871 * think the liquidity in a channel likely lies, given such bounds.
46873 * If this flag is set, that PDF is simply a constant - we assume that the actual available
46874 * liquidity in a channel is just as likely to be at any point between our lower and upper
46877 * If this flag is *not* set, that PDF is `(x - 0.5*capacity) ^ 2`. That is, we use an
46878 * exponential curve which expects the liquidity of a channel to lie \"at the edges\". This
46879 * matches experimental results - most routing nodes do not aggressively rebalance their
46880 * channels and flows in the network are often unbalanced, leaving liquidity usually
46883 * Thus, for the \"best\" routes, leave this flag `false`. However, the flag does imply a number
46884 * of floating-point multiplications in the hottest routing code, which may lead to routing
46885 * performance degradation on some machines.
46887 * Default value: false
46889 void ProbabilisticScoringFeeParameters_set_linear_success_probability(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_ptr, bool val);
46892 * Creates a copy of the ProbabilisticScoringFeeParameters
46894 struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_clone(const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR orig);
46897 * Creates a "default" ProbabilisticScoringFeeParameters. See struct and individual field documentaiton for details on which values are used.
46899 MUST_USE_RES struct LDKProbabilisticScoringFeeParameters ProbabilisticScoringFeeParameters_default(void);
46902 * Marks the node with the given `node_id` as banned,
46903 * i.e it will be avoided during path finding.
46905 void ProbabilisticScoringFeeParameters_add_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
46908 * Marks all nodes in the given list as banned, i.e.,
46909 * they will be avoided during path finding.
46911 void ProbabilisticScoringFeeParameters_add_banned_from_list(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, struct LDKCVec_NodeIdZ node_ids);
46914 * Removes the node with the given `node_id` from the list of nodes to avoid.
46916 void ProbabilisticScoringFeeParameters_remove_banned(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
46919 * Sets a manual penalty for the given node.
46921 void ProbabilisticScoringFeeParameters_set_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id, uint64_t penalty);
46924 * Removes the node with the given `node_id` from the list of manual penalties.
46926 void ProbabilisticScoringFeeParameters_remove_manual_penalty(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR node_id);
46929 * Clears the list of manual penalties that are applied during path finding.
46931 void ProbabilisticScoringFeeParameters_clear_manual_penalties(struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR this_arg);
46934 * Frees any resources used by the ProbabilisticScoringDecayParameters, if is_owned is set and inner is non-NULL.
46936 void ProbabilisticScoringDecayParameters_free(struct LDKProbabilisticScoringDecayParameters this_obj);
46939 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
46940 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
46941 * seen a liquidity estimate update for this amount of time, the historical datapoints are
46943 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
46945 * Note that after 16 or more half lives all historical data will be completely gone.
46947 * Default value: 14 days
46949 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
46951 uint64_t ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
46954 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
46955 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
46956 * seen a liquidity estimate update for this amount of time, the historical datapoints are
46958 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
46960 * Note that after 16 or more half lives all historical data will be completely gone.
46962 * Default value: 14 days
46964 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
46966 void ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
46969 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
46970 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
46971 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
46974 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
46975 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
46976 * struct documentation for more info on the way the liquidity bounds are used.
46978 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
46979 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
46980 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
46982 * Default value: 6 hours
46986 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
46987 * liquidity knowledge will never decay except when the bounds cross.
46989 uint64_t ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr);
46992 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
46993 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
46994 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
46997 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
46998 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
46999 * struct documentation for more info on the way the liquidity bounds are used.
47001 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
47002 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
47003 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
47005 * Default value: 6 hours
47009 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
47010 * liquidity knowledge will never decay except when the bounds cross.
47012 void ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR this_ptr, uint64_t val);
47015 * Constructs a new ProbabilisticScoringDecayParameters given each field
47017 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_new(uint64_t historical_no_updates_half_life_arg, uint64_t liquidity_offset_half_life_arg);
47020 * Creates a copy of the ProbabilisticScoringDecayParameters
47022 struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_clone(const struct LDKProbabilisticScoringDecayParameters *NONNULL_PTR orig);
47025 * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
47027 MUST_USE_RES struct LDKProbabilisticScoringDecayParameters ProbabilisticScoringDecayParameters_default(void);
47030 * Creates a new scorer using the given scoring parameters for sending payments from a node
47031 * through a network graph.
47033 MUST_USE_RES struct LDKProbabilisticScorer ProbabilisticScorer_new(struct LDKProbabilisticScoringDecayParameters decay_params, const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
47036 * Dump the contents of this scorer into the configured logger.
47038 * Note that this writes roughly one line per channel for which we have a liquidity estimate,
47039 * which may be a substantial amount of log output.
47041 void ProbabilisticScorer_debug_log_liquidity_stats(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
47044 * Query the estimated minimum and maximum liquidity available for sending a payment over the
47045 * channel with `scid` towards the given `target` node.
47047 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);
47050 * Query the historical estimated minimum and maximum liquidity available for sending a
47051 * payment over the channel with `scid` towards the given `target` node.
47053 * Returns two sets of 32 buckets. The first set describes the lower-bound liquidity history,
47054 * the second set describes the upper-bound liquidity history. Each bucket describes the
47055 * relative frequency at which we've seen a liquidity bound in the bucket's range relative to
47056 * the channel's total capacity, on an arbitrary scale. Because the values are slowly decayed,
47057 * more recent data points are weighted more heavily than older datapoints.
47059 * Note that the range of each bucket varies by its location to provide more granular results
47060 * at the edges of a channel's capacity, where it is more likely to sit.
47062 * When scoring, the estimated probability that an upper-/lower-bound lies in a given bucket
47063 * is calculated by dividing that bucket's value with the total value of all buckets.
47065 * For example, using a lower bucket count for illustrative purposes, a value of
47066 * `[0, 0, 0, ..., 0, 32]` indicates that we believe the probability of a bound being very
47067 * close to the channel's capacity to be 100%, and have never (recently) seen it in any other
47068 * bucket. A value of `[31, 0, 0, ..., 0, 0, 32]` indicates we've seen the bound being both
47069 * in the top and bottom bucket, and roughly with similar (recent) frequency.
47071 * Because the datapoints are decayed slowly over time, values will eventually return to
47072 * `Some(([0; 32], [0; 32]))` or `None` if no data remains for a channel.
47074 * In order to fetch a single success probability from the buckets provided here, as used in
47075 * the scoring model, see [`Self::historical_estimated_payment_success_probability`].
47077 MUST_USE_RES struct LDKCOption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target);
47080 * Query the probability of payment success sending the given `amount_msat` over the channel
47081 * with `scid` towards the given `target` node, based on the historical estimated liquidity
47084 * These are the same bounds as returned by
47085 * [`Self::historical_estimated_channel_liquidity_probabilities`] (but not those returned by
47086 * [`Self::estimated_channel_liquidity_range`]).
47088 MUST_USE_RES struct LDKCOption_f64Z ProbabilisticScorer_historical_estimated_payment_success_probability(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg, uint64_t scid, const struct LDKNodeId *NONNULL_PTR target, uint64_t amount_msat, const struct LDKProbabilisticScoringFeeParameters *NONNULL_PTR params);
47091 * Constructs a new ScoreLookUp which calls the relevant methods on this_arg.
47092 * This copies the `inner` pointer in this_arg and thus the returned ScoreLookUp must be freed before this_arg is
47094 struct LDKScoreLookUp ProbabilisticScorer_as_ScoreLookUp(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
47097 * Constructs a new ScoreUpdate which calls the relevant methods on this_arg.
47098 * This copies the `inner` pointer in this_arg and thus the returned ScoreUpdate must be freed before this_arg is
47100 struct LDKScoreUpdate ProbabilisticScorer_as_ScoreUpdate(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
47103 * Constructs a new Score which calls the relevant methods on this_arg.
47104 * This copies the `inner` pointer in this_arg and thus the returned Score must be freed before this_arg is
47106 struct LDKScore ProbabilisticScorer_as_Score(const struct LDKProbabilisticScorer *NONNULL_PTR this_arg);
47109 * Serialize the ProbabilisticScorer object into a byte array which can be read by ProbabilisticScorer_read
47111 struct LDKCVec_u8Z ProbabilisticScorer_write(const struct LDKProbabilisticScorer *NONNULL_PTR obj);
47114 * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
47116 struct LDKCResult_ProbabilisticScorerDecodeErrorZ ProbabilisticScorer_read(struct LDKu8slice ser, struct LDKProbabilisticScoringDecayParameters arg_a, const struct LDKNetworkGraph *NONNULL_PTR arg_b, struct LDKLogger arg_c);
47119 * Frees any resources used by the DelayedPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
47121 void DelayedPaymentOutputDescriptor_free(struct LDKDelayedPaymentOutputDescriptor this_obj);
47124 * The outpoint which is spendable.
47126 struct LDKOutPoint DelayedPaymentOutputDescriptor_get_outpoint(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47129 * The outpoint which is spendable.
47131 void DelayedPaymentOutputDescriptor_set_outpoint(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
47134 * Per commitment point to derive the delayed payment key by key holder.
47136 struct LDKPublicKey DelayedPaymentOutputDescriptor_get_per_commitment_point(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47139 * Per commitment point to derive the delayed payment key by key holder.
47141 void DelayedPaymentOutputDescriptor_set_per_commitment_point(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
47144 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
47145 * the witness_script.
47147 uint16_t DelayedPaymentOutputDescriptor_get_to_self_delay(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47150 * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in
47151 * the witness_script.
47153 void DelayedPaymentOutputDescriptor_set_to_self_delay(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint16_t val);
47156 * The output which is referenced by the given outpoint.
47158 struct LDKTxOut DelayedPaymentOutputDescriptor_get_output(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47161 * The output which is referenced by the given outpoint.
47163 void DelayedPaymentOutputDescriptor_set_output(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
47166 * The revocation point specific to the commitment transaction which was broadcast. Used to
47167 * derive the witnessScript for this output.
47169 struct LDKRevocationKey DelayedPaymentOutputDescriptor_get_revocation_pubkey(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47172 * The revocation point specific to the commitment transaction which was broadcast. Used to
47173 * derive the witnessScript for this output.
47175 void DelayedPaymentOutputDescriptor_set_revocation_pubkey(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKRevocationKey val);
47178 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
47179 * This may be useful in re-deriving keys used in the channel to spend the output.
47181 const uint8_t (*DelayedPaymentOutputDescriptor_get_channel_keys_id(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
47184 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
47185 * This may be useful in re-deriving keys used in the channel to spend the output.
47187 void DelayedPaymentOutputDescriptor_set_channel_keys_id(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
47190 * The value of the channel which this output originated from, possibly indirectly.
47192 uint64_t DelayedPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47195 * The value of the channel which this output originated from, possibly indirectly.
47197 void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
47200 * Constructs a new DelayedPaymentOutputDescriptor given each field
47202 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 LDKRevocationKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg);
47205 * Creates a copy of the DelayedPaymentOutputDescriptor
47207 struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
47210 * Generates a non-cryptographic 64-bit hash of the DelayedPaymentOutputDescriptor.
47212 uint64_t DelayedPaymentOutputDescriptor_hash(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR o);
47215 * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
47216 * This ignores pointers and is_owned flags and looks at the values in fields.
47217 * Two objects with NULL inner values will be considered "equal" here.
47219 bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
47222 * Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
47224 struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
47227 * Read a DelayedPaymentOutputDescriptor from a byte array, created by DelayedPaymentOutputDescriptor_write
47229 struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
47232 * Frees any resources used by the StaticPaymentOutputDescriptor, if is_owned is set and inner is non-NULL.
47234 void StaticPaymentOutputDescriptor_free(struct LDKStaticPaymentOutputDescriptor this_obj);
47237 * The outpoint which is spendable.
47239 struct LDKOutPoint StaticPaymentOutputDescriptor_get_outpoint(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47242 * The outpoint which is spendable.
47244 void StaticPaymentOutputDescriptor_set_outpoint(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
47247 * The output which is referenced by the given outpoint.
47249 struct LDKTxOut StaticPaymentOutputDescriptor_get_output(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47252 * The output which is referenced by the given outpoint.
47254 void StaticPaymentOutputDescriptor_set_output(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKTxOut val);
47257 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
47258 * This may be useful in re-deriving keys used in the channel to spend the output.
47260 const uint8_t (*StaticPaymentOutputDescriptor_get_channel_keys_id(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr))[32];
47263 * Arbitrary identification information returned by a call to [`ChannelSigner::channel_keys_id`].
47264 * This may be useful in re-deriving keys used in the channel to spend the output.
47266 void StaticPaymentOutputDescriptor_set_channel_keys_id(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
47269 * The value of the channel which this transactions spends.
47271 uint64_t StaticPaymentOutputDescriptor_get_channel_value_satoshis(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47274 * The value of the channel which this transactions spends.
47276 void StaticPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val);
47279 * The necessary channel parameters that need to be provided to the re-derived signer through
47280 * [`ChannelSigner::provide_channel_parameters`].
47282 * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
47284 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47286 struct LDKChannelTransactionParameters StaticPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr);
47289 * The necessary channel parameters that need to be provided to the re-derived signer through
47290 * [`ChannelSigner::provide_channel_parameters`].
47292 * Added as optional, but always `Some` if the descriptor was produced in v0.0.117 or later.
47294 * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
47296 void StaticPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
47299 * Constructs a new StaticPaymentOutputDescriptor given each field
47301 * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None
47303 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, struct LDKChannelTransactionParameters channel_transaction_parameters_arg);
47306 * Creates a copy of the StaticPaymentOutputDescriptor
47308 struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
47311 * Generates a non-cryptographic 64-bit hash of the StaticPaymentOutputDescriptor.
47313 uint64_t StaticPaymentOutputDescriptor_hash(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR o);
47316 * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
47317 * This ignores pointers and is_owned flags and looks at the values in fields.
47318 * Two objects with NULL inner values will be considered "equal" here.
47320 bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
47323 * Returns the `witness_script` of the spendable output.
47325 * Note that this will only return `Some` for [`StaticPaymentOutputDescriptor`]s that
47326 * originated from an anchor outputs channel, as they take the form of a P2WSH script.
47328 MUST_USE_RES struct LDKCOption_CVec_u8ZZ StaticPaymentOutputDescriptor_witness_script(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
47331 * The maximum length a well-formed witness spending one of these should have.
47332 * Note: If you have the grind_signatures feature enabled, this will be at least 1 byte
47335 MUST_USE_RES uint64_t StaticPaymentOutputDescriptor_max_witness_length(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR this_arg);
47338 * Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
47340 struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
47343 * Read a StaticPaymentOutputDescriptor from a byte array, created by StaticPaymentOutputDescriptor_write
47345 struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
47348 * Frees any resources used by the SpendableOutputDescriptor
47350 void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr);
47353 * Creates a copy of the SpendableOutputDescriptor
47355 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
47358 * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
47360 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output, struct LDKThirtyTwoBytes channel_keys_id);
47363 * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
47365 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
47368 * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
47370 struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
47373 * Generates a non-cryptographic 64-bit hash of the SpendableOutputDescriptor.
47375 uint64_t SpendableOutputDescriptor_hash(const struct LDKSpendableOutputDescriptor *NONNULL_PTR o);
47378 * Checks if two SpendableOutputDescriptors contain equal inner contents.
47379 * This ignores pointers and is_owned flags and looks at the values in fields.
47381 bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
47384 * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
47386 struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
47389 * Read a SpendableOutputDescriptor from a byte array, created by SpendableOutputDescriptor_write
47391 struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
47394 * Creates an unsigned [`PartiallySignedTransaction`] which spends the given descriptors to
47395 * the given outputs, plus an output to the given change destination (if sufficient
47396 * change value remains). The PSBT will have a feerate, at least, of the given value.
47398 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
47399 * transaction will have a locktime of 0. It it recommended to set this to the current block
47400 * height to avoid fee sniping, unless you have some specific reason to use a different
47403 * Returns the PSBT and expected max transaction weight.
47405 * Returns `Err(())` if the output value is greater than the input value minus required fee,
47406 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
47407 * does not match the one we can spend.
47409 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
47411 MUST_USE_RES struct LDKCResult_C2Tuple_CVec_u8Zu64ZNoneZ 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_u32Z locktime);
47414 * Frees any resources used by the ChannelDerivationParameters, if is_owned is set and inner is non-NULL.
47416 void ChannelDerivationParameters_free(struct LDKChannelDerivationParameters this_obj);
47419 * The value in satoshis of the channel we're attempting to spend the anchor output of.
47421 uint64_t ChannelDerivationParameters_get_value_satoshis(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
47424 * The value in satoshis of the channel we're attempting to spend the anchor output of.
47426 void ChannelDerivationParameters_set_value_satoshis(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, uint64_t val);
47429 * The unique identifier to re-derive the signer for the associated channel.
47431 const uint8_t (*ChannelDerivationParameters_get_keys_id(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr))[32];
47434 * The unique identifier to re-derive the signer for the associated channel.
47436 void ChannelDerivationParameters_set_keys_id(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
47439 * The necessary channel parameters that need to be provided to the re-derived signer through
47440 * [`ChannelSigner::provide_channel_parameters`].
47442 struct LDKChannelTransactionParameters ChannelDerivationParameters_get_transaction_parameters(const struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr);
47445 * The necessary channel parameters that need to be provided to the re-derived signer through
47446 * [`ChannelSigner::provide_channel_parameters`].
47448 void ChannelDerivationParameters_set_transaction_parameters(struct LDKChannelDerivationParameters *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val);
47451 * Constructs a new ChannelDerivationParameters given each field
47453 MUST_USE_RES struct LDKChannelDerivationParameters ChannelDerivationParameters_new(uint64_t value_satoshis_arg, struct LDKThirtyTwoBytes keys_id_arg, struct LDKChannelTransactionParameters transaction_parameters_arg);
47456 * Creates a copy of the ChannelDerivationParameters
47458 struct LDKChannelDerivationParameters ChannelDerivationParameters_clone(const struct LDKChannelDerivationParameters *NONNULL_PTR orig);
47461 * Checks if two ChannelDerivationParameterss contain equal inner contents.
47462 * This ignores pointers and is_owned flags and looks at the values in fields.
47463 * Two objects with NULL inner values will be considered "equal" here.
47465 bool ChannelDerivationParameters_eq(const struct LDKChannelDerivationParameters *NONNULL_PTR a, const struct LDKChannelDerivationParameters *NONNULL_PTR b);
47468 * Serialize the ChannelDerivationParameters object into a byte array which can be read by ChannelDerivationParameters_read
47470 struct LDKCVec_u8Z ChannelDerivationParameters_write(const struct LDKChannelDerivationParameters *NONNULL_PTR obj);
47473 * Read a ChannelDerivationParameters from a byte array, created by ChannelDerivationParameters_write
47475 struct LDKCResult_ChannelDerivationParametersDecodeErrorZ ChannelDerivationParameters_read(struct LDKu8slice ser);
47478 * Frees any resources used by the HTLCDescriptor, if is_owned is set and inner is non-NULL.
47480 void HTLCDescriptor_free(struct LDKHTLCDescriptor this_obj);
47483 * The parameters required to derive the signer for the HTLC input.
47485 struct LDKChannelDerivationParameters HTLCDescriptor_get_channel_derivation_parameters(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47488 * The parameters required to derive the signer for the HTLC input.
47490 void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
47493 * The number of the commitment transaction in which the HTLC output lives.
47495 uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47498 * The number of the commitment transaction in which the HTLC output lives.
47500 void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val);
47503 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
47504 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
47505 * arrive at unique keys per commitment.
47507 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
47509 struct LDKPublicKey HTLCDescriptor_get_per_commitment_point(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47512 * The key tweak corresponding to the number of the commitment transaction in which the HTLC
47513 * output lives. This tweak is applied to all the basepoints for both parties in the channel to
47514 * arrive at unique keys per commitment.
47516 * See <https://github.com/lightning/bolts/blob/master/03-transactions.md#keys> for more info.
47518 void HTLCDescriptor_set_per_commitment_point(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKPublicKey val);
47521 * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
47522 * originating from a channel supporting anchor outputs, otherwise it is the channel's
47523 * negotiated feerate at the time the commitment transaction was built.
47525 uint32_t HTLCDescriptor_get_feerate_per_kw(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47528 * The feerate to use on the HTLC claiming transaction. This is always `0` for HTLCs
47529 * originating from a channel supporting anchor outputs, otherwise it is the channel's
47530 * negotiated feerate at the time the commitment transaction was built.
47532 void HTLCDescriptor_set_feerate_per_kw(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint32_t val);
47535 * The details of the HTLC as it appears in the commitment transaction.
47537 struct LDKHTLCOutputInCommitment HTLCDescriptor_get_htlc(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47540 * The details of the HTLC as it appears in the commitment transaction.
47542 void HTLCDescriptor_set_htlc(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKHTLCOutputInCommitment val);
47545 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
47548 struct LDKCOption_ThirtyTwoBytesZ HTLCDescriptor_get_preimage(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47551 * The preimage, if `Some`, to claim the HTLC output with. If `None`, the timeout path must be
47554 void HTLCDescriptor_set_preimage(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val);
47557 * The counterparty's signature required to spend the HTLC output.
47559 struct LDKECDSASignature HTLCDescriptor_get_counterparty_sig(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr);
47562 * The counterparty's signature required to spend the HTLC output.
47564 void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val);
47567 * Creates a copy of the HTLCDescriptor
47569 struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig);
47572 * Checks if two HTLCDescriptors contain equal inner contents.
47573 * This ignores pointers and is_owned flags and looks at the values in fields.
47574 * Two objects with NULL inner values will be considered "equal" here.
47576 bool HTLCDescriptor_eq(const struct LDKHTLCDescriptor *NONNULL_PTR a, const struct LDKHTLCDescriptor *NONNULL_PTR b);
47579 * Serialize the HTLCDescriptor object into a byte array which can be read by HTLCDescriptor_read
47581 struct LDKCVec_u8Z HTLCDescriptor_write(const struct LDKHTLCDescriptor *NONNULL_PTR obj);
47584 * Read a HTLCDescriptor from a byte array, created by HTLCDescriptor_write
47586 struct LDKCResult_HTLCDescriptorDecodeErrorZ HTLCDescriptor_read(struct LDKu8slice ser);
47589 * Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
47590 * being spent by the HTLC input in the HTLC transaction.
47592 MUST_USE_RES struct LDKOutPoint HTLCDescriptor_outpoint(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
47595 * Returns the UTXO to be spent by the HTLC input, which can be obtained via
47596 * [`Self::unsigned_tx_input`].
47598 MUST_USE_RES struct LDKTxOut HTLCDescriptor_previous_utxo(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
47601 * Returns the unsigned transaction input spending the HTLC output in the commitment
47604 MUST_USE_RES struct LDKTxIn HTLCDescriptor_unsigned_tx_input(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
47607 * Returns the delayed output created as a result of spending the HTLC output in the commitment
47610 MUST_USE_RES struct LDKTxOut HTLCDescriptor_tx_output(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
47613 * Returns the witness script of the HTLC output in the commitment transaction.
47615 MUST_USE_RES struct LDKCVec_u8Z HTLCDescriptor_witness_script(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg);
47618 * Returns the fully signed witness required to spend the HTLC output in the commitment
47621 MUST_USE_RES struct LDKWitness HTLCDescriptor_tx_input_witness(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature, struct LDKu8slice witness_script);
47624 * Derives the channel signer required to sign the HTLC input.
47626 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner HTLCDescriptor_derive_channel_signer(const struct LDKHTLCDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
47629 * Calls the free function if one is set
47631 void ChannelSigner_free(struct LDKChannelSigner this_ptr);
47634 * Creates a copy of the Recipient
47636 enum LDKRecipient Recipient_clone(const enum LDKRecipient *NONNULL_PTR orig);
47639 * Utility method to constructs a new Node-variant Recipient
47641 enum LDKRecipient Recipient_node(void);
47644 * Utility method to constructs a new PhantomNode-variant Recipient
47646 enum LDKRecipient Recipient_phantom_node(void);
47649 * Calls the free function if one is set
47651 void EntropySource_free(struct LDKEntropySource this_ptr);
47654 * Calls the free function if one is set
47656 void NodeSigner_free(struct LDKNodeSigner this_ptr);
47659 * Calls the free function if one is set
47661 void SignerProvider_free(struct LDKSignerProvider this_ptr);
47664 * Frees any resources used by the InMemorySigner, if is_owned is set and inner is non-NULL.
47666 void InMemorySigner_free(struct LDKInMemorySigner this_obj);
47669 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
47670 * holder's anchor output in a commitment transaction, if one is present.
47672 const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
47675 * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the
47676 * holder's anchor output in a commitment transaction, if one is present.
47678 void InMemorySigner_set_funding_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
47681 * Holder secret key for blinded revocation pubkey.
47683 const uint8_t (*InMemorySigner_get_revocation_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
47686 * Holder secret key for blinded revocation pubkey.
47688 void InMemorySigner_set_revocation_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
47691 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
47693 const uint8_t (*InMemorySigner_get_payment_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
47696 * Holder secret key used for our balance in counterparty-broadcasted commitment transactions.
47698 void InMemorySigner_set_payment_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
47701 * Holder secret key used in an HTLC transaction.
47703 const uint8_t (*InMemorySigner_get_delayed_payment_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
47706 * Holder secret key used in an HTLC transaction.
47708 void InMemorySigner_set_delayed_payment_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
47711 * Holder HTLC secret key used in commitment transaction HTLC outputs.
47713 const uint8_t (*InMemorySigner_get_htlc_base_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
47716 * Holder HTLC secret key used in commitment transaction HTLC outputs.
47718 void InMemorySigner_set_htlc_base_key(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKSecretKey val);
47723 const uint8_t (*InMemorySigner_get_commitment_seed(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32];
47728 void InMemorySigner_set_commitment_seed(struct LDKInMemorySigner *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
47731 * Creates a copy of the InMemorySigner
47733 struct LDKInMemorySigner InMemorySigner_clone(const struct LDKInMemorySigner *NONNULL_PTR orig);
47736 * Creates a new [`InMemorySigner`].
47738 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);
47741 * Returns the counterparty's pubkeys.
47743 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47744 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47746 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47748 MUST_USE_RES struct LDKChannelPublicKeys InMemorySigner_counterparty_pubkeys(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47751 * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable
47752 * transactions, i.e., the amount of time that we have to wait to recover our funds if we
47753 * broadcast a transaction.
47755 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47756 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47758 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_counterparty_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47761 * Returns the `contest_delay` value specified by us and applied on transactions broadcastable
47762 * by our counterparty, i.e., the amount of time that they have to wait to recover their funds
47763 * if they broadcast a transaction.
47765 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47766 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47768 MUST_USE_RES struct LDKCOption_u16Z InMemorySigner_holder_selected_contest_delay(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47771 * Returns whether the holder is the initiator.
47773 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47774 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47776 MUST_USE_RES struct LDKCOption_boolZ InMemorySigner_is_outbound(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47781 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47782 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47784 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47786 MUST_USE_RES struct LDKOutPoint InMemorySigner_funding_outpoint(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47789 * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or
47790 * building transactions.
47792 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47793 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47795 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47797 MUST_USE_RES struct LDKChannelTransactionParameters InMemorySigner_get_channel_parameters(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47800 * Returns the channel type features of the channel parameters. Should be helpful for
47801 * determining a channel's category, i. e. legacy/anchors/taproot/etc.
47803 * Will return `None` if [`ChannelSigner::provide_channel_parameters`] has not been called.
47804 * In general, this is safe to `unwrap` only in [`ChannelSigner`] implementation.
47806 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
47808 MUST_USE_RES struct LDKChannelTypeFeatures InMemorySigner_channel_type_features(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47811 * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described
47812 * by `descriptor`, returning the witness stack for the input.
47814 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
47815 * is not spending the outpoint described by [`descriptor.outpoint`],
47816 * or if an output descriptor `script_pubkey` does not match the one we can spend.
47818 * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint
47820 MUST_USE_RES struct LDKCResult_WitnessNoneZ 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);
47823 * Sign the single input of `spend_tx` at index `input_idx` which spends the output
47824 * described by `descriptor`, returning the witness stack for the input.
47826 * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`,
47827 * is not spending the outpoint described by [`descriptor.outpoint`], does not have a
47828 * sequence set to [`descriptor.to_self_delay`], or if an output descriptor
47829 * `script_pubkey` does not match the one we can spend.
47831 * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint
47832 * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay
47834 MUST_USE_RES struct LDKCResult_WitnessNoneZ 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);
47837 * Constructs a new EntropySource which calls the relevant methods on this_arg.
47838 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
47840 struct LDKEntropySource InMemorySigner_as_EntropySource(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47843 * Constructs a new ChannelSigner which calls the relevant methods on this_arg.
47844 * This copies the `inner` pointer in this_arg and thus the returned ChannelSigner must be freed before this_arg is
47846 struct LDKChannelSigner InMemorySigner_as_ChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47849 * Constructs a new EcdsaChannelSigner which calls the relevant methods on this_arg.
47850 * This copies the `inner` pointer in this_arg and thus the returned EcdsaChannelSigner must be freed before this_arg is
47852 struct LDKEcdsaChannelSigner InMemorySigner_as_EcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47855 * Constructs a new WriteableEcdsaChannelSigner which calls the relevant methods on this_arg.
47856 * This copies the `inner` pointer in this_arg and thus the returned WriteableEcdsaChannelSigner must be freed before this_arg is
47858 struct LDKWriteableEcdsaChannelSigner InMemorySigner_as_WriteableEcdsaChannelSigner(const struct LDKInMemorySigner *NONNULL_PTR this_arg);
47861 * Serialize the InMemorySigner object into a byte array which can be read by InMemorySigner_read
47863 struct LDKCVec_u8Z InMemorySigner_write(const struct LDKInMemorySigner *NONNULL_PTR obj);
47866 * Read a InMemorySigner from a byte array, created by InMemorySigner_write
47868 struct LDKCResult_InMemorySignerDecodeErrorZ InMemorySigner_read(struct LDKu8slice ser, struct LDKEntropySource arg);
47871 * Frees any resources used by the KeysManager, if is_owned is set and inner is non-NULL.
47873 void KeysManager_free(struct LDKKeysManager this_obj);
47876 * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g.,
47877 * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds).
47878 * `starting_time` isn't strictly required to actually be a time, but it must absolutely,
47879 * without a doubt, be unique to this instance. ie if you start multiple times with the same
47880 * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this
47881 * is to simply use the current time (with very high precision).
47883 * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however,
47884 * obviously, `starting_time` should be unique every time you reload the library - it is only
47885 * used to generate new ephemeral key data (which will be stored by the individual channel if
47888 * Note that the seed is required to recover certain on-chain funds independent of
47889 * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required
47890 * for any channel, and some on-chain during-closing funds.
47892 * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
47894 MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos);
47897 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
47899 MUST_USE_RES struct LDKSecretKey KeysManager_get_node_secret_key(const struct LDKKeysManager *NONNULL_PTR this_arg);
47902 * Derive an old [`WriteableEcdsaChannelSigner`] containing per-channel secrets based on a key derivation parameters.
47904 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]);
47907 * Signs the given [`PartiallySignedTransaction`] which spends the given [`SpendableOutputDescriptor`]s.
47908 * The resulting inputs will be finalized and the PSBT will be ready for broadcast if there
47909 * are no other inputs that need signing.
47911 * Returns `Err(())` if the PSBT is missing a descriptor or if we fail to sign.
47913 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
47914 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
47916 MUST_USE_RES struct LDKCResult_CVec_u8ZNoneZ KeysManager_sign_spendable_outputs_psbt(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_u8Z psbt);
47919 * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an
47920 * output to the given change destination (if sufficient change value remains). The
47921 * transaction will have a feerate, at least, of the given value.
47923 * The `locktime` argument is used to set the transaction's locktime. If `None`, the
47924 * transaction will have a locktime of 0. It it recommended to set this to the current block
47925 * height to avoid fee sniping, unless you have some specific reason to use a different
47928 * Returns `Err(())` if the output value is greater than the input value minus required fee,
47929 * if a descriptor was duplicated, or if an output descriptor `script_pubkey`
47930 * does not match the one we can spend.
47932 * We do not enforce that outputs meet the dust limit or that any output scripts are standard.
47934 * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used
47935 * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`].
47937 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_u32Z locktime);
47940 * Constructs a new EntropySource which calls the relevant methods on this_arg.
47941 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
47943 struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg);
47946 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
47947 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
47949 struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg);
47952 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
47953 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
47955 struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg);
47958 * Frees any resources used by the PhantomKeysManager, if is_owned is set and inner is non-NULL.
47960 void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj);
47963 * Constructs a new EntropySource which calls the relevant methods on this_arg.
47964 * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is
47966 struct LDKEntropySource PhantomKeysManager_as_EntropySource(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
47969 * Constructs a new NodeSigner which calls the relevant methods on this_arg.
47970 * This copies the `inner` pointer in this_arg and thus the returned NodeSigner must be freed before this_arg is
47972 struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
47975 * Constructs a new SignerProvider which calls the relevant methods on this_arg.
47976 * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is
47978 struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
47981 * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed`
47982 * that is shared across all nodes that intend to participate in [phantom node payments]
47985 * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and
47986 * `starting_time_nanos`.
47988 * `cross_node_seed` must be the same across all phantom payment-receiving nodes and also the
47989 * same across restarts, or else inbound payments may fail.
47991 * [phantom node payments]: PhantomKeysManager
47993 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]);
47996 * See [`KeysManager::spend_spendable_outputs`] for documentation on this method.
47998 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_u32Z locktime);
48001 * See [`KeysManager::derive_channel_keys`] for documentation on this method.
48003 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]);
48006 * Gets the \"node_id\" secret key used to sign gossip announcements, decode onion data, etc.
48008 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
48011 * Gets the \"node_id\" secret key of the phantom node used to sign invoices, decode the
48012 * last-hop onion data, etc.
48014 MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg);
48017 * Calls the free function if one is set
48019 void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr);
48022 * Creates a copy of a WriteableEcdsaChannelSigner
48024 struct LDKWriteableEcdsaChannelSigner WriteableEcdsaChannelSigner_clone(const struct LDKWriteableEcdsaChannelSigner *NONNULL_PTR orig);
48027 * Calls the free function if one is set
48029 void WriteableEcdsaChannelSigner_free(struct LDKWriteableEcdsaChannelSigner this_ptr);
48032 * Frees any resources used by the OnionMessenger, if is_owned is set and inner is non-NULL.
48034 void OnionMessenger_free(struct LDKOnionMessenger this_obj);
48037 * Calls the free function if one is set
48039 void MessageRouter_free(struct LDKMessageRouter this_ptr);
48042 * Frees any resources used by the DefaultMessageRouter, if is_owned is set and inner is non-NULL.
48044 void DefaultMessageRouter_free(struct LDKDefaultMessageRouter this_obj);
48047 * Creates a [`DefaultMessageRouter`] using the given [`NetworkGraph`].
48049 MUST_USE_RES struct LDKDefaultMessageRouter DefaultMessageRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKEntropySource entropy_source);
48052 * Constructs a new MessageRouter which calls the relevant methods on this_arg.
48053 * This copies the `inner` pointer in this_arg and thus the returned MessageRouter must be freed before this_arg is
48055 struct LDKMessageRouter DefaultMessageRouter_as_MessageRouter(const struct LDKDefaultMessageRouter *NONNULL_PTR this_arg);
48058 * Frees any resources used by the OnionMessagePath, if is_owned is set and inner is non-NULL.
48060 void OnionMessagePath_free(struct LDKOnionMessagePath this_obj);
48063 * Nodes on the path between the sender and the destination.
48065 * Returns a copy of the field.
48067 struct LDKCVec_PublicKeyZ OnionMessagePath_get_intermediate_nodes(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
48070 * Nodes on the path between the sender and the destination.
48072 void OnionMessagePath_set_intermediate_nodes(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCVec_PublicKeyZ val);
48075 * The recipient of the message.
48077 struct LDKDestination OnionMessagePath_get_destination(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
48080 * The recipient of the message.
48082 void OnionMessagePath_set_destination(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKDestination val);
48085 * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
48087 * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
48088 * this to initiate such a connection.
48090 * Returns a copy of the field.
48092 struct LDKCOption_CVec_SocketAddressZZ OnionMessagePath_get_first_node_addresses(const struct LDKOnionMessagePath *NONNULL_PTR this_ptr);
48095 * Addresses that may be used to connect to [`OnionMessagePath::first_node`].
48097 * Only needs to be set if a connection to the node is required. [`OnionMessenger`] may use
48098 * this to initiate such a connection.
48100 void OnionMessagePath_set_first_node_addresses(struct LDKOnionMessagePath *NONNULL_PTR this_ptr, struct LDKCOption_CVec_SocketAddressZZ val);
48103 * Constructs a new OnionMessagePath given each field
48105 MUST_USE_RES struct LDKOnionMessagePath OnionMessagePath_new(struct LDKCVec_PublicKeyZ intermediate_nodes_arg, struct LDKDestination destination_arg, struct LDKCOption_CVec_SocketAddressZZ first_node_addresses_arg);
48108 * Creates a copy of the OnionMessagePath
48110 struct LDKOnionMessagePath OnionMessagePath_clone(const struct LDKOnionMessagePath *NONNULL_PTR orig);
48113 * Returns the first node in the path.
48115 MUST_USE_RES struct LDKPublicKey OnionMessagePath_first_node(const struct LDKOnionMessagePath *NONNULL_PTR this_arg);
48118 * Frees any resources used by the Destination
48120 void Destination_free(struct LDKDestination this_ptr);
48123 * Creates a copy of the Destination
48125 struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig);
48128 * Utility method to constructs a new Node-variant Destination
48130 struct LDKDestination Destination_node(struct LDKPublicKey a);
48133 * Utility method to constructs a new BlindedPath-variant Destination
48135 struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a);
48138 * Frees any resources used by the SendSuccess
48140 void SendSuccess_free(struct LDKSendSuccess this_ptr);
48143 * Creates a copy of the SendSuccess
48145 struct LDKSendSuccess SendSuccess_clone(const struct LDKSendSuccess *NONNULL_PTR orig);
48148 * Utility method to constructs a new Buffered-variant SendSuccess
48150 struct LDKSendSuccess SendSuccess_buffered(void);
48153 * Utility method to constructs a new BufferedAwaitingConnection-variant SendSuccess
48155 struct LDKSendSuccess SendSuccess_buffered_awaiting_connection(struct LDKPublicKey a);
48158 * Checks if two SendSuccesss contain equal inner contents.
48159 * This ignores pointers and is_owned flags and looks at the values in fields.
48161 bool SendSuccess_eq(const struct LDKSendSuccess *NONNULL_PTR a, const struct LDKSendSuccess *NONNULL_PTR b);
48164 * Frees any resources used by the SendError
48166 void SendError_free(struct LDKSendError this_ptr);
48169 * Creates a copy of the SendError
48171 struct LDKSendError SendError_clone(const struct LDKSendError *NONNULL_PTR orig);
48174 * Utility method to constructs a new Secp256k1-variant SendError
48176 struct LDKSendError SendError_secp256k1(enum LDKSecp256k1Error a);
48179 * Utility method to constructs a new TooBigPacket-variant SendError
48181 struct LDKSendError SendError_too_big_packet(void);
48184 * Utility method to constructs a new TooFewBlindedHops-variant SendError
48186 struct LDKSendError SendError_too_few_blinded_hops(void);
48189 * Utility method to constructs a new InvalidFirstHop-variant SendError
48191 struct LDKSendError SendError_invalid_first_hop(struct LDKPublicKey a);
48194 * Utility method to constructs a new PathNotFound-variant SendError
48196 struct LDKSendError SendError_path_not_found(void);
48199 * Utility method to constructs a new InvalidMessage-variant SendError
48201 struct LDKSendError SendError_invalid_message(void);
48204 * Utility method to constructs a new BufferFull-variant SendError
48206 struct LDKSendError SendError_buffer_full(void);
48209 * Utility method to constructs a new GetNodeIdFailed-variant SendError
48211 struct LDKSendError SendError_get_node_id_failed(void);
48214 * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError
48216 struct LDKSendError SendError_blinded_path_advance_failed(void);
48219 * Checks if two SendErrors contain equal inner contents.
48220 * This ignores pointers and is_owned flags and looks at the values in fields.
48222 bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
48225 * Calls the free function if one is set
48227 void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
48230 * Frees any resources used by the PeeledOnion
48232 void PeeledOnion_free(struct LDKPeeledOnion this_ptr);
48235 * Creates a copy of the PeeledOnion
48237 struct LDKPeeledOnion PeeledOnion_clone(const struct LDKPeeledOnion *NONNULL_PTR orig);
48240 * Utility method to constructs a new Forward-variant PeeledOnion
48242 struct LDKPeeledOnion PeeledOnion_forward(struct LDKPublicKey a, struct LDKOnionMessage b);
48245 * Utility method to constructs a new Receive-variant PeeledOnion
48247 struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKThirtyTwoBytes b, struct LDKBlindedPath c);
48250 * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of
48253 * Returns the node id of the peer to send the message to, the message itself, and any addresses
48254 * need to connect to the first node.
48256 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
48258 struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path);
48261 * Decode one layer of an incoming [`OnionMessage`].
48263 * Returns either the next layer of the onion for forwarding or the decrypted content for the
48266 struct LDKCResult_PeeledOnionNoneZ peel_onion_message(const struct LDKOnionMessage *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
48269 * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
48270 * their respective handlers.
48272 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);
48275 * Sends an [`OnionMessage`] with the given `contents` to `destination`.
48277 * See [`OnionMessenger`] for example usage.
48279 * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
48281 MUST_USE_RES struct LDKCResult_SendSuccessSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessageContents contents, struct LDKDestination destination, struct LDKBlindedPath reply_path);
48284 * Constructs a new OnionMessageHandler which calls the relevant methods on this_arg.
48285 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageHandler must be freed before this_arg is
48287 struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
48290 * Calls the free function if one is set
48292 void OffersMessageHandler_free(struct LDKOffersMessageHandler this_ptr);
48295 * Frees any resources used by the OffersMessage
48297 void OffersMessage_free(struct LDKOffersMessage this_ptr);
48300 * Creates a copy of the OffersMessage
48302 struct LDKOffersMessage OffersMessage_clone(const struct LDKOffersMessage *NONNULL_PTR orig);
48305 * Utility method to constructs a new InvoiceRequest-variant OffersMessage
48307 struct LDKOffersMessage OffersMessage_invoice_request(struct LDKInvoiceRequest a);
48310 * Utility method to constructs a new Invoice-variant OffersMessage
48312 struct LDKOffersMessage OffersMessage_invoice(struct LDKBolt12Invoice a);
48315 * Utility method to constructs a new InvoiceError-variant OffersMessage
48317 struct LDKOffersMessage OffersMessage_invoice_error(struct LDKInvoiceError a);
48320 * Returns whether `tlv_type` corresponds to a TLV record for Offers.
48322 MUST_USE_RES bool OffersMessage_is_known_type(uint64_t tlv_type);
48325 * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
48326 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
48328 struct LDKOnionMessageContents OffersMessage_as_OnionMessageContents(const struct LDKOffersMessage *NONNULL_PTR this_arg);
48331 * Serialize the OffersMessage object into a byte array which can be read by OffersMessage_read
48333 struct LDKCVec_u8Z OffersMessage_write(const struct LDKOffersMessage *NONNULL_PTR obj);
48336 * Read a OffersMessage from a byte array, created by OffersMessage_write
48338 struct LDKCResult_OffersMessageDecodeErrorZ OffersMessage_read(struct LDKu8slice ser, uint64_t arg_a, const struct LDKLogger *NONNULL_PTR arg_b);
48341 * Frees any resources used by the Packet, if is_owned is set and inner is non-NULL.
48343 void Packet_free(struct LDKPacket this_obj);
48346 * Bolt 04 version number
48348 uint8_t Packet_get_version(const struct LDKPacket *NONNULL_PTR this_ptr);
48351 * Bolt 04 version number
48353 void Packet_set_version(struct LDKPacket *NONNULL_PTR this_ptr, uint8_t val);
48356 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
48358 struct LDKPublicKey Packet_get_public_key(const struct LDKPacket *NONNULL_PTR this_ptr);
48361 * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data
48363 void Packet_set_public_key(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val);
48366 * Encrypted payload for the next hop
48368 * Returns a copy of the field.
48370 struct LDKCVec_u8Z Packet_get_hop_data(const struct LDKPacket *NONNULL_PTR this_ptr);
48373 * Encrypted payload for the next hop
48375 void Packet_set_hop_data(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
48378 * HMAC to verify the integrity of hop_data
48380 const uint8_t (*Packet_get_hmac(const struct LDKPacket *NONNULL_PTR this_ptr))[32];
48383 * HMAC to verify the integrity of hop_data
48385 void Packet_set_hmac(struct LDKPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
48388 * Constructs a new Packet given each field
48390 MUST_USE_RES struct LDKPacket Packet_new(uint8_t version_arg, struct LDKPublicKey public_key_arg, struct LDKCVec_u8Z hop_data_arg, struct LDKThirtyTwoBytes hmac_arg);
48393 * Creates a copy of the Packet
48395 struct LDKPacket Packet_clone(const struct LDKPacket *NONNULL_PTR orig);
48398 * Generates a non-cryptographic 64-bit hash of the Packet.
48400 uint64_t Packet_hash(const struct LDKPacket *NONNULL_PTR o);
48403 * Checks if two Packets contain equal inner contents.
48404 * This ignores pointers and is_owned flags and looks at the values in fields.
48405 * Two objects with NULL inner values will be considered "equal" here.
48407 bool Packet_eq(const struct LDKPacket *NONNULL_PTR a, const struct LDKPacket *NONNULL_PTR b);
48410 * Serialize the Packet object into a byte array which can be read by Packet_read
48412 struct LDKCVec_u8Z Packet_write(const struct LDKPacket *NONNULL_PTR obj);
48415 * Frees any resources used by the ParsedOnionMessageContents
48417 void ParsedOnionMessageContents_free(struct LDKParsedOnionMessageContents this_ptr);
48420 * Creates a copy of the ParsedOnionMessageContents
48422 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_clone(const struct LDKParsedOnionMessageContents *NONNULL_PTR orig);
48425 * Utility method to constructs a new Offers-variant ParsedOnionMessageContents
48427 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_offers(struct LDKOffersMessage a);
48430 * Utility method to constructs a new Custom-variant ParsedOnionMessageContents
48432 struct LDKParsedOnionMessageContents ParsedOnionMessageContents_custom(struct LDKOnionMessageContents a);
48435 * Constructs a new OnionMessageContents which calls the relevant methods on this_arg.
48436 * This copies the `inner` pointer in this_arg and thus the returned OnionMessageContents must be freed before this_arg is
48438 struct LDKOnionMessageContents ParsedOnionMessageContents_as_OnionMessageContents(const struct LDKParsedOnionMessageContents *NONNULL_PTR this_arg);
48441 * Serialize the ParsedOnionMessageContents object into a byte array which can be read by ParsedOnionMessageContents_read
48443 struct LDKCVec_u8Z ParsedOnionMessageContents_write(const struct LDKParsedOnionMessageContents *NONNULL_PTR obj);
48446 * Creates a copy of a OnionMessageContents
48448 struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig);
48451 * Calls the free function if one is set
48453 void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr);
48456 * Frees any resources used by the BlindedPath, if is_owned is set and inner is non-NULL.
48458 void BlindedPath_free(struct LDKBlindedPath this_obj);
48461 * To send to a blinded path, the sender first finds a route to the unblinded
48462 * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
48463 * message or payment's next hop and forward it along.
48465 * [`encrypted_payload`]: BlindedHop::encrypted_payload
48467 struct LDKPublicKey BlindedPath_get_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
48470 * To send to a blinded path, the sender first finds a route to the unblinded
48471 * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion
48472 * message or payment's next hop and forward it along.
48474 * [`encrypted_payload`]: BlindedHop::encrypted_payload
48476 void BlindedPath_set_introduction_node_id(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
48479 * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
48480 * message or payment.
48482 * [`encrypted_payload`]: BlindedHop::encrypted_payload
48484 struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
48487 * Used by the introduction node to decrypt its [`encrypted_payload`] to forward the onion
48488 * message or payment.
48490 * [`encrypted_payload`]: BlindedHop::encrypted_payload
48492 void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val);
48495 * The hops composing the blinded path.
48497 struct LDKCVec_BlindedHopZ BlindedPath_get_blinded_hops(const struct LDKBlindedPath *NONNULL_PTR this_ptr);
48500 * The hops composing the blinded path.
48502 void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val);
48505 * Constructs a new BlindedPath given each field
48507 MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKPublicKey introduction_node_id_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg);
48510 * Creates a copy of the BlindedPath
48512 struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig);
48515 * Generates a non-cryptographic 64-bit hash of the BlindedPath.
48517 uint64_t BlindedPath_hash(const struct LDKBlindedPath *NONNULL_PTR o);
48520 * Checks if two BlindedPaths contain equal inner contents.
48521 * This ignores pointers and is_owned flags and looks at the values in fields.
48522 * Two objects with NULL inner values will be considered "equal" here.
48524 bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b);
48527 * Frees any resources used by the BlindedHop, if is_owned is set and inner is non-NULL.
48529 void BlindedHop_free(struct LDKBlindedHop this_obj);
48532 * The blinded node id of this hop in a [`BlindedPath`].
48534 struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
48537 * The blinded node id of this hop in a [`BlindedPath`].
48539 void BlindedHop_set_blinded_node_id(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKPublicKey val);
48542 * The encrypted payload intended for this hop in a [`BlindedPath`].
48544 * Returns a copy of the field.
48546 struct LDKCVec_u8Z BlindedHop_get_encrypted_payload(const struct LDKBlindedHop *NONNULL_PTR this_ptr);
48549 * The encrypted payload intended for this hop in a [`BlindedPath`].
48551 void BlindedHop_set_encrypted_payload(struct LDKBlindedHop *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val);
48554 * Constructs a new BlindedHop given each field
48556 MUST_USE_RES struct LDKBlindedHop BlindedHop_new(struct LDKPublicKey blinded_node_id_arg, struct LDKCVec_u8Z encrypted_payload_arg);
48559 * Creates a copy of the BlindedHop
48561 struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig);
48564 * Generates a non-cryptographic 64-bit hash of the BlindedHop.
48566 uint64_t BlindedHop_hash(const struct LDKBlindedHop *NONNULL_PTR o);
48569 * Checks if two BlindedHops contain equal inner contents.
48570 * This ignores pointers and is_owned flags and looks at the values in fields.
48571 * Two objects with NULL inner values will be considered "equal" here.
48573 bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b);
48576 * Create a one-hop blinded path for a message.
48578 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_one_hop_for_message(struct LDKPublicKey recipient_node_id, const struct LDKEntropySource *NONNULL_PTR entropy_source);
48581 * Create a blinded path for an onion message, to be forwarded along `node_pks`. The last node
48582 * pubkey in `node_pks` will be the destination node.
48584 * Errors if no hops are provided or if `node_pk`(s) are invalid.
48586 MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, const struct LDKEntropySource *NONNULL_PTR entropy_source);
48589 * Create a one-hop blinded path for a payment.
48591 MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, const struct LDKEntropySource *NONNULL_PTR entropy_source);
48594 * Create a blinded path for a payment, to be forwarded along `intermediate_nodes`.
48597 * * a provided node id is invalid
48598 * * [`BlindedPayInfo`] calculation results in an integer overflow
48599 * * any unknown features are required in the provided [`ForwardTlvs`]
48601 * [`ForwardTlvs`]: crate::blinded_path::payment::ForwardTlvs
48603 MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_new_for_payment(struct LDKCVec_ForwardNodeZ intermediate_nodes, struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint64_t htlc_maximum_msat, const struct LDKEntropySource *NONNULL_PTR entropy_source);
48606 * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read
48608 struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj);
48611 * Read a BlindedPath from a byte array, created by BlindedPath_write
48613 struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser);
48616 * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read
48618 struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj);
48621 * Read a BlindedHop from a byte array, created by BlindedHop_write
48623 struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser);
48626 * Frees any resources used by the ForwardNode, if is_owned is set and inner is non-NULL.
48628 void ForwardNode_free(struct LDKForwardNode this_obj);
48631 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
48632 * used for [`BlindedPayInfo`] construction.
48634 struct LDKForwardTlvs ForwardNode_get_tlvs(const struct LDKForwardNode *NONNULL_PTR this_ptr);
48637 * The TLVs for this node's [`BlindedHop`], where the fee parameters contained within are also
48638 * used for [`BlindedPayInfo`] construction.
48640 void ForwardNode_set_tlvs(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKForwardTlvs val);
48643 * This node's pubkey.
48645 struct LDKPublicKey ForwardNode_get_node_id(const struct LDKForwardNode *NONNULL_PTR this_ptr);
48648 * This node's pubkey.
48650 void ForwardNode_set_node_id(struct LDKForwardNode *NONNULL_PTR this_ptr, struct LDKPublicKey val);
48653 * The maximum value, in msat, that may be accepted by this node.
48655 uint64_t ForwardNode_get_htlc_maximum_msat(const struct LDKForwardNode *NONNULL_PTR this_ptr);
48658 * The maximum value, in msat, that may be accepted by this node.
48660 void ForwardNode_set_htlc_maximum_msat(struct LDKForwardNode *NONNULL_PTR this_ptr, uint64_t val);
48663 * Constructs a new ForwardNode given each field
48665 MUST_USE_RES struct LDKForwardNode ForwardNode_new(struct LDKForwardTlvs tlvs_arg, struct LDKPublicKey node_id_arg, uint64_t htlc_maximum_msat_arg);
48668 * Creates a copy of the ForwardNode
48670 struct LDKForwardNode ForwardNode_clone(const struct LDKForwardNode *NONNULL_PTR orig);
48673 * Frees any resources used by the ForwardTlvs, if is_owned is set and inner is non-NULL.
48675 void ForwardTlvs_free(struct LDKForwardTlvs this_obj);
48678 * The short channel id this payment should be forwarded out over.
48680 uint64_t ForwardTlvs_get_short_channel_id(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
48683 * The short channel id this payment should be forwarded out over.
48685 void ForwardTlvs_set_short_channel_id(struct LDKForwardTlvs *NONNULL_PTR this_ptr, uint64_t val);
48688 * Payment parameters for relaying over [`Self::short_channel_id`].
48690 struct LDKPaymentRelay ForwardTlvs_get_payment_relay(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
48693 * Payment parameters for relaying over [`Self::short_channel_id`].
48695 void ForwardTlvs_set_payment_relay(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentRelay val);
48698 * Payment constraints for relaying over [`Self::short_channel_id`].
48700 struct LDKPaymentConstraints ForwardTlvs_get_payment_constraints(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
48703 * Payment constraints for relaying over [`Self::short_channel_id`].
48705 void ForwardTlvs_set_payment_constraints(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
48708 * Supported and required features when relaying a payment onion containing this object's
48709 * corresponding [`BlindedHop::encrypted_payload`].
48711 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
48713 struct LDKBlindedHopFeatures ForwardTlvs_get_features(const struct LDKForwardTlvs *NONNULL_PTR this_ptr);
48716 * Supported and required features when relaying a payment onion containing this object's
48717 * corresponding [`BlindedHop::encrypted_payload`].
48719 * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload
48721 void ForwardTlvs_set_features(struct LDKForwardTlvs *NONNULL_PTR this_ptr, struct LDKBlindedHopFeatures val);
48724 * Constructs a new ForwardTlvs given each field
48726 MUST_USE_RES struct LDKForwardTlvs ForwardTlvs_new(uint64_t short_channel_id_arg, struct LDKPaymentRelay payment_relay_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKBlindedHopFeatures features_arg);
48729 * Creates a copy of the ForwardTlvs
48731 struct LDKForwardTlvs ForwardTlvs_clone(const struct LDKForwardTlvs *NONNULL_PTR orig);
48734 * Frees any resources used by the ReceiveTlvs, if is_owned is set and inner is non-NULL.
48736 void ReceiveTlvs_free(struct LDKReceiveTlvs this_obj);
48739 * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
48741 const uint8_t (*ReceiveTlvs_get_payment_secret(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr))[32];
48744 * Used to authenticate the sender of a payment to the receiver and tie MPP HTLCs together.
48746 void ReceiveTlvs_set_payment_secret(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
48749 * Constraints for the receiver of this payment.
48751 struct LDKPaymentConstraints ReceiveTlvs_get_payment_constraints(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr);
48754 * Constraints for the receiver of this payment.
48756 void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val);
48759 * Constructs a new ReceiveTlvs given each field
48761 MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg);
48764 * Creates a copy of the ReceiveTlvs
48766 struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig);
48769 * Frees any resources used by the PaymentRelay, if is_owned is set and inner is non-NULL.
48771 void PaymentRelay_free(struct LDKPaymentRelay this_obj);
48774 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
48776 uint16_t PaymentRelay_get_cltv_expiry_delta(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
48779 * Number of blocks subtracted from an incoming HTLC's `cltv_expiry` for this [`BlindedHop`].
48781 void PaymentRelay_set_cltv_expiry_delta(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint16_t val);
48784 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
48785 * this [`BlindedHop`], (i.e., 10,000 is 1%).
48787 uint32_t PaymentRelay_get_fee_proportional_millionths(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
48790 * Liquidity fee charged (in millionths of the amount transferred) for relaying a payment over
48791 * this [`BlindedHop`], (i.e., 10,000 is 1%).
48793 void PaymentRelay_set_fee_proportional_millionths(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
48796 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
48798 uint32_t PaymentRelay_get_fee_base_msat(const struct LDKPaymentRelay *NONNULL_PTR this_ptr);
48801 * Base fee charged (in millisatoshi) for relaying a payment over this [`BlindedHop`].
48803 void PaymentRelay_set_fee_base_msat(struct LDKPaymentRelay *NONNULL_PTR this_ptr, uint32_t val);
48806 * Constructs a new PaymentRelay given each field
48808 MUST_USE_RES struct LDKPaymentRelay PaymentRelay_new(uint16_t cltv_expiry_delta_arg, uint32_t fee_proportional_millionths_arg, uint32_t fee_base_msat_arg);
48811 * Creates a copy of the PaymentRelay
48813 struct LDKPaymentRelay PaymentRelay_clone(const struct LDKPaymentRelay *NONNULL_PTR orig);
48816 * Frees any resources used by the PaymentConstraints, if is_owned is set and inner is non-NULL.
48818 void PaymentConstraints_free(struct LDKPaymentConstraints this_obj);
48821 * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
48823 uint32_t PaymentConstraints_get_max_cltv_expiry(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
48826 * The maximum total CLTV that is acceptable when relaying a payment over this [`BlindedHop`].
48828 void PaymentConstraints_set_max_cltv_expiry(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint32_t val);
48831 * The minimum value, in msat, that may be accepted by the node corresponding to this
48834 uint64_t PaymentConstraints_get_htlc_minimum_msat(const struct LDKPaymentConstraints *NONNULL_PTR this_ptr);
48837 * The minimum value, in msat, that may be accepted by the node corresponding to this
48840 void PaymentConstraints_set_htlc_minimum_msat(struct LDKPaymentConstraints *NONNULL_PTR this_ptr, uint64_t val);
48843 * Constructs a new PaymentConstraints given each field
48845 MUST_USE_RES struct LDKPaymentConstraints PaymentConstraints_new(uint32_t max_cltv_expiry_arg, uint64_t htlc_minimum_msat_arg);
48848 * Creates a copy of the PaymentConstraints
48850 struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig);
48853 * Serialize the ForwardTlvs object into a byte array which can be read by ForwardTlvs_read
48855 struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj);
48858 * Serialize the ReceiveTlvs object into a byte array which can be read by ReceiveTlvs_read
48860 struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj);
48863 * Serialize the PaymentRelay object into a byte array which can be read by PaymentRelay_read
48865 struct LDKCVec_u8Z PaymentRelay_write(const struct LDKPaymentRelay *NONNULL_PTR obj);
48868 * Read a PaymentRelay from a byte array, created by PaymentRelay_write
48870 struct LDKCResult_PaymentRelayDecodeErrorZ PaymentRelay_read(struct LDKu8slice ser);
48873 * Serialize the PaymentConstraints object into a byte array which can be read by PaymentConstraints_read
48875 struct LDKCVec_u8Z PaymentConstraints_write(const struct LDKPaymentConstraints *NONNULL_PTR obj);
48878 * Read a PaymentConstraints from a byte array, created by PaymentConstraints_write
48880 struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser);
48883 * Frees any resources used by the PaymentPurpose
48885 void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
48888 * Creates a copy of the PaymentPurpose
48890 struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
48893 * Utility method to constructs a new InvoicePayment-variant PaymentPurpose
48895 struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret);
48898 * Utility method to constructs a new SpontaneousPayment-variant PaymentPurpose
48900 struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a);
48903 * Checks if two PaymentPurposes contain equal inner contents.
48904 * This ignores pointers and is_owned flags and looks at the values in fields.
48906 bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b);
48909 * Returns the preimage for this payment, if it is known.
48911 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ PaymentPurpose_preimage(const struct LDKPaymentPurpose *NONNULL_PTR this_arg);
48914 * Serialize the PaymentPurpose object into a byte array which can be read by PaymentPurpose_read
48916 struct LDKCVec_u8Z PaymentPurpose_write(const struct LDKPaymentPurpose *NONNULL_PTR obj);
48919 * Read a PaymentPurpose from a byte array, created by PaymentPurpose_write
48921 struct LDKCResult_PaymentPurposeDecodeErrorZ PaymentPurpose_read(struct LDKu8slice ser);
48924 * Frees any resources used by the ClaimedHTLC, if is_owned is set and inner is non-NULL.
48926 void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj);
48929 * The `channel_id` of the channel over which the HTLC was received.
48931 const uint8_t (*ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr))[32];
48934 * The `channel_id` of the channel over which the HTLC was received.
48936 void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val);
48939 * The `user_channel_id` of the channel over which the HTLC was received. This is the value
48940 * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
48941 * [`ChannelManager::accept_inbound_channel`] for inbound channels if
48942 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
48943 * `user_channel_id` will be randomized for an inbound channel.
48945 * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
48946 * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
48947 * was not actually claimed until after upgrading.)
48949 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
48950 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
48951 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
48953 struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
48956 * The `user_channel_id` of the channel over which the HTLC was received. This is the value
48957 * passed in to [`ChannelManager::create_channel`] for outbound channels, or to
48958 * [`ChannelManager::accept_inbound_channel`] for inbound channels if
48959 * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise
48960 * `user_channel_id` will be randomized for an inbound channel.
48962 * This field will be zero for a payment that was serialized prior to LDK version 0.0.117. (This
48963 * should only happen in the case that a payment was claimable prior to LDK version 0.0.117, but
48964 * was not actually claimed until after upgrading.)
48966 * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel
48967 * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel
48968 * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels
48970 void ClaimedHTLC_set_user_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKU128 val);
48973 * The block height at which this HTLC expires.
48975 uint32_t ClaimedHTLC_get_cltv_expiry(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
48978 * The block height at which this HTLC expires.
48980 void ClaimedHTLC_set_cltv_expiry(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint32_t val);
48983 * The amount (in msats) of this part of an MPP.
48985 uint64_t ClaimedHTLC_get_value_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
48988 * The amount (in msats) of this part of an MPP.
48990 void ClaimedHTLC_set_value_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
48993 * The extra fee our counterparty skimmed off the top of this HTLC, if any.
48995 * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
48998 uint64_t ClaimedHTLC_get_counterparty_skimmed_fee_msat(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr);
49001 * The extra fee our counterparty skimmed off the top of this HTLC, if any.
49003 * This value will always be 0 for [`ClaimedHTLC`]s serialized with LDK versions prior to
49006 void ClaimedHTLC_set_counterparty_skimmed_fee_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val);
49009 * Constructs a new ClaimedHTLC given each field
49011 MUST_USE_RES struct LDKClaimedHTLC ClaimedHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKU128 user_channel_id_arg, uint32_t cltv_expiry_arg, uint64_t value_msat_arg, uint64_t counterparty_skimmed_fee_msat_arg);
49014 * Creates a copy of the ClaimedHTLC
49016 struct LDKClaimedHTLC ClaimedHTLC_clone(const struct LDKClaimedHTLC *NONNULL_PTR orig);
49019 * Checks if two ClaimedHTLCs contain equal inner contents.
49020 * This ignores pointers and is_owned flags and looks at the values in fields.
49021 * Two objects with NULL inner values will be considered "equal" here.
49023 bool ClaimedHTLC_eq(const struct LDKClaimedHTLC *NONNULL_PTR a, const struct LDKClaimedHTLC *NONNULL_PTR b);
49026 * Serialize the ClaimedHTLC object into a byte array which can be read by ClaimedHTLC_read
49028 struct LDKCVec_u8Z ClaimedHTLC_write(const struct LDKClaimedHTLC *NONNULL_PTR obj);
49031 * Read a ClaimedHTLC from a byte array, created by ClaimedHTLC_write
49033 struct LDKCResult_ClaimedHTLCDecodeErrorZ ClaimedHTLC_read(struct LDKu8slice ser);
49036 * Frees any resources used by the PathFailure
49038 void PathFailure_free(struct LDKPathFailure this_ptr);
49041 * Creates a copy of the PathFailure
49043 struct LDKPathFailure PathFailure_clone(const struct LDKPathFailure *NONNULL_PTR orig);
49046 * Utility method to constructs a new InitialSend-variant PathFailure
49048 struct LDKPathFailure PathFailure_initial_send(struct LDKAPIError err);
49051 * Utility method to constructs a new OnPath-variant PathFailure
49053 struct LDKPathFailure PathFailure_on_path(struct LDKCOption_NetworkUpdateZ network_update);
49056 * Checks if two PathFailures contain equal inner contents.
49057 * This ignores pointers and is_owned flags and looks at the values in fields.
49059 bool PathFailure_eq(const struct LDKPathFailure *NONNULL_PTR a, const struct LDKPathFailure *NONNULL_PTR b);
49062 * Serialize the PathFailure object into a byte array which can be read by PathFailure_read
49064 struct LDKCVec_u8Z PathFailure_write(const struct LDKPathFailure *NONNULL_PTR obj);
49067 * Read a PathFailure from a byte array, created by PathFailure_write
49069 struct LDKCResult_COption_PathFailureZDecodeErrorZ PathFailure_read(struct LDKu8slice ser);
49072 * Frees any resources used by the ClosureReason
49074 void ClosureReason_free(struct LDKClosureReason this_ptr);
49077 * Creates a copy of the ClosureReason
49079 struct LDKClosureReason ClosureReason_clone(const struct LDKClosureReason *NONNULL_PTR orig);
49082 * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason
49084 struct LDKClosureReason ClosureReason_counterparty_force_closed(struct LDKUntrustedString peer_msg);
49087 * Utility method to constructs a new HolderForceClosed-variant ClosureReason
49089 struct LDKClosureReason ClosureReason_holder_force_closed(void);
49092 * Utility method to constructs a new CooperativeClosure-variant ClosureReason
49094 struct LDKClosureReason ClosureReason_cooperative_closure(void);
49097 * Utility method to constructs a new CommitmentTxConfirmed-variant ClosureReason
49099 struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void);
49102 * Utility method to constructs a new FundingTimedOut-variant ClosureReason
49104 struct LDKClosureReason ClosureReason_funding_timed_out(void);
49107 * Utility method to constructs a new ProcessingError-variant ClosureReason
49109 struct LDKClosureReason ClosureReason_processing_error(struct LDKStr err);
49112 * Utility method to constructs a new DisconnectedPeer-variant ClosureReason
49114 struct LDKClosureReason ClosureReason_disconnected_peer(void);
49117 * Utility method to constructs a new OutdatedChannelManager-variant ClosureReason
49119 struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
49122 * Utility method to constructs a new CounterpartyCoopClosedUnfundedChannel-variant ClosureReason
49124 struct LDKClosureReason ClosureReason_counterparty_coop_closed_unfunded_channel(void);
49127 * Utility method to constructs a new FundingBatchClosure-variant ClosureReason
49129 struct LDKClosureReason ClosureReason_funding_batch_closure(void);
49132 * Checks if two ClosureReasons contain equal inner contents.
49133 * This ignores pointers and is_owned flags and looks at the values in fields.
49135 bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
49138 * Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
49140 struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
49143 * Read a ClosureReason from a byte array, created by ClosureReason_write
49145 struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
49148 * Frees any resources used by the HTLCDestination
49150 void HTLCDestination_free(struct LDKHTLCDestination this_ptr);
49153 * Creates a copy of the HTLCDestination
49155 struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig);
49158 * Utility method to constructs a new NextHopChannel-variant HTLCDestination
49160 struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id);
49163 * Utility method to constructs a new UnknownNextHop-variant HTLCDestination
49165 struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid);
49168 * Utility method to constructs a new InvalidForward-variant HTLCDestination
49170 struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid);
49173 * Utility method to constructs a new FailedPayment-variant HTLCDestination
49175 struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
49178 * Checks if two HTLCDestinations contain equal inner contents.
49179 * This ignores pointers and is_owned flags and looks at the values in fields.
49181 bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
49184 * Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
49186 struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
49189 * Read a HTLCDestination from a byte array, created by HTLCDestination_write
49191 struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
49194 * Creates a copy of the PaymentFailureReason
49196 enum LDKPaymentFailureReason PaymentFailureReason_clone(const enum LDKPaymentFailureReason *NONNULL_PTR orig);
49199 * Utility method to constructs a new RecipientRejected-variant PaymentFailureReason
49201 enum LDKPaymentFailureReason PaymentFailureReason_recipient_rejected(void);
49204 * Utility method to constructs a new UserAbandoned-variant PaymentFailureReason
49206 enum LDKPaymentFailureReason PaymentFailureReason_user_abandoned(void);
49209 * Utility method to constructs a new RetriesExhausted-variant PaymentFailureReason
49211 enum LDKPaymentFailureReason PaymentFailureReason_retries_exhausted(void);
49214 * Utility method to constructs a new PaymentExpired-variant PaymentFailureReason
49216 enum LDKPaymentFailureReason PaymentFailureReason_payment_expired(void);
49219 * Utility method to constructs a new RouteNotFound-variant PaymentFailureReason
49221 enum LDKPaymentFailureReason PaymentFailureReason_route_not_found(void);
49224 * Utility method to constructs a new UnexpectedError-variant PaymentFailureReason
49226 enum LDKPaymentFailureReason PaymentFailureReason_unexpected_error(void);
49229 * Checks if two PaymentFailureReasons contain equal inner contents.
49230 * This ignores pointers and is_owned flags and looks at the values in fields.
49232 bool PaymentFailureReason_eq(const enum LDKPaymentFailureReason *NONNULL_PTR a, const enum LDKPaymentFailureReason *NONNULL_PTR b);
49235 * Serialize the PaymentFailureReason object into a byte array which can be read by PaymentFailureReason_read
49237 struct LDKCVec_u8Z PaymentFailureReason_write(const enum LDKPaymentFailureReason *NONNULL_PTR obj);
49240 * Read a PaymentFailureReason from a byte array, created by PaymentFailureReason_write
49242 struct LDKCResult_PaymentFailureReasonDecodeErrorZ PaymentFailureReason_read(struct LDKu8slice ser);
49245 * Frees any resources used by the Event
49247 void Event_free(struct LDKEvent this_ptr);
49250 * Creates a copy of the Event
49252 struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
49255 * Utility method to constructs a new FundingGenerationReady-variant Event
49257 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);
49260 * Utility method to constructs a new PaymentClaimable-variant Event
49262 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 LDKCOption_ThirtyTwoBytesZ via_channel_id, struct LDKCOption_U128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline);
49265 * Utility method to constructs a new PaymentClaimed-variant Event
49267 struct LDKEvent Event_payment_claimed(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose, struct LDKCVec_ClaimedHTLCZ htlcs, struct LDKCOption_u64Z sender_intended_total_msat);
49270 * Utility method to constructs a new ConnectionNeeded-variant Event
49272 struct LDKEvent Event_connection_needed(struct LDKPublicKey node_id, struct LDKCVec_SocketAddressZ addresses);
49275 * Utility method to constructs a new InvoiceRequestFailed-variant Event
49277 struct LDKEvent Event_invoice_request_failed(struct LDKThirtyTwoBytes payment_id);
49280 * Utility method to constructs a new PaymentSent-variant Event
49282 struct LDKEvent Event_payment_sent(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_u64Z fee_paid_msat);
49285 * Utility method to constructs a new PaymentFailed-variant Event
49287 struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKCOption_PaymentFailureReasonZ reason);
49290 * Utility method to constructs a new PaymentPathSuccessful-variant Event
49292 struct LDKEvent Event_payment_path_successful(struct LDKThirtyTwoBytes payment_id, struct LDKCOption_ThirtyTwoBytesZ payment_hash, struct LDKPath path);
49295 * Utility method to constructs a new PaymentPathFailed-variant Event
49297 struct LDKEvent Event_payment_path_failed(struct LDKCOption_ThirtyTwoBytesZ payment_id, struct LDKThirtyTwoBytes payment_hash, bool payment_failed_permanently, struct LDKPathFailure failure, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
49300 * Utility method to constructs a new ProbeSuccessful-variant Event
49302 struct LDKEvent Event_probe_successful(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path);
49305 * Utility method to constructs a new ProbeFailed-variant Event
49307 struct LDKEvent Event_probe_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash, struct LDKPath path, struct LDKCOption_u64Z short_channel_id);
49310 * Utility method to constructs a new PendingHTLCsForwardable-variant Event
49312 struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
49315 * Utility method to constructs a new HTLCIntercepted-variant Event
49317 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);
49320 * Utility method to constructs a new SpendableOutputs-variant Event
49322 struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKCOption_ThirtyTwoBytesZ channel_id);
49325 * Utility method to constructs a new PaymentForwarded-variant Event
49327 struct LDKEvent Event_payment_forwarded(struct LDKCOption_ThirtyTwoBytesZ prev_channel_id, struct LDKCOption_ThirtyTwoBytesZ next_channel_id, struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat);
49330 * Utility method to constructs a new ChannelPending-variant Event
49332 struct LDKEvent Event_channel_pending(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKCOption_ThirtyTwoBytesZ former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo);
49335 * Utility method to constructs a new ChannelReady-variant Event
49337 struct LDKEvent Event_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type);
49340 * Utility method to constructs a new ChannelClosed-variant Event
49342 struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u64Z channel_capacity_sats, struct LDKOutPoint channel_funding_txo);
49345 * Utility method to constructs a new DiscardFunding-variant Event
49347 struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction);
49350 * Utility method to constructs a new OpenChannelRequest-variant Event
49352 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);
49355 * Utility method to constructs a new HTLCHandlingFailed-variant Event
49357 struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination);
49360 * Utility method to constructs a new BumpTransaction-variant Event
49362 struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a);
49365 * Checks if two Events contain equal inner contents.
49366 * This ignores pointers and is_owned flags and looks at the values in fields.
49368 bool Event_eq(const struct LDKEvent *NONNULL_PTR a, const struct LDKEvent *NONNULL_PTR b);
49371 * Serialize the Event object into a byte array which can be read by Event_read
49373 struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
49376 * Read a Event from a byte array, created by Event_write
49378 struct LDKCResult_COption_EventZDecodeErrorZ Event_read(struct LDKu8slice ser);
49381 * Frees any resources used by the MessageSendEvent
49383 void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
49386 * Creates a copy of the MessageSendEvent
49388 struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
49391 * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
49393 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
49396 * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent
49398 struct LDKMessageSendEvent MessageSendEvent_send_accept_channel_v2(struct LDKPublicKey node_id, struct LDKAcceptChannelV2 msg);
49401 * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
49403 struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
49406 * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent
49408 struct LDKMessageSendEvent MessageSendEvent_send_open_channel_v2(struct LDKPublicKey node_id, struct LDKOpenChannelV2 msg);
49411 * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
49413 struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
49416 * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
49418 struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
49421 * Utility method to constructs a new SendStfu-variant MessageSendEvent
49423 struct LDKMessageSendEvent MessageSendEvent_send_stfu(struct LDKPublicKey node_id, struct LDKStfu msg);
49426 * Utility method to constructs a new SendSplice-variant MessageSendEvent
49428 struct LDKMessageSendEvent MessageSendEvent_send_splice(struct LDKPublicKey node_id, struct LDKSplice msg);
49431 * Utility method to constructs a new SendSpliceAck-variant MessageSendEvent
49433 struct LDKMessageSendEvent MessageSendEvent_send_splice_ack(struct LDKPublicKey node_id, struct LDKSpliceAck msg);
49436 * Utility method to constructs a new SendSpliceLocked-variant MessageSendEvent
49438 struct LDKMessageSendEvent MessageSendEvent_send_splice_locked(struct LDKPublicKey node_id, struct LDKSpliceLocked msg);
49441 * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent
49443 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_input(struct LDKPublicKey node_id, struct LDKTxAddInput msg);
49446 * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent
49448 struct LDKMessageSendEvent MessageSendEvent_send_tx_add_output(struct LDKPublicKey node_id, struct LDKTxAddOutput msg);
49451 * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent
49453 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_input(struct LDKPublicKey node_id, struct LDKTxRemoveInput msg);
49456 * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent
49458 struct LDKMessageSendEvent MessageSendEvent_send_tx_remove_output(struct LDKPublicKey node_id, struct LDKTxRemoveOutput msg);
49461 * Utility method to constructs a new SendTxComplete-variant MessageSendEvent
49463 struct LDKMessageSendEvent MessageSendEvent_send_tx_complete(struct LDKPublicKey node_id, struct LDKTxComplete msg);
49466 * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent
49468 struct LDKMessageSendEvent MessageSendEvent_send_tx_signatures(struct LDKPublicKey node_id, struct LDKTxSignatures msg);
49471 * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent
49473 struct LDKMessageSendEvent MessageSendEvent_send_tx_init_rbf(struct LDKPublicKey node_id, struct LDKTxInitRbf msg);
49476 * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent
49478 struct LDKMessageSendEvent MessageSendEvent_send_tx_ack_rbf(struct LDKPublicKey node_id, struct LDKTxAckRbf msg);
49481 * Utility method to constructs a new SendTxAbort-variant MessageSendEvent
49483 struct LDKMessageSendEvent MessageSendEvent_send_tx_abort(struct LDKPublicKey node_id, struct LDKTxAbort msg);
49486 * Utility method to constructs a new SendChannelReady-variant MessageSendEvent
49488 struct LDKMessageSendEvent MessageSendEvent_send_channel_ready(struct LDKPublicKey node_id, struct LDKChannelReady msg);
49491 * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
49493 struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
49496 * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
49498 struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
49501 * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
49503 struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
49506 * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
49508 struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
49511 * Utility method to constructs a new SendShutdown-variant MessageSendEvent
49513 struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
49516 * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
49518 struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
49521 * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent
49523 struct LDKMessageSendEvent MessageSendEvent_send_channel_announcement(struct LDKPublicKey node_id, struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
49526 * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
49528 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
49531 * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
49533 struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
49536 * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
49538 struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
49541 * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
49543 struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
49546 * Utility method to constructs a new HandleError-variant MessageSendEvent
49548 struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
49551 * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
49553 struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
49556 * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
49558 struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
49561 * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
49563 struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
49566 * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent
49568 struct LDKMessageSendEvent MessageSendEvent_send_gossip_timestamp_filter(struct LDKPublicKey node_id, struct LDKGossipTimestampFilter msg);
49571 * Calls the free function if one is set
49573 void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
49576 * Calls the free function if one is set
49578 void EventsProvider_free(struct LDKEventsProvider this_ptr);
49581 * Calls the free function if one is set
49583 void EventHandler_free(struct LDKEventHandler this_ptr);
49586 * Frees any resources used by the AnchorDescriptor, if is_owned is set and inner is non-NULL.
49588 void AnchorDescriptor_free(struct LDKAnchorDescriptor this_obj);
49591 * The parameters required to derive the signer for the anchor input.
49593 struct LDKChannelDerivationParameters AnchorDescriptor_get_channel_derivation_parameters(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
49596 * The parameters required to derive the signer for the anchor input.
49598 void AnchorDescriptor_set_channel_derivation_parameters(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val);
49601 * The transaction input's outpoint corresponding to the commitment transaction's anchor
49604 struct LDKOutPoint AnchorDescriptor_get_outpoint(const struct LDKAnchorDescriptor *NONNULL_PTR this_ptr);
49607 * The transaction input's outpoint corresponding to the commitment transaction's anchor
49610 void AnchorDescriptor_set_outpoint(struct LDKAnchorDescriptor *NONNULL_PTR this_ptr, struct LDKOutPoint val);
49613 * Constructs a new AnchorDescriptor given each field
49615 MUST_USE_RES struct LDKAnchorDescriptor AnchorDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKOutPoint outpoint_arg);
49618 * Creates a copy of the AnchorDescriptor
49620 struct LDKAnchorDescriptor AnchorDescriptor_clone(const struct LDKAnchorDescriptor *NONNULL_PTR orig);
49623 * Checks if two AnchorDescriptors contain equal inner contents.
49624 * This ignores pointers and is_owned flags and looks at the values in fields.
49625 * Two objects with NULL inner values will be considered "equal" here.
49627 bool AnchorDescriptor_eq(const struct LDKAnchorDescriptor *NONNULL_PTR a, const struct LDKAnchorDescriptor *NONNULL_PTR b);
49630 * Returns the UTXO to be spent by the anchor input, which can be obtained via
49631 * [`Self::unsigned_tx_input`].
49633 MUST_USE_RES struct LDKTxOut AnchorDescriptor_previous_utxo(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
49636 * Returns the unsigned transaction input spending the anchor output in the commitment
49639 MUST_USE_RES struct LDKTxIn AnchorDescriptor_unsigned_tx_input(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
49642 * Returns the witness script of the anchor output in the commitment transaction.
49644 MUST_USE_RES struct LDKCVec_u8Z AnchorDescriptor_witness_script(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg);
49647 * Returns the fully signed witness required to spend the anchor output in the commitment
49650 MUST_USE_RES struct LDKWitness AnchorDescriptor_tx_input_witness(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, struct LDKECDSASignature signature);
49653 * Derives the channel signer required to sign the anchor input.
49655 MUST_USE_RES struct LDKWriteableEcdsaChannelSigner AnchorDescriptor_derive_channel_signer(const struct LDKAnchorDescriptor *NONNULL_PTR this_arg, const struct LDKSignerProvider *NONNULL_PTR signer_provider);
49658 * Frees any resources used by the BumpTransactionEvent
49660 void BumpTransactionEvent_free(struct LDKBumpTransactionEvent this_ptr);
49663 * Creates a copy of the BumpTransactionEvent
49665 struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig);
49668 * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent
49670 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);
49673 * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent
49675 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);
49678 * Checks if two BumpTransactionEvents contain equal inner contents.
49679 * This ignores pointers and is_owned flags and looks at the values in fields.
49681 bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b);
49684 * Frees any resources used by the Input, if is_owned is set and inner is non-NULL.
49686 void Input_free(struct LDKInput this_obj);
49689 * The unique identifier of the input.
49691 struct LDKOutPoint Input_get_outpoint(const struct LDKInput *NONNULL_PTR this_ptr);
49694 * The unique identifier of the input.
49696 void Input_set_outpoint(struct LDKInput *NONNULL_PTR this_ptr, struct LDKOutPoint val);
49699 * The UTXO being spent by the input.
49701 struct LDKTxOut Input_get_previous_utxo(const struct LDKInput *NONNULL_PTR this_ptr);
49704 * The UTXO being spent by the input.
49706 void Input_set_previous_utxo(struct LDKInput *NONNULL_PTR this_ptr, struct LDKTxOut val);
49709 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
49710 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
49713 uint64_t Input_get_satisfaction_weight(const struct LDKInput *NONNULL_PTR this_ptr);
49716 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and
49717 * [`TxIn::witness`], each with their lengths included, required to satisfy the output's
49720 void Input_set_satisfaction_weight(struct LDKInput *NONNULL_PTR this_ptr, uint64_t val);
49723 * Constructs a new Input given each field
49725 MUST_USE_RES struct LDKInput Input_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut previous_utxo_arg, uint64_t satisfaction_weight_arg);
49728 * Creates a copy of the Input
49730 struct LDKInput Input_clone(const struct LDKInput *NONNULL_PTR orig);
49733 * Generates a non-cryptographic 64-bit hash of the Input.
49735 uint64_t Input_hash(const struct LDKInput *NONNULL_PTR o);
49738 * Checks if two Inputs contain equal inner contents.
49739 * This ignores pointers and is_owned flags and looks at the values in fields.
49740 * Two objects with NULL inner values will be considered "equal" here.
49742 bool Input_eq(const struct LDKInput *NONNULL_PTR a, const struct LDKInput *NONNULL_PTR b);
49745 * Frees any resources used by the Utxo, if is_owned is set and inner is non-NULL.
49747 void Utxo_free(struct LDKUtxo this_obj);
49750 * The unique identifier of the output.
49752 struct LDKOutPoint Utxo_get_outpoint(const struct LDKUtxo *NONNULL_PTR this_ptr);
49755 * The unique identifier of the output.
49757 void Utxo_set_outpoint(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKOutPoint val);
49760 * The output to spend.
49762 struct LDKTxOut Utxo_get_output(const struct LDKUtxo *NONNULL_PTR this_ptr);
49765 * The output to spend.
49767 void Utxo_set_output(struct LDKUtxo *NONNULL_PTR this_ptr, struct LDKTxOut val);
49770 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
49771 * with their lengths included, required to satisfy the output's script. The weight consumed by
49772 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
49774 uint64_t Utxo_get_satisfaction_weight(const struct LDKUtxo *NONNULL_PTR this_ptr);
49777 * The upper-bound weight consumed by the input's full [`TxIn::script_sig`] and [`TxIn::witness`], each
49778 * with their lengths included, required to satisfy the output's script. The weight consumed by
49779 * the input's `script_sig` must account for [`WITNESS_SCALE_FACTOR`].
49781 void Utxo_set_satisfaction_weight(struct LDKUtxo *NONNULL_PTR this_ptr, uint64_t val);
49784 * Constructs a new Utxo given each field
49786 MUST_USE_RES struct LDKUtxo Utxo_new(struct LDKOutPoint outpoint_arg, struct LDKTxOut output_arg, uint64_t satisfaction_weight_arg);
49789 * Creates a copy of the Utxo
49791 struct LDKUtxo Utxo_clone(const struct LDKUtxo *NONNULL_PTR orig);
49794 * Generates a non-cryptographic 64-bit hash of the Utxo.
49796 uint64_t Utxo_hash(const struct LDKUtxo *NONNULL_PTR o);
49799 * Checks if two Utxos contain equal inner contents.
49800 * This ignores pointers and is_owned flags and looks at the values in fields.
49801 * Two objects with NULL inner values will be considered "equal" here.
49803 bool Utxo_eq(const struct LDKUtxo *NONNULL_PTR a, const struct LDKUtxo *NONNULL_PTR b);
49806 * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output.
49808 MUST_USE_RES struct LDKUtxo Utxo_new_p2pkh(struct LDKOutPoint outpoint, uint64_t value, const uint8_t (*pubkey_hash)[20]);
49811 * Frees any resources used by the CoinSelection, if is_owned is set and inner is non-NULL.
49813 void CoinSelection_free(struct LDKCoinSelection this_obj);
49816 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
49817 * requiring additional fees.
49819 struct LDKCVec_UtxoZ CoinSelection_get_confirmed_utxos(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
49822 * The set of UTXOs (with at least 1 confirmation) to spend and use within a transaction
49823 * requiring additional fees.
49825 void CoinSelection_set_confirmed_utxos(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCVec_UtxoZ val);
49828 * An additional output tracking whether any change remained after coin selection. This output
49829 * should always have a value above dust for its given `script_pubkey`. It should not be
49830 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
49831 * not met. This implies no other party should be able to spend it except us.
49833 struct LDKCOption_TxOutZ CoinSelection_get_change_output(const struct LDKCoinSelection *NONNULL_PTR this_ptr);
49836 * An additional output tracking whether any change remained after coin selection. This output
49837 * should always have a value above dust for its given `script_pubkey`. It should not be
49838 * spent until the transaction it belongs to confirms to ensure mempool descendant limits are
49839 * not met. This implies no other party should be able to spend it except us.
49841 void CoinSelection_set_change_output(struct LDKCoinSelection *NONNULL_PTR this_ptr, struct LDKCOption_TxOutZ val);
49844 * Constructs a new CoinSelection given each field
49846 MUST_USE_RES struct LDKCoinSelection CoinSelection_new(struct LDKCVec_UtxoZ confirmed_utxos_arg, struct LDKCOption_TxOutZ change_output_arg);
49849 * Creates a copy of the CoinSelection
49851 struct LDKCoinSelection CoinSelection_clone(const struct LDKCoinSelection *NONNULL_PTR orig);
49854 * Calls the free function if one is set
49856 void CoinSelectionSource_free(struct LDKCoinSelectionSource this_ptr);
49859 * Calls the free function if one is set
49861 void WalletSource_free(struct LDKWalletSource this_ptr);
49864 * Frees any resources used by the Wallet, if is_owned is set and inner is non-NULL.
49866 void Wallet_free(struct LDKWallet this_obj);
49869 * Returns a new instance backed by the given [`WalletSource`] that serves as an implementation
49870 * of [`CoinSelectionSource`].
49872 MUST_USE_RES struct LDKWallet Wallet_new(struct LDKWalletSource source, struct LDKLogger logger);
49875 * Constructs a new CoinSelectionSource which calls the relevant methods on this_arg.
49876 * This copies the `inner` pointer in this_arg and thus the returned CoinSelectionSource must be freed before this_arg is
49878 struct LDKCoinSelectionSource Wallet_as_CoinSelectionSource(const struct LDKWallet *NONNULL_PTR this_arg);
49881 * Frees any resources used by the BumpTransactionEventHandler, if is_owned is set and inner is non-NULL.
49883 void BumpTransactionEventHandler_free(struct LDKBumpTransactionEventHandler this_obj);
49886 * Returns a new instance capable of handling [`Event::BumpTransaction`] events.
49888 * [`Event::BumpTransaction`]: crate::events::Event::BumpTransaction
49890 MUST_USE_RES struct LDKBumpTransactionEventHandler BumpTransactionEventHandler_new(struct LDKBroadcasterInterface broadcaster, struct LDKCoinSelectionSource utxo_source, struct LDKSignerProvider signer_provider, struct LDKLogger logger);
49893 * Handles all variants of [`BumpTransactionEvent`].
49895 void BumpTransactionEventHandler_handle_event(const struct LDKBumpTransactionEventHandler *NONNULL_PTR this_arg, const struct LDKBumpTransactionEvent *NONNULL_PTR event);
49898 * Frees any resources used by the FilesystemStore, if is_owned is set and inner is non-NULL.
49900 void FilesystemStore_free(struct LDKFilesystemStore this_obj);
49903 * Constructs a new [`FilesystemStore`].
49905 MUST_USE_RES struct LDKFilesystemStore FilesystemStore_new(struct LDKStr data_dir);
49908 * Returns the data directory.
49910 MUST_USE_RES struct LDKStr FilesystemStore_get_data_dir(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
49913 * Constructs a new KVStore which calls the relevant methods on this_arg.
49914 * This copies the `inner` pointer in this_arg and thus the returned KVStore must be freed before this_arg is
49916 struct LDKKVStore FilesystemStore_as_KVStore(const struct LDKFilesystemStore *NONNULL_PTR this_arg);
49919 * Frees any resources used by the BackgroundProcessor, if is_owned is set and inner is non-NULL.
49921 void BackgroundProcessor_free(struct LDKBackgroundProcessor this_obj);
49924 * Frees any resources used by the GossipSync
49926 void GossipSync_free(struct LDKGossipSync this_ptr);
49929 * Utility method to constructs a new P2P-variant GossipSync
49931 struct LDKGossipSync GossipSync_p2_p(const struct LDKP2PGossipSync *NONNULL_PTR a);
49934 * Utility method to constructs a new Rapid-variant GossipSync
49936 struct LDKGossipSync GossipSync_rapid(const struct LDKRapidGossipSync *NONNULL_PTR a);
49939 * Utility method to constructs a new None-variant GossipSync
49941 struct LDKGossipSync GossipSync_none(void);
49944 * Start a background thread that takes care of responsibilities enumerated in the [top-level
49947 * The thread runs indefinitely unless the object is dropped, [`stop`] is called, or
49948 * [`Persister::persist_manager`] returns an error. In case of an error, the error is retrieved by calling
49949 * either [`join`] or [`stop`].
49951 * # Data Persistence
49953 * [`Persister::persist_manager`] is responsible for writing out the [`ChannelManager`] to disk, and/or
49954 * uploading to one or more backup services. See [`ChannelManager::write`] for writing out a
49955 * [`ChannelManager`]. See the `lightning-persister` crate for LDK's
49956 * provided implementation.
49958 * [`Persister::persist_graph`] is responsible for writing out the [`NetworkGraph`] to disk, if
49959 * [`GossipSync`] is supplied. See [`NetworkGraph::write`] for writing out a [`NetworkGraph`].
49960 * See the `lightning-persister` crate for LDK's provided implementation.
49962 * Typically, users should either implement [`Persister::persist_manager`] to never return an
49963 * error or call [`join`] and handle any error that may arise. For the latter case,
49964 * `BackgroundProcessor` must be restarted by calling `start` again after handling the error.
49968 * `event_handler` is responsible for handling events that users should be notified of (e.g.,
49969 * payment failed). [`BackgroundProcessor`] may decorate the given [`EventHandler`] with common
49970 * functionality implemented by other handlers.
49971 * * [`P2PGossipSync`] if given will update the [`NetworkGraph`] based on payment failures.
49973 * # Rapid Gossip Sync
49975 * If rapid gossip sync is meant to run at startup, pass [`RapidGossipSync`] via `gossip_sync`
49976 * to indicate that the [`BackgroundProcessor`] should not prune the [`NetworkGraph`] instance
49977 * until the [`RapidGossipSync`] instance completes its first sync.
49979 * [top-level documentation]: BackgroundProcessor
49980 * [`join`]: Self::join
49981 * [`stop`]: Self::stop
49982 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
49983 * [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
49984 * [`Persister::persist_manager`]: lightning::util::persist::Persister::persist_manager
49985 * [`Persister::persist_graph`]: lightning::util::persist::Persister::persist_graph
49986 * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph
49987 * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
49989 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);
49992 * Join `BackgroundProcessor`'s thread, returning any error that occurred while persisting
49993 * [`ChannelManager`].
49997 * This function panics if the background thread has panicked such as while persisting or
50000 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
50002 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_join(struct LDKBackgroundProcessor this_arg);
50005 * Stop `BackgroundProcessor`'s thread, returning any error that occurred while persisting
50006 * [`ChannelManager`].
50010 * This function panics if the background thread has panicked such as while persisting or
50013 * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
50015 MUST_USE_RES struct LDKCResult_NoneIOErrorZ BackgroundProcessor_stop(struct LDKBackgroundProcessor this_arg);
50018 * Frees any resources used by the Bolt11ParseError
50020 void Bolt11ParseError_free(struct LDKBolt11ParseError this_ptr);
50023 * Creates a copy of the Bolt11ParseError
50025 struct LDKBolt11ParseError Bolt11ParseError_clone(const struct LDKBolt11ParseError *NONNULL_PTR orig);
50028 * Utility method to constructs a new Bech32Error-variant Bolt11ParseError
50030 struct LDKBolt11ParseError Bolt11ParseError_bech32_error(struct LDKBech32Error a);
50033 * Utility method to constructs a new ParseAmountError-variant Bolt11ParseError
50035 struct LDKBolt11ParseError Bolt11ParseError_parse_amount_error(struct LDKError a);
50038 * Utility method to constructs a new MalformedSignature-variant Bolt11ParseError
50040 struct LDKBolt11ParseError Bolt11ParseError_malformed_signature(enum LDKSecp256k1Error a);
50043 * Utility method to constructs a new BadPrefix-variant Bolt11ParseError
50045 struct LDKBolt11ParseError Bolt11ParseError_bad_prefix(void);
50048 * Utility method to constructs a new UnknownCurrency-variant Bolt11ParseError
50050 struct LDKBolt11ParseError Bolt11ParseError_unknown_currency(void);
50053 * Utility method to constructs a new UnknownSiPrefix-variant Bolt11ParseError
50055 struct LDKBolt11ParseError Bolt11ParseError_unknown_si_prefix(void);
50058 * Utility method to constructs a new MalformedHRP-variant Bolt11ParseError
50060 struct LDKBolt11ParseError Bolt11ParseError_malformed_hrp(void);
50063 * Utility method to constructs a new TooShortDataPart-variant Bolt11ParseError
50065 struct LDKBolt11ParseError Bolt11ParseError_too_short_data_part(void);
50068 * Utility method to constructs a new UnexpectedEndOfTaggedFields-variant Bolt11ParseError
50070 struct LDKBolt11ParseError Bolt11ParseError_unexpected_end_of_tagged_fields(void);
50073 * Utility method to constructs a new DescriptionDecodeError-variant Bolt11ParseError
50075 struct LDKBolt11ParseError Bolt11ParseError_description_decode_error(struct LDKError a);
50078 * Utility method to constructs a new PaddingError-variant Bolt11ParseError
50080 struct LDKBolt11ParseError Bolt11ParseError_padding_error(void);
50083 * Utility method to constructs a new IntegerOverflowError-variant Bolt11ParseError
50085 struct LDKBolt11ParseError Bolt11ParseError_integer_overflow_error(void);
50088 * Utility method to constructs a new InvalidSegWitProgramLength-variant Bolt11ParseError
50090 struct LDKBolt11ParseError Bolt11ParseError_invalid_seg_wit_program_length(void);
50093 * Utility method to constructs a new InvalidPubKeyHashLength-variant Bolt11ParseError
50095 struct LDKBolt11ParseError Bolt11ParseError_invalid_pub_key_hash_length(void);
50098 * Utility method to constructs a new InvalidScriptHashLength-variant Bolt11ParseError
50100 struct LDKBolt11ParseError Bolt11ParseError_invalid_script_hash_length(void);
50103 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11ParseError
50105 struct LDKBolt11ParseError Bolt11ParseError_invalid_recovery_id(void);
50108 * Utility method to constructs a new InvalidSliceLength-variant Bolt11ParseError
50110 struct LDKBolt11ParseError Bolt11ParseError_invalid_slice_length(struct LDKStr a);
50113 * Utility method to constructs a new Skip-variant Bolt11ParseError
50115 struct LDKBolt11ParseError Bolt11ParseError_skip(void);
50118 * Checks if two Bolt11ParseErrors contain equal inner contents.
50119 * This ignores pointers and is_owned flags and looks at the values in fields.
50121 bool Bolt11ParseError_eq(const struct LDKBolt11ParseError *NONNULL_PTR a, const struct LDKBolt11ParseError *NONNULL_PTR b);
50124 * Frees any resources used by the ParseOrSemanticError
50126 void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
50129 * Creates a copy of the ParseOrSemanticError
50131 struct LDKParseOrSemanticError ParseOrSemanticError_clone(const struct LDKParseOrSemanticError *NONNULL_PTR orig);
50134 * Utility method to constructs a new ParseError-variant ParseOrSemanticError
50136 struct LDKParseOrSemanticError ParseOrSemanticError_parse_error(struct LDKBolt11ParseError a);
50139 * Utility method to constructs a new SemanticError-variant ParseOrSemanticError
50141 struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKBolt11SemanticError a);
50144 * Checks if two ParseOrSemanticErrors contain equal inner contents.
50145 * This ignores pointers and is_owned flags and looks at the values in fields.
50147 bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
50150 * Frees any resources used by the Bolt11Invoice, if is_owned is set and inner is non-NULL.
50152 void Bolt11Invoice_free(struct LDKBolt11Invoice this_obj);
50155 * Checks if two Bolt11Invoices contain equal inner contents.
50156 * This ignores pointers and is_owned flags and looks at the values in fields.
50157 * Two objects with NULL inner values will be considered "equal" here.
50159 bool Bolt11Invoice_eq(const struct LDKBolt11Invoice *NONNULL_PTR a, const struct LDKBolt11Invoice *NONNULL_PTR b);
50162 * Creates a copy of the Bolt11Invoice
50164 struct LDKBolt11Invoice Bolt11Invoice_clone(const struct LDKBolt11Invoice *NONNULL_PTR orig);
50167 * Generates a non-cryptographic 64-bit hash of the Bolt11Invoice.
50169 uint64_t Bolt11Invoice_hash(const struct LDKBolt11Invoice *NONNULL_PTR o);
50172 * Frees any resources used by the SignedRawBolt11Invoice, if is_owned is set and inner is non-NULL.
50174 void SignedRawBolt11Invoice_free(struct LDKSignedRawBolt11Invoice this_obj);
50177 * Checks if two SignedRawBolt11Invoices contain equal inner contents.
50178 * This ignores pointers and is_owned flags and looks at the values in fields.
50179 * Two objects with NULL inner values will be considered "equal" here.
50181 bool SignedRawBolt11Invoice_eq(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR a, const struct LDKSignedRawBolt11Invoice *NONNULL_PTR b);
50184 * Creates a copy of the SignedRawBolt11Invoice
50186 struct LDKSignedRawBolt11Invoice SignedRawBolt11Invoice_clone(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR orig);
50189 * Generates a non-cryptographic 64-bit hash of the SignedRawBolt11Invoice.
50191 uint64_t SignedRawBolt11Invoice_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
50194 * Frees any resources used by the RawBolt11Invoice, if is_owned is set and inner is non-NULL.
50196 void RawBolt11Invoice_free(struct LDKRawBolt11Invoice this_obj);
50201 struct LDKRawDataPart RawBolt11Invoice_get_data(const struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr);
50206 void RawBolt11Invoice_set_data(struct LDKRawBolt11Invoice *NONNULL_PTR this_ptr, struct LDKRawDataPart val);
50209 * Checks if two RawBolt11Invoices contain equal inner contents.
50210 * This ignores pointers and is_owned flags and looks at the values in fields.
50211 * Two objects with NULL inner values will be considered "equal" here.
50213 bool RawBolt11Invoice_eq(const struct LDKRawBolt11Invoice *NONNULL_PTR a, const struct LDKRawBolt11Invoice *NONNULL_PTR b);
50216 * Creates a copy of the RawBolt11Invoice
50218 struct LDKRawBolt11Invoice RawBolt11Invoice_clone(const struct LDKRawBolt11Invoice *NONNULL_PTR orig);
50221 * Generates a non-cryptographic 64-bit hash of the RawBolt11Invoice.
50223 uint64_t RawBolt11Invoice_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR o);
50226 * Frees any resources used by the RawDataPart, if is_owned is set and inner is non-NULL.
50228 void RawDataPart_free(struct LDKRawDataPart this_obj);
50231 * generation time of the invoice
50233 struct LDKPositiveTimestamp RawDataPart_get_timestamp(const struct LDKRawDataPart *NONNULL_PTR this_ptr);
50236 * generation time of the invoice
50238 void RawDataPart_set_timestamp(struct LDKRawDataPart *NONNULL_PTR this_ptr, struct LDKPositiveTimestamp val);
50241 * Checks if two RawDataParts contain equal inner contents.
50242 * This ignores pointers and is_owned flags and looks at the values in fields.
50243 * Two objects with NULL inner values will be considered "equal" here.
50245 bool RawDataPart_eq(const struct LDKRawDataPart *NONNULL_PTR a, const struct LDKRawDataPart *NONNULL_PTR b);
50248 * Creates a copy of the RawDataPart
50250 struct LDKRawDataPart RawDataPart_clone(const struct LDKRawDataPart *NONNULL_PTR orig);
50253 * Generates a non-cryptographic 64-bit hash of the RawDataPart.
50255 uint64_t RawDataPart_hash(const struct LDKRawDataPart *NONNULL_PTR o);
50258 * Frees any resources used by the PositiveTimestamp, if is_owned is set and inner is non-NULL.
50260 void PositiveTimestamp_free(struct LDKPositiveTimestamp this_obj);
50263 * Checks if two PositiveTimestamps contain equal inner contents.
50264 * This ignores pointers and is_owned flags and looks at the values in fields.
50265 * Two objects with NULL inner values will be considered "equal" here.
50267 bool PositiveTimestamp_eq(const struct LDKPositiveTimestamp *NONNULL_PTR a, const struct LDKPositiveTimestamp *NONNULL_PTR b);
50270 * Creates a copy of the PositiveTimestamp
50272 struct LDKPositiveTimestamp PositiveTimestamp_clone(const struct LDKPositiveTimestamp *NONNULL_PTR orig);
50275 * Generates a non-cryptographic 64-bit hash of the PositiveTimestamp.
50277 uint64_t PositiveTimestamp_hash(const struct LDKPositiveTimestamp *NONNULL_PTR o);
50280 * Creates a copy of the SiPrefix
50282 enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
50285 * Utility method to constructs a new Milli-variant SiPrefix
50287 enum LDKSiPrefix SiPrefix_milli(void);
50290 * Utility method to constructs a new Micro-variant SiPrefix
50292 enum LDKSiPrefix SiPrefix_micro(void);
50295 * Utility method to constructs a new Nano-variant SiPrefix
50297 enum LDKSiPrefix SiPrefix_nano(void);
50300 * Utility method to constructs a new Pico-variant SiPrefix
50302 enum LDKSiPrefix SiPrefix_pico(void);
50305 * Checks if two SiPrefixs contain equal inner contents.
50306 * This ignores pointers and is_owned flags and looks at the values in fields.
50308 bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
50311 * Generates a non-cryptographic 64-bit hash of the SiPrefix.
50313 uint64_t SiPrefix_hash(const enum LDKSiPrefix *NONNULL_PTR o);
50316 * Returns the multiplier to go from a BTC value to picoBTC implied by this SiPrefix.
50317 * This is effectively 10^12 * the prefix multiplier
50319 MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
50322 * Creates a copy of the Currency
50324 enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
50327 * Utility method to constructs a new Bitcoin-variant Currency
50329 enum LDKCurrency Currency_bitcoin(void);
50332 * Utility method to constructs a new BitcoinTestnet-variant Currency
50334 enum LDKCurrency Currency_bitcoin_testnet(void);
50337 * Utility method to constructs a new Regtest-variant Currency
50339 enum LDKCurrency Currency_regtest(void);
50342 * Utility method to constructs a new Simnet-variant Currency
50344 enum LDKCurrency Currency_simnet(void);
50347 * Utility method to constructs a new Signet-variant Currency
50349 enum LDKCurrency Currency_signet(void);
50352 * Generates a non-cryptographic 64-bit hash of the Currency.
50354 uint64_t Currency_hash(const enum LDKCurrency *NONNULL_PTR o);
50357 * Checks if two Currencys contain equal inner contents.
50358 * This ignores pointers and is_owned flags and looks at the values in fields.
50360 bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
50363 * Frees any resources used by the Sha256, if is_owned is set and inner is non-NULL.
50365 void Sha256_free(struct LDKSha256 this_obj);
50368 * Creates a copy of the Sha256
50370 struct LDKSha256 Sha256_clone(const struct LDKSha256 *NONNULL_PTR orig);
50373 * Generates a non-cryptographic 64-bit hash of the Sha256.
50375 uint64_t Sha256_hash(const struct LDKSha256 *NONNULL_PTR o);
50378 * Checks if two Sha256s contain equal inner contents.
50379 * This ignores pointers and is_owned flags and looks at the values in fields.
50380 * Two objects with NULL inner values will be considered "equal" here.
50382 bool Sha256_eq(const struct LDKSha256 *NONNULL_PTR a, const struct LDKSha256 *NONNULL_PTR b);
50385 * Constructs a new [`Sha256`] from the given bytes, which are assumed to be the output of a
50386 * single sha256 hash.
50388 MUST_USE_RES struct LDKSha256 Sha256_from_bytes(const uint8_t (*bytes)[32]);
50391 * Frees any resources used by the Description, if is_owned is set and inner is non-NULL.
50393 void Description_free(struct LDKDescription this_obj);
50396 * Creates a copy of the Description
50398 struct LDKDescription Description_clone(const struct LDKDescription *NONNULL_PTR orig);
50401 * Generates a non-cryptographic 64-bit hash of the Description.
50403 uint64_t Description_hash(const struct LDKDescription *NONNULL_PTR o);
50406 * Checks if two Descriptions contain equal inner contents.
50407 * This ignores pointers and is_owned flags and looks at the values in fields.
50408 * Two objects with NULL inner values will be considered "equal" here.
50410 bool Description_eq(const struct LDKDescription *NONNULL_PTR a, const struct LDKDescription *NONNULL_PTR b);
50413 * Frees any resources used by the PayeePubKey, if is_owned is set and inner is non-NULL.
50415 void PayeePubKey_free(struct LDKPayeePubKey this_obj);
50417 struct LDKPublicKey PayeePubKey_get_a(const struct LDKPayeePubKey *NONNULL_PTR this_ptr);
50419 void PayeePubKey_set_a(struct LDKPayeePubKey *NONNULL_PTR this_ptr, struct LDKPublicKey val);
50422 * Constructs a new PayeePubKey given each field
50424 MUST_USE_RES struct LDKPayeePubKey PayeePubKey_new(struct LDKPublicKey a_arg);
50427 * Creates a copy of the PayeePubKey
50429 struct LDKPayeePubKey PayeePubKey_clone(const struct LDKPayeePubKey *NONNULL_PTR orig);
50432 * Generates a non-cryptographic 64-bit hash of the PayeePubKey.
50434 uint64_t PayeePubKey_hash(const struct LDKPayeePubKey *NONNULL_PTR o);
50437 * Checks if two PayeePubKeys contain equal inner contents.
50438 * This ignores pointers and is_owned flags and looks at the values in fields.
50439 * Two objects with NULL inner values will be considered "equal" here.
50441 bool PayeePubKey_eq(const struct LDKPayeePubKey *NONNULL_PTR a, const struct LDKPayeePubKey *NONNULL_PTR b);
50444 * Frees any resources used by the ExpiryTime, if is_owned is set and inner is non-NULL.
50446 void ExpiryTime_free(struct LDKExpiryTime this_obj);
50449 * Creates a copy of the ExpiryTime
50451 struct LDKExpiryTime ExpiryTime_clone(const struct LDKExpiryTime *NONNULL_PTR orig);
50454 * Generates a non-cryptographic 64-bit hash of the ExpiryTime.
50456 uint64_t ExpiryTime_hash(const struct LDKExpiryTime *NONNULL_PTR o);
50459 * Checks if two ExpiryTimes contain equal inner contents.
50460 * This ignores pointers and is_owned flags and looks at the values in fields.
50461 * Two objects with NULL inner values will be considered "equal" here.
50463 bool ExpiryTime_eq(const struct LDKExpiryTime *NONNULL_PTR a, const struct LDKExpiryTime *NONNULL_PTR b);
50466 * Frees any resources used by the MinFinalCltvExpiryDelta, if is_owned is set and inner is non-NULL.
50468 void MinFinalCltvExpiryDelta_free(struct LDKMinFinalCltvExpiryDelta this_obj);
50470 uint64_t MinFinalCltvExpiryDelta_get_a(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr);
50472 void MinFinalCltvExpiryDelta_set_a(struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR this_ptr, uint64_t val);
50475 * Constructs a new MinFinalCltvExpiryDelta given each field
50477 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_new(uint64_t a_arg);
50480 * Creates a copy of the MinFinalCltvExpiryDelta
50482 struct LDKMinFinalCltvExpiryDelta MinFinalCltvExpiryDelta_clone(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR orig);
50485 * Generates a non-cryptographic 64-bit hash of the MinFinalCltvExpiryDelta.
50487 uint64_t MinFinalCltvExpiryDelta_hash(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR o);
50490 * Checks if two MinFinalCltvExpiryDeltas contain equal inner contents.
50491 * This ignores pointers and is_owned flags and looks at the values in fields.
50492 * Two objects with NULL inner values will be considered "equal" here.
50494 bool MinFinalCltvExpiryDelta_eq(const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR a, const struct LDKMinFinalCltvExpiryDelta *NONNULL_PTR b);
50497 * Frees any resources used by the Fallback
50499 void Fallback_free(struct LDKFallback this_ptr);
50502 * Creates a copy of the Fallback
50504 struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
50507 * Utility method to constructs a new SegWitProgram-variant Fallback
50509 struct LDKFallback Fallback_seg_wit_program(struct LDKWitnessVersion version, struct LDKCVec_u8Z program);
50512 * Utility method to constructs a new PubKeyHash-variant Fallback
50514 struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
50517 * Utility method to constructs a new ScriptHash-variant Fallback
50519 struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
50522 * Generates a non-cryptographic 64-bit hash of the Fallback.
50524 uint64_t Fallback_hash(const struct LDKFallback *NONNULL_PTR o);
50527 * Checks if two Fallbacks contain equal inner contents.
50528 * This ignores pointers and is_owned flags and looks at the values in fields.
50530 bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
50533 * Frees any resources used by the Bolt11InvoiceSignature, if is_owned is set and inner is non-NULL.
50535 void Bolt11InvoiceSignature_free(struct LDKBolt11InvoiceSignature this_obj);
50538 * Creates a copy of the Bolt11InvoiceSignature
50540 struct LDKBolt11InvoiceSignature Bolt11InvoiceSignature_clone(const struct LDKBolt11InvoiceSignature *NONNULL_PTR orig);
50543 * Generates a non-cryptographic 64-bit hash of the Bolt11InvoiceSignature.
50545 uint64_t Bolt11InvoiceSignature_hash(const struct LDKBolt11InvoiceSignature *NONNULL_PTR o);
50548 * Checks if two Bolt11InvoiceSignatures contain equal inner contents.
50549 * This ignores pointers and is_owned flags and looks at the values in fields.
50550 * Two objects with NULL inner values will be considered "equal" here.
50552 bool Bolt11InvoiceSignature_eq(const struct LDKBolt11InvoiceSignature *NONNULL_PTR a, const struct LDKBolt11InvoiceSignature *NONNULL_PTR b);
50555 * Frees any resources used by the PrivateRoute, if is_owned is set and inner is non-NULL.
50557 void PrivateRoute_free(struct LDKPrivateRoute this_obj);
50560 * Creates a copy of the PrivateRoute
50562 struct LDKPrivateRoute PrivateRoute_clone(const struct LDKPrivateRoute *NONNULL_PTR orig);
50565 * Generates a non-cryptographic 64-bit hash of the PrivateRoute.
50567 uint64_t PrivateRoute_hash(const struct LDKPrivateRoute *NONNULL_PTR o);
50570 * Checks if two PrivateRoutes contain equal inner contents.
50571 * This ignores pointers and is_owned flags and looks at the values in fields.
50572 * Two objects with NULL inner values will be considered "equal" here.
50574 bool PrivateRoute_eq(const struct LDKPrivateRoute *NONNULL_PTR a, const struct LDKPrivateRoute *NONNULL_PTR b);
50577 * Disassembles the `SignedRawBolt11Invoice` into its three parts:
50579 * 2. hash of the raw invoice
50582 MUST_USE_RES struct LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ SignedRawBolt11Invoice_into_parts(struct LDKSignedRawBolt11Invoice this_arg);
50585 * The [`RawBolt11Invoice`] which was signed.
50587 MUST_USE_RES struct LDKRawBolt11Invoice SignedRawBolt11Invoice_raw_invoice(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
50590 * The hash of the [`RawBolt11Invoice`] that was signed.
50592 MUST_USE_RES const uint8_t (*SignedRawBolt11Invoice_signable_hash(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg))[32];
50595 * Signature for the invoice.
50597 MUST_USE_RES struct LDKBolt11InvoiceSignature SignedRawBolt11Invoice_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
50600 * Recovers the public key used for signing the invoice from the recoverable signature.
50602 MUST_USE_RES struct LDKCResult_PayeePubKeySecp256k1ErrorZ SignedRawBolt11Invoice_recover_payee_pub_key(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
50605 * Checks if the signature is valid for the included payee public key or if none exists if it's
50606 * valid for the recovered signature (which should always be true?).
50608 MUST_USE_RES bool SignedRawBolt11Invoice_check_signature(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR this_arg);
50611 * Calculate the hash of the encoded `RawBolt11Invoice` which should be signed.
50613 MUST_USE_RES struct LDKThirtyTwoBytes RawBolt11Invoice_signable_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50617 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50619 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_payment_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50623 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50625 MUST_USE_RES struct LDKDescription RawBolt11Invoice_description(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50629 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50631 MUST_USE_RES struct LDKPayeePubKey RawBolt11Invoice_payee_pub_key(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50635 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50637 MUST_USE_RES struct LDKSha256 RawBolt11Invoice_description_hash(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50641 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50643 MUST_USE_RES struct LDKExpiryTime RawBolt11Invoice_expiry_time(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50647 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50649 MUST_USE_RES struct LDKMinFinalCltvExpiryDelta RawBolt11Invoice_min_final_cltv_expiry_delta(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50651 MUST_USE_RES struct LDKCOption_ThirtyTwoBytesZ RawBolt11Invoice_payment_secret(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50653 MUST_USE_RES struct LDKCOption_CVec_u8ZZ RawBolt11Invoice_payment_metadata(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50657 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50659 MUST_USE_RES struct LDKBolt11InvoiceFeatures RawBolt11Invoice_features(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50661 MUST_USE_RES struct LDKCVec_PrivateRouteZ RawBolt11Invoice_private_routes(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50663 MUST_USE_RES struct LDKCOption_u64Z RawBolt11Invoice_amount_pico_btc(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50665 MUST_USE_RES enum LDKCurrency RawBolt11Invoice_currency(const struct LDKRawBolt11Invoice *NONNULL_PTR this_arg);
50668 * Creates a `PositiveTimestamp` from a Unix timestamp in the range `0..=MAX_TIMESTAMP`.
50670 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
50672 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_unix_timestamp(uint64_t unix_seconds);
50675 * Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
50676 * the range `0..=MAX_TIMESTAMP`.
50678 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
50680 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
50682 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_system_time(uint64_t time);
50685 * Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
50686 * `0..=MAX_TIMESTAMP`.
50688 * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
50690 * Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
50692 MUST_USE_RES struct LDKCResult_PositiveTimestampCreationErrorZ PositiveTimestamp_from_duration_since_epoch(uint64_t duration);
50695 * Returns the Unix timestamp representing the stored time
50697 MUST_USE_RES uint64_t PositiveTimestamp_as_unix_timestamp(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
50700 * Returns the duration of the stored time since the Unix epoch
50702 MUST_USE_RES uint64_t PositiveTimestamp_as_duration_since_epoch(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
50705 * Returns the [`SystemTime`] representing the stored time
50707 MUST_USE_RES uint64_t PositiveTimestamp_as_time(const struct LDKPositiveTimestamp *NONNULL_PTR this_arg);
50710 * The hash of the [`RawBolt11Invoice`] that was signed.
50712 MUST_USE_RES struct LDKThirtyTwoBytes Bolt11Invoice_signable_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50715 * Transform the `Bolt11Invoice` into its unchecked version.
50717 MUST_USE_RES struct LDKSignedRawBolt11Invoice Bolt11Invoice_into_signed_raw(struct LDKBolt11Invoice this_arg);
50720 * Check that the invoice is signed correctly and that key recovery works
50722 MUST_USE_RES struct LDKCResult_NoneBolt11SemanticErrorZ Bolt11Invoice_check_signature(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50725 * Constructs a `Bolt11Invoice` from a [`SignedRawBolt11Invoice`] by checking all its invariants.
50727 * use lightning_invoice::*;
50729 * let invoice = \"lnbc100p1psj9jhxdqud3jxktt5w46x7unfv9kz6mn0v3jsnp4q0d3p2sfluzdx45tqcs\\
50730 * h2pu5qc7lgq0xs578ngs6s0s68ua4h7cvspp5q6rmq35js88zp5dvwrv9m459tnk2zunwj5jalqtyxqulh0l\\
50731 * 5gflssp5nf55ny5gcrfl30xuhzj3nphgj27rstekmr9fw3ny5989s300gyus9qyysgqcqpcrzjqw2sxwe993\\
50732 * h5pcm4dxzpvttgza8zhkqxpgffcrf5v25nwpr3cmfg7z54kuqq8rgqqqqqqqq2qqqqq9qq9qrzjqd0ylaqcl\\
50733 * j9424x9m8h2vcukcgnm6s56xfgu3j78zyqzhgs4hlpzvznlugqq9vsqqqqqqqlgqqqqqeqq9qrzjqwldmj9d\\
50734 * ha74df76zhx6l9we0vjdquygcdt3kssupehe64g6yyp5yz5rhuqqwccqqyqqqqlgqqqqjcqq9qrzjqf9e58a\\
50735 * guqr0rcun0ajlvmzq3ek63cw2w282gv3z5uupmuwvgjtq2z55qsqqg6qqqyqqqrtnqqqzq3cqygrzjqvphms\\
50736 * ywntrrhqjcraumvc4y6r8v4z5v593trte429v4hredj7ms5z52usqq9ngqqqqqqqlgqqqqqqgq9qrzjq2v0v\\
50737 * p62g49p7569ev48cmulecsxe59lvaw3wlxm7r982zxa9zzj7z5l0cqqxusqqyqqqqlgqqqqqzsqygarl9fh3\\
50738 * 8s0gyuxjjgux34w75dnc6xp2l35j7es3jd4ugt3lu0xzre26yg5m7ke54n2d5sym4xcmxtl8238xxvw5h5h5\\
50739 * j5r6drg6k6zcqj0fcwg\";
50741 * let signed = invoice.parse::<SignedRawBolt11Invoice>().unwrap();
50743 * assert!(Bolt11Invoice::from_signed(signed).is_ok());
50746 MUST_USE_RES struct LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ Bolt11Invoice_from_signed(struct LDKSignedRawBolt11Invoice signed_invoice);
50749 * Returns the `Bolt11Invoice`'s timestamp (should equal its creation time)
50751 MUST_USE_RES uint64_t Bolt11Invoice_timestamp(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50754 * Returns the `Bolt11Invoice`'s timestamp as a duration since the Unix epoch
50756 MUST_USE_RES uint64_t Bolt11Invoice_duration_since_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50759 * Returns the hash to which we will receive the preimage on completion of the payment
50761 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_hash(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
50764 * Get the payee's public key if one was included in the invoice
50766 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50768 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50771 * Get the payment secret if one was included in the invoice
50773 MUST_USE_RES const uint8_t (*Bolt11Invoice_payment_secret(const struct LDKBolt11Invoice *NONNULL_PTR this_arg))[32];
50776 * Get the payment metadata blob if one was included in the invoice
50778 MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt11Invoice_payment_metadata(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50781 * Get the invoice features if they were included in the invoice
50783 * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
50785 MUST_USE_RES struct LDKBolt11InvoiceFeatures Bolt11Invoice_features(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50788 * Recover the payee's public key (only to be used if none was included in the invoice)
50790 MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50793 * Returns the Duration since the Unix epoch at which the invoice expires.
50794 * Returning None if overflow occurred.
50796 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50799 * Returns the invoice's expiry time, if present, otherwise [`DEFAULT_EXPIRY_TIME`].
50801 MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50804 * Returns whether the invoice has expired.
50806 MUST_USE_RES bool Bolt11Invoice_is_expired(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50809 * Returns the Duration remaining until the invoice expires.
50811 MUST_USE_RES uint64_t Bolt11Invoice_duration_until_expiry(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50814 * Returns the Duration remaining until the invoice expires given the current time.
50815 * `time` is the timestamp as a duration since the Unix epoch.
50817 MUST_USE_RES uint64_t Bolt11Invoice_expiration_remaining_from_epoch(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t time);
50820 * Returns whether the expiry time would pass at the given point in time.
50821 * `at_time` is the timestamp as a duration since the Unix epoch.
50823 MUST_USE_RES bool Bolt11Invoice_would_expire(const struct LDKBolt11Invoice *NONNULL_PTR this_arg, uint64_t at_time);
50826 * Returns the invoice's `min_final_cltv_expiry_delta` time, if present, otherwise
50827 * [`DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA`].
50829 MUST_USE_RES uint64_t Bolt11Invoice_min_final_cltv_expiry_delta(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50832 * Returns a list of all fallback addresses as [`Address`]es
50834 MUST_USE_RES struct LDKCVec_StrZ Bolt11Invoice_fallback_addresses(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50837 * Returns a list of all routes included in the invoice
50839 MUST_USE_RES struct LDKCVec_PrivateRouteZ Bolt11Invoice_private_routes(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50842 * Returns a list of all routes included in the invoice as the underlying hints
50844 MUST_USE_RES struct LDKCVec_RouteHintZ Bolt11Invoice_route_hints(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50847 * Returns the currency for which the invoice was issued
50849 MUST_USE_RES enum LDKCurrency Bolt11Invoice_currency(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50852 * Returns the amount if specified in the invoice as millisatoshis.
50854 MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_amount_milli_satoshis(const struct LDKBolt11Invoice *NONNULL_PTR this_arg);
50857 * Creates a new `Description` if `description` is at most 1023 __bytes__ long,
50858 * returns [`CreationError::DescriptionTooLong`] otherwise
50860 * Please note that single characters may use more than one byte due to UTF8 encoding.
50862 MUST_USE_RES struct LDKCResult_DescriptionCreationErrorZ Description_new(struct LDKStr description);
50865 * Returns the underlying description [`UntrustedString`]
50867 MUST_USE_RES struct LDKUntrustedString Description_into_inner(struct LDKDescription this_arg);
50870 * Get the string representation of a Description object
50872 struct LDKStr Description_to_str(const struct LDKDescription *NONNULL_PTR o);
50875 * Construct an `ExpiryTime` from seconds.
50877 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_seconds(uint64_t seconds);
50880 * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part.
50882 MUST_USE_RES struct LDKExpiryTime ExpiryTime_from_duration(uint64_t duration);
50885 * Returns the expiry time in seconds
50887 MUST_USE_RES uint64_t ExpiryTime_as_seconds(const struct LDKExpiryTime *NONNULL_PTR this_arg);
50890 * Returns a reference to the underlying [`Duration`] (=expiry time)
50892 MUST_USE_RES uint64_t ExpiryTime_as_duration(const struct LDKExpiryTime *NONNULL_PTR this_arg);
50895 * Creates a new (partial) route from a list of hops
50897 MUST_USE_RES struct LDKCResult_PrivateRouteCreationErrorZ PrivateRoute_new(struct LDKRouteHint hops);
50900 * Returns the underlying list of hops
50902 MUST_USE_RES struct LDKRouteHint PrivateRoute_into_inner(struct LDKPrivateRoute this_arg);
50905 * Creates a copy of the CreationError
50907 enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
50910 * Utility method to constructs a new DescriptionTooLong-variant CreationError
50912 enum LDKCreationError CreationError_description_too_long(void);
50915 * Utility method to constructs a new RouteTooLong-variant CreationError
50917 enum LDKCreationError CreationError_route_too_long(void);
50920 * Utility method to constructs a new TimestampOutOfBounds-variant CreationError
50922 enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
50925 * Utility method to constructs a new InvalidAmount-variant CreationError
50927 enum LDKCreationError CreationError_invalid_amount(void);
50930 * Utility method to constructs a new MissingRouteHints-variant CreationError
50932 enum LDKCreationError CreationError_missing_route_hints(void);
50935 * Utility method to constructs a new MinFinalCltvExpiryDeltaTooShort-variant CreationError
50937 enum LDKCreationError CreationError_min_final_cltv_expiry_delta_too_short(void);
50940 * Checks if two CreationErrors contain equal inner contents.
50941 * This ignores pointers and is_owned flags and looks at the values in fields.
50943 bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
50946 * Get the string representation of a CreationError object
50948 struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
50951 * Creates a copy of the Bolt11SemanticError
50953 enum LDKBolt11SemanticError Bolt11SemanticError_clone(const enum LDKBolt11SemanticError *NONNULL_PTR orig);
50956 * Utility method to constructs a new NoPaymentHash-variant Bolt11SemanticError
50958 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_hash(void);
50961 * Utility method to constructs a new MultiplePaymentHashes-variant Bolt11SemanticError
50963 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_hashes(void);
50966 * Utility method to constructs a new NoDescription-variant Bolt11SemanticError
50968 enum LDKBolt11SemanticError Bolt11SemanticError_no_description(void);
50971 * Utility method to constructs a new MultipleDescriptions-variant Bolt11SemanticError
50973 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_descriptions(void);
50976 * Utility method to constructs a new NoPaymentSecret-variant Bolt11SemanticError
50978 enum LDKBolt11SemanticError Bolt11SemanticError_no_payment_secret(void);
50981 * Utility method to constructs a new MultiplePaymentSecrets-variant Bolt11SemanticError
50983 enum LDKBolt11SemanticError Bolt11SemanticError_multiple_payment_secrets(void);
50986 * Utility method to constructs a new InvalidFeatures-variant Bolt11SemanticError
50988 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_features(void);
50991 * Utility method to constructs a new InvalidRecoveryId-variant Bolt11SemanticError
50993 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_recovery_id(void);
50996 * Utility method to constructs a new InvalidSignature-variant Bolt11SemanticError
50998 enum LDKBolt11SemanticError Bolt11SemanticError_invalid_signature(void);
51001 * Utility method to constructs a new ImpreciseAmount-variant Bolt11SemanticError
51003 enum LDKBolt11SemanticError Bolt11SemanticError_imprecise_amount(void);
51006 * Checks if two Bolt11SemanticErrors contain equal inner contents.
51007 * This ignores pointers and is_owned flags and looks at the values in fields.
51009 bool Bolt11SemanticError_eq(const enum LDKBolt11SemanticError *NONNULL_PTR a, const enum LDKBolt11SemanticError *NONNULL_PTR b);
51012 * Get the string representation of a Bolt11SemanticError object
51014 struct LDKStr Bolt11SemanticError_to_str(const enum LDKBolt11SemanticError *NONNULL_PTR o);
51017 * Frees any resources used by the SignOrCreationError
51019 void SignOrCreationError_free(struct LDKSignOrCreationError this_ptr);
51022 * Creates a copy of the SignOrCreationError
51024 struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
51027 * Utility method to constructs a new SignError-variant SignOrCreationError
51029 struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
51032 * Utility method to constructs a new CreationError-variant SignOrCreationError
51034 struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
51037 * Checks if two SignOrCreationErrors contain equal inner contents.
51038 * This ignores pointers and is_owned flags and looks at the values in fields.
51040 bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
51043 * Get the string representation of a SignOrCreationError object
51045 struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
51048 * Builds the necessary parameters to pay or pre-flight probe the given zero-amount
51049 * [`Bolt11Invoice`] using [`ChannelManager::send_payment`] or
51050 * [`ChannelManager::send_preflight_probes`].
51052 * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
51053 * same [`PaymentHash`] has never been paid before.
51055 * Will always succeed unless the invoice has an amount specified, in which case
51056 * [`payment_parameters_from_invoice`] should be used.
51058 * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
51059 * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
51061 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice, uint64_t amount_msat);
51064 * Builds the necessary parameters to pay or pre-flight probe the given [`Bolt11Invoice`] using
51065 * [`ChannelManager::send_payment`] or [`ChannelManager::send_preflight_probes`].
51067 * Prior to paying, you must ensure that the [`Bolt11Invoice::payment_hash`] is unique and the
51068 * same [`PaymentHash`] has never been paid before.
51070 * Will always succeed unless the invoice has no amount specified, in which case
51071 * [`payment_parameters_from_zero_amount_invoice`] should be used.
51073 * [`ChannelManager::send_payment`]: lightning::ln::channelmanager::ChannelManager::send_payment
51074 * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes
51076 struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(const struct LDKBolt11Invoice *NONNULL_PTR invoice);
51079 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
51080 * See [`PhantomKeysManager`] for more information on phantom node payments.
51082 * `phantom_route_hints` parameter:
51083 * * Contains channel info for all nodes participating in the phantom invoice
51084 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
51085 * participating node
51086 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
51087 * updated when a channel becomes disabled or closes
51088 * * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
51089 * may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
51092 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
51093 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
51094 * If `None` is provided for `payment_hash`, then one will be created.
51096 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
51097 * in excess of the current time.
51099 * `duration_since_epoch` is the current time since epoch in seconds.
51101 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
51102 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`] - 3.
51103 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
51104 * confirmations during routing.
51106 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
51107 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
51110 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
51111 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
51112 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
51113 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
51114 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
51115 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
51117 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
51118 * available and the current time is supplied by the caller.
51120 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ 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);
51123 * Utility to create an invoice that can be paid to one of multiple nodes, or a \"phantom invoice.\"
51124 * See [`PhantomKeysManager`] for more information on phantom node payments.
51126 * `phantom_route_hints` parameter:
51127 * * Contains channel info for all nodes participating in the phantom invoice
51128 * * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
51129 * participating node
51130 * * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
51131 * updated when a channel becomes disabled or closes
51132 * * Note that the route hints generated from `phantom_route_hints` will be limited to a maximum
51133 * of 3 hints to ensure that the invoice can be scanned in a QR code. These hints are selected
51134 * in the order that the nodes in `PhantomRouteHints` are specified, selecting one hint per node
51135 * until the maximum is hit. Callers may provide as many `PhantomRouteHints::channels` as
51136 * desired, but note that some nodes will be trimmed if more than 3 nodes are provided.
51138 * `description_hash` is a SHA-256 hash of the description text
51140 * `payment_hash` can be specified if you have a specific need for a custom payment hash (see the difference
51141 * between [`ChannelManager::create_inbound_payment`] and [`ChannelManager::create_inbound_payment_for_hash`]).
51142 * If `None` is provided for `payment_hash`, then one will be created.
51144 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
51145 * in excess of the current time.
51147 * `duration_since_epoch` is the current time since epoch in seconds.
51149 * Note that the provided `keys_manager`'s `NodeSigner` implementation must support phantom
51150 * invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
51153 * [`PhantomKeysManager`]: lightning::sign::PhantomKeysManager
51154 * [`ChannelManager::get_phantom_route_hints`]: lightning::ln::channelmanager::ChannelManager::get_phantom_route_hints
51155 * [`ChannelManager::create_inbound_payment`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment
51156 * [`ChannelManager::create_inbound_payment_for_hash`]: lightning::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
51157 * [`PhantomRouteHints::channels`]: lightning::ln::channelmanager::PhantomRouteHints::channels
51159 * This can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
51160 * available and the current time is supplied by the caller.
51162 struct LDKCResult_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKCOption_ThirtyTwoBytesZ 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);
51165 * Utility to construct an invoice. Generally, unless you want to do something like a custom
51166 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
51167 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
51168 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
51169 * that the payment secret is valid when the invoice is paid.
51171 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
51172 * in excess of the current time.
51174 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
51175 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
51176 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
51177 * confirmations during routing.
51179 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
51181 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);
51184 * Utility to construct an invoice. Generally, unless you want to do something like a custom
51185 * cltv_expiry, this is what you should be using to create an invoice. The reason being, this
51186 * method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
51187 * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
51188 * that the payment secret is valid when the invoice is paid.
51189 * Use this variant if you want to pass the `description_hash` to the invoice.
51191 * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
51192 * in excess of the current time.
51194 * You can specify a custom `min_final_cltv_expiry_delta`, or let LDK default it to
51195 * [`MIN_FINAL_CLTV_EXPIRY_DELTA`]. The provided expiry must be at least [`MIN_FINAL_CLTV_EXPIRY_DELTA`].
51196 * Note that LDK will add a buffer of 3 blocks to the delta to allow for up to a few new block
51197 * confirmations during routing.
51199 * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
51201 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);
51204 * See [`create_invoice_from_channelmanager_with_description_hash`]
51205 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
51206 * available and the current time is supplied by the caller.
51208 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);
51211 * See [`create_invoice_from_channelmanager`]
51212 * This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
51213 * available and the current time is supplied by the caller.
51215 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);
51218 * See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
51219 * This version allows for providing a custom [`PaymentHash`] for the invoice.
51220 * This may be useful if you're building an on-chain swap or involving another protocol where
51221 * the payment hash is also involved outside the scope of lightning.
51223 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);
51226 * Read a SiPrefix object from a string
51228 struct LDKCResult_SiPrefixBolt11ParseErrorZ SiPrefix_from_str(struct LDKStr s);
51231 * Read a Bolt11Invoice object from a string
51233 struct LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ Bolt11Invoice_from_str(struct LDKStr s);
51236 * Read a SignedRawBolt11Invoice object from a string
51238 struct LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ SignedRawBolt11Invoice_from_str(struct LDKStr s);
51241 * Get the string representation of a Bolt11ParseError object
51243 struct LDKStr Bolt11ParseError_to_str(const struct LDKBolt11ParseError *NONNULL_PTR o);
51246 * Get the string representation of a ParseOrSemanticError object
51248 struct LDKStr ParseOrSemanticError_to_str(const struct LDKParseOrSemanticError *NONNULL_PTR o);
51251 * Get the string representation of a Bolt11Invoice object
51253 struct LDKStr Bolt11Invoice_to_str(const struct LDKBolt11Invoice *NONNULL_PTR o);
51256 * Get the string representation of a SignedRawBolt11Invoice object
51258 struct LDKStr SignedRawBolt11Invoice_to_str(const struct LDKSignedRawBolt11Invoice *NONNULL_PTR o);
51261 * Get the string representation of a Currency object
51263 struct LDKStr Currency_to_str(const enum LDKCurrency *NONNULL_PTR o);
51266 * Get the string representation of a SiPrefix object
51268 struct LDKStr SiPrefix_to_str(const enum LDKSiPrefix *NONNULL_PTR o);
51271 * Frees any resources used by the GraphSyncError
51273 void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
51276 * Creates a copy of the GraphSyncError
51278 struct LDKGraphSyncError GraphSyncError_clone(const struct LDKGraphSyncError *NONNULL_PTR orig);
51281 * Utility method to constructs a new DecodeError-variant GraphSyncError
51283 struct LDKGraphSyncError GraphSyncError_decode_error(struct LDKDecodeError a);
51286 * Utility method to constructs a new LightningError-variant GraphSyncError
51288 struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
51291 * Frees any resources used by the RapidGossipSync, if is_owned is set and inner is non-NULL.
51293 void RapidGossipSync_free(struct LDKRapidGossipSync this_obj);
51296 * Instantiate a new [`RapidGossipSync`] instance.
51298 MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger);
51301 * Sync gossip data from a file.
51302 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
51304 * `network_graph`: The network graph to apply the updates to
51306 * `sync_path`: Path to the file where the gossip update data is located
51309 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
51312 * Update network graph from binary data.
51313 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
51315 * `update_data`: `&[u8]` binary stream that comprises the update data
51317 MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
51320 * Update network graph from binary data.
51321 * Returns the last sync timestamp to be used the next time rapid sync data is queried.
51323 * `update_data`: `&[u8]` binary stream that comprises the update data
51324 * `current_time_unix`: `Option<u64>` optional current timestamp to verify data age
51326 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);
51329 * Returns whether a rapid gossip sync has completed at least once.
51331 MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
51333 #endif /* LDK_C_BINDINGS_H */
51335 #include "ldk_ver.h"